You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(bin): match whole multi-word project names in the registry lookup - #5659
bin/fm-project-mode.sh resolves a project's registered posture with an awk match on $2, which is only the first whitespace-delimited token of a registry row, so a project whose name contains a space never matches.
The lookup then warns that the project is not in the registry and silently defaults it to no-mistakes off instead of its declared mode, yolo posture, branch prefix, and forge.
Make the lookup match the whole registered name, so a row such as - 048. Blast- Lease summary drafter [local-only] - description (added 2026-08-08) resolves to local-only off, while single-word names, bracket parsing, and every existing output stay exactly as they are.
A name that is a leading prefix of another registered name must still resolve to its own row.
What Changed
Rewrote the awk lookup in bin/fm-project-mode.sh to match a project's whole registered name against the raw line text (literal, never a regex) instead of only the first whitespace-delimited token ($2), so a name containing spaces now resolves to its declared mode, yolo posture, branch prefix, and forge instead of warning "not in registry" and defaulting to no-mistakes off.
Anchored the match to - + name and required the trailing text to be empty or start with [ or -, so a name that is a leading prefix of a longer registered name no longer matches the longer row; bracket-token parsing now works off the post-name remainder.
Added a tests/fm-task-delivery.test.sh case covering multi-word resolution, leading-prefix disambiguation (longer row listed first), the registered branch prefix, and a single-word control name.
Risk Assessment
✅ Low: A minimal, well-bounded awk lookup fix that correctly matches whole multi-word registered names with a literal boundary check, preserves single-word and bracket-parsing behavior, rejects leading-prefix collisions, and is covered by a proper behavioral regression test.
Testing
Drove the real fm-project-mode.sh CLI end-to-end against an isolated fixture registry. On the fixed commit every case resolves correctly: 048. Blast- Lease summary drafter -> local-only off (no warning), foo bar -> local-only on with --branch-prefixx/, foo -> direct-PR off (not stolen by the earlier foo bar row), controlproj and single-word rows unchanged, legacy no-bracket legacy multi word -> no-mistakes off, and --forge gerritproj -> gerrit. Running the same fixture through the pre-fix base script reproduces #1977 (multi-word names warn "not in registry" and default to no-mistakes off). The repo's task-delivery test file, including the added multi-word regression test, passes. Product surface is a CLI, so evidence is a CLI transcript rather than a visual artifact.
Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario
Result
Live
Evidence
A registered multi-word name resolves to its own row (issue #1977)
A single-word name that is a leading prefix of a longer registered name resolves to its own row, not the longer one
✅ pass
live
foo => direct-PR off even though - foo bar [...] is listed before - foo [...] in the fixture
A longer multi-word name resolves its own bracket tokens (mode, yolo, branch prefix)
✅ pass
live
foo bar => local-only on; --branch-prefix foo bar => x/
Single-word rows and legacy no-bracket rows keep existing output unchanged
✅ pass
live
controlproj => direct-PR off; legacy multi word (no brackets, " - " terminator) => no-mistakes off; --forge gerritproj => gerrit
Regression reproduces before the fix
✅ pass
live
base commit c643b57 script on the same fixture: 048. Blast- Lease summary drafter and foo bar both warn "not in registry" and default to no-mistakes off
Evidence: fm-project-mode multi-word lookup transcript (fixed vs base)
A single-word name that is a leading prefix of a longer registered name resolves to its own row, not the longer one
✅ pass
live
foo => direct-PR off even though - foo bar [...] is listed before - foo [...] in the fixture
A longer multi-word name resolves its own bracket tokens (mode, yolo, branch prefix)
✅ pass
live
foo bar => local-only on; --branch-prefix foo bar => x/
Single-word rows and legacy no-bracket rows keep existing output unchanged
✅ pass
live
controlproj => direct-PR off; legacy multi word (no brackets, " - " terminator) => no-mistakes off; --forge gerritproj => gerrit
Regression reproduces before the fix
✅ pass
live
base commit c643b57 script on the same fixture: 048. Blast- Lease summary drafter and foo bar both warn "not in registry" and default to no-mistakes off
Ran bin/fm-project-mode.sh against a fixture data/projects.md (via FM_HOME) for: 048. Blast- Lease summary drafter, foo, foo bar, --branch-prefix foo bar, controlproj, legacy multi word, --forge gerritproj, and an unregistered name
Reproduced the regression by driving the base-commit script (git show c643b57:bin/fm-project-mode.sh) against the same fixture
bash tests/fm-task-delivery.test.sh (includes the new test_project_mode_matches_whole_multiword_names)
Intent
Fixes #1977
bin/fm-project-mode.shresolves a project's registered posture with an awk match on$2, which is only the first whitespace-delimited token of a registry row, so a project whose name contains a space never matches.The lookup then warns that the project is not in the registry and silently defaults it to
no-mistakes offinstead of its declared mode, yolo posture, branch prefix, and forge.Make the lookup match the whole registered name, so a row such as
- 048. Blast- Lease summary drafter [local-only] - description (added 2026-08-08)resolves tolocal-only off, while single-word names, bracket parsing, and every existing output stay exactly as they are.A name that is a leading prefix of another registered name must still resolve to its own row.
What Changed
bin/fm-project-mode.shto match a project's whole registered name against the raw line text (literal, never a regex) instead of only the first whitespace-delimited token ($2), so a name containing spaces now resolves to its declared mode, yolo posture, branch prefix, and forge instead of warning "not in registry" and defaulting tono-mistakes off.-+ name and required the trailing text to be empty or start with[or-, so a name that is a leading prefix of a longer registered name no longer matches the longer row; bracket-token parsing now works off the post-name remainder.tests/fm-task-delivery.test.shcase covering multi-word resolution, leading-prefix disambiguation (longer row listed first), the registered branch prefix, and a single-word control name.Risk Assessment
✅ Low: A minimal, well-bounded awk lookup fix that correctly matches whole multi-word registered names with a literal boundary check, preserves single-word and bracket-parsing behavior, rejects leading-prefix collisions, and is covered by a proper behavioral regression test.
Testing
Drove the real fm-project-mode.sh CLI end-to-end against an isolated fixture registry. On the fixed commit every case resolves correctly:048. Blast- Lease summary drafter->local-only off(no warning),foo bar->local-only onwith--branch-prefixx/,foo->direct-PR off(not stolen by the earlierfoo barrow),controlprojand single-word rows unchanged, legacy no-bracketlegacy multi word->no-mistakes off, and--forge gerritproj->gerrit. Running the same fixture through the pre-fix base script reproduces #1977 (multi-word names warn "not in registry" and default tono-mistakes off). The repo's task-delivery test file, including the added multi-word regression test, passes. Product surface is a CLI, so evidence is a CLI transcript rather than a visual artifact.fm-project-mode.sh "048. Blast- Lease summary drafter"=> stdoutlocal-only off, rc 0, no stderr warningfoo=>direct-PR offeven though- foo bar [...]is listed before- foo [...]in the fixturefoo bar=>local-only on;--branch-prefix foo bar=>x/controlproj=>direct-PR off;legacy multi word(no brackets, " - " terminator) =>no-mistakes off;--forge gerritproj=>gerrit048. Blast- Lease summary drafterandfoo barboth warn "not in registry" and default tono-mistakes offEvidence: fm-project-mode multi-word lookup transcript (fixed vs base)
Source: fm-project-mode multi-word lookup transcript (fixed vs base)
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-project-mode.sh "048. Blast- Lease summary drafter"=> stdoutlocal-only off, rc 0, no stderr warningfoo=>direct-PR offeven though- foo bar [...]is listed before- foo [...]in the fixturefoo bar=>local-only on;--branch-prefix foo bar=>x/controlproj=>direct-PR off;legacy multi word(no brackets, " - " terminator) =>no-mistakes off;--forge gerritproj=>gerrit048. Blast- Lease summary drafterandfoo barboth warn "not in registry" and default tono-mistakes offRanbin/fm-project-mode.shagainst a fixturedata/projects.md(via FM_HOME) for:048. Blast- Lease summary drafter,foo,foo bar,--branch-prefix foo bar,controlproj,legacy multi word,--forge gerritproj, and an unregistered nameReproduced the regression by driving the base-commit script (git show c643b57:bin/fm-project-mode.sh) against the same fixturebash tests/fm-task-delivery.test.sh(includes the newtest_project_mode_matches_whole_multiword_names)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.