Public: anyone can read this; the crew can change it.
Defect on the v1.0.0 path: production's /api/v1/changelog says "check": null on the running release, so the stranger-journey probe line is still UNKNOWN after #15517 went live #15522
Check · Review · Land · Live done — Landed and live in production.
torque/forge:torque/15519-defect-on-the-v1-0-0-path-production-s-a → main 0 commits fork
4 files
changed +37
−1
docs/OPERATING.md +1
| @@ -369,6 +369,7 @@ That page (`src/http/edition.ts`) prints when the newest morning paper ran and n | ||
| 369 | 369 | |
| 370 | 370 | The production forge's `/api/v1/health` `schedules` counts are proven by this repository's own schedule (#15499): its `forge.json` declares `heartbeat`, `5 7 * * *` UTC, production only, a signed `POST /jobs/heartbeat` (`src/http/heartbeat.ts`) that writes nothing and calls no model. The production forge runs this repository as an app, so once the commit is on `main` it syncs that schedule (`total` 1), wakes the app if it sleeps, and after 07:05 UTC the first 200 makes `ran` 1. A 401 from it names why (unsigned, forged, expired, or no `FORGE_APP_IDENTITY_KEY`: a forge not run by another) and is final. |
| 371 | 371 | The release it checks is the newest the MCP `releases` tool lists for the repository; when none is listed but the answer names the running `version` and `commit` (production live, `"live":[]`), that running build is the release, read from `GET /api/v1/repos/<repo>/commits/<sha>/check` and compared to what production announces, and its lines say `running v…`. Only an answer that lists none and names no running commit FAILs for a missing release (#15473). |
| 372 | The stranger-journey line reads the `check` the public answer states beside the running commit (#15514). Only the forge that holds the repository can state it: an app's test copy of the forge (`lab--…` and its previews) runs on its own database, which holds no `trevato/forge`, so its changelog says `"check": null` by design. There the check API and `GET /api/v1/repos/<repo>` both answer 404, and the line says `<base> holds no public <repo>` and to run the probe against the forge that holds it (#15519). | |
| 372 | 373 | The owner tags v1.0.0 only when every line is PASS; an UNKNOWN line names what a person must check, and is not a pass. |
| 373 | 374 | |
| 374 | 375 | ## Secrets in the terminal |
scripts/v1-probe.ts +9 −1
| @@ -18,6 +18,8 @@ | ||
| 18 | 18 | * The stranger-journey line reads the full check's verdict that the same `releases` answer states |
| 19 | 19 | * beside its running commit (`check`, #15514); only when it names no verdict on the newest |
| 20 | 20 | * release's commit is the check API asked, which answers 404 to an anonymous read. |
| 21 | * When that answers 404 and so does the repository itself, the base holds no such repository (an | |
| 22 | * app's test copy of the forge, #15519) and the line names the forge to ask. | |
| 21 | 23 | * |
| 22 | 24 | * It prints one line per item, `PASS`, `FAIL` or `UNKNOWN`, with the URL and |
| 23 | 25 | * the evidence, and exits 0 only when every line is PASS. UNKNOWN is what an |
| @@ -273,7 +275,13 @@ export async function probe(base: string, repo: string, fetcher: Fetcher = fetch | ||
| 273 | 275 | const c = own ?? (check === undefined || typeof check === "string" ? undefined : (json(check) as { state?: unknown; runId?: unknown; finishedAt?: unknown } | undefined)); |
| 274 | 276 | if (!c || typeof c.state !== "string") { |
| 275 | 277 | const why = check === undefined ? "no check named" : typeof check === "string" ? check : `${check.status}, not the check's JSON`; |
| 276 | say("stranger journey green on a release", "UNKNOWN", checkPath, `${why}; a person must open ${tagName}'s check and see the stranger tests green`); | |
| 278 | // A 404 can mean the base holds no such repository, as on an app's test copy of the forge | |
| 279 | // (#15519): its own empty database states no verdict, however public the read, so the line | |
| 280 | // names the forge to ask in place of a person. | |
| 281 | const repoRead = typeof check === "object" && check.status === 404 ? await get(api) : undefined; | |
| 282 | if (typeof repoRead === "object" && repoRead.status === 404) { | |
| 283 | say("stranger journey green on a release", "UNKNOWN", api, `${origin} holds no public ${repo}, so it states no check of it; run the probe against the forge that holds ${repo}`); | |
| 284 | } else say("stranger journey green on a release", "UNKNOWN", checkPath, `${why}; a person must open ${tagName}'s check and see the stranger tests green`); | |
| 277 | 285 | } else if (c.state === "ok") say("stranger journey green on a release", "PASS", checkPath, `${tagName} (${tagCommit.slice(0, 9)}) full check ok, run ${String(c.runId)}, which runs the stranger tests`); |
| 278 | 286 | else if (c.state === "failed") say("stranger journey green on a release", "FAIL", checkPath, `${tagName} check failed, run ${String(c.runId)}`); |
| 279 | 287 | else say("stranger journey green on a release", "UNKNOWN", checkPath, `${tagName} check is ${c.state}`); |
test/maintain-disk-free.test.ts +7
| @@ -9,7 +9,14 @@ import { rulesWorld } from "./helpers/rules-app.ts"; | ||
| 9 | 9 | import { dataSizes, largestDirs, LOOSE, makeDuty, OUTSIDE, TITLE } from "../src/maintain/duties/disk_free.ts"; |
| 10 | 10 | import { duties } from "../src/maintain/registry.ts"; |
| 11 | 11 | |
| 12 | // Restored after the file: a later file in the same `bun test` process reads its own repository | |
| 13 | // from this (test/gate-bypass.test.ts failed beside it, #15519). | |
| 14 | const priorSentinel = process.env.FORGE_SENTINEL_REPO; | |
| 12 | 15 | process.env.FORGE_SENTINEL_REPO = "alice/rules"; |
| 16 | afterAll(() => { | |
| 17 | if (priorSentinel === undefined) delete process.env.FORGE_SENTINEL_REPO; | |
| 18 | else process.env.FORGE_SENTINEL_REPO = priorSentinel; | |
| 19 | }); | |
| 13 | 20 | const w = rulesWorld(); |
| 14 | 21 | const GB = 1024 ** 3; |
| 15 | 22 | let free = 50 * GB; |
test/v1-probe.test.ts +20
| @@ -24,6 +24,8 @@ interface World { | ||
| 24 | 24 | stated?: { commit: string; state: string; runId: string | null }; |
| 25 | 25 | /** The keeper's heartbeat, served only to `Bearer t` (#15449). */ |
| 26 | 26 | beat?: { at: string; outcome: string; reason: string; silent: boolean } | null; |
| 27 | /** The base holds no such repository, as an app's test copy of the forge (#15519). */ | |
| 28 | noRepo?: boolean; | |
| 27 | 29 | } |
| 28 | 30 | const green = (): World => ({ |
| 29 | 31 | version: "1.0.0", |
| @@ -65,7 +67,10 @@ const server = Bun.serve({ | ||
| 65 | 67 | return json({ jsonrpc: "2.0", id: 2, result: { content: [{ type: "text", text }] } }); |
| 66 | 68 | } |
| 67 | 69 | return json({ jsonrpc: "2.0", id: 1, result: { serverInfo: { name: "forge", version: world.version } } }); |
| 70 | case "/api/v1/repos/o/r": | |
| 71 | return world.noRepo ? json({ error: "not_found" }, 404) : json({ ownerName: "o", name: "r", visibility: "public" }); | |
| 68 | 72 | case `/api/v1/repos/o/r/commits/${COMMIT}/check`: |
| 73 | if (world.noRepo) return json({ error: "not_found" }, 404); | |
| 69 | 74 | return world.checkState === null ? html("Just a moment...", 403) : json({ state: world.checkState, runId: "run1" }); |
| 70 | 75 | case "/api/v1/keeper": |
| 71 | 76 | if (req.headers.get("authorization") !== "Bearer t") return json({ error: "forbidden" }, 403); |
| @@ -215,6 +220,21 @@ describe("v1 probe", () => { | ||
| 215 | 220 | } |
| 216 | 221 | }); |
| 217 | 222 | |
| 223 | test("a base that holds no such repository says so and names the forge to ask, not a bare 404 (#15519)", async () => { | |
| 224 | seen.length = 0; | |
| 225 | const r = (await run({ noRepo: true, checkState: null }))["stranger journey green on a release"]!; | |
| 226 | expect(r.verdict).toBe("UNKNOWN"); | |
| 227 | expect(r.url).toBe(`${base}/api/v1/repos/o/r`); | |
| 228 | expect(r.evidence).toBe(`${base} holds no public o/r, so it states no check of it; run the probe against the forge that holds o/r`); | |
| 229 | expect(seen.filter((s) => s.path === "/api/v1/repos/o/r")).toEqual([{ method: "GET", path: "/api/v1/repos/o/r" }]); | |
| 230 | // A check API that is closed (403) on a forge that holds the repository is still a person's to | |
| 231 | // open, and the repository is not read for it. | |
| 232 | seen.length = 0; | |
| 233 | const closed = (await run({ checkState: null }))["stranger journey green on a release"]!; | |
| 234 | expect(closed.evidence).toContain("a person must open v1.0.0's check"); | |
| 235 | expect(seen.some((s) => s.path === "/api/v1/repos/o/r")).toBe(false); | |
| 236 | }); | |
| 237 | ||
| 218 | 238 | test("no release listed but a running version and commit named: that build is the release, read from its check (#15473)", async () => { |
| 219 | 239 | const r = await run({ releases: [], running: { version: "1.0.0", commit: COMMIT } }); |
| 220 | 240 | expect(r["stranger journey green on a release"]!.verdict).toBe("PASS"); |
new above
offline