fix(bin): report composer state after interrupt failure - #108
Merged
Merged
Conversation
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.
Intent
Fix the review residual from the landed fm-control composer-clear change: route post-interrupt failures through the shared composer reporting boundary in bin/fm-control.sh. When the interrupt key sequence fails, still perform the shared composer read, preserve and report the first 80 characters of pending text, and report the observed composer state plus successfully sent keys through the same refusal boundary. Never submit the exit command on that path. Add an executable-interface regression in tests/fm-control.test.sh using the fake backend where Muse Escape restores pending text and the interrupt sequence then fails. Run all touched tests through bin/fm-test-run.sh. Keep this to one fix in one PR and use no more than two review rounds.
What Changed
Risk Assessment
✅ Low: The narrow fix refreshes shared composer evidence after interrupt-send failures, tracks successfully sent keys, and adds an executable regression covering restored text and exit suppression.
Testing
The touched test ran through
bin/fm-test-run.sh; the failure-path transcript shows fresh restored excerpt reporting, observed state, exact successfully sent keys, refusal status 1, and no exit submission. No broad suite or linter was run.Evidence: Targeted fm-control test-runner log
Source: Targeted fm-control test-runner log
Evidence: Direct interrupt-failure transcript
Source: Direct interrupt-failure transcript
scenario: Muse Escape restores pending text; C-u then fails fm-control exit status: 1 pending composer excerpt: restored pending text 0123456789012345678901234567890123456789012345678901234567 error: ... composer state 'pending-unproven'; keys sent: Escape recorded named keys: C-u, Escape, C-u literal submissions: nonePipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed ✅
bin/fm-control.sh:378- Required criterion: “When the interrupt key sequence fails, still perform the shared composer read, preserve and report the first 80 characters of pending text.” The new failure hunk at line 378 reusesread_composer_stateafter an earlier pre-interrupt pending read has already setCOMPOSER_EXCERPT_CAPTURED=1andCOMPOSER_EXCERPT_REPORTED=1; a busy Muse exit can therefore clear an initial draft, have Escape restore a different prompt, then fail on C-u while reporting only the old excerpt (or no new excerpt) even though the observed state is pending. Confirm whether this failure boundary must force a fresh shared excerpt capture/report.tests/fm-control.test.sh:771- The regression only checks that output containskeys sent: Escapeat line 771. Because the fake records the failing C-u before returning nonzero, an implementation that incorrectly reportskeys sent: Escape, C-uwould still pass this substring assertion. Assert the exact successfully-sent-key field, and/or assert that the failed key is absent from it.🔧 Fix: Refresh composer evidence after failed interrupts, captain
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bin/fm-test-run.sh tests/fm-control.test.shtest_busy_interrupt_failure_reports_restored_composer_without_exitDirect fake Muse/tmux executable-interface reproduction offm-control t1 exit✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.