Get Started
DocsTrack 2heal-and-map
/llms.txt
Fixes, Map & Guards5 min readbrevio-core v0.11.1

Deterministic Fixes (brevio-core heal), PageRank Repo Map (brevio-core map) & Learned Guards

Plain-English Summary (For Anyone)

Apply the fixes that have one right answer, and give a model a compact map of the repository

`brevio-core heal` scans, applies the deterministic fixes, and prints what still needs a person. `brevio-core map` ranks the files of your repository with Personalized PageRank and prints a compact symbol map that fits a token budget. Neither makes a model call.

Why this matters:
A fix applied by code is the same fix every time, and you can read the diff.
A map ranked by how files depend on each other is a smaller starting context for a model than a dump of the files.
`brevio-core learn` turns a bug you fixed into a local guard, so the same lines are reported if they return.
When to use:Run `brevio-core map` before you hand a repository to a model, and `brevio-core heal` when a scan reports findings you want fixed.
Technical Contract (For Engineers)
Line-level rules
CLI Invocation Signature:
brevio-core heal [--root ROOT] [--diff BASE] [--no-fix] [--json] | brevio-core map [--files F] [--budget 4000] [--json]
Latency / Execution
Not measured for 0.11.1
Token Cost
No model call. The map takes a token budget (default 4000).
Exit Codes
heal: 0 = nothing remains; 1 = something still needs a person; 2 = usage error
Artifacts & Files Generated:
.brevio/guards.json.agents/rules/
Visual Execution Pipeline
5-Stage Progressive Flow
01No model call
Graph
Read symbols and imports of the repository's code files
02alpha 0.85
PageRank
Rank files by how they depend on each other, seeded by the files you name
03--budget
Pack
Print the highest-ranked files and symbols within the budget
04--no-fix to report
Heal
Scan, apply the deterministic fixes, list what remains

Personalized PageRank Symbol Mapping

In Plain English:Instead of pasting your whole codebase into a model, brevio-core ranks which files matter most to the files you are working on.
`brevio-core map` reads the `.py`, `.ts`, `.tsx`, `.js`, `.jsx`, `.go` and `.rs` files under the root and builds a dependency graph of files from their imports. Personalized PageRank with damping 0.85 (at most 30 iterations) ranks the files, with the seed files you name (`--files`, or positional) given extra weight. Python files are read with the standard-library ast module; the other languages with regular expressions. The map is printed within `--budget` tokens (default 4000), as text or as JSON (`--json`).
Generating a Symbol Map for One Seed File
Fixed (After)Exit 0
brevio-core map src/app/checkout/page.tsx --budget 4000
Terminal Output:
# Repository Symbol Map (PageRank Ranked)
# (the ranked files and their symbols follow, within the token budget)

Fitting the Map into a Token Budget

In Plain English:You choose how large the map may be.
Files are listed from the highest rank down until the budget is used. `brevio-core plan` builds the same map with a default budget of 2000 tokens.

Applying Fixes (`brevio-core heal`)

In Plain English:Scans, rewrites what has one correct fix, and tells you what is left.
`brevio-core heal` scans, applies the deterministic fixes of the rules that have one (R5.4, R9.2, R10.1 and R18.2 in 0.11.1), lists the lines it changed, and prints a repair packet of the findings that still need a person (`--max-chars` limits its size). It exits 1 while anything remains. `--no-fix` only reports. It makes no model call.

Learning Guards from Git Diffs (`brevio-core learn`)

In Plain English:When you fix a bug, brevio-core can turn the lines you removed into a local check.
`brevio-core learn` reads the lines a fix removed (`git diff HEAD~1` by default; `--diff`, `--staged` and `--worktree` choose another) and writes a guard to `.brevio/guards.json` plus an agent rule to `.agents/rules/<id>.md`, but only when the guard passes a control run: it must match the lines the fix removed and not the file the fix produced. A new guard is on trial and only reports until a person promotes it. A guard is text, not an understanding of the bug, so use `learn --dry-run` to see how broad it is first.

Interactive Rule Explorer

Explore the brevio-core rules and load their examples into the panel on the right.

129 / 129 rules