fix(bin): accept post-colon decision keys - #8
Merged
Conversation
_fm_decision_key now owns both placements (needs-decision [key=x]: and needs-decision: [key=x]), so fold, OPEN DECISIONS, and fm-send --resolve-key agree. Brief rule 6 shows the canonical pre-colon form with an example.
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 decision-key grammar mismatch between what workers naturally write and what the key parser accepts.
Observed bug (live on multiple tasks): workers write
needs-decision: [key=x] ...(key AFTER the colon)._fm_decision_keyin bin/fm-classify-lib.sh parsed that as keydefault, sofm-send --resolve-key xrefused with "no open decision with that key" while wake-drain's OPEN DECISIONS section displayed the raw line as if it were keyed. The canonical grammar the parser expected isneeds-decision [key=x]: ...(key BEFORE the colon), but brief scaffold rule 6 mentioned[key=<slug>]without showing placement, so workers guessed the post-colon form.Fix with one semantic owner, robustness first:
_fm_decision_key(bin/fm-classify-lib.sh) the single owner of key extraction and have it tolerate BOTH placements:needs-decision [key=x]: ...andneeds-decision: [key=x] ...(same for blocked/paused/resolved verbs that carry keys). The first key token found in either position wins; absent key still folds todefault. Mid-note[key=...]prose must not become a key. Invalid post-colon key tokens fall through to default rather than dropping the line.needs-decision [key=my-slug]: summary), so new briefs teach the preferred form.--resolve-keyand by a resolved line in either form. The live failure (post-colon key parsed asdefault-> resolve-key refusal) must be covered by a test that fails on the old parser.Constraints: firstmate shared tracked material; shellcheck-clean; behavior tests through public interfaces. Acceptance: both key placements parse to the same key everywhere (fold, display, --resolve-key), scaffold rule 6 shows the canonical grammar with an example, regression tests cover both forms, no-mistakes pipeline green with a PR on origin (Bloh09/firstmate) against main.
Prior run failed only because the claude test agent hit a session limit after review already applied fold-version bump + invalid post-colon defaulting; local targeted suites already pass on the current head.
What Changed
--resolve-key.--resolve-keyflows.Risk Assessment
✅ Low: Captain, the change is well-bounded and satisfies the required grammar, shared-fold consistency, cursor-version migration, scaffold guidance, and behavioral regression coverage without a substantiated source defect.
Testing
Targeted classifier/fold,
fm-send --resolve-key, and brief-generation behavior checks passed; manual evidence generation captured the emitted canonical rule and the end-to-end post-colon resolve regression result, and the worktree remained clean.Evidence: Generated brief rule 6 showing canonical decision-key grammar
Evidence: Public fm-send post-colon regression result
ok - fm-send --resolve-key: post-colon worker key is closablePipeline
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.
bash tests/fm-watch-triage.test.sh— exercised shared key extraction, full/incremental decision folding, both open/resolved placements, invalid post-colon fallback, and mid-note exclusionbash tests/fm-send-resolve-key.test.sh— exercised the realfm-sendand wake-drain interfaces, including the original post-colon-key resolve failurebash tests/fm-brief.test.sh— exercised generated ship, scout, and secondmate briefsFM_HOME="$evidence_dir/brief-home" bin/fm-brief.sh evidence-scout alpha --scoutfollowed by extraction of emitted rule 6 — captured the generated user-facing grammar contract✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.