Skip to content
EN · PT

Gate: count-honored

The number the spec asserts matches the code.

Property Value
Checker count-honored
Confronts spec
Blocking by default — new project yes
Blocking by default — existing project no — informs

Confronts numerical claims made in specs against the codebase: does a number that a spec asserts about the code match the actual count in code?

The “lying anchor” defect has a numerical variant that ages completely on its own: a spec asserts “the 50 models of the product”, an engineer introduces the 51st model, and the sentence instantly becomes a lie without anyone ever touching or modifying the spec. In real project measurements, a single spec file held 7 numeric assertions, and adding ONE model rendered 10 sentences obsolete at once.

Unlike other anchor defects caused by developer carelessness or skipped steps, numerical drift depends strictly on the passage of time. Every count written in prose represents debt accumulating compound interest.

The gate does NOT guess what to count. In the measured project, “51 models”, “51 authorization clauses”, and “46 indexed models” represented three completely different questions evaluated over the exact same set of files; no static heuristic can guess all three correctly. Instead, the spec explicitly DECLARES how to count using the declaration contract:

  • A glob pattern alone counts matching FILES (for example, counting model files).
  • A glob pattern followed by a regex pattern counts OCCURRENCES matching the regex across those files (for example, counting authorization clauses).

Any undeclared number in prose (such as a data retention policy stating “90 days”) is deliberately ignored: the gate verifies what was explicitly contracted, not every arbitrary number appearing in text.

Crucially, the gate also confronts the PROSE situated alongside the count declaration marker, not merely the marker itself. In real inspection, a marker declared 51 (matching code), yet a prose sentence three lines below asserted “50 authorization clauses”. Passing the marker while ignoring the prose would certify a spec that lies to any human reader opening the document.

gates:
- name: count-honored
on: [spec]
check: count-honored

Source: checker · its spec