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

Crash reports: the route accepts the Apple app's body (os, device, at, previousRun, findings) #18226

opened this

Merged 1h 43m ago, live in production

POST /api/v1/apps/:owner/:name/crash-reports now accepts the Apple app's body, and a report with several findings files or counts one group per finding. I ran the crash-reports, contract, unused-exports, feature-orphans and module-state tests and tsc --noEmit; all pass. I did not run the full suite.

Notes

opened this

POST /api/v1/apps/:owner/:name/crash-reports now accepts the Apple app's body, and a report with several findings files or counts one group per finding. I ran the crash-reports, contract, unused-exports, feature-orphans and module-state tests and tsc --noEmit; all pass. I did not run the full suite. The forge's check runs it on this push.

What changed

  • New fields: the route accepts app, os, device, at, previousRun and findings.
    • app, os and device are text of up to 64 characters; at is a time; previousRun is true or false.
    • findings is 1 to 8 objects of {kind, frames, breadcrumbs?}. Each uses the existing frame and line caps.
    • The code is in src/core/crash_groups.ts; new refusals are invalid_context and invalid_findings, both 422.
  • Old shape: an old-shape report parses and files exactly as before. An unknown field, at the top level or inside a finding, is still a 422.
  • Groups per finding: splitReport makes one group per distinct finding, so duplicates inside one report count once. reportCrashes in src/actions/crash_reports.ts files each one. The answer keeps {issue, count, opened, reopened} for the first finding and adds findings, one entry per group.
  • Issue text: a new issue's body gets a "System" line with os and device, and notes if previousRun was true. app is validated but not stored, and at is kept only as a parsed time on the report, so it never reaches the issue. Nothing that names a person is read or kept.
  • Docs: /contract/openapi.json documents the body with an example (postApiV1AppsOwnerNameCrashReports.ts), and docs/features/crash-reports.md describes it.
  • Test: the new test posts the app's payload with three findings, two of them identical, and gets two groups and two issues. It also checks that an unknown field, an over-long os, a bad at and an unknown finding field each get a 422.

Choices to check

  • The Apple payload has no build, so when findings is present and build is absent, the build is "unknown". I guessed here. If the app sends the build inside app or device, say which and I'll read it from there.
  • device and os are plain strings. If the app sends device as an object, that is a 422 today.
  • The old strict shape test used device as its example unknown field, which is now valid. I switched it to account.
  • The new test uses its own repo because the rate limiter counts per app, and the shared repo's limit was already used up by earlier tests.

Left out

  • The report key and the private-app door, which were parts of #18197 beyond this issue.
  • /api/v1/telemetry/apple is untouched: it stays the usage summary only, and there is no second store.
  • No new terminal screen: the existing crash groups screen and page already list every group this route files, and the commit carries a No door: line saying so.

Try it: POST /api/v1/apps/<owner>/<name>/crash-reports with {"v":1,"kind":"crash","app":"Forge","os":"iOS 19.1","device":"iPhone17,1","at":"2026-12-04T10:00:00Z","previousRun":true,"findings":[{"kind":"crash","frames":["Forge +1"]},{"kind":"hang","frames":["Forge +99"]}]}. It answers 202 with two entries in findings.

🤖 Generated with Claude Code

Closes #18223

2 earlier comments
commented

POST /api/v1/apps/:owner/:name/crash-reports now accepts the Apple app's body, and a report with several findings files or counts one group per finding. I ran the crash-reports, contract, unused-exports, feature-orphans and module-state tests and tsc --noEmit; all pass. I did not run the full suite. The forge's check runs it on this push.

What changed

  • New fields: the route accepts app, os, device, at, previousRun and findings.
    • app, os and device are text of up to 64 characters; at is a time; previousRun is true or false.
    • findings is 1 to 8 objects of {kind, frames, breadcrumbs?}. Each uses the existing frame and line caps.
    • The code is in src/core/crash_groups.ts; new refusals are invalid_context and invalid_findings, both 422.
  • Old shape: an old-shape report parses and files exactly as before. An unknown field, at the top level or inside a finding, is still a 422.
  • Groups per finding: splitReport makes one group per distinct finding, so duplicates inside one report count once. reportCrashes in src/actions/crash_reports.ts files each one. The answer keeps {issue, count, opened, reopened} for the first finding and adds findings, one entry per group.
  • Issue text: a new issue's body gets a "System" line with os and device, and notes if previousRun was true. app is validated but not stored, and at is kept only as a parsed time on the report, so it never reaches the issue. Nothing that names a person is read or kept.
  • Docs: /contract/openapi.json documents the body with an example (postApiV1AppsOwnerNameCrashReports.ts), and docs/features/crash-reports.md describes it.
  • Test: the new test posts the app's payload with three findings, two of them identical, and gets two groups and two issues. It also checks that an unknown field, an over-long os, a bad at and an unknown finding field each get a 422.

Choices to check

  • The Apple payload has no build, so when findings is present and build is absent, the build is "unknown". I guessed here. If the app sends the build inside app or device, say which and I'll read it from there.
  • device and os are plain strings. If the app sends device as an object, that is a 422 today.
  • The old strict shape test used device as its example unknown field, which is now valid. I switched it to account.
  • The new test uses its own repo because the rate limiter counts per app, and the shared repo's limit was already used up by earlier tests.

Left out

  • The report key and the private-app door, which were parts of #18197 beyond this issue.
  • /api/v1/telemetry/apple is untouched: it stays the usage summary only, and there is no second store.
  • No new terminal screen: the existing crash groups screen and page already list every group this route files, and the commit carries a No door: line saying so.

Try it: POST /api/v1/apps/<owner>/<name>/crash-reports with {"v":1,"kind":"crash","app":"Forge","os":"iOS 19.1","device":"iPhone17,1","at":"2026-12-04T10:00:00Z","previousRun":true,"findings":[{"kind":"crash","frames":["Forge +1"]},{"kind":"hang","frames":["Forge +99"]}]}. It answers 202 with two entries in findings.

🤖 Generated with Claude Code

commented

<!-- look-pages 2bd1e9cf09ff --> Look pages for 2bd1e9c, from the gate:

  • look pages (none): this pull changes src/web/studio/crash_card.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

API Error: 402 This request requires more credits, or fewer max_tokens. You requested up to 128000 tokens, but can only afford 4000. To increase, visit https://openrouter.ai/workspaces/default/keys/b36b4d5ca03526e2ce9b015c94d62cc19d23669897752807e5fe44ac6efc00fd and adjust the key's monthly limit

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs