story-150: An interrupted planning session is judged on what it committed, whatever order its prompts were answered in - #301
Merged
Merged
Conversation
…committed, whatever order its prompts were answered in
…tted, whatever order its prompts were answered in Implemented by the l5 harness story workflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_an_interrupt_still_commits_what_was_written_and_exits_130failed under load and passed on a quiet machine, and it was filed as a flaky test. It was not flaky. It was intermittently catching a real defect, and this story found it.main'stry/except KeyboardInterruptcovered the session subprocess and nothing else. An interrupt arriving after the session — while the script was committing, stamping the mandate, validating, publishing, or waiting at one of its own prompts — leftmainthrough an uncaughtKeyboardInterrupt, and the process died by the signal rather than exiting.A shell reports a process killed by SIGINT as 128 plus the signal, so a developer's terminal shows 130 either way. That is why it went unnoticed. Anything reading the return code rather than watching a terminal sees
-SIGINTfor one and130for the other — and under load, the interrupt lands in the post-session work often enough to redden the suite.What changed
A second guard around the post-session work, and
INTERRUPTED_EXIT_CODEnamed once so both guards say the same thing.Nothing is undone, retried or completed by it. Whatever the steps above had already committed, stamped, pushed or published stands exactly as they left it, and the steps below the interrupt did not happen — which is what dying by the signal already meant. All that changes is that the script exits with the status instead of dying of the signal, so a caller that is not a shell is told what a shell was already told.
The interrupt now also says what it left behind, rather than leaving a developer to infer it from a bare status.
What is still outside both guards
Everything
maindoes above the session: the base refresh, the id reservation, the worktree, the build-state link, and the script's own workflow-confirmation prompt. An interrupt there still dies by the signal, and the comment on the constant says so rather than leaving the boundary to be discovered. That is a deliberate stopping point — those steps have nothing committed to report on — and naming it is what keeps the next reader from assuming the guard is total.A note on the brief
The brief this was planned from (#298) asserted that the behaviour under test was correct and put it out of scope, and rated its own confidence medium for exactly the reason that mattered: the failing run captured the assertion and not the pty transcript, so the mechanism was inferred rather than observed. The inference was wrong. What looked like a race between a signal and two pty writes was a gap in the script's own interrupt handling, and the story established that before repairing it.
Planned from the brief filed under 298.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NJzpgnY9aJ7K2godyjrJJR