Repository navigation
feat(bin): name the RAG instead of PP Brain in generated briefs - #28
Merged
Merged
Conversation
PP Brain is what this installation calls its RAG: the rag_qdrant_server MCP server with its query_rag_hybrid and query_rag search tools. Briefs still named PP Brain and its search_knowledge tool, so workers searched for a server that is not installed under that name and reported it absent. The Grounding contract is unchanged in substance: ship and scout briefs still search the knowledge store and the local memory store before the first substantive action and again on each new obstacle, check it before working around a trap, and never write to it. Its tool names and fields now match the real RAG (query_text set, user_roles passed, empty when the worker has none). The ship-only pp-brain auth_missing banner handling and its fixed blocked line are dropped because the RAG has no such banner. Rule 4's CANDIDATE paragraph and the script header/--help follow suit, and a new test asserts every generated brief names the RAG and carries no PP Brain, search_knowledge, or auth_missing text. Co-Authored-By: Claude Opus 5 <[email protected]>
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.
Intent
Rename every PP Brain reference in the crewmate briefs that bin/fm-brief.sh generates to the RAG. The captain first asked (2026-09-11) to remove PP Brain from the brief instructions ('elimina ppbrain dalle istruzioni di brief. Qui non lo usiamo'), then corrected it the same day: 'in realtà ppbrain si chiama RAG nella nostra installazione, quindi puoi semplicemente modificare il riferimento a RAG'. So this is a RENAME, not a removal: PP Brain is this installation's RAG, the MCP server rag_qdrant_server with search tools query_rag / query_rag_hybrid (their real parameters are query_text and a required user_roles; a live read-only call with empty user_roles succeeded, so the brief says to pass it empty when the worker has none; never use its write tools). Keep the grounding contract: search the RAG and the local memory store before the first substantive action, search again on new obstacles, treat the # Task section as a starting point, check the RAG before working around a trap (cite it or append 'note: CANDIDATE - {finding}'), never write to it or any shared memory directly, and report what was found. Adapt PP Brain-specific tool names and parameters (search_knowledge, query+prompt) to the real RAG tool, and drop only statements with no RAG equivalent: the ship brief's 'pp-brain: auth_missing' banner false-positive handling, its one-live-search_knowledge-call rule, and its fixed 'blocked: unreachable ...' line. Acceptance: (1) no brief fm-brief.sh generates (ship in every mode, scout, secondmate charter, --herdr-lab variants) mentions PP Brain, search_knowledge, pp-brain, or auth_missing; (2) Grounding keeps its useful remainder and stays short since it is always-loaded; (3) the ship Rule 4 rule widening the Grounding CANDIDATE channel stays, reworded to the RAG; (4) fm-brief.sh --help/header and any comment or doc describing the Grounding contract (bin/, docs/, tests/, AGENTS.md, README.md, CONTRIBUTING.md) match, with no stale PP Brain description of the brief; (5) tests/fm-brief.test.sh asserts the RAG wording and that no PP Brain / search_knowledge / auth_missing text remains in any generated brief (neutral task ids because each brief embeds its own status-file path), dropping the PP Brain and auth-banner assertions; (6) fm-spawn.sh still accepts the briefs, and the firstmate recall section from PR 25 and its RECALL_FOUND/RECALL_CHANGED placeholder check stay intact; (7) brief, spawn, and lint suites and bin/fm-lint.sh green. The change was rebuilt from origin/main, not on top of the superseded removal commit, and is validated on the fresh branch fm/fm-brief-rag (the earlier branch name is left untouched because the gate still holds the superseded commit there). Out of scope, deliberately untouched: the retrospective skill and its reports, README.md's /retrospective row that mentions PP Brain, and any secondmate home.
What Changed
bin/fm-brief.shnow points the ship and scout# Groundingsections at the RAG instead of PP Brain. They namequery_rag_hybrid/query_ragon therag_qdrant_serverMCP server, withquery_textset anduser_rolespassed (empty if the worker has none). These replace the oldsearch_knowledgequery+promptguidance. The check-before-working-around-a-trap rule, thenote: CANDIDATEchannel, the ban on writing to shared memory, and the ship Rule 4 durable-findings paragraph all stay, now worded for the RAG. The header comment was updated to match.pp-brain: auth_missingbanner false-positive handling, the one-live-search_knowledge-call rule, and the fixedblocked: <server> unreachable ...line. There is no RAG equivalent for any of them.tests/fm-brief.test.shnow asserts the RAG wording and drops the auth-banner and degraded-mode assertions. A newtest_briefs_name_rag_not_pp_braingenerates ship briefs in every mode (no-mistakes, direct-PR, local-only), a scout brief,--herdr-labvariants, and a secondmate charter, and fails if any of them contains PP Brain,search_knowledge, orauth_missing.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The change only renames prompt text in the generated briefs and updates the matching tests. It meets every acceptance criterion I could check in source: no PP Brain, search_knowledge, pp-brain or auth_missing text is left in any brief template; Grounding stays four lines; Rule 4 now says the RAG; the header and --help text match; the recall section and fm-spawn's placeholder check are untouched; out-of-scope files are untouched. The only issue is two now-dead test assertions.
Testing
I ran the targeted brief, spawn/delivery and lint suites plus
bin/fm-lint.sh, and all passed. That includes the new test that no generated brief carries PP Brain text and the existing recall-placeholder spawn check. I also generated every brief variant (3 ship modes, scout, all 4 with--herdr-lab, and the secondmate charter) in a scratch home and saved the rendered Grounding and Rule 4 text. None of them mention PP Brain,search_knowledgeorauth_missing, the charter still has no Grounding section, and--helpmatches. Run against the base-commit script, the new regression test fails, showing it catches the old wording. The worktree was left clean and all artifacts are in the evidence directory. Nothing failed.Evidence: Rendered Grounding section, Rule 4 lines and forbidden-term counts for every generated brief variant, plus the --help excerpt
Source: Rendered Grounding section, Rule 4 lines and forbidden-term counts for every generated brief variant, plus the --help excerpt
Evidence: Full generated ship brief (--mode no-mistakes) at target commit
Source: Full generated ship brief (--mode no-mistakes) at target commit
Evidence: Full generated scout brief at target commit
Source: Full generated scout brief at target commit
Evidence: New regression test fails against the base fm-brief.sh (shows the PP Brain / search_knowledge / auth_missing lines it replaced)
Source: New regression test fails against the base fm-brief.sh (shows the PP Brain / search_knowledge / auth_missing lines it replaced)
Known leftover
test_ship_worker_operating_contractsintests/fm-brief.test.shstill carries twoassert_no_grep "unreachable (confirmed by a live call"checks (around lines 1124-1125 for the scout brief and 1135-1136 for the secondmate charter).They assert absence of the degraded-mode template this change removed from the ship brief, so they can no longer fail.
They are harmless and left in place on purpose; drop them in a later cleanup.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
tests/fm-brief.test.sh:1124- Twoassert_no_grep "unreachable (confirmed by a live call"guards (lines 1124 and 1135, for the scout and secondmate briefs) are now dead. They check that the ship-only "degraded-mode template" was not copied into other briefs, but this change deleted that template from bin/fm-brief.sh, so the text exists nowhere and the guards can never fail. Their failure messages also still describe a ship-only contract that no longer exists. That contradicts the updated comment at lines 982-990, which no longer lists the degraded-mode template among the ship-only contracts. The new test_briefs_name_rag_not_pp_brain already checks every generated brief for leftover banner handling. Fix: delete both assertions, in line with criterion (5)'s "dropping the PP Brain and auth-banner assertions".✅ **Test** - passed
✅ No issues found.
bash tests/fm-brief.test.sh(full brief suite, including the rewordedtest_grounding_section_requires_search_and_reporting, the newtest_briefs_name_rag_not_pp_brain,test_firstmate_recall_section, andtest_ship_worker_operating_contracts)bash tests/fm-task-delivery.test.sh(fm-spawn accepts the briefs, the recorded mode must match, and it refuses an unfilled RECALL_FOUND/RECALL_CHANGED recall section)bash tests/fm-lint.test.shbin/fm-lint.sh(required by acceptance criterion 7)Manual: generated briefs withFM_HOME=<scratch> bin/fm-brief.sh <id> gh-projfor--mode no-mistakes|direct-PR|local-only,--scout, each of those with--herdr-lab, and--secondmate --no-projects; captured each Grounding section and Rule 4 line and countedpp.?brain|search_knowledge|auth_missingmatches (0 everywhere)bin/fm-brief.sh --helpchecked for the RAG Grounding description and no stale PP Brain textgrep -rniE 'pp.?brain|search_knowledge|auth_missing' bin docs tests AGENTS.md README.md CONTRIBUTING.md: the only hit outside the test file is README.md's out-of-scope/retrospectiverowRegression check: exported the base commit 4a6429b withgit archiveto a scratch dir, dropped in the new test file, and ran onlytest_briefs_name_rag_not_pp_brain; it fails (not ok - brief with --mode no-mistakes lost the RAG grounding search) and the base brief shows the PP Brain,search_knowledgeandauth_missinglinestests/fm-brief.test.sh:1124- test_ship_worker_operating_contracts still has two assert_no_grep "unreachable (confirmed by a live call" checks (lines 1124-1125 for scout, 1135-1136 for the secondmate charter). Their failure messages say "duplicated the ship-only degraded-mode template", but this change removed that template from the ship brief, so the text now exists in no brief and the checks can never fail. They are leftovers of the auth-banner handling that intent criterion 5 says to drop, and the new test_briefs_name_rag_not_pp_brain already guards every generated brief against the auth-banner text. Fix: delete both assert_no_grep pairs. This is a test edit, so the document phase did not make it.🔧 Fix: No documentation changes needed for the RAG brief rename
1 warning still open:
tests/fm-brief.test.sh:1124- This is still unfixed. The user chose to fix it in round 1, but it needs a test edit, and the document phase may only edit documentation and doc comments. test_ship_worker_operating_contracts still has two assert_no_grep "unreachable (confirmed by a live call" checks: lines 1124-1125 for the scout brief and 1135-1136 for the secondmate charter. Their failure messages say "duplicated the ship-only degraded-mode template", but this change removed that template from the ship brief. A repo-wide grep finds the text nowhere outside these asserts, so the checks can never fail. They are leftovers of the auth-banner handling that intent criterion 5 says to drop, and test_briefs_name_rag_not_pp_brain already guards every generated brief against the auth-banner text. Fix: delete both assert_no_grep pairs (4 lines) in a code or test phase, not the document phase.✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.