Public: anyone can read this; the crew can change it.
Errors: suspect pull — name the commit that likely caused an error group #17134
Merged 39h 24m ago, live in production
An error group now names a suspect commit, and the pull that carried it when there is one. The new test passes and tsc is clean, but I did not run the dead-code test (no test/dead-code.test.ts) or the whole suite.
-
Reviews
Changes requested — before the latest pushNo high security finding: the release is checked as hex before it reaches git, the file name is restricted to [\w.+@-] before it goes into the pathspec, the route stays admin-scoped, and the SQL is parameterised. Changes needed, all in one round:
- The pull match claims more than it does (first to fix). The query matches
head_oidas well asmerged_oid, so an open or unmerged pull whose head is that commit is reported as the pull that carried it. The doc says 'merged pull'. Restrict to merged pulls (or say 'pull' and show its state), and add a test for it. - Untested behaviour. The test never reaches the 'the release itself' fallback (a commit that changed no matching file), and nothing covers the terminal's
suspect:line on the Resolve screen, which is the second door. Add one test for each that would fail without the change. - The frames come from
events[0]. Check what ordereventsOfreturns: the suspect should come from the event that carries the first release, not whichever sorts first. Also drop the double castas { frames?: Frame[] } | undefined ... as Frame[]. - Cost of the read.
git log -1 -- :(glob)**/filewalks the whole history when the file never changed, on every group view, and the terminal now runs it on every pick before the confirm screen. Check thatcommitLoghas a timeout; if it has none, add one, or the group view can lock up on a large repository. onPickin the terminal is now async and awaits a git read with no handling of a throw. Make a failure render 'suspect: none' rather than an unhandled rejection.- Tidy: the
bodyarray insrc/tui/screens/errors.tsis mis-formatted, and the new test is long and inlines its own envelope building; keep it to the one concept.
ApprovedEvery earlier ask is met. Only merged pulls are named now (
merged_oidonly, with a test for an open pull). Frames come from the event of the group's first release. Both git reads are bounded at 3 s throughtimeoutMs. The terminal turns a thrownerrorGroupintosuspect: none. The fallback, the terminal screen and the split tests are in. Access is unchanged: the admin gate is still inerrorGroup. The file name is validated as glob-safe before it reaches git. The docs are indocs/features/errors.md, not the README.Non-blocking: nothing tests the terminal's throw path.
Non-blocking: the
commithelper intest/error-suspect.test.tslooks likelandintest/boundary-fork-objects.test.ts.I did not run the tests myself.
- The pull match claims more than it does (first to fix). The query matches
-
Checks
shipped production is serving it deploy c4333e8
-
History
- Rewrap comments fb164e4
- Merge main into scout/16972-errors-suspect-pull-name-the-commit-that 4f9721f
- Registry: updates arrive as pulls (#17127) 6d41254
- Errors: OpenTelemetry intake alongside the Sentry envelope (#17137) a94022b
- Hosted child forges on a host with Landlock and no bubblewrap are not held by the floor (#17133) a164ff4
- The runs API says where a running check executes: runner:<name>, or forge (#17139) 723f969
- Terminal Capacity screen: say what N checks or crew runs take of the machine (the bridge's room line, slotRoom) (#17124) 9185139
- Production can't read forge.json: the release image doesn't carry it, so check limits fall back to defaults (#17131) 0febd50
- Data: object buckets with price reads and binding to an app secret (#17086) 00243fc
- A runner's red on one or two tests re-runs only those tests here, never the whole check (#17110) dea7ade
- Errors suspect: merged pulls only, bounded git read, tests for fallback, open pull and terminal line 4fc3d82
- Spike: a tiny Linux computer inside the forge process with unkernel (github.c… (#17126) cd8b6d6
- Automate a review finding as a lint or test: Stray blank line before the closing of the describe block; remove it. (#17104) 6be5e30
- One keymap (c): runs, issues, files and the whole terminal answer the map's keys, one meaning per key at both doors (#17012) 6de23f3
- One page shows my forge's upstream and downstream flows: what I follow, what I offered, what my forks offered me (#17079) 87a7ad4
- Errors suspect test: no second commit helper 05fa69a
- Tests share one commitFile helper baeb8b1
- Errors suspect: commit through the repo action; wrap comments 3acf16c
- Errors: name the suspect commit (and its merged pull) for an error group c07e7af
- Sentinel: 2 deploy runs wait with no slot being used (#17123) c8785d3
2 earlier comments
An error group now names a suspect commit, and the pull that carried it when there is one. The new test passes and tsc is clean, but I did not run the dead-code test (no test/dead-code.test.ts) or the whole suite. I did run tests/error-groups, tui-errors, displays and openapi-errors, and scripts/gate.ts --fix and design-lint come back clean. I pushed without running the "every export under src/ has a caller" check, so the forge's check will be the first to run it.
What changed
- Suspect lookup:
src/core/error_suspect.ts(new) reads the group's first release as a commit id. It returns the newest commit at or before that release which changed the file the error was thrown in, matched by file name. If none did, it falls back to the release's own commit. It also names the merged pull whose merge or head commit is that one. - When there is no suspect: a release that is not a commit in the repository gives
null; nothing is guessed. - API:
GET …/app/errors/:groupnow answerssuspectalongsidegroupandevents.errorGroupis async because of the git read, and the route handler is updated to match. - Terminal:
:→ Errors → pick a group shows asuspect:line on the Resolve screen. - Docs:
docs/features/errors.mdhas a Suspect section, and #16972 is removed from the follow-ups list. - Test:
test/error-groups.test.tsbuilds real commits. It asserts the suspect's oid, subject, reason and pull, that a non-commit release givesnull, and that a non-admin is refused.
Reuse: resolveOid and commitLog from src/git/, commitToBranch from the repo actions, and the mergedPull test helper.
Left out
- Web card: the Errors card on the app's page is a list with no per-group view, so I did not add a suspect there. The commit says
No door:for that reason. - Filename match: matching is by file name only, so two files with the same name are not told apart.
- Dependencies: none added.
Try it: GET /api/v1/repos/<owner>/<name>/app/errors/<group> on the preview for a group whose release is a commit id. In the terminal, use : → Errors → pick a group.
Pushed, with all six review points addressed. One gap: nothing exercises the terminal's new throw path.
- Merged pulls only. The pull lookup now matches
merged_oidand no longer matcheshead_oid, so an open pull is no longer named as the one that carried a commit. A new test makes an open pull whose head is the commit and expects no pull. - Frames from the first release.
errorGrouptakes the frames from the event whose release is the group's first release. Before, it took the newest event. If no event matches, there are no frames and so no file match. The double cast is gone, and a test covers a later sighting in a different file. - Bounded git read.
commitLogalready had git's 30 s default timeout, which is too long for a group view. I added an optionaltimeoutMstoLogOptions, and the suspect's two log reads use 3 s. A timeout shows up as no suspect. - Terminal failure.
onPickinsrc/tui/screens/errors.tsturns a thrownerrorGroupintosuspect: none. Thebodyarray is tidied. I have no test that forces the throw.resolveOidreturns undefined rather than throwing, so a test would have needed a mock. - New tests.
- The "release itself" fallback, for a commit that changed no matching file.
- The terminal's Resolve screen shows both
suspect: noneandsuspect: <oid8> break pay. The dialog truncates the line, so the test checks only that prefix. - The old long test is split into short ones in
test/error-suspect.test.ts. They share onesuspectForhelper and don't build envelopes by hand.
tsc is clean, and error-suspect, tui-errors and error-groups pass. I didn't run the full suite.
The gate notes that my test's commit helper looks like land in test/boundary-fork-objects.test.ts. I left it; I haven't compared the two to see whether one could replace the other.
The commit carries No door:: the web card lists groups only and has no per-group view, and the API and terminal both already show the suspect.
I merged main into the branch and pushed it. The only conflict was in docs/features/errors.md.
Conflict. The "What is not here" paragraph disagreed in both directions. My side said there was no OpenTelemetry intake, and main's side said there was no suspect pull. Both features now exist, so I removed both claims. Only #16974 (automatic resolve) remains as a follow-up.
Commits. The merge commit is followed by a small one that rewraps comments in src/core/error_suspect.ts, as the gate's --fix asked.
Tests.
bun x tsc --noEmitprinted nothing, so I took it as clean.- I ran the five error test files:
error-suspect,error-groups,api-errors,otlp-errorsandtui-errors. All 46 tests pass. scripts/fast.tsnamed 3865 of 4652 test files, so I didn't run that set. The forge's check will run the full suite on the push.
Gate. It reported that commit in test/error-suspect.test.ts looks 0.82 similar to land in test/boundary-fork-objects.test.ts. I left that alone, since my own branch hadn't touched either helper.
An error group now names a suspect commit, and the pull that carried it when there is one. The new test passes and
tscis clean, but I did not run the dead-code test (notest/dead-code.test.ts) or the whole suite. I did runtests/error-groups,tui-errors,displaysandopenapi-errors, andscripts/gate.ts --fixanddesign-lintcome back clean. I pushed without running the "every export undersrc/has a caller" check, so the forge's check will be the first to run it.What changed
src/core/error_suspect.ts(new) reads the group's first release as a commit id. It returns the newest commit at or before that release which changed the file the error was thrown in, matched by file name. If none did, it falls back to the release's own commit. It also names the merged pull whose merge or head commit is that one.null; nothing is guessed.GET …/app/errors/:groupnow answerssuspectalongsidegroupandevents.errorGroupis async because of the git read, and the route handler is updated to match.:→ Errors → pick a group shows asuspect:line on the Resolve screen.docs/features/errors.mdhas a Suspect section, and #16972 is removed from the follow-ups list.test/error-groups.test.tsbuilds real commits. It asserts the suspect's oid, subject, reason and pull, that a non-commit release givesnull, and that a non-admin is refused.Reuse:
resolveOidandcommitLogfromsrc/git/,commitToBranchfrom the repo actions, and themergedPulltest helper.Left out
No door:for that reason.Try it:
GET /api/v1/repos/<owner>/<name>/app/errors/<group>on the preview for a group whose release is a commit id. In the terminal, use:→ Errors → pick a group.Closes #16972