feat(brief): make ship-brief Project memory section opt-out via config knob - #2528
Open
aleb-moviestarplanet wants to merge 1 commit into
Open
Conversation
…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.
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.
Make the ship-brief Project memory section opt-out
bin/fm-brief.shunconditionally told every ship crewmate to commit knowledge into a project'sAGENTS.md/CLAUDE.md, which conflicts with a captain preference that those files must never be committed into a project repo. This adds a local, gitignoredconfig/project-memoryknob so a fleet can opt out without changing the tracked default for every other firstmate user.Changes
bin/fm-project-memory-lib.sh:fm_project_memory_value/fm_project_memory_enabledreadconfig/project-memory(absent oron= enabled,off= disabled, anything else fails open toon).bin/fm-brief.shomits 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.shrefuses 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 fromFM_HOME/FM_CONFIG_OVERRIDEwhen set, else from its own tracked-code-root location - this reliably covers an ordinary crewmate (which has noFM_HOMEin its pane perbin/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.AGENTS.mdsection 2 gets a one-line config entry, sections 6 and 11 get a one-line cross-reference to the new conditional behavior, anddocs/configuration.mdgets the full "Project memory" writeup.tests/fm-brief.test.shandtests/fm-ensure-agents-md.test.sh(colocated, no new runner) to cover on/off/absent for both scripts.bin/fm-test-run.sh's--check-coverageguard comparedLC_ALL=C-sorted files with plaincomm, which spuriously fails under a non-C collation locale; pinned everycommcall (and the matching one intests/fm-test-run.test.sh) toLC_ALL=Cto match the existingsortcalls.Deliberately not inherited into secondmate homes (like
config/calm) and not added toFM_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.