Skip to content

feat(brief): make ship-brief Project memory section opt-out via config knob - #2528

Open
aleb-moviestarplanet wants to merge 1 commit into
kunchenguid:mainfrom
aleb-moviestarplanet:fm/brief-project-memory-knob-c9
Open

feat(brief): make ship-brief Project memory section opt-out via config knob#2528
aleb-moviestarplanet wants to merge 1 commit into
kunchenguid:mainfrom
aleb-moviestarplanet:fm/brief-project-memory-knob-c9

Conversation

@aleb-moviestarplanet

Copy link
Copy Markdown

Make the ship-brief Project memory section opt-out

bin/fm-brief.sh unconditionally told every ship crewmate to commit knowledge into a project's AGENTS.md/CLAUDE.md, which conflicts with a captain preference that those files must never be committed into a project repo. This adds a local, gitignored config/project-memory knob so a fleet can opt out without changing the tracked default for every other firstmate user.

Changes

  • Add bin/fm-project-memory-lib.sh: fm_project_memory_value/fm_project_memory_enabled read config/project-memory (absent or on = enabled, off = disabled, anything else fails open to on).
  • bin/fm-brief.sh omits the whole "Project memory" section (no stub) from generated ship briefs when the knob is off; unchanged byte-for-byte when on/absent.
  • bin/fm-ensure-agents-md.sh refuses loudly when the knob is off, so the opt-out is structural, not only a matter of the brief never mentioning it. It resolves its config directory from FM_HOME/FM_CONFIG_OVERRIDE when set, else from its own tracked-code-root location - this reliably covers an ordinary crewmate (which has no FM_HOME in its pane per bin/fm-spawn.sh) invoking the exact path baked into its brief, but not a secondmate home's own distinct value when that secondmate shares the primary's tracked checkout. Documented as a known limitation rather than silently assumed complete.
  • Docs: AGENTS.md section 2 gets a one-line config entry, sections 6 and 11 get a one-line cross-reference to the new conditional behavior, and docs/configuration.md gets the full "Project memory" writeup.
  • Tests: extended tests/fm-brief.test.sh and tests/fm-ensure-agents-md.test.sh (colocated, no new runner) to cover on/off/absent for both scripts.
  • Unrelated fix found while validating: bin/fm-test-run.sh's --check-coverage guard compared LC_ALL=C-sorted files with plain comm, which spuriously fails under a non-C collation locale; pinned every comm call (and the matching one in tests/fm-test-run.test.sh) to LC_ALL=C to match the existing sort calls.

Deliberately not inherited into secondmate homes (like config/calm) and not added to FM_INHERITABLE_CONFIG, since this is a per-captain preference not requested for secondmate propagation and secondmates may legitimately work on projects with a different convention.

…g knob

Add config/project-memory (local, gitignored; absent/on = unchanged
default, off = section fully omitted, no stub) so a fleet that forbids
committing AGENTS.md/CLAUDE.md into project repos can turn off that
instruction. fm-ensure-agents-md.sh also refuses to run when the knob
is off, making the rule structural rather than only advisory.

Also fixes a pre-existing locale-dependent flakiness bug in
bin/fm-test-run.sh's coverage guard: several `comm` calls compared
LC_ALL=C-sorted files without pinning `comm` itself to LC_ALL=C, so
--check-coverage spuriously failed under a non-C collation locale.
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.

1 participant