Skip to content

v4 PROOF-1: external trust-discharge for A3 (no new file) - #3158

Merged
briansrls merged 1 commit into
mainfrom
v4-proof-export
May 15, 2026
Merged

briansrls merged 1 commit into
mainfrom
v4-proof-export

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Summary

Operator-ratified 2026-05-15 (option b; AGENT-1-style placement — no new file). The "proof export to Coq/Lean" capability, framed correctly: not transpilation, but the external trust-discharge for A3.

gunbc's structural evidence — A2 termination descent, the algebra-homomorphism epistemic chain, cost, effects — is emitted as a machine-checkable proof term in an external prover (Lean/Coq); their small, independently-audited kernel checks it. This converts A3's named seed-trust axiom into an intersubjective check against a trust anchor gunbc does not own.

Honest framing (consistent with A3)

  • It does NOT make gunbc un-gameable. The external kernel + the faithfulness of the evidence→proof-term emission are the new named axioms. PROOF-1 moves trust to a far stronger anchor; it does not eliminate it (the same Trusting-Trust honesty A3 itself states).
  • Constraints: (i) the lens exports witnesses gunbc already has — the prover only kernel-checks, never searches (a searching export would violate no-engine + A2 "checker not discoverer"); (ii) it discharges only what is structurally grounded — ungroundable ⇒ fail-closed Diagnostic. PROOF-1 inherits gunbc's honesty boundary; it does not paper over it.

Placement (operator-chosen — no new file)

Encoded in A3's existing homes: STRUCTURE.md §7 + workflow/bootstrap.dag A3 block + DECISIONS.md PROOF-1 row + TASKS.md T-15 note. Cross-ref A2 (primary evidence source) / AGENT-1 (an agent may request it) / B2-OMNI (lean/coq = ordinary emit targets). Realized later as a composition (evidence read) ⊕ (B2-OMNI emit to a lean/coq model) — no new subsystem, closed-tree invariant preserved.

Test plan

  • cargo fmt --all --check clean
  • v2-compiler compile --source-root src/v4 --target dag → 0 diagnostics
  • reviewer pass

🤖 Generated with Claude Code

Operator-ratified 2026-05-15 (option b, AGENT-1-style placement — no new
file). gunbc's structural evidence (A2 termination descent, the algebra-
homomorphism epistemic chain, cost, effects) is emitted as a machine-
checkable proof term in an external prover (Lean/Coq); their small
independently-audited kernel checks it.

This is the honest completion of A3: it converts A3's named seed-trust
axiom into an INTERSUBJECTIVE check against an anchor gunbc does not own.
It does NOT make gunbc un-gameable — the external kernel + the evidence→
proof-term faithfulness are the NEW named axioms; trust is MOVED to a
stronger anchor, not eliminated (same Trusting-Trust honesty A3 states).
Constraints: the lens EXPORTS witnesses gunbc already has, the prover
only KERNEL-CHECKS (never searches — no-engine + A2 checker-not-
discoverer); discharges only structurally GROUNDED claims (ungroundable
⇒ fail-closed Diagnostic).

Placed in A3's homes: STRUCTURE.md §7 + workflow/bootstrap.dag A3 block
+ DECISIONS.md PROOF-1 row + TASKS.md T-15 note. Realized later as a
composition (evidence read ⊕ B2-OMNI emit to a lean/coq model) — no new
file, closed-tree invariant preserved.

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

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 576d205c · Trigger: schedule
  • Thinking: 128s wall

BLOCKING (1)

Root Cause

  • src/v4/STRUCTURE.md PROOF-1 adds a proof-assistant target without reconciling the closed file tree → either ratify the Lean/Coq model file(s) in the tree or rewrite PROOF-1 to consume an already-enumerated target.

⚠️ The external trust-discharge direction is coherent, but the no-new-file framing conflicts with the closed-tree substrate authority.

Comment thread src/v4/STRUCTURE.md
discoverer"); (ii) it discharges only what is structurally GROUNDED —
ungroundable concepts remain fail-closed Diagnostics; PROOF-1 inherits
gunbc's honesty boundary, it does not paper over it. Realized as a
lens = (evidence read) ⊕ (B2-OMNI emit to a `lean`/`coq` language

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKING: PROOF-1 requires B2-OMNI emission to a lean/coq language model while also requiring no new file, but the closed v4 tree enumerates no Lean/Coq model, so the design has no substrate home and violates INVARIANTS P1/P5.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 576d205c · Trigger: manual
  • Comparison: main @ c7c668c0 ... v4-proof-export @ 576d205c
  • Conversation: View conversation

1. Story of the diff

This PR adds PROOF-1 to the v4 planning spine as an external trust-discharge mechanism for A3, without adding a new file or implementation surface. The new decision says gunbc will export structural evidence it already has—A2 descent, algebra-homomorphism chain, cost, and effects—as machine-checkable Lean/Coq proof terms, with the external prover kernel checking rather than searching (src/v4/DECISIONS.md:45, src/v4/STRUCTURE.md:281-297). The same concept is then threaded into the operational plan: STRUCTURE.md gives the invariant-level framing, TASKS.md places realization under T-15 once the lens framework and Lean/Coq target model exist, and workflow/bootstrap.dag records the bootstrap-facing A3 comment so workers see the trust boundary where the seed axiom is already documented (src/v4/TASKS.md:78-85, src/v4/workflow/bootstrap.dag:51-61).

The load-bearing design choice is that PROOF-1 is not a new proof engine inside gunbc. It is described as “lens = evidence read ⊕ B2-OMNI emit,” with ordinary Lean/Coq target emission and no new subsystem (src/v4/STRUCTURE.md:298-301). That preserves the project’s existing thesis direction: v4 is the live operational target, correctness dimensions are structural facts read by lenses, and target growth should stay modeled rather than becoming hand-maintained compiler logic. chatgpt-review-d803db69-e8bc-4a…

chatgpt-review-d803db69-e8bc-4a…

2. Invariant categories

  1. LAYER MODEL — Compliant. This is a docs/planning diff, not a new substrate connective, behavior, Dag field, or mutation API. Where it does touch substrate-level intent, it keeps PROOF-1 as a consumer/export of existing structural witnesses: “the lens EXPORTS witnesses gunbc ALREADY HAS” and the prover “never SEARCHES for a proof” (src/v4/STRUCTURE.md:292-296). That matches the invariant model where constructs must ground in declared sources and not become ungrounded internal categories. chatgpt-review-8ccde09a-13d7-4b…
  2. INVARIANTS.md + modeling-discipline.md — Compliant. Fail-closed and no-engine are explicitly preserved: ungroundable concepts remain diagnostics (src/v4/STRUCTURE.md:296-298), and the proof assistant is a kernel checker, not a search engine (src/v4/STRUCTURE.md:292-296). Single-authority/projection discipline is also handled: the plan is one lens reading already-held evidence plus ordinary target emission, not a parallel verifier (src/v4/STRUCTURE.md:298-301, src/v4/TASKS.md:78-85). This lines up with the five invariant principles and the modeling practices around fail-closed, facts flowing forward, single authority, and projection over enumeration. chatgpt-review-8ccde09a-13d7-4b…

chatgpt-review-335a2851-89fa-4d…

  1. CODING.md — N/A. No Rust implementation code, functions, methods, traits, or APIs are added. The planned implementation shape is nevertheless compatible with Coding’s data + pure-functions posture because it is framed as evidence-read plus emit, not hidden state or object behavior (src/v4/STRUCTURE.md:298-300). chatgpt-review-b54640ce-e186-4c…
  2. TESTING.md — N/A. The diff adds a planning/design commitment only; there is no new executable behavior to test in this PR. The realization trigger is explicitly deferred to when “the lens framework + a lean/coq model land” (src/v4/TASKS.md:83-85), so the test obligation belongs with that future implementation, not this no-code documentation change. Testing’s general discipline remains behavior/interface-driven when executable work does land. chatgpt-review-7a099ca7-40f3-4b…
  3. LOCKED DESIGN DECISIONS — Compliant. The change respects the live v4/0-floor authority: it says “NO new file” and “no new subsystem” (src/v4/STRUCTURE.md:298-301; src/v4/DECISIONS.md:45; src/v4/TASKS.md:82-85). That is consistent with the Pure Bootstrap to Zero v4 supersession and generated/zero-hand-authored direction. chatgpt-review-b4ef00af-9559-44…
  4. TRACKED vs UNTRACKED DEBT — Compliant. PROOF-1 is a future work item, but it is bounded and tracked: the bounds are existing witnesses only, kernel-check only, structurally grounded only (src/v4/STRUCTURE.md:292-298); the realization trigger is named as the lens framework plus Lean/Coq language model landing (src/v4/TASKS.md:83-85); and the no-new-file/no-new-subsystem boundary is repeated in the decision and structure docs (src/v4/DECISIONS.md:45, src/v4/STRUCTURE.md:298-301). That satisfies the scaffold/debt requirement for documentation, bounds, and a dissolution/realization trigger rather than leaving a vague bridge. chatgpt-review-8ccde09a-13d7-4b…

2.5. Top-down PM intent review

Compliant. The highest-level intent is preserved: gunbc’s correctness surface remains structural, lens-readable, and v4-applicable; PROOF-1 adds an external check for already-derived evidence rather than turning structural guarantees into optional testing or hand-maintained proof infrastructure (src/v4/STRUCTURE.md:281-301). It also keeps trust-honesty intact by naming the new axioms—the external kernel and evidence-to-proof-term faithfulness—instead of claiming proof eliminates all trust (src/v4/STRUCTURE.md:286-291, src/v4/workflow/bootstrap.dag:54-59). That is a strengthening of A3’s seed-trust story, not semantic dilution.

I do not see a PM-level mismatch. The plan does not postpone a must-have target without reconciliation, does not create permanent scaffolding, and does not add hand-written compiler implementation where the active v4/zero-floor direction requires generated/data-authored structure. The “ordinary emit targets, no new subsystem” language is the key PM-preserving clause (src/v4/STRUCTURE.md:298-301, src/v4/TASKS.md:83-85). chatgpt-review-d803db69-e8bc-4a…

chatgpt-review-d803db69-e8bc-4a…

chatgpt-review-b4ef00af-9559-44…

3. Verdict

APPROVE. The PR is documentation-only, but it threads the new PROOF-1 concept through the right authorities and keeps the boundaries explicit: existing structural witnesses, kernel-check only, fail-closed on ungrounded facts, ordinary Lean/Coq target emission, and no new subsystem/file. I found no diff-cited invariant or PM-intent violation.

@briansrls
briansrls merged commit 26d0bd5 into main May 15, 2026
7 checks passed
briansrls added a commit that referenced this pull request May 15, 2026
B-5 (affected_set R1 usefulness): effect is a per-Arrow-Node fact from
the signature (B3), never aggregated coarse — a granularity invariant
(coarse ⇒ R1 correct-but-useless). effect.dag B-5 block + affected_set
Consumes/Ex.R1 cross-ref + DECISIONS B-5 row.

Subsume #3153 (v4-affected-set-design, no worker — operator-directed):
its 4 worked-examples + adversarial R1/R2/R3 + dogfood-reality folded
into affected_set.dag as the T-21 design contract, reconciled to the
now-ENCODED reciprocal contracts — Ex.R1→B-5 (effect.dag), Ex.R2→B-4
(04_infer.dag), Ex.R3→B-3 (drafted #3157 point-3 correction). #3153
superseded; recommend close. DECISIONS #3153-subsumed row.

B-2 (PROOF-1 prover model lands): extdeps/languages/lean.dag (new) —
Lean first, termination theorem class; Coq deferred second-prover
probe. B2-OMNI requires the LanguageModel file PROOF-1 #3158 deferred.
STRUCTURE enumeration+count 63→64; DECISIONS L-4; TASKS PROOF-1 note.

Includes the already-committed origin/main merge (204b855: #3158
PROOF-1 + #3160 meta-cut; DECISIONS.md conflict resolved keeping
D1/B-4/PROOF-1).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 16, 2026
…ursor #3162 APPROVE_WITH_COMMENTS)

Valid NON-BLOCKING finding: B-2 added lean.dag + the L-4 row but the
PROOF-1 row still ended "**NO new file** (closed-tree invariant)",
contradicting L-4 (which lands extdeps/languages/lean.dag). Reconciled:
PROOF-1's framing (#3158) added no file (framing-only, deferred the
model "lands later"); that deferred model subsequently lands as
lean.dag per B-2/L-4. One coherent story; PROOF-1 row now cross-refs
L-4 and states "No contradiction" explicitly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 16, 2026
…#3162)

* WIP: v4 design

* v4 D1: Diff/Path structural-delta vocabulary over Node

Side-session-ratified B-1. EdgeSelector/Path/Edit/Diff data types in
std/node.dag (DATA ONLY; A1-clean — Node stays the sole recursive type;
B1/Hash precedent for substrate-tier placement). Operations
(subterm_at/apply_diff -> Result<Node,Diagnostic>, paths_independent/
diff_well_formed) contracted into lens/application.dag header — forced
off node.dag by the diagnostic.dag->node.dag cycle (Correction=
Suggested(Node)); the node.dag "consumers fail-close" discipline.
affected_set.dag consumes the type. DECISIONS.md Part-1 row D1 carries
the data/op-split PROPOSED sub-point for operator confirmation.

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

* WIP: v4 design

* v4 D1: dissolve two P2 illegal-state surfaces (codex #3162 REQUEST_CHANGES)

Both findings valid; fixed structurally rather than patched.

Finding 1 (node.dag:~478 ByPosition{index:Int} admits negatives): drop
EdgeSelector/ByPosition entirely. Path = List<Symbol> — each step
descends the Named edge keyed by that opaque Symbol. No ordinal exists,
so the negative/out-of-range illegal state is structurally impossible
(dissolved, not deferred to path resolution). Positional-connective
children are reached by replacing the enclosing Named subtree (the safe
over-fire #3157 blesses); surgical positional addressing is a future
operator-ratified extension (consumes-nothing root has no Nat; recursive
Peano = A1 STOP).

Finding 2 (node.dag:~514 Diff=List<Edit> validity via external
predicate): drop the set / pairwise-independence / parallel-positions
framing and paths_independent/diff_well_formed. Diff = ORDERED List<Edit>
applied SEQUENTIALLY; any List<Edit> is a valid rewrite program (no
representable illegal state). A non-resolving Edit => fail-closed
Diagnostic at apply time (operational, not a type-level illegal state);
apply_diff is a fold, all-or-nothing.

Both refine the operator-ratified shape — flagged in DECISIONS.md D1
PROPOSED-for-operator-eye for confirm/redirect.

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

* v4 D1: add Practice-4 dissolution receipt; fix RATIFIED/PROPOSED contradiction (#3162 BLOCKING)

BLOCKING (codex via briansrls relay, vs pre-fix sha a06a066 — verified
against current HEAD):
- "D1 sum vocabulary without coproduct receipt": the EdgeSelector sum
  was already deleted in 7c91f73, but the DECISION not to have a
  positional selector is itself a Practice-4 dissolution requiring the
  formal 4-pattern ledger (algebra.dag precedent). Added the receipt to
  std/node.dag D1 (🟢 GREEN terminal: positional addressing subsumed by
  enclosing-Named-subtree replacement; not a deferred gap).
- "root-status driving the index carrier": resolved by the same
  dissolution — there is no index carrier; the receipt documents why
  none is needed (vs the reviewer's Nat/Fin suggestion) and why a
  future surgical form is an explicit operator-ratified extension.

Non-blocking: DECISIONS.md D1 row no longer carries a "confirm or
redirect" clause inside a RATIFIED row — refinements are stated as
encoded-via-PR-review (the normal channel), not an open fork.

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

* v4 D1: fix stale EdgeLabel cross-reference in node.dag header (cursor #3162 editorial)

The D1 header block cited "lines ~221-230" for the no-stored-index
discipline, but adding the D1 header block shifted line numbers — that
range is now `Connective`. Re-anchored by construct name + corrected
approx lines: `type EdgeLabel` ~284 and its "deliberately NO stored
index" rationale ~278. Editorial only; cursor APPROVE on this PR.

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

* v4 B-4: affected_set R2 node-precise-resolution contract

Encodes the B-4 cross-cutting decision (operator-greenlit): affected_set
minimality requires 04_infer resolution to bind each use-site name-ref
to the EXACT declaration Node (not module/scope). The use->def graph is
derived by traversal over already-resolved name-references, NOT a 5th
InferredFacts field (IR-1-safe; same derive-don't-store discipline as
content_hash/D1). Coarse resolution = correct but maximally over-fires.

Reciprocal header contracts: 04_infer.dag B-4 block + affected_set.dag
Consumes note. DECISIONS.md Part-1 row B-4. Scaffold headers only; no
bodies. Continues the v4 design-survey on the session branch alongside
D1 (operator sequences/carves at manual merge).

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

* v4 B-5 + subsume #3153 + B-2 (lean.dag PROOF-1 model)

B-5 (affected_set R1 usefulness): effect is a per-Arrow-Node fact from
the signature (B3), never aggregated coarse — a granularity invariant
(coarse ⇒ R1 correct-but-useless). effect.dag B-5 block + affected_set
Consumes/Ex.R1 cross-ref + DECISIONS B-5 row.

Subsume #3153 (v4-affected-set-design, no worker — operator-directed):
its 4 worked-examples + adversarial R1/R2/R3 + dogfood-reality folded
into affected_set.dag as the T-21 design contract, reconciled to the
now-ENCODED reciprocal contracts — Ex.R1→B-5 (effect.dag), Ex.R2→B-4
(04_infer.dag), Ex.R3→B-3 (drafted #3157 point-3 correction). #3153
superseded; recommend close. DECISIONS #3153-subsumed row.

B-2 (PROOF-1 prover model lands): extdeps/languages/lean.dag (new) —
Lean first, termination theorem class; Coq deferred second-prover
probe. B2-OMNI requires the LanguageModel file PROOF-1 #3158 deferred.
STRUCTURE enumeration+count 63→64; DECISIONS L-4; TASKS PROOF-1 note.

Includes the already-committed origin/main merge (204b855: #3158
PROOF-1 + #3160 meta-cut; DECISIONS.md conflict resolved keeping
D1/B-4/PROOF-1).

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

* WIP: v4 design

* v4 B-4: correct the use→def carrier (Symbol/K-1, not resolved_type) — #3162 BLOCKING

Valid P2/Practice-3 finding (briansrls inline @ 04_infer.dag:54):
resolved_type is the node's TYPE; many declarations share a type, so it
is lossy for binding identity — the use→def fact had no named forward
carrier. Corrected: the carrier is the post-resolution opaque Symbol
(K-1) on the name-ref Atom, AUTHORED by 03_resolve.dag (binding =
Symbol equality, node.dag name_occurrences pattern). 04_infer is
preserve-only (no 5th InferredFacts field, IR-1-safe); affected_set
derives by Symbol-equality traversal. Fixed consistently across
04_infer.dag B-4 block, new 03_resolve.dag B-4 authority note,
affected_set.dag Consumes note, DECISIONS.md B-4 row.

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

* WIP: v4 design

* WIP: v4 design

* v4 C5-2 emit-locality + T-9 infer keystone contracts (operator-ratified)

C5-2 (emit-locality): emit is structurally local — a D1 apply_diff at
Path p re-emits ONLY p's subtree. Per operator code-as-data steer:
locality is Node-relative, NOT file-relative; a file is a convenience
projection, the substrate anchors no semantic on the file concept;
non-local emit = declared normalization at the enclosing NODE scope,
never "file scope". The C5↔D1 hinge (AGENT-1 faithful re-emit).
05_emit.dag header + Owns + DECISIONS C5-2 row.

T-9 A+B: A — Find decidable by construction (closed declared-inhabitance
candidate set, not a synthesized search; structural descent ⇒ the
inferencer terminates; empty = decidable fail-closed Diagnostic).
B — single-file discipline is the 03_resolve scope boundary (env/scope/
lookup/binding belongs to 03_resolve per B-4; infer owns only Find +
cardinality + diagnostic precision). 04_infer.dag header + DECISIONS
T-9 row.

Receipts: in-header (operator decision; status quo, no change).

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

* v4 D1: complete the Practice-4 receipt — add Pattern 5 (#3162 codex REQUEST_CHANGES)

Valid finding. docs/modeling-discipline.md:112 requires FIVE dissolution
patterns; the node.dag #3160 operator-ratified receipts already use 5.
The D1 receipt did only 4 (I wrongly followed algebra.dag's older
4-pattern style). Added Pattern 5 (Parameterized family) — FAILS:
ByName/ByPosition are not one mechanical F<X> over a declared set
(different payload types + addressing semantics; mirror EdgeLabel's
genuine 2-variant discriminant, not an enumerated copy à la
Homomorphism-per-algebra); no source set to project over (Practice-7
N/A); post-dissolution one constructor = not a family. "four" → "five".

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

* v4 C5-1 + C5-3 (operator-ratified) — node-level round-trip law + spec-provable F

C5-1: the bidirectional_roundtrip TestClaim asserts ingest∘emit=id_Node
via B1 content_hash (meaning round-trips), NOT text-byte identity.
Text-level fidelity recorded as a DEFERRED orthogonal future layer (a
trivia sidecar outside Node/content_hash, partial; the C5-fidelity
Declared-normalized dispositions are its forward hook — node-level
adoption preserves it zero-rework). Non-orthogonal route (lexical in
the Node) explicitly rejected.

C5-3: F = the spec-provable meaning core; spec silence ⇒ out of F
(Declared-normalized or Fail-closed). Conservative/fail-safe — the
spec decides, modeler has no discretion; per-language non-F shrinkage
declared up front, not discovered at test time.

Encoded: lens/testgen.dag C5-1/C5-3 header block + DECISIONS C5-1/C5-3
rows.

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

* v4: reconcile PROOF-1 row with L-4 — DECISIONS.md self-consistency (cursor #3162 APPROVE_WITH_COMMENTS)

Valid NON-BLOCKING finding: B-2 added lean.dag + the L-4 row but the
PROOF-1 row still ended "**NO new file** (closed-tree invariant)",
contradicting L-4 (which lands extdeps/languages/lean.dag). Reconciled:
PROOF-1's framing (#3158) added no file (framing-only, deferred the
model "lands later"); that deferred model subsequently lands as
lean.dag per B-2/L-4. One coherent story; PROOF-1 row now cross-refs
L-4 and states "No contradiction" explicitly.

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls
briansrls deleted the v4-proof-export branch June 1, 2026 18:43
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