Repository navigation
feat(bin): make the generated-brief knowledge store a per-home setting - #36
Merged
Merged
Conversation
added 2 commits
September 23, 2026 13:27
Commit cf5bed9 hard-coded the RAG's rag_qdrant_server wording into every generated brief, but homes whose installed MCP servers don't match that tool now start every worker with an instruction it cannot follow. config/knowledge-store lets a home name its own store and search instructions instead; absent, briefs stay byte-identical to today's output.
…defaulting The knowledge-store gate checked non-empty (-s) rather than existence, so a present but 0-byte file - the placeholder shape firstmate itself would create by hand - silently kept the upstream RAG wording instead of refusing, exactly the unfollowable-instruction failure this setting exists to prevent.
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.
Fixes the mismatch reported after #28: generated briefs told every worker to search a tool
(
rag_qdrant_server'squery_rag_hybrid/query_rag) that isn't installed in this home, so thegrounding step silently failed and workers substituted whatever knowledge store they actually had.
Adds an optional
config/knowledge-store(local, gitignored, two lines: store name + searchinstructions) that
bin/fm-brief.shreads when generating a ship or scout brief. Absent, everygenerated brief stays byte-identical to today's output; present, every place a brief names the
knowledge store (both Grounding sections, the CANDIDATE no-direct-write rule) uses the configured
wording instead.
Why it matters: without this, every worker in this home starts with an unfollowable
instruction, and the fallback behavior (guessing at whatever knowledge store is actually present)
is undocumented and untested.
Change
bin/fm-brief.shconfig/knowledge-storeinto two variables (name, search-instructions clause) with the historical RAG wording as the default; refuses a malformed file - including a present but 0-byte one - rather than rendering a partial phrase or silently keeping the default; substitutes the variables everywhere the RAG was previously hard-coded.bin/fm-config-inherit-lib.shknowledge-storeto the defaultFM_INHERITABLE_CONFIGlist.docs/configuration.mdAGENTS.mdconfig/*knobs.tests/fm-brief.test.shSecondmate inheritance
Inherited. A secondmate's own crewmates get their briefs from this same script, so if the setting
weren't inherited, a secondmate would silently regress its own workers to the upstream RAG wording
even though its MCP servers don't have that tool either - reproducing the exact bug this setting
exists to fix.
Validation
bin/fm-lint.sh- clean (ShellCheck 0.11.0, actionlint 1.7.12).bin/fm-test-run.sh tests/fm-brief.test.sh-FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0.bin/fm-test-run.sh --family pure-contract-unitand thesecondmate-family scripts touched by--changed- one pre-existing failure in each group, both unrelated to this change and presenton
main:fm-calm-pi-extension.test.sh(a Node experimental-warning line breaks an outputmatch),
fm-on.test.sh(a PATH portable-contract assertion), andfm-remote-job.test.sh(aqueue-timing test). Confirmed by running
fm-secondmate-harness.test.sh,fm-shared-captain-inheritance.test.sh, andfm-trace-context-lib.test.sh(the scripts thatactually exercise
FM_INHERITABLE_CONFIGand this config's mechanics) individually, all green.config/knowledge-storepresent: identical except for the embedded home path.
-s)rather than an existence check, so a present but 0-byte
config/knowledge-store- the exactplaceholder shape a fresh
touchor a cleared editor save produces - silently kept the defaultRAG wording instead of refusing. Fixed to check existence (
-f) instead, so an empty file nowhits the same validation and refusal as a one-line file; added a test for that case.
config/knowledge-store content for this home
Not created by this MR - firstmate creates it in the primary home after merge. Exact content: