Gate: value-anchored
Each declared value anchor matches the code below it, its spec rule’s value, and every other declaration of the same key.
| Property | Value |
|---|---|
| Checker | value-anchored |
| Confronts | code |
| Blocking by default — new project | yes |
| Blocking by default — existing project | no — informs |
| Presupposes | derived.value_anchor — until these are declared in anchors.yaml, the gate is pending and asks nothing |
How it measures
Section titled “How it measures”A value that lives in more than one place has no address. Changing a colour means changing it everywhere, and nothing says where “everywhere” is: the copies are plain literals, and the one that was forgotten keeps compiling.
The gate turns the replicated value into a symbol. Whoever replicates a value declares its KEY in a comment, and the code line right below carries the value:
// @code-reference-[COLOR-SUCCESS]-[#1F8A5B]success: '#1F8A5B',Three confrontations follow from the declaration:
- LOCAL — the next code line below it (comment and blank lines skipped) contains the declared value: the declaration does not lie about its own line.
- ACROSS — every declaration of the same key declares the same value. Without this, a change reaches one file — value and declaration together — and every other copy stays behind while each file is locally consistent.
- SPEC — when the key is a rule code whose defining line in the spec declares a value, every declaration is confronted with it. The rule is then the source: change it there, and every place still carrying the old value is reported.
The key may therefore have a source in the spec, or be only a replicated reference whose copies are the truth.
Declaring it
Section titled “Declaring it”gates: - name: value-anchored on: [code] check: value-anchored