Skip to content
EN · PT

anchors map

Operate the dependency map (anchors.graph.yaml).

Terminal window
anchors map

Build the dependency map from the project.

Walks the project reading TEXT (never parsing code) and infers the
map's edges by co-location (file names) and by scenario code
(the stable identity that crosses spec→feature→test). Writes anchors.graph.yaml.
Terminal window
anchors map build [flags]
Flag Default What it does
--out output path (default: /anchors.graph.yaml)
--root . project root to scan

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 the
code'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>`)
Terminal window
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

Map merge driver: unites the stamps from both sides (git merge=anchors-map).

Resolves the merge of `anchors.graph.yaml` by uniting the judgment stamps
from 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 merge
erased 62 judgment stamps — the report of each one lives in the command that wrote it, not
in the file, and redoing an adversarial review is expensive.
The result is written to <ours>, which is what git expects.
Terminal window
anchors map merge <base> <ours> <theirs>

The app’s navigation: which screen leads to which.

Prints the navigation between the app's screens — the screens' Out tables and the
code'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 leads
Terminal window
anchors map nav [screen] [flags]
Flag Default What it does
--root . project root

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)
Terminal window
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

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).


Terminal window
# Rebuild the dependency graph from files on disk
anchors map build
# Display graph summary and top-level node metrics
anchors map show
# Check for circular dependency loops
anchors map circular

Before modifying a spec or core domain file, calculate the downstream blast radius:

Terminal window
anchors impact src/domain/user.spec.md

Outputs:

  • 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?

Terminal window
anchors recode USER-B01 ACC-B01

This 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.