anchors map
Operate the dependency map (anchors.graph.yaml).
anchors mapSubcommands
Section titled “Subcommands”anchors map build
Section titled “anchors map build”Build the dependency map from the project.
Walks the project reading TEXT (never parsing code) and infers themap's edges by co-location (file names) and by scenario code(the stable identity that crosses spec→feature→test). Writes anchors.graph.yaml.anchors map build [flags]| Flag | Default | What it does |
|---|---|---|
--out |
output path (default: |
|
--root |
. |
project root to scan |
anchors map deps
Section titled “anchors map deps”The dependency tree of a file: what it uses, or who uses it (–up).
Prints the dependency tree of a file, by the depends-on edges of the map — the ones thecode's `@dep:` flags declare:
anchors map deps TOKNS — what the file of code TOKNS uses, down the tree anchors map deps src/theme/tokens.ts --up — who uses it, up the tree anchors map deps ARSCR --depth 2 — two levels anchors map deps --kind db — each database resource the code reaches, and the files that reach it (`@dep[db]: <name>`)anchors map deps <CODE|file> | --kind <kind> [flags]| Flag | Default | What it does |
|---|---|---|
--depth |
0 |
levels to print (0 = all) |
--kind |
list the resources of a kind (db, api…) and the files that reach each |
|
--root |
. |
project root |
--up |
who uses the file, instead of what it uses |
anchors map merge
Section titled “anchors map merge”Map merge driver: unites the stamps from both sides (git merge=anchors-map).
Resolves the merge of `anchors.graph.yaml` by uniting the judgment stampsfrom both sides, instead of merging text.
Not meant to be run by hand. Configure git to call it:
# .gitattributes (in the repository) anchors.graph.yaml merge=anchors-map
# once per clone git config merge.anchors-map.name "anchors: unites the map's stamps" git config merge.anchors-map.driver "anchors map merge %O %A %B"
WHY: the map is derived, and git treats it as text. Measured: a conflict-free mergeerased 62 judgment stamps — the report of each one lives in the command that wrote it, notin the file, and redoing an adversarial review is expensive.
The result is written to <ours>, which is what git expects.anchors map merge <base> <ours> <theirs>anchors map nav
Section titled “anchors map nav”The app’s navigation: which screen leads to which.
Prints the navigation between the app's screens — the screens' Out tables and thecode's `@navigates:` flags:
anchors map nav — every screen and where it leads anchors map nav GoalEdit — one screen: where it comes from and where it leadsanchors map nav [screen] [flags]| Flag | Default | What it does |
|---|---|---|
--root |
. |
project root |
anchors map show
Section titled “anchors map show”Query the map: a node’s neighbourhood, orphans, statistics.
Inspects the dependency map: anchors map show <file> — the node's neighbourhood (in ↑ / out ↓) anchors map show --orphans — nodes with no edge at all (islands) anchors map show --stats — summary (nodes by kind, edges by type)anchors map show [file] [flags]| Flag | Default | What it does |
|---|---|---|
--map |
path to the map | |
--orphans |
lists nodes without edges (islands) | |
--pending |
with –worklist: only the files that HAVE pending items (failing gates) | |
--root |
. |
project root |
--stats |
graph summary | |
--worklist |
lists the nodes in TOPOLOGICAL order (parents/rulers before the governed) — for batch fixing without rework |
The map and its signals — family
Section titled “The map and its signals — family”Commands of the same family — what tells each apart:
| Command | What it does |
|---|---|
anchors map |
Operate the dependency map (anchors.graph.yaml) |
anchors ingest |
Ingest test signals (JUnit/lcov) the project generated and bind them to the map |
anchors test |
Run the test suites declared in anchors.yaml and ingest the reports |
anchors mutation |
Run the mutation suites declared in anchors.yaml and ingest the reports |
anchors keep-evidence |
Declare that a change proves nothing new, keeping the files’ evidence fresh |
anchors stamp |
Write the missing @contract stamps on test doubles (never rewrites an existing one) |
anchors recode |
Rename an identity code and propagate it across the project |
anchors renumber |
Renumber the revisions this branch added when the base already took their number |
anchors generated-paths |
The paths of DERIVED files — whoever conflicts in them rebuilds |
anchors merge-progress |
Progress merge driver: unites both sides, [x] beats [ ] |
The Anchors dependency map (anchors.graph.yaml) models the entire repository as a Directed Acyclic Graph (DAG).
1. Managing the Map
Section titled “1. Managing the Map”# Rebuild the dependency graph from files on diskanchors map build
# Display graph summary and top-level node metricsanchors map show
# Check for circular dependency loopsanchors map circular2. Impact Wave Analysis (anchors impact)
Section titled “2. Impact Wave Analysis (anchors impact)”Before modifying a spec or core domain file, calculate the downstream blast radius:
anchors impact src/domain/user.spec.mdOutputs:
- Direct Dependents: Services and handlers directly calling this unit.
- Downstream Impact: Integration tests and contracts that will become stale.
- Recommended Test Scope: The minimal set of test suites required to validate the change.
3. Atomic Identity Renaming (anchors recode)
Section titled “3. Atomic Identity Renaming (anchors recode)”Need to rebrand or reorganize a domain module from USER to ACCOUNT?
anchors recode USER-B01 ACC-B01This atomically updates the code in the spec (*.spec.md), the feature (*.feature), test assertions (*_test.go), code annotations, and the dependency graph in one step.