Skip to content

doc: record the "a harness must not delete its own evidence" rule - #133

Merged
douglasmun merged 1 commit into
mainfrom
doc/preserve-serial-rule
Aug 23, 2026
Merged

doc: record the "a harness must not delete its own evidence" rule#133
douglasmun merged 1 commit into
mainfrom
doc/preserve-serial-rule

Conversation

@douglasmun

Copy link
Copy Markdown
Owner

Follow-up to #131.

Three harnesses put SERIAL inside a mktemp -d dir and rm -rf'd it from an EXIT trap — which fires on failure too, destroying exactly the panic dump PR #128 added for issue #126. #131 fixed that with the shared verify/preserve-serial.sh; this records the rule in CLAUDE.md along with the two traps that make it non-obvious:

  • key the preservation on the exit status, not a parsed verdict — a run killed by set -e, a QEMU timeout, or a typist TIMEOUT never prints a verdict, and those are the runs worth keeping;
  • capture rc=$? as the trap's first action, because any earlier command (cleanup_qemu) succeeds and resets $?. Unit tests that call the helper first in the trap pass against that bug; only the real trap shape catches it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CEkhAhgTxbE5TgifyYf8v4

Three harnesses put SERIAL inside a mktemp -d dir and rm -rf'd it from an EXIT
trap, which fires on failure too -- destroying exactly the panic dump PR #128
added for issue #126. Fixed in PR #131 with the shared
verify/preserve-serial.sh; this records the rule and the two traps that make it
non-obvious (key on exit status rather than a parsed verdict, and capture rc=$?
as the trap's first action before cleanup_qemu resets it).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CEkhAhgTxbE5TgifyYf8v4
@douglasmun
douglasmun merged commit 080c667 into main Aug 23, 2026
2 checks passed
@douglasmun
douglasmun deleted the doc/preserve-serial-rule branch August 23, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant