anchors map
Operate the dependency map (anchors.graph.yaml).
anchors mapSubcomandos
Seção intitulada “Subcomandos”anchors map build
Seção intitulada “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 | Padrão | O que faz |
|---|---|---|
--out |
output path (default: |
|
--root |
. |
project root to scan |
anchors map deps
Seção intitulada “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 | Padrão | O que faz |
|---|---|---|
--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
Seção intitulada “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
Seção intitulada “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 | Padrão | O que faz |
|---|---|---|
--root |
. |
project root |
anchors map show
Seção intitulada “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 | Padrão | O que faz |
|---|---|---|
--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 |
O mapa e seus sinais — família
Seção intitulada “O mapa e seus sinais — família”Comandos da mesma família — o que distingue cada um:
| Comando | O que faz |
|---|---|
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 [ ] |
O mapa de dependências do Anchors (anchors.graph.yaml) modela todo o repositório como um Grafo Acíclico Dirigido (DAG).
1. Gerenciando o Grafo
Seção intitulada “1. Gerenciando o Grafo”# Reconstrói o grafo de dependências a partir dos arquivos em discoanchors map build
# Exibe o resumo do grafo e métricas dos nósanchors map show
# Checa se há ciclos de dependência no projetoanchors map circular2. Análise da Onda de Impacto (anchors impact)
Seção intitulada “2. Análise da Onda de Impacto (anchors impact)”Antes de alterar uma spec ou entidade central de domínio, calcule o raio de alcance:
anchors impact src/domain/user.spec.mdSaída:
- Dependentes Diretos: Serviços e handlers que importam ou usam esta unidade.
- Impacto Downstream: Testes de integração e contratos que ficarão obsoletos (stale).
- Escopo Recomendado de Testes: Conjunto mínimo de testes a rodar para validar a alteração.
3. Renomeação Atômica de Códigos (anchors recode)
Seção intitulada “3. Renomeação Atômica de Códigos (anchors recode)”Precisa renomear ou reorganizar o prefixo de um módulo de USER para ACC?
anchors recode USER-B01 ACC-B01O comando renomeia o código atomicamente na spec, na feature, nos testes, no código fonte e no grafo de dependências de uma só vez.