Repository navigation
fix(update): record terminal failures before offering reports - #158354
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 25, 2026, 5:54 PM ET / 21:54 UTC. ClawSweeper reviewWhat this changesThe branch records unexpected CLI update failures in existing run history before failure triage, preserves wrapped recovery outcomes, adds regression tests, and documents the behavior. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 5 items remain Current main still has the reported terminal-reporting gap, so this PR remains useful. One new fallback path reports recovery as pending even when update history records success, and the required installed-update proof is not shown. Priority: P2 Review scores
Verification
How this fits togetherThe flowchart LR
A[CLI update request] --> B[Update executor]
B --> C[Terminal result owner]
C --> D{Safe history outcome?}
D -->|Recorded| E[Update history]
D -->|Recovery pending| F[Pending recovery message]
E --> G[Result or failure triage]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +85, Tests +300, Docs +7. Total +392 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep failure recording with the terminal-result owner, while reporting post-commit presentation failures without recasting a finalized run as pending recovery. Do we have a high-confidence way to reproduce the issue? Yes for the source-level reporting gap: inject a terminal publisher exception around a recorded CLI run and inspect the history and failure report. The original reporter's exception remains unknown, and this review did not execute the path. Is this the best way to solve the issue? Mostly yes: the terminal-result owner is the right place to record failures before triage. The branch must distinguish finalized publication failures from genuinely pending recovery. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 800bf8e10e7c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Backport #158354 from b31c0ac. Backport #158455 from 31cd888. Source author: Peter Steinberger. Record otherwise-unreported settled failures before interactive reporting; keep nested primary failures, pending recovery and committed outcomes intact. Observer failures cannot replace or redeliver terminal results. Distinguish config-read-failed from invalid-config at the target's existing owners. Keep local rejected-field detail while masking operator keys and values in public reports. Do not import main-only candidate admission or alter no-op ordering. Preserve unavailable-source write fencing. Move all three legacy result assertions to a complete typed snapshot fixture. Repair the preexisting settlement test's incomplete ChildProcess cast with an unspawned real ChildProcess, retaining the seven original assertions. Proof: terminal 10 red then 77 green; installed config 8, classification 20, public reporting 106, triage 66, migrated assertions 3, config siblings 79, settlement fixture 7. These are distinct scoped receipts, not a full-suite claim. Production and owning CLI/config/services types, lint, frozen ratchets and independent review pass. Unchanged linked-plugin/real-npm baseline failures remain recorded. Database composition proof and publication remain pending. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: jalehman <[email protected]>
What Problem This Solves
Fixes failed CLI updates reaching the interactive report with no recorded phase or reason when executor admission, settlement, or terminal publication throws outside the inner update callback.
Refs #158187.
User Impact
The failure menu receives a recorded outcome with the reached phase, sanitized cause, and explicit rollback disposition. Pending recovery keeps its original diagnostic and owning history; a wrapped pending outcome cannot start an empty-report or automatic-repair flow.
Why This Change Was Made
The terminal-result owner now handles unclassified exceptions before triage, after checking that diagnostic writes are safe. Errors that already carry an owner's structured result retain it instead of rebuilding it from a bounded aggregate message. Triage recognizes the existing pending/finalized markers through their error graph, keeping command-cleanup protection first.
Reporting observers receive only confirmed publication results, once. Observer failures warn without replacing the committed outcome. Previously finalized history remains unchanged. This fixes the installed updater; older discarded diagnostics cannot be reconstructed from a report or supplied retroactively by candidate code.
Evidence
The final ten-case terminal-to-triage regression failed on the original implementation and passed three times on a Blacksmith Testbox using
pnpm test src/cli/update-cli/update-command-terminal-unreported.test.ts --maxWorkers=1. Measured wall times were 17.305, 17.178, and 17.427 seconds, with 1.557, 2.061, and 1.710 seconds of test time. Shared preparation dominated wall time.All 25 importing/sibling files passed: 450 tests across five routed projects, 171.176 seconds total. This includes the existing inspection-failure cases that caught a draft implementation truncating the original SQLite error; those original assertions now pass unchanged.
Exact-source independent Codex autoreview is scoped-clean at P0–P2.
node scripts/check-changed.mjs -- <four changed paths>passed all 25 test-type graphs, lint (zero warnings/errors), and guards in 1838.312 seconds. The complete remote command finished successfully in 38m37.832s on leasetbx_01m3d53sy16nh01g9q5cz5nhsr(Testbox run). CI timing is pending the PR run. Proof uses isolated Linux state and does not establish the original reporter's missing exception.Change size: production +101/−16 lines; tests +300/−0; docs +7/−0.