Skip to content

test: add spawn-guard placeholder regression test for fm-brief.sh - #9

Merged
prajwal-395 merged 2 commits into
mainfrom
fm/fm-brief-placeholder-regression-test
Aug 15, 2026
Merged

prajwal-395 merged 2 commits into
mainfrom
fm/fm-brief-placeholder-regression-test

Conversation

@prajwal-395

Copy link
Copy Markdown
Owner

What

Regression test that stops bin/fm-brief.sh from ever again emitting a scaffold token that its own sibling guard in bin/fm-spawn.sh then rejects.

Why

PR 5 added a spawn guard that refuses to launch when any {[A-Z_]+} token remains in the brief file. PR 8 (commit a9c8212) then fixed a case where the Herdr NOT-ENABLED section contained a literal {TASK} in its prose - "the task text that replaces {TASK} later" - creating a second occurrence that survived firstmate's placeholder fill and blocked dispatch for every non---herdr-lab brief.

Nothing prevented recurrence. This test closes that gap.

How

Extends tests/fm-brief.test.sh with test_scaffold_tokens_match_spawn_guard_expectations, which:

  1. Reads the guard's own regex from bin/fm-spawn.sh (\{[A-Z_]+\}) rather than restating it, so the test cannot drift from the pattern it protects.
  2. Generates every scaffold variant the script can produce:
    • Ship: no-mistakes, direct-PR, local-only
    • Scout
    • Secondmate charter: project-list and --no-projects
    • Each with and without --herdr-lab where that flag applies
  3. Asserts exact per-token occurrence counts in the generated brief file - not just the unique set. An extra occurrence of an expected token (the exact original bug class) is caught, along with any novel token.

Defect-reintroduced run (test MUST fail)

Reintroduced the defect: put {TASK} back into the Herdr NOT-ENABLED prose.

not ok - ship no-mistakes no-herdr: {TASK} appears 2 time(s), expected 1

Defect-reverted run (test MUST pass)

ok - fm-brief.sh: no scaffold variant emits uppercase brace tokens beyond its expected placeholders (spawn-guard regression)
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0

Constraints satisfied

  • bin/fm-spawn.sh is unchanged
  • bin/fm-brief.sh is unchanged
  • shellcheck is clean on the test file
  • The guard regex is read from source, not restated

kunchenguid and others added 2 commits August 15, 2026 02:20
A wedged family-run step was occupying the runner until the 75-minute
job cap; bound that step so cleanup and timing artifacts still upload.
Add a regression test to tests/fm-brief.test.sh that prevents
bin/fm-brief.sh from ever again emitting a scaffold token that its
sibling guard in bin/fm-spawn.sh then rejects.

The spawn guard (PR 5) refuses to launch when any {[A-Z_]+} token
remains in the brief file.  PR 8 fixed a case where the Herdr
NOT-ENABLED section contained a literal {TASK} in prose, creating a
second occurrence that survived firstmate filling the real placeholder
and blocked dispatch for every non---herdr-lab brief.

Coverage spans every scaffold variant:
- ship (no-mistakes, direct-PR, local-only)
- scout
- secondmate charter (project-list and --no-projects)
- each with and without --herdr-lab where applicable

For each variant the test asserts exact per-token occurrence counts
against the spawn guard regex (read from bin/fm-spawn.sh, not
restated), catching both novel tokens and extra occurrences of
expected ones - the exact original bug class.
@prajwal-395
prajwal-395 merged commit b30b589 into main Aug 15, 2026
12 checks passed
@prajwal-395
prajwal-395 deleted the fm/fm-brief-placeholder-regression-test branch August 19, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants