feat: add Company Brain context injection safety#29
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (8)
📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR implements account-scoped Company Brain context injection into the plugin's before-agent-start hook. It adds configuration for enabling context mode, resolving accounts, and sizing injected context; implements account resolution with keyword heuristics or explicit search; renders context blocks with approval-gated items marked read-only; and includes tests, documentation, and diagnostic tooling. ChangesCompany Brain Context Injection
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
companyBrainContextMode: "auto"runtime path that injects a separate<company-brain-context>block instead of flattening Company Brain into<relevant-memories>company_brain_accounts_listclient path, then fetches account brief plus follow-up/action-readiness contextcitations,insufficient_evidence,requires_approval,action_readiness,verification_status, andvisibility_scopeexecutable_actions: []andapproval_required_not_executablefor approval-gated itemsTargets #24 and #25.
Verification
npm run buildnpm testnode --check scripts/company-brain-canary.mjsnpx gitnexus detect_changesis unavailable in this installed CLI (unknown command), so scope was verified with explicitgit diff --name-onlyandgit diff --check.Notes
The new injection mode remains opt-in. If no account ID is configured, the plugin only injects context when the account-list path resolves exactly one account; ambiguous or empty resolution is logged and skipped.
Summary by CodeRabbit
New Features
Documentation