Repository navigation
fix(decision-key): accept after-colon key form, correct scaffold to canonical - #52
Merged
Merged
Conversation
…anonical fm-brief.sh's scaffold instructed crews to open a decision with `needs-decision: [key=<slug>] ...` (key after the colon) while fm-classify-lib.sh's decision fold only parsed a key before the colon (`needs-decision [key=x]: ...`). Every scaffold-following crew's decision folded under the "default" key, and its correctly-keyed `resolved [key=x]:` line then closed the wrong key, so resolved decisions kept resurfacing as open. _fm_decision_key now also accepts the after-colon position so existing status logs still parse, and the scaffold text is corrected to the canonical before-colon form so new briefs teach what the parser prefers.
Bre77
marked this pull request as draft
August 6, 2026 09:47
Shellcheck 0.11.0 flagged the single-quoted sed expression extracting the brief's literal needs-decision example: its backticks are deliberately literal markdown fencing, not an unexpanded variable mistake.
Bre77
marked this pull request as ready for review
August 6, 2026 20:12
Bre77
added a commit
that referenced
this pull request
Aug 7, 2026
…n key like the rest of the scaffold (#54) The secondmate charter's escalated-decision resolve instruction still described the key as "(keyed with [key=<slug>] if you opened it with one)" without showing where in the line it goes, unlike the ship, scout, and this same charter's keyed-phase examples, which all show the key between the verb and the colon. A worker following that vague form literally could append the key after the note instead, which _fm_decision_key does not parse, so the decision would never fold closed - the same contradiction class PR #52 fixed elsewhere in this file. Adds a round-trip test that extracts the charter's own literal needs-decision/resolved examples and asserts they fold closed under the real parser; it fails against the pre-fix wording and passes against the fix.
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
bin/fm-brief.sh's scaffold instructed crews to open a decision withneeds-decision: [key=<slug>] <summary>(key after the colon), butbin/fm-classify-lib.sh's decision fold (_fm_decision_key) only recognized a key before the colon (needs-decision [key=x]: <summary>).needs-decisionfolded under thedefaultkey instead of its stated one.resolved [key=x]:line then closed the wrong key, so the original decision kept resurfacing as open even after it was answered._fm_decision_keynow also accepts the after-colon position, so status logs already written under the old scaffold instruction still parse and close correctly.fm-brief.sh's scaffold text is corrected to the canonical before-colon form (needs-decision [key=<slug>]: <summary>) across the ship, scout, and secondmate scaffolds, so new briefs teach the position the parser actually prefers.tests/fm-wake-drain-open-decisions.test.shgains open+close round-trip coverage for the after-colon form and for mixed key positions (opened one way, closed the other).tests/fm-brief.test.shgains an assertion that the generated brief'sneeds-decisionexample line actually folds under its stated key through the real parser, not just a text match.