Public: anyone can read this; the crew can change it.
Crash reports from the Apple app are kept and shown to the app's owner #18018
Parked 56m ago
The forge now keeps the Apple app's crash reports, groups them, shows them to the owner and notifies once per new group (#18006). The new crash test, the openapi, body-cap and notify suites and tsc pass locally. I did not run the full suite; the forge's check does that.
-
Reviews
Changes requested — before the latest pushChanges needed, in one round:
- Contract (box 6). The route's
refusesstill says[422], but a bad crash report is a 400 and a big one a 413. Declare 400 and 413, and make the contract test check the crash path. The test file has no contract assertion. - Silent deletion (Never: data deleted without a red button).
recordCrashdeletes groups past 200 on its own, so an anonymous sender can push real groups out. Mason's note says this is a known gap. Drop the automatic delete. Bound growth another way, such as refusing a new group once 200 exist while still counting into known groups. Or give the owner a delete button where they type the name. - Notification flood. Any anonymous caller can open a new group with each distinct frame set, and each new group sends a push to every admin. The cap is 60 an hour-ish per forge. Once the old groups are evicted, the same frames notify again. Fix: tell at most once per build-and-frames id ever, and batch the lines into one summary line per notifier pass. 3a. Test the notifier on a re-sent group after eviction, and on a flood.
- Design (principles 1, 6, 7, 8). The owner page hand-rolls markup. Each group is a
settings-blocksection with an h3, asmall mutedline anddetails+pre. That is a box per thing, not a row. Usedlstatus rows, as the usage section does. The explanation paragraph under 'Crash reports' says what the page already shows (principle 1). Show the frames and breadcrumbs as rows or onepreper group. - Tests that would fail without the behaviour. Missing: the 5 a minute per-address limit (429), the 200-line cut, control-character stripping, and a summary over 8 KB still being 413 now the read cap is 64 KB. The page test asserts
"1 report "with a trailing space, which is brittle. Assert on the group's id anchor instead. - Tidy. The
pair = {...}literal intelemetry_apple.tsis badly wrapped. Run the formatter.keepCrashandreadAppleCrashesduplicate the admin check fromreadAppleUsage. Share one.
Boxes 1, 3, 4 (the owner view and the notification, aside from points 2-4), 5: met.
Changes requested — before the latest pushEarlier asks: contract 400/413/429 declared (met, tested); no silent deletion (met in code); one notification line per pass (met, tested); owner page as one dl of rows (met); shared admin gate (met); the missing tests (met). One thing left, small: docs/features/apple-usage.md says the cap works by 'the least recently seen going first', but recordCrash now never evicts. It refuses new groups at 200 and keeps the old ones. The how-to tells the owner the opposite of what happens, so fix that sentence to say that new groups are not kept at 200 and known ones still count. Non-blocking: once 200 groups exist, an anonymous sender can fill the table (5 a minute from one address) and real crashes stop being kept with no way to clear it. A red button on the owner page that names the group (or the table) would fix that without a silent delete; consider it as a follow-up issue. Everything else (strict shape, byte-capped read, per-address limiter, escaped output, admin-only reads on page and terminal, /privacy row, openapi) looks right.
- Contract (box 6). The route's
-
Checks
stopped parked by the crew deploy a23bf0c
-
History
- Crash how-to: at 200 groups a new group is not kept, known ones still count (#18006) a23bf0c
- Rewrap comments (#18006) 892caa3
- Crash reports: never delete a group, one batched notification, contract declares 400/413/429, rows on the owner page, tests (#18006) c096015
- Classify apple.crash_group as an admin's event (#18006) d443280
- Pin the crash-report migration; rewrap comments (#18006) d94ded6
- Apple app crash reports: kept in groups, shown to the owner, told once per group (#18006) cb24a00
- Talk API: a person's sent files on each turn, and search inside turns (#18009) 0e5211b
- GET /api/v1/repos/{owner}/{name}/commits reads `path`: only the commits that touched it (#18007) 2b24ebd
- Move in: bring all of GitHub and Vercel into the forge through one trusted flow (inventory → plan → paced copy → verify), read-only toward the sources; clean-up is a separate, later step (#18000) 6d7f17e
- A test that reads an /api/v1 answer disagreeing with openapi.json goes red (#18013) 23d6af8
- Talk API: an agent turn's cards as data, with exact values (#18008) 866b811
- The test files outside api-* read no answer that disagrees with openapi.json (#18001) d861d63
- Traces: every conversation and run kept as a trace, imported from outside agents, and explored in the forge (#17968) 35a5490
- Traces 3: one trace as a tree beside a time strip, with what it changed (#17996) 2902a64
- Merge pull request #17997 from sold/ssh-mlkem 05c87e1
- SSH: the hybrid's K has its own known answer, the client test skips the hybrid on OpenSSH before 9.9, one comment, the docs in their own paragraph 281e40c
- Merge pull request #17998 from sold/tab-start 7e39794
- The /tab fix serves #16840 4eed511
- /tab starts in Safari and Chrome: the worker sees its host page, and the page waits for activation a5d9dd7
- SSH offers the hybrid post-quantum key exchange first: mlkem768x25519-sha256 1124a92
5 earlier comments · 1 event
The forge now keeps the Apple app's crash reports, groups them, shows them to the owner and notifies once per new group (#18006). The new crash test, the openapi, body-cap and notify suites and tsc pass locally. I did not run the full suite; the forge's check does that.
What changed
- Route:
POST /api/v1/telemetry/applestill takes the daily summary and now also takes a body withkind: "crash".- A crash body must have exactly the fields in the issue. An unknown field, a wrong type, more than 200 breadcrumb lines, more than 12 frames per finding or more than 10 findings is a 400 that names the problem.
- A line longer than 200 characters is cut rather than refused. Control characters are stripped.
- A body over 64 KB is a 413. Summaries keep their own 8 KB cap and their 422 answers.
- Crash reports are limited to 5 a minute from one address and 60 in all, counted in memory and never stored. The limit counts only reports with a valid shape.
- It answers 204 and keeps no address, account or device id.
- Storage and grouping: reports go in their own table,
apple_crash_group, apart from the usage rows. Reports with the same build and the same top 3 frames of the first finding are one group, holding a count and the latest report's detail. At most 200 groups are kept, least recently seen dropped first. - Owner view:
/admin/telemetryshows a "Crash reports" section above the usage, newest group first, with each group's frames and breadcrumbs. The "App usage" terminal screen shows the same groups first (readAppleCrashesis the one gate). - Notification: a group's first report appends an
apple.crash_groupevent, which wakes the notifier. The notifier tells each admin with a notification URL once per new group, so a repeat report in a known group sends nothing. /privacy: a new row says what a report holds and that it is sent only when the user chooses.- Contract and docs: the route is updated in openapi, with the 400 and the 413 declared.
docs/features/apple-usage.mdhas a crash section. - Test:
test/apple-crash.test.tsposts two reports with the same frames and one different. It checks the owner view shows two groups with counts 2 and 1, and that there is one notification each. It also covers the planted extra field (400), the 413, and the escaping of breadcrumbs.
Reused and chosen
- I reused the daily-summary route, its limiter pattern,
readBoundedandBODY_CAPS/RATE_CAPSrows, andcrew/notify.ts's ask-lines path, with no new dependency. - Two similarity notes from
scripts/gate.tsstayed (keepCrash,readAppleCrashes). I left them as separate functions; the second is the same admin check asreadAppleUsage. - The gate asked for a new terminal screen or a
No door:line, so a commit line says the terminal door is the extended App usage screen. - I did not keep every individual report, only the group's count and the latest one. An anonymous flood of distinct frames could push real groups out past 200, and the rate limit is what bounds that.
- I did not add a switch for the owner to refuse crash reports.
Try it
Post a crash body (see docs/features/apple-usage.md) to /api/v1/telemetry/apple on the preview, then open /admin/telemetry as an admin.
Review
[
{"go":"/admin/telemetry","look":"after a crash report is posted, a Crash reports section with the group above the usage rows","expect":"the group shows its count, build, top frame, frames and breadcrumbs, newest first"},
{"go":"/privacy","look":"the row 'Crash reports in the Apple app'","expect":"it says it is sent only when you choose and lists what it holds"}
]
🤖 Generated with Claude Code
The check failed because the apple.crash_group event I added wasn't classified in the event-audience table. I added it to src/core/event_audience.ts as an admin-only event, so readers and guests never see it. I pushed the fix; the forge's check has not run on it yet.
Locally, test/event-audience-coverage.test.ts and test/apple-crash.test.ts pass, and tsc and the gate are clean. I did not re-run the full suite.
The rest of the pull is as I described it before.
🤖 Generated with Claude Code
This round takes all six of sentinel's points. The new and neighbouring tests, tsc, design-lint and the gate pass. I did not run the whole suite. unused-exports prints a note about dead exports in other files (src/http/crawl.ts and others), none of them this change's.
What changed
- Contract: the route now declares 400 (
invalid_crash), 413 and 429 througherrorStatus. I used that rather than wideningrefuses, whose type only allows 401, 403, 404 and 422. A new contract test checks all three on the crash path. - No silent deletion:
recordCrashno longer deletes anything. Once 200 groups exist, a report for a new group is not kept, but it still returns 204. A report for a known group still counts. The sender can't tell it was dropped, which is a gap to decide on. - Notification flood: groups are never evicted, so a group's id is told once and a re-sent group is not told again.
crashLinesnow gives one line per notifier pass: "N new crashes in the Apple app, latest …". The admin's existing hourly cap still applies on top. - Owner page: the "Crash reports" section is one
dlofstatusRows. Each group is one row with the id anchorcrash-<id>, and the frames and breadcrumbs sit in onepre. The explanation paragraph is gone. - Tidy: the
pairliteral intelemetry_apple.tsis reformatted. The admin check is now onemayReadApple, shared byreadAppleUsageand the crash reads. The gate's rewrap touchedevent_audience.ts. - Tests:
- 429 after 5 crash reports a minute from one address.
- Lines cut to 200 characters, and control characters stripped.
- A summary over 8 KB is still a 413.
- The cap holds with no deletion, and a known group still counts at the cap.
- A flood of 30 new groups is one line, and re-sending them tells nothing.
- The page test asserts on the
id="crash-…"anchors instead of"1 report ".
What I chose not to do
- No owner delete button. Sentinel offered it as an alternative, and a full table cannot be cleared from the page.
- The gate still sees
keepCrashandreadAppleCrashesas loosely similar to other functions. The shared admin check is the real duplication, and it is now one function.
To try it
- As an admin, open
/admin/telemetry. - POST a
kind: "crash"body to/api/v1/telemetry/apple.
The Apple app's crash reports are now kept, grouped and shown to the app's owner. Reports with the same build and the same top three frames count as one group. A group's first report notifies each admin once. Admins read the groups on /admin/telemetry and on the App usage terminal screen. The route rejects a malformed report with 400, a body over 64 KB with 413, and more than 5 reports a minute from one address with 429.
This last commit fixes one sentence in docs/features/apple-usage.md:30, the line review flagged. It used to say the least recently seen group goes first at the cap, which is wrong, because recordCrash in src/core/apple_crash.ts never deletes a group. It now says that once 200 groups exist, a report of a new group is not kept, a report of a known group still counts, and nothing is deleted on its own. No code changed in this commit.
Not done here: once 200 groups exist, an anonymous sender can fill the table and real crashes stop being kept. A danger button that names the group or table it clears and asks first would fix this without deleting anything silently. That is a new feature, so it is filed as #18024 for its own pull.
Checks: the gate reports 0 failures. It notes that keepCrash and readAppleCrashes look like existing functions; both notes were already there before this commit. bun x tsc --noEmit is clean. bun scripts/fast.ts would not name a test set because the whole pull's diff is too broad, so I picked the crash test and the feature-doc tests: 84 pass, 0 fail.
To try it: read docs/features/apple-usage.md, under "Crash reports", and check the "Kept" line against recordCrash in src/core/apple_crash.ts.
🤖 Generated with Claude Code
Parked, offered to the crew again: it sat 6 h with no push, and nobody on the crew can take it from here, so it waits for its author. The last verdict (changes requested): Earlier asks: contract 400/413/429 declared (met, tested); no silent deletion (met in code); one notification line per pass (met, tested); owner page as one dl of rows (met); shared admin gate (met); the missing tests (met). One thing left, small: docs/features/apple-usage.md says the cap works by … (The forge posts this; nobody wrote it by hand.)
The forge now keeps the Apple app's crash reports, groups them, shows them to the owner and notifies once per new group (#18006). The new crash test, the openapi, body-cap and notify suites and
tscpass locally. I did not run the full suite; the forge's check does that.What changed
POST /api/v1/telemetry/applestill takes the daily summary and now also takes a body withkind: "crash".apple_crash_group, apart from the usage rows. Reports with the same build and the same top 3 frames of the first finding are one group, holding a count and the latest report's detail. At most 200 groups are kept, least recently seen dropped first./admin/telemetryshows a "Crash reports" section above the usage, newest group first, with each group's frames and breadcrumbs. The "App usage" terminal screen shows the same groups first (readAppleCrashesis the one gate).apple.crash_groupevent, which wakes the notifier. The notifier tells each admin with a notification URL once per new group, so a repeat report in a known group sends nothing./privacy: a new row says what a report holds and that it is sent only when the user chooses.docs/features/apple-usage.mdhas a crash section.test/apple-crash.test.tsposts two reports with the same frames and one different. It checks the owner view shows two groups with counts 2 and 1, and that there is one notification each. It also covers the planted extra field (400), the 413, and the escaping of breadcrumbs.Reused and chosen
readBoundedandBODY_CAPS/RATE_CAPSrows, andcrew/notify.ts's ask-lines path, with no new dependency.scripts/gate.tsstayed (keepCrash,readAppleCrashes). I left them as separate functions; the second is the same admin check asreadAppleUsage.No door:line, so a commit line says the terminal door is the extended App usage screen.Try it Post a crash body (see
docs/features/apple-usage.md) to/api/v1/telemetry/appleon the preview, then open/admin/telemetryas an admin.Review
🤖 Generated with Claude Code
Closes #18006