Skip to content

vcl-ut Phase 3: L1/L6–L10 soundness + dependent SafetyCertificate + sound ABI.Layout (stacked on #22) — Refs standards#124#23

Merged
hyperpolymath merged 5 commits into
mainfrom
proof-debt/vclut-124-phase3
May 19, 2026
Merged

vcl-ut Phase 3: L1/L6–L10 soundness + dependent SafetyCertificate + sound ABI.Layout (stacked on #22) — Refs standards#124#23
hyperpolymath merged 5 commits into
mainfrom
proof-debt/vclut-124-phase3

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Stacked on #22 (Phase 2), which is stacked on #21 (Phase 1). Refs hyperpolymath/standards#124. Does not close the issue. Retarget down the stack as #21/#22 merge.

What this does (Phase 3 of the standards#124 vcl-ut HOLE remediation)

3a — soundness for all remaining levels

checkLevel1SoundcheckLevel10Sound, same machine-checked with … proof p shape as checkLevel4Sound, no proof-escape. L1's Decide.allFieldsBoundFromResolve builds the genuine inductive AllFieldsBound (each FieldBound carries the real resolveFieldRef ref schema = Just fd), connected to the checker without disturbing the genuine Composition.l1Compose. With Phase 2, all of L1–L10 now have genuine checker→predicate soundness.

3b — checkQuery emits a real dependent SafetyCertificate

tryL1..tryL10 run each decision procedure and, on acceptance, return the genuine LN_* witness via the Sound lemmas; certifyAt/certifyRequested assemble them into the cumulative dependent SafetyCertificate. A Just from certifyRequested stmt schema is a machine-checked proof the query meets its declared requestedLevel. The previously-decorative dependent certificate is now produced by the decision procedure. checkQuery (C-ABI Bool path) retained unchanged.

3c — ABI.Layout made sound + CI-gated (honest, not faked)

The only false proofs in the entire codebase were two items in ABI.Layout; deleted rather than forced: alignUpCorrect ((align > 0) Bool-as-Type + bogus Refl), offsetInBounds (open ?metavariable), queryPlanHeaderNoPadding (over-claimed + non-reducing). paddingFor's genuine non-compile ((-) needs Neg Nat) fixed to minus. The sound content (roundtrip Refl proofs, layout data) is kept; VclTotal.ABI.Layout is now the 9th ipkg module, CI-gated. ABI.Foreign stays excluded but is not unsound (FFI plumbing, no proofs) — stub-transport is precisely-disclosed Phase 3+ architecture.

Verification

  • Clean idris2 0.8.0 --build verification/proofs/vclut-core.ipkgEXIT=0, 9/9 modules, %default total.
  • Zero proof-escape symbols (CI escape-grep updated for Layout.idr); SafetyL4Model.idr still --check EXIT=0.
  • No fake green: every undischarged obligation (FFI transport, genuine ABI.Layout alignment/no-padding theorems, L6–L10 predicate shallowness, L3 subquery/heuristic scoping) is scoped OWED in VERIFICATION-STANCE.adoc, not masked. Headline residuals (non-compiling corpus, vacuous L2/L3/L5, decorative certificate, unsound ABI.Layout) are all resolved.

🤖 Generated with Claude Code

hyperpolymath and others added 5 commits May 19, 2026 08:13
checkLevel6Sound..checkLevel10Sound: acceptance => the LN_* witness,
same with..proof p shape as checkLevel4Sound, no proof-escape. The
L6-L10 predicates assert exactly 'the relevant clause/annotation is
present' (real, non-vacuous, but shallower than what checkLevelN also
enforces e.g. L9!=LinUnlimited / L10 declared+acyclic) — soundness is
genuine for the predicates as stated; the shallowness gap is a disclosed
Phase 3 residual, not masked.

Clean build EXIT=0 (8/8), zero escapes, SafetyL4Model checks.
Refs hyperpolymath/standards#124. Does not close.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Decide: fieldRefResolves/allFieldRefsResolve + allFieldsBoundFromResolve,
which BUILDS the genuine inductive AllFieldsBound (each FieldBound carries
the real resolveFieldRef ref schema = Just fd). checkLevel1 decided
through allFieldRefsResolve over BOTH statementFieldRefs (thorough,
subquery-descending — behaviour preserved) AND Levels.extractFieldRefs
(the L1 predicate's extractor — drift-free soundness hook, verdict-
neutral since statementFieldRefs strictly dominates). checkLevel1Sound
connects checker -> the existing non-vacuous L1_SchemaBound WITHOUT
touching the genuine Composition.l1Compose proof.

Phase 3a DONE: checkLevel1Sound..checkLevel10Sound all genuine, no
proof-escape. Clean build EXIT=0 (8/8), SafetyL4Model checks.
Refs hyperpolymath/standards#124. Does not close.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tryL1..tryL10 run each decision procedure and, on acceptance, return the
genuine LN_* witness via the machine-checked checkLevelNSound lemmas
(with..proof p, no escape, no re-assertion). certifyAt assembles them
into the cumulative dependent SafetyCertificate; certifyRequested
certifies at the statement's own requestedLevel — a Just IS a
machine-checked proof the query meets its declared level. checkQuery
(Bool/CheckResult) retained unchanged for the C ABI.

This closes the certificate<->checker disconnect (previously the
dependent SafetyCertificate type was decorative w.r.t. the decision
procedure). Clean build EXIT=0 (8/8), zero escapes, SafetyL4Model checks.
Refs hyperpolymath/standards#124. Does not close.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Honest, not faked. The ONLY false proofs in the codebase were two items
in ABI.Layout; DELETED rather than forced:
- alignUpCorrect: (align > 0) is a Bool used as a Type + bogus Refl
  asserting the divisibility goal — removed (genuine div/mod proof OWED).
- offsetInBounds: an open ?metavariable (never a proof, false in
  general) — removed (membership-quantified version OWED).
- queryPlanHeaderNoPadding: over-claimed 'no padding', and even the
  trivial totalSize=24 restatement won't reduce under Refl (Vect-n
  implicit blocks the projection) — removed (real no-padding proof OWED).
GENUINELY FIXED: paddingFor used (-) on Nat (no Neg Nat) -> minus.
Sound content kept (roundtrip Refl proofs, layout data, alignUp/
paddingFor/Divides) and is now machine-checked: VclTotal.ABI.Layout
added to vclut-core.ipkg (9 modules) + CI escape-grep.

ABI.Foreign stays excluded but is NOT unsound — it has no proofs (FFI
plumbing); its non-compile + stub-transport is architectural Phase 3+
OWED, precisely disclosed. VERIFICATION-STANCE.adoc rewritten:
ABI.Layout OWED RESOLVED; certificate-disconnect RESOLVED (Phase 3a/3b);
residuals re-scoped to the FFI boundary + genuine alignment theorems +
L6-L10 predicate shallowness.

Clean build EXIT=0 (9/9), zero proof-escapes, SafetyL4Model checks.
Refs hyperpolymath/standards#124. Does not close.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ed mint

The FFI fabricated a verification result: ffi/zig/src/lib.zig returned 2
(Verified L2) for ANY query containing the substring "SELECT", with a
Zig test enshrining it. A fake green is worse than a red.

- ffi/zig/src/lib.zig: fabrication DELETED; vclut_verify_query is now
  fail-closed (returns -1 Rejected, explicit 'no verifier backend
  linked' message; never returns a level it didn't establish). The
  lie-test rewritten to assert the fail-closed contract. zig build test
  green.
- Checker.certifiedLevel : Statement -> OctadSchema -> Int — genuine
  proof-gated attestation mint: a non-negative level is returned ONLY on
  the Just-certificate branch of certifyRequested (structural, no
  escape). The real verification authority, in the CI-gated corpus.
- src/abi/Foreign.idr + src/interface/abi/Foreign.idr: trust model
  documented honestly (C int = trusted-certifier attestation, NOT a
  transported dependent proof — inherent to any FFI).
- VERIFICATION-STANCE.adoc: FFI item rewritten — lie removed, boundary
  precisely scoped. NAMED OWED: no string->Statement parser exists
  anywhere in the repo (the verify(query_string) shape presupposes an
  unwritten component); C-ABI Statement marshalling; Idris->C build;
  real backend link. A C ABI carrying a re-checkable dependent proof is
  impossible by construction — honest target is attestation.

Clean build EXIT=0 (9/9), L4 model EXIT=0, zig build test EXIT=0, zero
proof-escapes. Refs hyperpolymath/standards#124. Does not close.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath
Copy link
Copy Markdown
Owner Author

Update — Phase 3d added to this PR (commit `28cbe71`): FFI honesty.

The FFI fabricated a result — `ffi/zig/src/lib.zig` returned `2` (`Verified L2`) for any query containing the substring `SELECT`, with a Zig test enshrining it. A fake green is worse than a red, so:

  • Lie deleted: `vclut_verify_query` is now fail-closed — returns `-1` (Rejected, explicit "no verifier backend linked"), never a level it did not establish. The enshrining test was rewritten to assert the fail-closed contract; `zig build test` EXIT=0.
  • Genuine proof-gated mint in the CI-gated corpus: `Checker.certifiedLevel : Statement -> OctadSchema -> Int` returns a level only on the `Just`-certificate branch of `certifyRequested` (structural, no proof-escape).
  • Honest trust model documented in both `Foreign.idr` copies + `VERIFICATION-STANCE.adoc`: a C int is a trusted-certifier attestation, not a transported dependent proof (impossible by construction over any FFI). Named OWED (absent, not faked): there is no string→`Statement` parser anywhere in the repo — the `verify(query_string)` FFI shape presupposes an unwritten component; plus C-ABI `Statement` marshalling, the Idris→C build, and the real backend link.

Authoritative verification: corpus `idris2 0.8.0 --build` EXIT=0 (9/9), `SafetyL4Model` EXIT=0, `zig build test` EXIT=0, zero proof-escapes. Refs hyperpolymath/standards#124; does not close.

Base automatically changed from proof-debt/vclut-124-phase2-devacuize to main May 19, 2026 07:54
@hyperpolymath hyperpolymath merged commit 233b9c0 into main May 19, 2026
11 of 17 checks passed
@hyperpolymath hyperpolymath deleted the proof-debt/vclut-124-phase3 branch May 19, 2026 07:55
hyperpolymath added a commit that referenced this pull request May 19, 2026
Brings the human-facing docs in line with the now-verified state
(Phases 1–3 on main via #21/#22/#23; Phase 4 = PR #24). No source or
proof changes; corpus remains green (10 modules, exit 0, zero escapes).

- PROOF-NEEDS.md: the false "corpus does not compile / never
  machine-checked / L2/L3/L5 vacuous" block replaced with the actual
  CI-gated 10-module state; per-level status corrected (L1–L10
  resolved, residual gaps precisely scoped).
- verification/proofs/README.adoc: added `vclut-core.ipkg` to Contents
  + the corpus build to "Verifying"; corrected the STANCE summary.
- verification/proofs/VERIFICATION-STANCE.adoc: headline updated
  "Phase 1 + 2 + 3" -> "Phase 1–4".
- CHANGELOG.md: new "### Verified" entry under [Unreleased] recording
  the Phase 0→4 proof-corpus remediation.

The a2ml machine manifests carry no verification state (generic
scaffolding) and were correctly left untouched.
VERIFICATION-STANCE.adoc remains the authoritative catalogue and takes
precedence over README/PROOF-NEEDS prose.

Refs hyperpolymath/standards#124.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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