Pular para o conteúdo
EN · PT

anchors stamp

Write the missing @contract stamps on test doubles (never rewrites an existing one).

Writes, above every double of a governed module that has no stamp, the
`@contract` stamp that the mock-stamped gate recomputes against the real module.
Each key of the double's factory that names an export of the module gets its own stamp,
covering that export's block. With no such key, one stamp covers the whole module.
It only ADDS stamps. An existing stamp is never rewritten, even when it diverges — the
divergence is the gate telling you the double may be stale, and that calls for a person
looking at the double, not a tool refreshing the hash.
With no file given, every test of the map is stamped.
anchors stamp every test
anchors stamp src/Home.test.tsx one test
anchors stamp --dry-run says what it would write
AFTER CHANGING A FUNCTION, refresh the stamps that point at its file — and read the answer:
anchors stamp --refresh src/hooks/balance.ts
It lists every double stamped against the previous version (test, line, member, old and
new hash, and how the stamped block changed from HEAD), then updates those hashes. Each
double listed reproduces the OLD contract: adjust it in the same commit. A stamp whose
anchor line is gone (the member was renamed or removed) is not refreshed — re-stamp it by
hand. With --dry-run it only lists.
Terminal window
anchors stamp [test files...] [flags]
Flag Padrão O que faz
--dry-run say what would be written, without writing
--map path to the map
--refresh after changing this file: list the doubles stamped against its previous version and update their stamps
--root . project root

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 [ ]