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
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/7819-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork
1 file
changed +8
−4
test/ledger.test.ts +8 −4
| @@ -27,13 +27,13 @@ import { | ||
| 27 | 27 | import { getIssueById, type Issue } from "../src/core/issues.ts"; |
| 28 | 28 | import { getPull } from "../src/core/pulls.ts"; |
| 29 | 29 | import { submitReview } from "../src/core/reviews.ts"; |
| 30 | import { provideChecksForTest, type ChecksHandle } from "../src/checks/service.ts"; | |
| 30 | 31 | import { claimRun, createRun, finishRun, listRuns } from "../src/core/runs.ts"; |
| 31 | 32 | import { createUser, getUserByName, type User } from "../src/core/users.ts"; |
| 32 | 33 | import { setCrewRole } from "../src/core/agents.ts"; |
| 33 | 34 | import type { Answer, Decider, Questions } from "../src/crew/decide.ts"; |
| 34 | 35 | import { driveRepo, landIfGreen } from "../src/crew/autonomy.ts"; |
| 35 | 36 | import { answerFailedCheck, judgeFailedCheck } from "../src/crew/dispatch.ts"; |
| 36 | import { startChecks } from "../src/checks/service.ts"; | |
| 37 | 37 | import { serve, type Servers } from "../src/http/server.ts"; |
| 38 | 38 | |
| 39 | 39 | /** A decider that answers from a script: question name → choice. */ |
| @@ -270,7 +270,12 @@ describe("the decision ledger", () => { | ||
| 270 | 270 | 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 () => { |
| 271 | 271 | const { getAgentByName } = await import("../src/core/agents.ts"); |
| 272 | 272 | 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); | |
| 274 | 279 | try { |
| 275 | 280 | const branch = await commitToBranch(app, alice, repo, { |
| 276 | 281 | branch: "feature/flaky", |
| @@ -353,10 +358,9 @@ describe("the decision ledger", () => { | ||
| 353 | 358 | ).toBe("reworked"); |
| 354 | 359 | expect(getPull(app.db, repo.id, pull.number)?.state).toBe("open"); |
| 355 | 360 | } finally { |
| 356 | await checks.stop(); | |
| 357 | 361 | delete script["cause"]; |
| 358 | 362 | } |
| 359 | }, 60_000); | |
| 363 | }); | |
| 360 | 364 | |
| 361 | 365 | test("conflicts come first: a green pull that no longer merges gets a conflict run before anyone decides", async () => { |
| 362 | 366 | const branch = await commitToBranch(app, alice, repo, { |
new above
offline