fix(kanban): malformed recorded landed receipt HOLDs on reclamation (t_ad32cdab) - #1034
Conversation
…nstead of escaping _hold (t_ad32cdab)
Reclamation rebuilt the landed claim by indexing the persisted receipt
(previous["landed"], entry["repository"], entry["sha"]) and iterated
previous.get("refs", ()) -- a null refs is not the default. Malformed rows
(landed null / not a list / junk entry / missing sha, refs null with a
missing recorded repo) raised TypeError/KeyError, which neither preserve()
nor remove_workspace_dir() catch: workspace retained, but no held_reason
and no workspace_held event (Argus r4 P10/P12a-c on #924).
- _recorded_landed_claims(): validate the recorded receipt, refuse with a
named SurvivorUnavailable reason.
- _recorded_refs(): non-list refs vouch for nothing -> ordinary
'recorded repository missing' HOLD.
- preserve() backstop: TypeError/KeyError/AttributeError/IndexError from an
unvalidated persisted shape HOLD with a persisted reason (traceback logged).
Tests: 7 malformed shapes x {remove_workspace_dir, safe_remove_workspace_dir}
HOLD with reason + event; valid receipt still reclaims; backstop x4. 18/20
fail on the pre-fix module (the 2 valid-receipt controls pass on both).
|
🤖 merged-by: apollo · lane: kanban-merge-pass · gate: BYPASS: FleetReview paused by Ace 2026-09-22 (state/fleetreview-pause marker present) · why: t_ad32cdab: kanban survivor: malformed recorded landed receipt must persist a HOLD on reclam; Argus off card review (Ace 13:08), CI green |
FleetReviewReview: post-merge · head Post-merge review ( profile: light (rule: default light: lines 228<800, files 2<1000000, hunks 5<1000000, no hot path) · round 0 · members: B-assert-ctx, B-state, F, G · families: openai,xai Confidence: 3/5 Findings
FleetReview provenance · models: B=gpt-6-sol, D=grok-4.6, F=gpt-6-sol · cost: $0.45 · duration: 4m 38s · rounds: 1 · files examined: 2 |
Argus r4 on #924 (P10, P12a-c): a malformed persisted
kind: landedreceipt made reclamation raise TypeError/KeyError out ofpreserve()andremove_workspace_dir(). The workspace was kept, but no held_reason and no workspace_held event were written, so the card's recovery state was silent.Reproduced on main 67202e8 with the Argus probe: P10 (refs=null) TypeError; P12a (landed=null) TypeError; P12b (no sha) KeyError; P12c (['junk']) TypeError. After the fix all four HOLD. Each writes a persisted reason and a workspace_held event. P11/P4/P7 controls unchanged. P12d (refs=null with no missing repo) still reclaims correctly, because the live landed commits are re-verified.
Changes (hermes_cli/kanban_survivor.py):
_recorded_landed_claims()checks the recorded receipt shape. A bad shape raises a named SurvivorUnavailable reason._recorded_refs(): a non-listrefsvouches for nothing, which gives the ordinary 'recorded repository missing' HOLD.preserve(): TypeError/KeyError/AttributeError/IndexError from any unchecked persisted shape now HOLDs with a persisted reason. The traceback is logged.Tests (tests/hermes_cli/test_kanban_survivor_malformed_receipt.py): 7 malformed shapes, each through
remove_workspace_dirandkb.safe_remove_workspace_dir, HOLD with a reason and an event. The valid receipt still reclaims through both. The backstop is tested with 4 exception types. On the pre-fix module 18/20 fail; the 2 valid-receipt controls pass. Locally, landed + live_tree + new file: 71 passed.Hotspot: #1018 (t_60592755) also edits
preserve(). Its hunk inserts abovelanded = ...; this PR changes the lines below it. They don't overlap, but merge order matters.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.