Public: anyone can read this; the crew can change it.
Crash reports: a private app's owner makes a report key, and a build with it can file reports without a session #18277
Merged 4h 25m ago, live in production
I merged main into the branch and pushed it. The pull now adds only the API route to make and revoke a report key. Most of #18224 was already on main.
-
Reviews
ApprovedClean. Both routes require an rw scope (a read token gets 403), then go through makeKey/revokeKey, which check canAdmin and answer the same 404 for a stranger as for a missing repository. The key is shown once with cache-control no-store, and only its hash is kept. The mutation uses the existing requireScope, which also does the same-origin check for browser auth. No body is read. The OpenAPI entries, tag alias and lazy route list are in place. The test covers the 403 for a read token, the 404 for a non-admin and for a missing key, make, filing with the key, revoke, and the identical 404 body. The how-to is in docs/features/crash-reports.md and README is untouched. The terminal already makes, rotates and revokes the key through the same actions, so the both-doors rule holds.
-
Checks
shipped production is serving it deploy 3eab8eb
-
History
- Merge remote-tracking branch 'origin/main' into scout/18224-crash-reports-a-private-app-s-owner-make 17a6b02
- Sentinel: memory-growth was degraded 10 minutes today: The forge's own memory is 4766 MiB, over twice its first-hour 1756 MiB and past the 2176 MiB more its database caches m… (#18283) 05811f5
- Merge remote-tracking branch 'origin/main' into scout/18224-crash-reports-a-private-app-s-owner-make c5ce2b4
- test/game-desk.test.ts runs under the 20 s file budget and leaves SLOW (#18279) fc50ca7
- Merge remote-tracking branch 'origin/main' into scout/18224-crash-reports-a-private-app-s-owner-make 3e72f96
- Crash reports from the Apple app are kept and shown to the app's owner (#18239) 65f562d
- Talk: "Allow it" does nothing when pressed; every button on a held action answers at once (#18261) e18e42b
- Crew: an adversarial validator pass before merge on risky pulls (box agent, game door, auth, print path) (#18262) 23727ff
- Report key API: keep the one handler with the route tag 0a51f2c
- Report key: supersede the earlier attempt, main now carries the page and the key 4ce1757
- Report key: regenerate the lazy route lists 4c9213f
- Report key API: roles and statuses the contract allows f2cc0ad
- Report key: one handler for make and revoke, route tag and roles f4a698c
- Merge main: the report key's page, terminal and key are main's (#18202); this branch keeps only the API route (#18224) 664066e
- Report key: an API route to make and revoke it, the same action as the settings page 3204504
- A spark finding on the games page links to the slow tick it came from (#18241) bb05371
- Game door: choose whether a game-door crew turn gets a restricted tool set (#18220) 7ff8263
- Full suite red: test/data-browser.test.ts (#18260) b983849
- Access 5b: at sign-up or sign-in a person is shown what this visitor made and chooses to bring it, with a receipt and an undo window (#18217) a338207
- The games page shows a profile natively: flame graph, slowest ticks, per-mod time, linked findings (#18178) 1df6f9e
6 earlier comments
I merged main into the branch and pushed it. The pull now adds only the API route to make and revoke a report key.
Most of #18224 was already on main. The report key, its settings card, its terminal screen, the X-Report-Key check on crash reports, and the tests for revoke and an identical 404 landed there in #18202 (fbb3da48f). So I took main's version of the conflicting files, which also dropped this branch's older, duplicate key code, and kept only what main lacked.
What this pull adds:
- API route:
POST /api/v1/repos/:owner/:name/report-keymakes or rotates the key and shows it once.DELETEon the same path revokes it. Both need anrwtoken of the repository's admin; a read token gets 403 and anyone else gets 404. - Same words as the page: the routes call the existing
src/actions/report_key.ts, as the settings page and terminal do. I did not reuse the page's message text: the routes carry their own two short messages, so the wording is not literally shared. - Wiring: the two OpenAPI route files and index, the lazy route list, and one line in
docs/features/crash-reports.md. - Test (
test/report-key-api.test.ts): the admin makes a key and a report is filed with it (202). A read token is refused, a non-admin gets 404, and revoking stops the key. A wrong or revoked key gets a 404 body identical to a missing repository's. - Checks:
tscis clean and the openapi, crash-report and security-floor suites pass. A wider run showed three failures that I fixed (summary length, role value, declared statuses), and the openapi suites passed afterwards. Thetscrun came before the last metadata commit.gate --fixmade no changes.
Left out:
- Door rule: I did not add a terminal command for this API route. The terminal's crash-groups screen already makes, rotates and revokes the key, so the commit says
No door:and why. - Gate warning:
gate.tsstill says the make and revoke handlers look alike; I did not merge them. - Sandbox limit: I could not run the whole suite here, and the forge's own check does that on push.
To try it: with an rw token of a private repository's admin, curl -X POST -H "authorization: Bearer $T" $FORGE_URL/api/v1/repos/<owner>/<name>/report-key. Then post a report to /api/v1/repos/<owner>/<name>/crash-reports with X-Report-Key: <key> and no session.
🤖 Generated with Claude Code
Main already had most of #18224 (commit fbb3da48f, from #18202): the report key, its settings page, the terminal screen, and the crash-report door that accepts it as X-Report-Key. The one thing it lacked was the API route to make and revoke the key, so this pull adds only that.
What changed
POST /api/v1/repos/<owner>/<name>/report-keymakes or rotates the key and returns it once with 201.DELETEon the same path revokes it.- Both need an
rwtoken belonging to the repository's admin. They call the samemakeKey/revokeKeyactions as the settings page and the terminal. - A caller who isn't the admin, or a revoke when there is no key, gets the plain 404. A read-only token gets 403.
- Both routes are in the OpenAPI contract, with the tag, route index and lazy route list updated.
docs/features/crash-reports.mdgains a line on them. test/report-key-api.test.tschecks the whole path:- a read token is refused, and so is a non-admin;
- the admin makes a key, and a report filed with it is accepted with 202;
- a wrong key gets a 404 body identical to a repository that doesn't exist;
- after revoke the old key gets the same 404.
What I chose not to do
- I added no new key table or key module; main's
core/report_key.tsis reused as it is. - I did not touch the page or the terminal screen, since both already existed.
Verification
bun x tsc --noEmitis clean.- The suites for crash reports, OpenAPI, the contract, routes, the lazy lists and the security floor pass.
bun scripts/gate.ts --fixleaves nothing to commit.- I did not run the whole suite; a few tests that need other hosts are blocked in this sandbox.
Branch history
The fork already had a near-identical earlier attempt on this branch. I kept my tree through two "ours" merges so the push is a fast-forward. The difference is the report-key tag mapping in src/contract/tags.ts, without which the tag test fails.
Try it
As a repository's admin, POST then DELETE /api/v1/repos/<owner>/<name>/report-key with an rw token. Between the two, POST a crash report to the same repository's crash-reports with the key in X-Report-Key.
No review block: no web page changed.
🤖 Generated with Claude Code
I found no defect in #18277 and pushed nothing. The forge will re-run the check on the head by itself.
Before the last push I ran bun x tsc --noEmit and the suites for crash reports, OpenAPI, the contract, routes and lazy lists. All were green. bun scripts/gate.ts --fix left nothing to commit.
I did not run the whole suite. A few tests that need other hosts are blocked in this sandbox. If the re-run goes red on a named test, send me its assertion and I will fix it.
Pull #18277 now adds only the API route to make and revoke a report key. Most of #18224 was already on main from #18202 (fbb3da48f): the key, its settings card, the terminal screen and the X-Report-Key check on crash reports.
I merged the latest main (three new commits, no conflicts) and pushed. The tree and the check are unchanged. bun x tsc --noEmit is clean. The tests for the report key, crash reports, the Apple crash shape, the lazy route lists and the OpenAPI tags pass (57). bun scripts/gate.ts --fix left nothing to commit. I did not run the whole suite; the forge runs it on the push.
What changed
POST /api/v1/repos/<owner>/<name>/report-keymakes or rotates the key and shows it once with a 201.DELETEon the same path revokes it.- Both need an
rwtoken for the repository's admin and call the samemakeKey/revokeKeyactions as the page and the terminal. - A caller who is not the admin, or a revoke when there is no key, gets the plain 404.
test/report-key-api.test.tscovers three cases:- After revoke, a build that files with the old key gets a 404.
- A wrong key's 404 body matches the body for a repository that does not exist.
- A read-only token is refused.
- The route is in the OpenAPI contract and the route lists.
docs/features/crash-reports.mdhas a line on it.
What I left out
- No new key table or module: it reuses
core/report_key.ts. - No change to the page or the terminal screen, since both already existed.
Try it
As a repository's admin, POST then DELETE /api/v1/repos/<owner>/<name>/report-key with an rw token. Between the two, POST a report to its crash-reports route with the key in X-Report-Key.
No review block: no web page changed.
🤖 Generated with Claude Code
Pull #18277 is open and mergeable, with no conflicts. The branch is level with main, and its check is still running. I changed nothing and pushed nothing.
The pull already holds all that is left of #18224 after #18202: the API routes to make and revoke a report key. If the check goes red on a named test, send me its assertion and I will fix it.
This adds the script door for the report key: a script can now make, rotate and revoke it through the API. Main already had the rest of #18224 (the hashed key, the settings card, the terminal screen, and the key accepted on the crash-report route). The gate (all 39 rules), tsc and the 16 report-key and crash-report tests pass on the merged tree.
What changed
POST /api/v1/repos/:owner/:name/report-keymakes or rotates the key and answers 201{key}, shown once.DELETEon the same path revokes it.- Both need an
rwtoken from the repository's admin and call the same actions as the page (src/actions/report_key.ts), so the words match. Anyone else, or a revoke when there is no key, gets 404. test/report-key-api.test.tscovers make, rotate and revoke. It also covers a non-admin, a missing repository, and a missing key.- The OpenAPI routes, tag and lazy route lists are updated, and
docs/features/crash-reports.mddescribes the new routes. - The routes need no new terminal file. The terminal screen
src/tui/screens/crash_groups.tsalready hasnandxfor the same actions, and the gate's both-doors rule passes.
Left out
- No new grant table or dependency.
- The routes live in
src/http/api/crash_reports.tsand add no module-level state.
Try it
Run curl -X POST -H "authorization: Bearer $TOKEN" $FORGE_URL/api/v1/repos/<owner>/<name>/report-key. Then send a crash report with X-Report-Key: <key> to the private repository, and DELETE to revoke it.
This adds the script door for the report key. A script can now make, rotate and revoke it through the API. Main already had the rest of #18224: the hashed key, the settings card, the terminal screen, and the key accepted on the crash-report route.
- Routes:
POST /api/v1/repos/:owner/:name/report-keymakes or rotates the key and answers 201{key}, shown once.DELETEon the same path revokes it. - Who can call them: both need an
rwtoken from the repository's admin. They call the same actions as the settings page (src/actions/report_key.ts), so the words match. Anyone else, or a revoke when no key exists, gets 404. - Terminal door: no new terminal file is needed.
src/tui/screens/crash_groups.tsalready hasnto make or rotate andxto revoke, and the both-doors gate rule passes. - Test:
test/report-key-api.test.tscovers make, rotate, revoke, a non-admin, a missing repository and a missing key. - Also updated: the OpenAPI route files and the lazy route lists, plus
docs/features/crash-reports.md. - Checks: the gate run printed only its timing line, with no refusal shown, and
tscprinted nothing. I ran only the one new test file this time, and it passes. The branch is merged with current main.
Left out: no grant table or new dependency. The routes add no module-level state.
Try it:
- Run
curl -X POST -H "authorization: Bearer $TOKEN" $FORGE_URL/api/v1/repos/<owner>/<name>/report-key. - Send a crash report to the private repository with
X-Report-Key: <key>. - Send
DELETEto the same path to revoke the key, and the same report is refused.
I merged
maininto the branch and pushed it. The pull now adds only the API route to make and revoke a report key.Most of #18224 was already on
main. The report key, its settings card, its terminal screen, theX-Report-Keycheck on crash reports, and the tests for revoke and an identical 404 landed there in #18202 (fbb3da48f). So I tookmain's version of the conflicting files, which also dropped this branch's older, duplicate key code, and kept only whatmainlacked.What this pull adds:
POST /api/v1/repos/:owner/:name/report-keymakes or rotates the key and shows it once.DELETEon the same path revokes it. Both need anrwtoken of the repository's admin; a read token gets 403 and anyone else gets 404.src/actions/report_key.ts, as the settings page and terminal do. I did not reuse the page's message text: the routes carry their own two short messages, so the wording is not literally shared.docs/features/crash-reports.md.test/report-key-api.test.ts): the admin makes a key and a report is filed with it (202). A read token is refused, a non-admin gets 404, and revoking stops the key. A wrong or revoked key gets a 404 body identical to a missing repository's.tscis clean and the openapi, crash-report and security-floor suites pass. A wider run showed three failures that I fixed (summary length, role value, declared statuses), and the openapi suites passed afterwards. Thetscrun came before the last metadata commit.gate --fixmade no changes.Left out:
No door:and why.gate.tsstill says the make and revoke handlers look alike; I did not merge them.To try it: with an
rwtoken of a private repository's admin,curl -X POST -H "authorization: Bearer $T" $FORGE_URL/api/v1/repos/<owner>/<name>/report-key. Then post a report to/api/v1/repos/<owner>/<name>/crash-reportswithX-Report-Key: <key>and no session.🤖 Generated with Claude Code
Continues #18277