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

Revert "Production's releases tool lists the forge's own v* releases to an anonymous reader, so the v1 probe's two release lines pass" #15430

Merged opened this

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

Merged

revert-15423 → main 0 commits

  • Merged. revert-15423 was merged into main as f0be0b3.

Review

Sign in to review this change.
2 files changed +2 −24
scripts/v1-probe.ts +2 −9
@@ -215,18 +215,11 @@ export async function probe(base: string, repo: string, fetcher: Fetcher = fetch
215215 const tagName = read?.release?.name;
216216 const tagCommit = read?.release?.commit;
217217 const unread = typeof shipped === "string" ? shipped : `${shipped.status}, the releases tool did not answer its JSON`;
218 // None listed: a forge that hosts no such repository (an app running this code with its own
219 // database, #15422) says so, rather than looking like a forge that cut no release.
220 let none = `the releases tool lists no release of ${repo}`;
221 if (read && !read.release) {
222 const hosted = await get(api);
223 if (typeof hosted !== "string" && hosted.status === 404) none = `${origin} hosts no ${repo} (${at(api)} answers 404): probe the forge that holds it`;
224 }
225218
226219 // 3. The stranger journey's last green release, from the check API.
227220 const checkPath = tagCommit ? `${api}/commits/${tagCommit}/check` : releasePath;
228221 if (!read) say("stranger journey green on a release", "UNKNOWN", checkPath, `${unread}; a person must open the latest release's check`);
229 else if (!tagName || !tagCommit) say("stranger journey green on a release", "FAIL", checkPath, none);
222 else if (!tagName || !tagCommit) say("stranger journey green on a release", "FAIL", checkPath, `the releases tool lists no release of ${repo}`);
230223 else {
231224 const check = await get(checkPath);
232225 const c = typeof check === "string" ? undefined : (json(check) as { state?: unknown; runId?: unknown; finishedAt?: unknown } | undefined);
@@ -241,7 +234,7 @@ export async function probe(base: string, repo: string, fetcher: Fetcher = fetch
241234 // 4. /changelog, /changelog.atom and production's version agree with the newest release.
242235 if (!announced) say("version agrees", "UNKNOWN", "/mcp", typeof init === "string" ? init : `initialize named no version or commit (${init.status})`);
243236 else if (!read) say("version agrees", "UNKNOWN", releasePath, `production says ${announced.text}; ${unread}`);
244 else if (!read.release) say("version agrees", "FAIL", releasePath, `production says ${announced.text}; ${none}`);
237 else if (!read.release) say("version agrees", "FAIL", releasePath, `production says ${announced.text}; the releases tool lists no release of ${repo}`);
245238 else {
246239 const r = read.release;
247240 const agrees = announced.kind === "version" ? r.version === announced.text : r.commit.startsWith(announced.text);
test/v1-probe.test.ts −15
@@ -18,11 +18,6 @@ interface World {
1818 headers: boolean;
1919 /** What the token-free `releases` tool lists; null when it does not answer. */
2020 releases: { repo: string; version: string; commit: string }[] | null;
21 /**
22 * Whether this forge holds the probed repository: false is an app with a database of its own
23 * (#15422).
24 */
25 hosted: boolean;
2621 }
2722 const green = (): World => ({
2823 version: "1.0.0",
@@ -31,7 +26,6 @@ const green = (): World => ({
3126 atomNames: true,
3227 headers: true,
3328 releases: [{ repo: "x/y", version: "9.9.9", commit: "d".repeat(40) }, { repo: "o/r", version: "1.0.0", commit: COMMIT }],
34 hosted: true,
3529 });
3630 let world = green();
3731 const seen: { method: string; path: string; mcp?: string }[] = [];
@@ -67,8 +61,6 @@ const server = Bun.serve({
6761 return json({ jsonrpc: "2.0", id: 1, result: { serverInfo: { name: "forge", version: world.version } } });
6862 case `/api/v1/repos/o/r/commits/${COMMIT}/check`:
6963 return world.checkState === null ? html("Just a moment...", 403) : json({ state: world.checkState, runId: "run1" });
70 case "/api/v1/repos/o/r":
71 return world.hosted ? json({ ownerName: "o", name: "r", visibility: "public" }) : json({ error: "not_found" }, 404);
7264 case "/api/v1/repos/o/r/schedules":
7365 return world.runs === null ? json({ error: "not_found" }, 404) : json({ items: [], runs: world.runs });
7466 }
@@ -179,13 +171,6 @@ describe("v1 probe", () => {
179171 expect(silent["version agrees"]!.evidence).toContain("production says 687c4ae; 403");
180172 });
181173
182 test("none listed by a forge that hosts no such repository says so, not that no release was cut (#15422)", async () => {
183 const r = await run({ releases: [], hosted: false });
184 expect(r["stranger journey green on a release"]!.verdict).toBe("FAIL");
185 expect(r["stranger journey green on a release"]!.evidence).toBe(`${base} hosts no o/r (${base}/api/v1/repos/o/r answers 404): probe the forge that holds it`);
186 expect(r["version agrees"]!.evidence).toBe(`production says 1.0.0; ${base} hosts no o/r (${base}/api/v1/repos/o/r answers 404): probe the forge that holds it`);
187 });
188
189174 test("sends only GETs, one MCP initialize and one releases call, all to the base host", async () => {
190175 seen.length = 0;
191176 const urls: string[] = [];

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs