Skip to content

ABI Layer 2: prove K9 config-contract validation — flagship Idris2 proof#46

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/new-session-znxgm7
Jun 27, 2026
Merged

ABI Layer 2: prove K9 config-contract validation — flagship Idris2 proof#46
hyperpolymath merged 1 commit into
mainfrom
claude/new-session-znxgm7

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Raises k9iser's Idris2 ABI to Layer 2 with its first flagship semantic proof. k9iser's headline is wrapping configs into self-validating K9 contracts; this proves a config validates against its contract iff its constraints hold (e.g. a value within range), with a sound+complete Dec and a certifier proven faithful. A violating config provably does not validate.

Mirrors the estate flagship-proof pattern: faithful config/contract model, sound+complete Dec, certifier proven sound, positive + negative controls.

Changes

  • Adds src/interface/abi/K9iser/ABI/Semantics.idrInRange/Validates propositions, sound+complete decisions, certify/certifySound, positive + negative controls.
  • Registers the module in k9iser-abi.ipkg.

RSR Quality Checklist

Required

  • Tests pass — ABI builds clean (see Testing)
  • Linter clean — zero warnings
  • No banned language patterns
  • No banned functions — genuine proof
  • SPDX headers present
  • No secrets

As Applicable

  • ABI/FFI changes validated — additive proof; FFI untouched

Testing

Verified with Idris2 0.7.0: idris2 --build k9iser-abi.ipkg → exit 0, zero warnings. Adversarial check: a deliberately-false proof was rejected. build/ removed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx


Generated by Claude Code

New module K9iser.ABI.Semantics proves the repo's headline property
("Wrap configs into self-validating K9 contracts"): a config that
SATISFIES a "must"-contract (a required key present whose value lies
within an inclusive numeric range) provably validates, and a config that
VIOLATES it (missing key OR out-of-range value) provably does not.

- Faithful model: Config = assoc list (Key, Nat); Contract = key + [lo,hi].
- Headline proposition `Validates c cfg` has constructors only for the
  satisfying case (resolver equation + InRange via propositional LTE);
  no constructor exists for a missing key or out-of-range value.
- Sound + complete `decValidates : Dec (Validates c cfg)` and `decInRange`.
- Certifier `certify` into the ABI Result code, with `certifySound` and
  `certifyComplete`.
- Positive control `goodValidates` (replicas=5 in [1,10]) and two negative
  controls: `badRangeNotValidates` (replicas=0) and `missingNotValidates`.

ABI builds clean (exit 0, zero warnings). A deliberately false witness
for the out-of-range config is rejected by idris2 (non-vacuity verified).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
@hyperpolymath hyperpolymath marked this pull request as ready for review June 27, 2026 19:47
@hyperpolymath hyperpolymath merged commit 7dddd86 into main Jun 27, 2026
23 of 25 checks passed
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.

2 participants