Skip to content

ADR-0018: Elimination of Regex Heuristics in Substantive Verification & Reconciliation Semantic Integrity

  • Status: Accepted.
  • §3.3 (reconciliation semantic integrity) is not implemented. Detecting existential requirements by keyword would conflict with GUARD-02 and with this ADR; the check awaits a typed requirement kind.
  • The problem-specific domains originally listed under §3.1 have been removed (GUARD-02). Only a general domain remains.
  • Date: 2026-09-29
  • Related: ADR-0010, ADR-0013, ADR-0015, ADR-0016, ADR-0017
  • Implementation and evidence: IMPL-0009

Context

A benchmark session exposed four weaknesses in the verification boundary:

  1. Pattern-matched domain routing. A regular expression guessed which checker to use from the problem text. A valid synonym in the prompt silently routed to the wrong checker.
  2. Ungrounded negative certificates. Loose typing accepted a claim of exhaustive search that had explored zero states.
  3. Contradictory reconciliation. A requirement to produce an example was marked satisfied by a non-existence certificate.
  4. Brittle code extraction. Code was extracted only from fenced blocks, so bare code never ran, and witness output in Python literal form was not parsed.

Decision drivers

  • Pydantic as the single source of truth for verification, as for the wire.
  • Mechanical guarantees that fail closed.
  • Certificates that prove what they claim.
  • Code and witness intake that follows the program's grammar, not keywords.

Decision

  1. Typed dispatch, no pattern matching.
  2. The problem's verification domain comes from classification as a typed value.
  3. Verification dispatches on that value.
  4. Problem and deliverable text is never searched for vocabulary.
  5. Strict witness types.
  6. A negative certificate requires exhaustive search to be asserted literally, and a strictly positive count of explored states.
  7. Witnesses are a discriminated union on polarity.
  8. (Not implemented.) Reconciliation integrity. A requirement to produce something cannot be satisfied by a non-existence certificate.
  9. Intake by grammar.
  10. What runs as a program is decided by whether the text parses as one, or by its explicitly fenced blocks.
  11. Printed witnesses are parsed as data, never evaluated as code.
  12. No scraping of deliverables (GUARD-05).
  13. Checkers never search deliverable prose to construct or recover a witness.
  14. A missing or malformed structured witness fails verification.

Consequences

  • Routing and verification no longer depend on how a prompt is phrased.
  • An empty negative claim cannot pass.
  • A model cannot be credited with a witness it did not produce.