fix: prevent false wedge escalations and replayed wake status - #88
Merged
Conversation
Port upstream kunchenguid#2524 and kunchenguid#2331 onto the fork. Reclaim abandoned Claude auto-arm claims, defer wedge alarms for active worktree writes, and transactionally surface unread status lines without replaying handled entries. Preserve durable inbox, OMP doorbell, RunPod, and correlation semantics. Keep status presentation fail-closed, and use the fork's established portable timeout selection because the upstream shared helper is absent.
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
Port upstream kunchenguid/firstmate PR kunchenguid#2524 at final head 52f0753 and PR kunchenguid#2331 at final head c6553df faithfully onto dnth/firstmate current main 7b463ae. Remedy repeated false wedge storms by re-arming after proven abandoned Claude auto-arm claims and deferring wedge escalation while an ordinary task worktree is actively written, while preserving the unchanged escalation schedule for a stall that writes nothing and retaining bounded long-cadence resurfacing. Surface buried unread status notes and pending-reply resolutions exactly once with no loss or replay, preserving raw wake rows and OPEN DECISIONS behavior. Keep the port limited to the two upstream file sets with explicit fork adaptations only: preserve the durable local inbox from #68, programmatic OMP inbox wake from #71, pending-reply correlation and autonomous lifecycle behavior from #70, RunPod and OMP branch behavior, and the fork stronger fail-closed status-presentation retry boundary. Do not introduce unrelated fork-absent machinery; the absent shared fm-timeout-lib dependency is adapted with the fork established portable timeout selection and its upstream-only afk fixture is intentionally omitted, with the central shared-timeout owner left as follow-up. Verify abandoned-claim reclaim and live-claim non-reclaim, active-write deferral and bounded resurfacing, no-write escalation, secondmate-home exclusion, buried-note surfacing with no duplication, upstream file-list fidelity, fork compatibility, full Firstmate tests and lint, and green CI on the opened PR. Do not merge the PR. Avoid --yes and escalate ask-user findings through Firstmate. Start validation only when no other no-mistakes run is active because the shared credential must not race.
Firstmate-Validation-Generation: b0ad0d844bb4c1877554ce6660da3d5a
What Changed
Risk Assessment
✅ Low: The changed watcher, auto-arm reclaim, incremental status folding, and presentation cursor paths were inspected end-to-end; no concrete source defect or intent contradiction was substantiated. The added tests assert executable outputs and state rather than implementation text.
Testing
Targeted executable tests for the requested wake/status/auto-arm behavior passed and produced reviewer-visible CLI transcripts; full watcher-triage evidence is incomplete because the suite exceeded the bounded execution window and hit missing coreutils diagnostics in its fallback-path exercise.
Evidence: Focused behavioral test transcripts
Targeted wake-drain, OPEN DECISIONS cursor, and Claude auto-arm test transcripts are saved in the evidence directory.Evidence: Claude auto-arm transcript
Evidence: OPEN DECISIONS cursor transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
tests/fm-watch-triage.test.sh- The complete fm-watch-triage.test.sh suite did not finish within a 150-second bounded run; it emitted repeateddirname: command not found/basename: command not founddiagnostics during its intentionally restricted-PATH remote deadline fallback cases, so full watcher-suite completion is not demonstrated in this phase.bash tests/fm-wake-drain-unread-status.test.shbash tests/fm-wake-drain-open-decisions-cursor.test.shbash tests/fm-claude-stop-autoarm.test.shbash tests/fm-turnend-guard.test.shbash tests/fm-wake-queue.test.shbash tests/fm-gotmp.test.shtimeout 150s bash tests/fm-watch-triage.test.sh(incomplete; timed out with restricted-PATH diagnostics)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.