Repository navigation
Error contract: exit-code taxonomy and JSON error envelope (Closes #31) - #50
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
33b07c6 to
e2a3b68
Compare
- sysexits-aligned exit codes for every APSError: 64 usage, 65 data
(corruptState + decodingFailed), 69 unavailable, 70 internal,
73 write did not persist (66 reserved)
- single CLIOutput.fail path: human stderr line + optional
{error:{code,message,hint}} envelope (--json/--jsonl or APS_ERROR_JSON=1);
replaces the corruptState-only reportAPSError shim and ValidationError
flattening; dump/reset covered for the first time
- keeps CHG-0016's requireDecodableDiskState as the loud corrupt-state
mechanism (no duplicate)
- tests + smoke assertions for the whole contract; specs/README in lockstep
- SpecSync CHG-0018 accepted; evidence rebound for CHG-0003/0004/0007/0011/
0012/0013/0014/0015/0016/0017 (audited reopens, actor 0xLeif)
Supersedes #47 (rebuilt on post-#43 main).
Main took CHG-0018 (Windows audit), CHG-0019 (PowerShell smoke), and CHG-0020 (windows tests) while this branch was in flight; the error contract change is recreated as CHG-0021 and all shared accepted changes are rebound (audited reopens, actor 0xLeif).
e2a3b68 to
5e6433c
Compare
Sync @mainactor XCTest methods break Linux package test discovery; async throws matches the rest of APSTests and unblocks linux-smoke. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Cursor babysit: linux-smoke failed because Pushed a one-line fix: |
Review (agent:cursor) — tested locallyVerdict: Approve to merge first. Individually green; good foundation for the rest of the stack. Tested
Merge coordination (required)Please merge this before #51 / #53 / #54 / #55. Your SpecSync change is Stack noteAfter this merges, #51 will need a rebase (smoke/tests/specs + SpecSync evidence conflict). That is expected; not a defect in this PR. |
Closes #31. Supersedes #47 (rebuilt onto post-#43 main; see notes).
Summary
Full error contract from design decision 4, built on top of #43's merged
corruptStatesemantics instead of duplicating them:APSErrornow maps: 64 usage (invalidValue), 65 data (corruptState+decodingFailed), 69 unavailable (keychainUnavailable), 70 internal (encodingFailed), 73 write did not persist (persistenceFailed); 66 reserved.CLIOutput.fail): human line on stderr, optional{"error":{"code","message","hint"}}envelope (with--json/--jsonlorAPS_ERROR_JSON=1), taxonomy exit code. Replaces both the old flatten-to-ValidationErrorbridge (everything was 64) and Add: loud torn FileState reads and multi-writer docs #43's corruptState-onlyreportAPSErrorshim. dump and reset are covered for the first time.StateStore.requireDecodableDiskState(Add: loud torn FileState reads and multi-writer docs #43) — no duplicate mechanism here.invalid_value,encoding_failed,decoding_failed,persistence_failed,keychain_unavailable,corrupt_state.Verification (local, worktree)
swift buildclean; 44 tests (4 new: taxonomy mapping, envelope shape, envelope modes, requireDecodableDiskState corrupt case), 0 failuressmoke.shextended and green: exit 64/65/73 assertions, stdout purity, envelope greps,APS_ERROR_JSON=1specsync check --force100%,specsync change check17 active valid,fledge lanes run verifygreen (4 steps incl. plugin validate)SpecSync
Notes on the rebuild
#47 was invalidated when #43 landed the corrupt-state slice with different naming (
corruptStatevs mydecodingFailed) and its own exit mapping. Rather than fight a 3-way conflict, this branch re-applies only the remaining contract delta on fresh main: #43's case name,requireDecodableDiskState, and the jsonl corrupt-state watch event are kept as-is.