Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:l4srihhymu is past its budget: trevato/forge: "the decision ledger > stop is not the last word on a red check: the environment's fault runs it again, … #7840

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/7819-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork

  • Merged. scout/7819-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as cee8271.

Review

Sign in to review this change.
1 file changed +8 −4
test/ledger.test.ts +8 −4
@@ -27,13 +27,13 @@ import {
2727 import { getIssueById, type Issue } from "../src/core/issues.ts";
2828 import { getPull } from "../src/core/pulls.ts";
2929 import { submitReview } from "../src/core/reviews.ts";
30 import { provideChecksForTest, type ChecksHandle } from "../src/checks/service.ts";
3031 import { claimRun, createRun, finishRun, listRuns } from "../src/core/runs.ts";
3132 import { createUser, getUserByName, type User } from "../src/core/users.ts";
3233 import { setCrewRole } from "../src/core/agents.ts";
3334 import type { Answer, Decider, Questions } from "../src/crew/decide.ts";
3435 import { driveRepo, landIfGreen } from "../src/crew/autonomy.ts";
3536 import { answerFailedCheck, judgeFailedCheck } from "../src/crew/dispatch.ts";
36 import { startChecks } from "../src/checks/service.ts";
3737 import { serve, type Servers } from "../src/http/server.ts";
3838
3939 /** A decider that answers from a script: question name → choice. */
@@ -270,7 +270,12 @@ describe("the decision ledger", () => {
270270 test("stop is not the last word on a red check: the environment's fault runs it again, once per commit, before anything is parked", async () => {
271271 const { getAgentByName } = await import("../src/core/agents.ts");
272272 const scoutAgent = getAgentByName(app.db, "scout")!;
273 const checks = startChecks(app, { forgeUrl: servers.url, concurrency: 1 });
273 // A stand-in lane: the retry is queued as the real one queues it, but no
274 // check runs, so the verdict does not wait on this machine's load.
275 provideChecksForTest(app, {
276 request: async (r: Repo, env: string, commitOid: string, reason: string, issueId?: string) =>
277 createRun(app.db, { repoId: r.id, kind: "check", issueId, env, commitOid, reason }),
278 } as unknown as ChecksHandle);
274279 try {
275280 const branch = await commitToBranch(app, alice, repo, {
276281 branch: "feature/flaky",
@@ -353,10 +358,9 @@ describe("the decision ledger", () => {
353358 ).toBe("reworked");
354359 expect(getPull(app.db, repo.id, pull.number)?.state).toBe("open");
355360 } finally {
356 await checks.stop();
357361 delete script["cause"];
358362 }
359 }, 60_000);
363 });
360364
361365 test("conflicts come first: a green pull that no longer merges gets a conflict run before anyone decides", async () => {
362366 const branch = await commitToBranch(app, alice, repo, {

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs