Public: anyone can read this; the crew can change it.
Main's full check keeps failing at its ~40-minute edge, and each failure reve… #16613
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/16612-main-s-full-check-keeps-failing-at-its-4 → main 0 commits fork 2 threads · 2 unresolved
4 files
changed +27
−7
src/checks/red_main.ts +5 −2
| @@ -84,8 +84,11 @@ const lastMain = (from: string): string => ` | ||
| 84 | 84 | AND r.state IN ('ok', 'failed') |
| 85 | 85 | ORDER BY r.id DESC LIMIT 1)`; |
| 86 | 86 | |
| 87 | /** A summary of a cell stop (`apps/contain.ts`) or a budget kill (`kernel/budgets.ts`). */ | |
| 88 | const LIMIT = /^(?:check failed: )?(?:stopped: |budget:)/; | |
| 87 | /** | |
| 88 | * A summary of a cell stop (`apps/contain.ts`), a budget kill (`kernel/budgets.ts`), a check that | |
| 89 | * stalled (`checks/stall.ts`) or one the forge's stopping cut off: the machine's, not a pull's. | |
| 90 | */ | |
| 91 | const LIMIT = /^(?:check failed: )?(?:stopped: |budget:|check stalled:|the forge was stopped under this check)/; | |
| 89 | 92 | |
| 90 | 93 | function toRed(row: Row): RedMain | undefined { |
| 91 | 94 | if (row.state !== "failed") return undefined; |
src/web/own_token.ts +3 −3
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /** |
| 2 | 2 | * The box a person's held build offers where its wait is shown (#16490): "Start now with your own |
| 3 | * Claude account", one masked field and one button, posting to the run's own address. Without | |
| 3 | * account", one masked field and one button, posting to the run's own address. Without | |
| 4 | 4 | * script the form posts and comes back to the run with a flash; with it the box says what |
| 5 | 5 | * happened in place, and the run page's (or Talk's) live stream shows the build starting. |
| 6 | 6 | */ |
| @@ -23,7 +23,7 @@ export function ownTokenBox(base: string, runId: string): Html { | ||
| 23 | 23 | return html`<form class="stack mt" method="post" action="${base}/runs/${runId}/own-token" data-own-token data-own-token-box aria-labelledby="${id}-h"> |
| 24 | 24 | <h2 class="h3" id="${id}-h">${START_NOW_HEAD}</h2> |
| 25 | 25 | <p class="muted small">${START_NOW_LINE}</p> |
| 26 | <label class="sr-only" for="${id}">Your Claude token or API key</label> | |
| 26 | <label class="sr-only" for="${id}">Your token or API key</label> | |
| 27 | 27 | <span class="bar"> |
| 28 | 28 | <input class="input mono" id="${id}" name="token" type="password" autocomplete="off" autocapitalize="off" spellcheck="false" required placeholder="sk-ant-…" /> |
| 29 | 29 | ${btn("Start now", { variant: "primary" })} |
| @@ -43,7 +43,7 @@ export const ownTokenJs = /* js */ ` | ||
| 43 | 43 | var button = form.querySelector('button'); |
| 44 | 44 | var field = form.querySelector('input[name=token]'); |
| 45 | 45 | if (button) button.disabled = true; |
| 46 | if (said) said.textContent = 'Testing it with Anthropic…'; | |
| 46 | if (said) said.textContent = 'Testing it…'; | |
| 47 | 47 | fetch(form.action, { method: 'POST', credentials: 'same-origin', headers: { accept: 'application/json' }, body: new FormData(form) }) |
| 48 | 48 | .then(function (r) { return r.json().catch(function () { return { ok: false, said: 'Nothing was saved; try again.' }; }); }) |
| 49 | 49 | .then(function (out) { |
test/revert-red.test.ts +17 −2
| @@ -42,7 +42,7 @@ describe("a red main after one landing proposes its revert", () => { | ||
| 42 | 42 | return getPull(app.db, repo.id, opened.value.number)!; |
| 43 | 43 | }; |
| 44 | 44 | |
| 45 | const mainCheck = async (state: "ok" | "failed", names: string[] = []): Promise<void> => { | |
| 45 | const mainCheck = async (state: "ok" | "failed", names: string[] = [], summary?: string): Promise<void> => { | |
| 46 | 46 | const oid = await resolveOid(repoDir(app.reposRoot, repo.ownerName, repo.name), "refs/heads/main"); |
| 47 | 47 | const run = createRun(app.db, { repoId: repo.id, kind: "check", env: "main", commitOid: oid ?? "" }); |
| 48 | 48 | app.db |
| @@ -50,7 +50,7 @@ describe("a red main after one landing proposes its revert", () => { | ||
| 50 | 50 | .run( |
| 51 | 51 | run.id, |
| 52 | 52 | state, |
| 53 | state === "ok" ? "check passed in 1s" : "check failed: 1 test failed", | |
| 53 | summary ?? (state === "ok" ? "check passed in 1s" : "check failed: 1 test failed"), | |
| 54 | 54 | state === "ok" ? "" : JSON.stringify({ names }), |
| 55 | 55 | new Date().toISOString(), |
| 56 | 56 | ); |
| @@ -113,6 +113,21 @@ describe("a red main after one landing proposes its revert", () => { | ||
| 113 | 113 | expect(reverts()).toHaveLength(0); |
| 114 | 114 | }); |
| 115 | 115 | |
| 116 | test("a red that is a timeout, a stop, a forge stop or a stall opens none (#16612)", async () => { | |
| 117 | for (const summary of [ | |
| 118 | "budget: a full gate took 61 min, limit 60", | |
| 119 | "stopped: out of memory", | |
| 120 | "the forge was stopped under this check 3 times; not trying again", | |
| 121 | "check stalled: started and wrote nothing, offered to no runner, twice; not trying again", | |
| 122 | ]) { | |
| 123 | await mainCheck("ok"); | |
| 124 | await land(`b${reverts().length}${summary.length}`, `${summary}\n`); | |
| 125 | await mainCheck("failed", [], summary); | |
| 126 | expect(await proposeRevert(app, repo.id)).toBeUndefined(); | |
| 127 | } | |
| 128 | expect(reverts()).toHaveLength(0); | |
| 129 | }); | |
| 130 | ||
| 116 | 131 | test("a green main opens none", async () => { |
| 117 | 132 | await mainCheck("ok"); |
| 118 | 133 | await land("one", "beta\n"); |
test/vendor-words.test.ts +2
| @@ -18,6 +18,8 @@ const LINES: Record<string, { match: RegExp; why: string }[]> = { | ||
| 18 | 18 | "src/tui/screens/changelog.ts": [{ match: /^\s*(?:\/\*\*|\*) Who built a pull.*"by Scout, with Claude/, why: "a doc example of data, not wording" }], |
| 19 | 19 | "src/web/client.ts": [{ match: /var FORGE = \/\^\(claude:/, why: "matches the runner's own log prefix" }], |
| 20 | 20 | "src/web/pages/new-forge.ts": [{ match: /a subscription token \\\(sk-ant-oat/, why: "matches the refusal text a validator sends, to reword it" }], |
| 21 | "src/web/own_token.ts": [{ match: /placeholder="sk-ant-…"/, why: "the shape of the token a person pastes: a key format the machine needs" }], | |
| 22 | "src/tui/screens/runlog.ts": [{ match: /what claude setup-token printed/, why: "names the command that prints the token: a literal the person must run" }], | |
| 21 | 23 | "src/web/pages/runs.ts": [{ match: /^\s*\/\^\(claude:/, why: "matches the runner's own log prefix" }], |
| 22 | 24 | }; |
| 23 | 25 | /** Literals removed from a line before it is checked. */ |
new above
offline
The
the forge was stopped under this checkalternative is untested. Cover it in test/revert-red.test.ts.