Skip to content

fix(decision-key): accept after-colon key form, correct scaffold to canonical - #52

Merged
Bre77 merged 2 commits into
mainfrom
fm/fm-brief-decision-key-syntax
Aug 6, 2026
Merged

Bre77 merged 2 commits into
mainfrom
fm/fm-brief-decision-key-syntax

Conversation

@Bre77

@Bre77 Bre77 commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Intent

  • Issue: bin/fm-brief.sh's scaffold instructed crews to open a decision with needs-decision: [key=<slug>] <summary> (key after the colon), but bin/fm-classify-lib.sh's decision fold (_fm_decision_key) only recognized a key before the colon (needs-decision [key=x]: <summary>).
    • Every scaffold-following crew's needs-decision folded under the default key instead of its stated one.
    • Its later, correctly-keyed resolved [key=x]: line then closed the wrong key, so the original decision kept resurfacing as open even after it was answered.
  • Fix: two-sided.
    • _fm_decision_key now 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: tests/fm-wake-drain-open-decisions.test.sh gains 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.sh gains an assertion that the generated brief's needs-decision example line actually folds under its stated key through the real parser, not just a text match.

…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 Bre77 added the fm Opened by a Firstmate crewmate label Aug 6, 2026
@Bre77
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
Bre77 marked this pull request as ready for review August 6, 2026 20:12
@Bre77
Bre77 merged commit 2d7ea05 into main Aug 6, 2026
13 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fm Opened by a Firstmate crewmate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant