Skip to content

feat(bin): make the generated-brief knowledge store a per-home setting - #36

Merged
alandomio merged 2 commits into
mainfrom
fm/brief-knowledge-store-name
Sep 24, 2026
Merged

alandomio merged 2 commits into
mainfrom
fm/brief-knowledge-store-name

Conversation

@alandomio

@alandomio alandomio commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Fixes the mismatch reported after #28: generated briefs told every worker to search a tool
(rag_qdrant_server's query_rag_hybrid/query_rag) that isn't installed in this home, so the
grounding step silently failed and workers substituted whatever knowledge store they actually had.

Adds an optional config/knowledge-store (local, gitignored, two lines: store name + search
instructions) that bin/fm-brief.sh reads when generating a ship or scout brief. Absent, every
generated 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
File Change
bin/fm-brief.sh Reads config/knowledge-store into 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.sh Adds knowledge-store to the default FM_INHERITABLE_CONFIG list.
docs/configuration.md Documents the setting: file format, default, and the inheritance decision.
AGENTS.md One-line index entry alongside the other config/* knobs.
tests/fm-brief.test.sh Three new tests: configured wording renders correctly in ship and scout briefs with no leftover RAG text, a malformed file (name with no instructions line) is refused rather than silently rendering, and a 0-byte file is refused rather than silently falling back to the default.
Secondmate 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-unit and the secondmate-family scripts touched by
    --changed - one pre-existing failure in each group, both unrelated to this change and present
    on main: fm-calm-pi-extension.test.sh (a Node experimental-warning line breaks an output
    match), fm-on.test.sh (a PATH portable-contract assertion), and fm-remote-job.test.sh (a
    queue-timing test). Confirmed by running fm-secondmate-harness.test.sh,
    fm-shared-captain-inheritance.test.sh, and fm-trace-context-lib.test.sh (the scripts that
    actually exercise FM_INHERITABLE_CONFIG and this config's mechanics) individually, all green.
  • Manually diffed a generated ship brief against the pre-change script with no config/knowledge-store
    present: identical except for the embedded home path.
  • An independent review of this PR found that the file-present gate used a non-empty check (-s)
    rather than an existence check, so a present but 0-byte config/knowledge-store - the exact
    placeholder shape a fresh touch or a cleared editor save produces - silently kept the default
    RAG wording instead of refusing. Fixed to check existence (-f) instead, so an empty file now
    hits 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:

PP Brain
`search_knowledge` on the `pp-brain` MCP server, with both `query` and `prompt` set, reusing the returned `sessionId` on follow-ups; call `get_knowledge` on finalists

Alan Domio 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.
@alandomio
alandomio merged commit 76891cd into main Sep 24, 2026
23 of 26 checks passed
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