Vesper Ruling — FLAG-041 Pre-Code Q1–Q3¶
To: Orion (he/him)
From: Vesper (she/her)
CC: Katja (Captain), Atlas (he/him)
Date: 2026-04-21
Re: Pre-code ruling for fix/halt-reason-taxonomy-leak — green light given
Q1 — _shutdown fallback with halt_reason=None: CONFIRMED SAFE¶
or "" + cascade guarantees at least HALT_REASON_UNEXPECTED lands. No path produces None or empty-string write. Safe to drop halt_reason= from both call sites.
Q2 — All return-False paths covered: CONFIRMED¶
Every _tick() return-False site writes a specific token before returning. The try/except Exception: pass edge case (StateManager write failure during halt classification) is correctly handled by the fix — the fallback to HALT_REASON_UNEXPECTED is better than the current silent clobber to engine_requested_halt. No uncovered path.
Q3 — Second clobber site at run_paper_session.py:415: CONFIRMED, OPTION A APPROVED¶
The finding is correct. S42 ran through run_paper_session.py, not NEOEngine.run(). The clobber that produced engine_requested_halt in the S42 DB row was at run_paper_session.py:415, not main_loop.py:4282. Both sites are structurally identical and carry the same incorrect halt_reason=HALT_REASON_ENGINE_REQUESTED override.
Ruling: Option A — extend this branch to fix both sites.
Reasoning:
- Same one-line change in two files. No unrelated scope introduced.
- Fixing only main_loop.py does not fix S43 — the paper session loop is the live code path. The point of FLAG-041 is for S43's DB to show the authentic token. That requires run_paper_session.py to be fixed.
- Test 1 (token preservation) should exercise run_paper_session.py:410–419 — that is the real S42/S43 path. This makes the test meaningful, not synthetic.
- Branch title and FLAG-041 description cover both — "halt.reason taxonomy leak" applies to both clobber sites.
Commit plan (revised):
fix(main_loop): preserve authentic halt.reason — drop ENGINE_REQUESTED clobber in run() halt pathfix(run_paper_session): preserve authentic halt.reason — drop ENGINE_REQUESTED clobber in paper session halt pathtest(halt): assert authentic halt token survives shutdown — FLAG-041
Three commits is fine. Alternatively, commits 1 and 2 can be combined into a single commit if the diff is cleaner that way — your call. Test commit is separate.
Test 1 spec (updated): Exercise the paper-session loop. Mock or configure _tick() to return False after the anchor saturation guard (or DEGRADED timeout) writes a specific token to halt.reason. Assert the token in engine_state at shutdown equals the specific token — not engine_requested_halt. This covers the actual S42 code path.
Test 2 spec (unchanged): Call _shutdown directly with no halt_reason and no prior halt.reason set. Assert halt.reason is written as HALT_REASON_UNEXPECTED.
Correction Acknowledged¶
Orion's original investigation memo attributed the clobber to main_loop.py. The correction to run_paper_session.py:415 is accepted without penalty — this is exactly what pre-code investigation is for. Good catch.
Summary¶
All three questions resolved. Both clobber sites confirmed, both in scope for this branch. Option A approved. Branch base is main. Build as described. Deliver in standard format. Vesper reviews before merge.
— Vesper