Skip to content

feat(formal): close the atom-matching gap — antonyms, guard-implication closure, coverage gating#1

Merged
theagenticguy merged 1 commit into
mainfrom
feat/v0.1.0-atom-matching-improvements
Jul 13, 2026
Merged

feat(formal): close the atom-matching gap — antonyms, guard-implication closure, coverage gating#1
theagenticguy merged 1 commit into
mainfrom
feat/v0.1.0-atom-matching-improvements

Conversation

@theagenticguy

Copy link
Copy Markdown
Owner

Closes the v0.1.0 field-report root cause: the formal tier only reasoned about atoms that already match, and every mismatch signal was capped below the error gate. Six changes widen what shares an atom and make the tool honest about what it could not check — never letting a fuzzy score touch a verdict.

What shipped

  • feat(formal): close the atom-matching gap — antonyms, guard-implication closure, coverage gating #1 Doc-committed antonym table + top-level antonym add/remove/list — open/shut, grant/deny now provable (write-time polarity-consistency validation; schema.antonyms defaults to [], no version bump).
  • Adversarial red-team: 28/30 specs certified verified=true with a z3-confirmed defect inside — numeric tier is pairwise-only #2 Guard-implication closure (src/formal/guard-implication.ts) — a bridge requirement links a guard to an established state, so transitive conflicts become provable with the bridge named in the unsat core. Sound: fixed verb lexicon + exact-guard-match inert-drop.
  • #3 Numeric same-quantity matching via the glossary as a quantity-alias map ("keep valid for" ≡ "expire after").
  • #4 check --strict / --fail-on-unmatched <n> gate coverage signals → new EXIT_INCONCLUSIVE (3).
  • #5 First-class data.verified: true|false (decide-tier predicate — a propose-only finding never flips it or softens --strict).
  • #6 Propose-only FND_OPPOSITION_CANDIDATE under --semantic, with a synonym-trap warning offering glossary add as the alternative.

Validation

…on closure, coverage gating

One root cause behind the v0.1.0 field report: the formal tier only reasoned
about atoms that already match, and every mismatch signal was capped below the
error gate. These six changes widen what shares an atom (so the sound machinery
sees more) and make the tool honest about what it could not check — without ever
letting a fuzzy score touch a verdict.

#1 Doc-committed antonym table + top-level `antonym add/remove/list` command.
   Mirrors the synonym glossary; folds seed + doc pairs through the existing
   signed union-find; validates polarity-consistency at write time so the check
   path stays throw-free. open/shut, grant/deny now reduce to same-atom-opposite-
   polarity and the SMT tier proves the conflict. (schema.antonyms defaults to [],
   backward-compatible; no SCHEMA_VERSION bump.)

#2 Guard-implication closure (src/formal/guard-implication.ts). A bridge
   requirement ("while authenticated, be verified") is re-encoded as
   `bridgeId => (context => stateAsGuard)` and added to the whole-spec
   conjunction, so the solver computes the transitive closure and names the
   bridge in the unsat core. Sound: fixed state-establishment verb lexicon +
   exact-guard-match inert-drop; only re-expresses implications the doc asserts.

#3 Numeric same-quantity matching via the committed glossary as a quantity-alias
   map — "keep valid for" ≡ "expire after" now land on one Real variable so the
   LIA/LRA tier fires.

#4 `check --strict` / `--fail-on-unmatched <n>` gate coverage signals; new
   EXIT_INCONCLUSIVE (3) for an otherwise error-free run that verified nothing.

#5 First-class `data.verified: true|false` — distinguishes "verified clean" from
   "nothing could be checked". Computed from a DECIDE-tier predicate, so a
   propose-only fuzzy finding never flips it or softens --strict.

#6 Propose-only FND_OPPOSITION_CANDIDATE under --semantic: structural
   (same-object/different-verb) proposal suggesting `antonym add`, with an
   explicit synonym-trap warning offering `glossary add` as the alternative.

Adversarial review (opus critic, two passes) confirmed #2 and #6 are sound — no
constructible false FND_CONTRADICTION, no fuzzy score reaching a verdict — and
drove two hardening fixes (the verified/strict split and the opposition message).

916 → 963 tests; biome, tsc, knip, AGENTS.md-drift, build all green. 3 new
ERPAVal architecture lessons under .erpaval/solutions/.
@theagenticguy
theagenticguy merged commit 08cdc5b into main Jul 13, 2026
1 check failed
@theagenticguy
theagenticguy deleted the feat/v0.1.0-atom-matching-improvements branch July 13, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant