Repository navigation
Preflight: rules and brain up to date before any work (0.5.0) - #12
Merged
Merged
Conversation
Agents forget to pull, so they work from stale rules and someone has to
keep telling them to check. Preflight does it for them:
- .brainium.json takes "update" (checkouts to fast-forward) and "rules"
(files or folders the agent must follow; "{agent}" is the agent's slug,
"!" excludes a glob).
- Pulls are fast-forward only. Detached HEADs (pinned submodules),
branches with no upstream, and pulls blocked by local work are left
alone and reported.
- It lists the rule files that changed since that agent's last
preflight (tracked per agent, per repo); the first run lists them all.
- Runs automatically in Claude Code's session-start hook, as the
brain_preflight MCP tool (instructions and skills say to call it
first), and as `brainium preflight` for VMs, cron and CI. Each git
call is capped at 8s so the 30s hook never times out.
Co-Authored-By: Claude Opus 5.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.
Why
Agents forget to pull, so they work from stale rules, and someone has to keep telling them to check.
What
.brainium.jsontakes two new fields:update: checkouts to fast-forwardrules: files or folders the agent must follow.{agent}stands for the agent's slug, and a leading!excludes a glob.brain_preflightMCP tool, which the instructions and skills tell agents to call firstbrainium preflightfor VMs, cron and CITests
npm test: 57/57 pass. The new tests run against real bare repos and cover pulls, per-agent change tracking,{agent},!exclusions, detached HEADs, blocked pulls and the MCP tool.🤖 Generated with Claude Code