docs(agents): cross-reference #790's keg-python pin in the root-checkout rule (XS) - #793
Conversation
…out rule (XS) #789 landed the root-checkout rule with the honest state at the time: no keg-python PR existed, and the pin lived only in `~/.claude/settings.json` as machine config. #790 merged 36 minutes later and changed that, so the section now says what is actually true. - For HOOKS the rule is now defence in depth: `hooks/*.py` shebangs name the keg python via the `opt/` symlink, `src/brainlayer/hook_python.py` resolves it and refuses a silent PATH fallback, and it lints a settings file. A `git checkout` at the root can no longer re-aim a hook. - For everything else the rule is still primary. Verified after #790 merged: `_brainlayer.pth` is untouched and bare `python3 -c "import brainlayer"` still resolves to `<root>/src/brainlayer/__init__.py`. #790 closed the worst consumer, not the mechanism. - New warning bullet, because this is a live "merged is not deployed" case: `~/.claude/hooks/*.py` are real files, not symlinks into this repo, so #790's shebang edit does not reach them by merging. Measured 2026-09-06, three deployed hook copies still begin `#!/usr/bin/env python3`; they are safe only because settings.json names the interpreter ahead of the script path. The section tells the reader to run the `hook_python` lint before believing the pin is live. Follow-up PR rather than a commit on the merged branch, per canon 9. Docs-only; no code. Agent: brainlayerClaude-8a49f7a0 (claude-opus-5[1m]) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_10cfba83-8eda-4512-aa0f-b4186467ee4f) |
|
Warning Review limit reachedNext included review available in 10 seconds. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (1)
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. Comment |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Python | Sep 5, 2026 10:33p.m. | Review ↗ | |
| Swift | Sep 5, 2026 10:33p.m. | Review ↗ | |
| JavaScript | Sep 5, 2026 10:33p.m. | Review ↗ | |
| Shell | Sep 5, 2026 10:33p.m. | Review ↗ | |
| Secrets | Sep 5, 2026 10:33p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
BrainLayer ratchetEvery Value below was measured by this run. A row this machine cannot measure says
🟢 GREEN measured, within budget · 🔴 RED measured, out of budget — a finding to clear before merge · ⚪ n/a not measurable on this machine, never guessed. No RED rows. Measured on Linux/x86_64 · measured |
Follow-up to #789 (merged
aaaf09c0). Per canon 9, a change found after merge opens a new PR rather than another commit on the merged branch.Why now
#789 landed the root-checkout rule with the honest state at the time: the brief told me to cross-reference "the keg-python hook pin" as landed or in flight, and I reported neither — zero open PRs, and the pin existing only in
~/.claude/settings.jsonas machine config. #790 merged 36 minutes after #789 and changed that. The section says something no longer true, so it gets corrected.What changed in the text
One bullet becomes three:
python3(L) #790 gives everyhooks/*.pythe keg-python shebang via theopt/symlink, addssrc/brainlayer/hook_python.py(resolves the interpreter, refuses a silent PATH fallback) and a settings linter. Agit checkoutat the root can no longer re-aim a hook.python3(L) #790 did not remove the.pth.Verification, after #790 merged
So the mechanism survives #790; only its worst consumer was closed.
And the pin is only half-deployed on this machine.
~/.claude/hooks/*.pyare real files, not symlinks into this repo, so #790's shebang edit does not reach them by merging:origin/main~/.claude/hooks/brainlayer-prompt-search.py#!/opt/homebrew/opt/brainlayer/libexec/venv/bin/python#!/usr/bin/env python3brainlayer-session-start.py#!/usr/bin/env python3session-cleanup.py#!/usr/bin/env python3They are safe today only because
~/.claude/settings.jsonnames the keg interpreter ahead of the script path, which makes the shebang moot. That is one mechanism, not the two #790 intends. The new bullet tells the reader to runpython -m brainlayer.hook_python ~/.claude/settings.jsonbefore believing the pin is live on a machine.This is a note about deployment state, not a defect in #790 — its repo-side change is correct and complete. Flagging it because Etan's letter says merged is not deployed — verify the thing that executes, and because the section is the place a future seat will look.
Docs-only; no code paths touched. Gate scoped:
BRAINLAYER_PREPUSH_SCOPE=changed-only BRAINLAYER_CHANGED_FILES=AGENTS.md→ passed.Worktree cut with the absolute form #789 documented, dogfooding round 1's fix:
git worktree add ~/Gits/brainlayer/.worktrees/agents-root-rule-xref -b wt/agents-root-rule-xref origin/main@coderabbitai review
Agent:
brainlayerClaude-8a49f7a0· modelclaude-opus-5[1m]Note
Low Risk
Documentation-only; no runtime, auth, or data paths changed.
Overview
Updates the “never work at the repo root” section in
AGENTS.mdso it matches post-#790 reality instead of the pre-pin wording from #789.The old single bullet (keg pin in machine⚠️ merged ≠ deployed warning that copies under
settings.jsononly; root.pthstill load-bearing for hooks) is replaced by three bullets: for hooks, root-checkout is now defence in depth because repo hooks use the Homebrew keg shebang,hook_python.py, and a settings linter; for everything else, the.pthrule stays primary with a 2026-09-06 verification note; and a~/.claude/hooks/may still use#!/usr/bin/env python3until settings pin them—runpython -m brainlayer.hook_pythonon the live settings file before assuming the pin is active.Reviewed by Cursor Bugbot for commit a9f16f0. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Document keg-python pin cross-reference in root-checkout rule in
AGENTS.mdReplaces the single keg-pinned Claude Code hooks guidance block with three separate bullets:
opt/interpreter,src/brainlayer/hook_python.pyrejects silent PATH fallback, and its module invocation lints settings for barepython3.pthstays active~/.claude/hooks/, and deployed scripts may still use#!/usr/bin/env python3unless the settings-file pin is verified with the lint command📊 Macroscope summarized a9f16f0. 1 file reviewed, 1 issue evaluated, 1 issue filtered, 0 comments posted
🗂️ Filtered Issues
AGENTS.md — 0 comments posted, 1 evaluated, 1 filtered
2026-09-06, which is still in the future relative to the review date (2026-09-05UTC). Thus this cannot have been verified when the document is consumed at this commit; it presents the.pthstate as completed evidence before the stated measurement date, misleading operators who rely on the root-checkout safety guidance. [ Out of scope (post-validation triage) ]