Skip to content

P6 retrieval-discipline reflex: /kg for discovery, never substrate grep (BRO-1426)#74

Merged
broomva merged 2 commits into
mainfrom
feature/bro-1426-p6-kg-discovery-reflex
Jun 8, 2026
Merged

P6 retrieval-discipline reflex: /kg for discovery, never substrate grep (BRO-1426)#74
broomva merged 2 commits into
mainfrom
feature/bro-1426-p6-kg-discovery-reflex

Conversation

@broomva

@broomva broomva commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Why

Agents reflexively find/grep/cat over research/entities/ instead of /kg, bypassing the routing layer. Two observed failure modes (the find-vs-/kg incident):

  1. Silent miss — a guessed slug that doesn't exist returns nothing, usually swallowed by 2>/dev/null / if [ -n "$f" ]. The agent believes it loaded N entities when it loaded fewer and reasons over a false-complete context. (Real incident: agent hand-picked 4 slugs; 1 was a doc not an entity; never noticed.)
  2. Recall miss — hand-picked slugs are bounded by agent memory; they miss the relevant entities the catalog routing surfaces. /kg surfaced 2 highly-relevant entities the agent never named; /kg --terms recovered the union.

Change

A P6 retrieval-discipline sub-rule — the read companion to the existing substrate-edit write rule — added to:

  • references/primitives.md §P6 (canonical spec)
  • assets/templates/AGENTS.md.template §P6 (so bstack bootstrap/repair propagate it on install — this is the "install bstack updates the rules" mechanism)

Rule: knowledge-graph discovery/kg load <topic> (+ --terms for paraphrase/jargon); Read only on a catalog-confirmed slug; never find -name "$slug.md" as discovery.

Reasoning-enforced reflex (no hook/gate), consistent with the P6/P9 reflexive-trigger pattern. No primitive-count change (sub-rule, not a new primitive) — 20 primitives intact in both files.

Evidence

research/entities/pattern/substrate-grep-bypasses-routing.md + the BRO-1425 benchmark. Workspace AGENTS.md §P6 updated in lockstep (Self-Documenting Standards: same reflex across all three surfaces).

Closes BRO-1426 (bstack/governance half)

🤖 Generated with Claude Code

…trate grep

Track A of BRO-1426. Agents reflexively find/grep/cat over research/entities/
instead of /kg, bypassing the routing layer. Two observed failure modes:
silent miss (a guessed slug that doesn't exist returns nothing, swallowed by
2>/dev/null — agent reasons over a false-complete context) and recall miss
(hand-picked slugs miss the relevant entities catalog routing surfaces).

Add a P6 retrieval-discipline sub-rule (read companion to the existing
substrate-edit write rule) to the canonical spec (references/primitives.md §P6)
and the install template (assets/templates/AGENTS.md.template §P6), so
bstack bootstrap/repair propagate it to every workspace. Reasoning-enforced
reflex — no hook/gate — consistent with the P6/P9 reflexive-trigger pattern.
No primitive-count change (sub-rule, not a new primitive).

Evidence: research/entities/pattern/substrate-grep-bypasses-routing.md +
the BRO-1425 benchmark. Workspace AGENTS.md §P6 updated in lockstep.

BRO-1426

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@linear

linear Bot commented Jun 8, 2026

Copy link
Copy Markdown

BRO-1426

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@broomva, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 51 minutes and 46 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dc695c87-28bc-49ac-b899-d8205dbee6ab

📥 Commits

Reviewing files that changed from the base of the PR and between 1538732 and 3e63cc4.

📒 Files selected for processing (2)
  • assets/templates/AGENTS.md.template
  • references/primitives.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/bro-1426-p6-kg-discovery-reflex

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…les (P20 review)

Cross-review (SHIP) flagged two wording MINORs: the carve-out could be read as
a blanket substrate-grep ban, and the silent-miss masking examples differed
across surfaces. Name the legitimate non-discovery greps (confirmed known file,
tooling/skill internals incl. /kg's own body-grep + bookkeeping lint/index, bulk
edits/counting) so it can't be over-read; equalize the masking set across
primitives.md + template + workspace AGENTS.md.

BRO-1426

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@broomva broomva merged commit 9aa4bbe into main Jun 8, 2026
5 checks passed
@broomva broomva deleted the feature/bro-1426-p6-kg-discovery-reflex branch June 8, 2026 16:26
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