fix(bin): recover corr-tagged decision verbs so open keys resolve - #6
Merged
Merged
Conversation
status_line_verb only peeled [key=...], so complete non-key tags such as secondmate [corr=hex] glued onto the verb and the open-decisions fold missed greppable needs-decision/blocked lines - fm-send --resolve-key then refused a plainly open key. Strip a before-colon suffix only when it is a whitespace-separated run of complete [name=value] tags (body rejects space/[, locale-independent ASCII slug names), fall back to the historical [key= peel otherwise, and bump the open-decisions fold version to 4. Regression coverage: corr-tagged open/close, shape I, key-led preserve, malformed-body and punctuated/unicode name refusal (including stock bash 3.2 + en_US.UTF-8), shared classifiers, cursor migration, and end-to-end fm-send false-send guards.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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 adopted-stack regression where bin/fm-send.sh --resolve-key refuses a plainly OPEN decision key.
Defect: a greppable needs-decision/blocked key (reproduced as project-registration-path as the last line of a status file) was OPEN, yet fm-send --resolve-key refused it. Refusal persisted after deleting the task's open-decisions-cursor to force a full re-fold, so the bug is in fold/verb parsing, not stale cursor state. Introduced or exposed by the 2026-08-14 overlay adoption (fm-send / upstream-kunchenguid#2041 revision). Operational impact: firstmate cannot close open decision keys at answer time; every decision reply currently uses the workaround of plain steer plus the worker self-appending its resolved line.
Root cause (implemented fix already committed at 14e7db6): status_line_verb only peeled [key=...], so complete non-key tags such as secondmate [corr=hex] glued onto the verb and the open-decisions fold missed greppable needs-decision/blocked lines. The fix strips a before-colon suffix only when it is a whitespace-separated run of complete [name=value] tags (body rejects space/[, locale-independent ASCII slug names), falls back to the historical [key= peel otherwise, and bumps the open-decisions fold version to 4 so cursors re-fold under the corrected verb recovery.
Deliberately OUT of scope: the key-position grammar ([key=x] at line END is prose, opening the DEFAULT slot) is documented, understood behavior — do NOT change it. Minimal fix only for the refusal-of-a-plainly-open-key defect.
Constraints already accepted: PR target = origin fork (jokim1/firstmate) ONLY; never push/PR/comment against upstream kunchenguid/firstmate. Regression tests colocated under tests/ covering corr-tagged open/close, shape I, key-led preserve, malformed-body and punctuated/unicode name refusal (including stock bash 3.2 + en_US.UTF-8), shared classifiers, cursor migration, and end-to-end fm-send false-send guards. Fork-queue adversarial plan panel already passed 3/3 on the v6 plan; implement/verify that committed fix, do not re-open the design. If CI is red only on pre-existing main failures unrelated to this change, report that and hold rather than chasing them.
What Changed
status_line_verbinbin/fm-classify-lib.shto strip a before-colon suffix only when it is a whitespace-separated run of complete[name=value]tags (fail-closed on whitespace/[in a token body, locale-independent ASCII slug names), falling back to the historical[key=peel otherwise, via a new_fm_is_wholly_complete_metadata_tagshelper. This stops complete non-key tags such assecondmate [corr=hex]from gluing onto the leading verb, so the open-decisions fold once again matches greppable needs-decision/blocked lines andfm-send --resolve-keyno longer refuses a plainly OPEN key.FM_OPEN_DECISIONS_FOLD_VERSIONfrom 3 to 4 so existing cursors re-fold under the corrected verb recovery.fm-sendfalse-send guards (tests/fm-classify-decision-key.test.sh,tests/fm-send-resolve-key.test.sh,tests/fm-wake-drain-open-decisions-cursor.test.sh).Risk Assessment
✅ Low: A well-bounded, thoroughly-tested classifier fix that structurally preserves the "no false opens" guarantee, correctly migrates cursors via the fold-version bump, preserves the documented key-position grammar, and matches the authoritative intent exactly.
Testing
Ran the three shipped test files (classifier, fm-send --resolve-key e2e, cursor migration) on the target commit — all pass. Reproduced the regression two ways: the real open-decisions fold shows the corr-tagged key invisible on base but OPEN on target, and the shipped fm-send e2e test fails its "corr-tagged decision should list as open" precondition (the actual --resolve-key refusal) when run against the base classifier, while passing all 15 checks on target. Verified fail-closed handling of unicode/whitespace/malformed tag names and the unchanged out-of-scope trailing-[key=x] grammar under stock bash 3.2 + en_US.UTF-8. No visual artifact applies (Bash CLI/status-fold change, no rendered UI); a CLI transcript is the product-level evidence. Base worktree and temp files removed; working tree clean.
Evidence: Regression + fix CLI transcript (fold, fm-send e2e, grammar guardrails)
Evidence: Base-vs-target open-decisions fold on corr-tagged line
Evidence: fm-send e2e against base classifier (refusal reproduced)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
fm-classify-decision-key.test.shfm-send-resolve-key.test.shfm-wake-drain-open-decisions-cursor.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.