Skip to content

v4: remaining design decisions — ledger for batch ratify/redirect - #3150

Merged
briansrls merged 15 commits into
mainfrom
v4-remaining-decisions
May 15, 2026
Merged

briansrls merged 15 commits into
mainfrom
v4-remaining-decisions

Conversation

@briansrls

@briansrls briansrls commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The remaining design decisions, now ratified and encoded (this PR evolved from a proposal-ledger into the encoding PR — read it as substrate changes, not "just a doc").

  • src/v4/DECISIONS.md — the canonical decisions ledger. Part 1 RATIFIED (A1–A4, U1, U2, C1–C5, K-1, IR-1, B2-OMNI, L-1, B1) with where-each-is-encoded pointers. Part 3 is CLOSED — every fork ratified.
  • Encoded into substrate headers (operator-ratified, interactively): U2 (cost total over the closed kernel; complexity consumes it), C3 (normalize dissolves exactly the 4 sugar forms), C1 (infer = bounded Find), B3 (type signature = single effect authority), C4 (on-disk emitted artifacts are committed==emit checked projections; STRUCTURE.md invariant Add node override support for non-transport I/O node mocking #8), IR-1 (InferredTree = Node + frozen flat InferredFacts; cardinality/effects NOT fields — single authority), B2-OMNI (the O(N+M) pivot; Shape A/B kept distinct), B1 (Hash carrier in primitive.dag; content_hash fold + canonical-form clause are node.dag-contract items the T-1 worker encodes per relay).
  • 3 new files (operator-ratified L-1 — B2-OMNI falsification probes): extdeps/languages/verilog.dag (T-4.9, concurrency vs the 5 behaviors), extdeps/formats/spice.dag (T-4.10, Shape B, no control flow), test/claim/boundary/english_ingest_fail_closed.dag (T-4.11, fail-closed ingest). STRUCTURE.md File tree + counts re-enumerated (invariant Add SVG viz, test helpers, and makegen scaffold #1).

Disjoint from #3149 (substrate review-fixes) and #3151 (T-1 node.dag). The B1 canonical-form clause + content_hash are routed to #3151 (the T-1 worker owns node.dag).

Test plan

  • cargo fmt --all --check clean
  • v2 → v4 bootstrap viability OK — 60 modules, 0 diagnostics (matches the re-enumerated tree: 57 + the 3 L-1 probes)
  • STRUCTURE.md closed file tree re-enumerated to match reality (invariant Add SVG viz, test helpers, and makegen scaffold #1)
  • Reviewer re-run confirms the followup BLOCKING resolutions + the tree fix

🤖 Generated with Claude Code

Single record of v4 design ratifications. Part 1 indexes the RATIFIED
this-session decisions (A1/A2/A3/A4/U1/C2 + where encoded). Parts 2-4
are PROPOSED, awaiting operator ratify/redirect — NOT encoded into
substrate until ratified:
- Part 2 quick confirms (cascade-closures of ratified parents): U2, C3, C1
- Part 3 open forks (genuine decisions, recommended + tradeoff): B1
  (elevated — load-bearing for A3), B2, B3, B4, C4, C5
- Part 4 lower-cascade defaults (non-blocking): JSON number, SC/CC,
  effect-type-set, bounded-coverage, v2-interpreter pre-flight

Each PROPOSED carries: why (cascade-of-X or the tension), recommended
resolution, honest tradeoff/residual, and the exact file header it
encodes into on ratification. This file proposes; it does not decide.

v2->v4 bootstrap viability OK (57 modules, 0 diagnostics).

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: f8ba3b3b · Trigger: schedule
  • Thinking: 242s wall

BLOCKING (2)

Root Cause

  • src/v4/DECISIONS.md B1 treats content hashing as a consumer pick while the canonicalization producer is still unnamed → add a canonical Node normal-form decision to std/node.dag or make B1 explicitly own it before ratification.
  • src/v4/DECISIONS.md The lower-cascade shorthand kept the old effect-type-set phrasing after B3 picked signature-derived effects → rewrite T-4.8 as a closed set of typed signature-fact carriers, not a standalone enum.

⚠️ Two ledger entries need tightening before ratification because they would otherwise propagate ambiguous substrate authority.

Comment thread src/v4/DECISIONS.md Outdated
unchanged-subgraph detection, **and the A3 reproduction/surfacing
check** all need content-addressing. Three schemes = drift.
- **Recommended:** a single canonical content-hash over the *canonical*
Node structure (A1 already mandates Node is canonical/deterministic, so

This comment was marked as resolved.

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.

Fixed in 831e14e. Correct — A1 only ratifies recursion/axis-closure/generics/termination, NOT canonicality. B1 no longer claims A1 provides it. Canonical form is now a SEPARATE explicit node.dag authority — the canonical-form clause (total deterministic normal form: structural child order, opaque-Symbol identity per K-1, no incidental ordering) — which the T-1 worker encodes. B1 depends on it; not subsumed by A1. Relay updated: THREE node.dag-contract items (K-1, canonical-form clause, content_hash). — sent from deep-wolf-155

Comment thread src/v4/DECISIONS.md Outdated
load-bearing per C5).
- **T-4.7 Server/Client Components** — recommend **effect-typed, not a
structural distinction** (consistent with B3; SC/CC differ by effect).
- **T-4.8 effect-type-set closure** — recommend `HttpEffect/QueueEffect/…`

This comment was marked as resolved.

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.

Fixed in 831e14e. Agreed — a closed HttpEffect|QueueEffect enum IS the parallel effect taxonomy B3 forbids (P2). The "effect-type-set closure" default is dissolved: there is NO effect enum to close. HttpEffect/QueueEffect are typed CARRIERS read from the type signature by lens/effect.dag — the signature is the single effect authority (B3). Non-default; resolved by B3. — sent from deep-wolf-155

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: f8ba3b3b · Trigger: manual
  • Comparison: main @ 46bc08bf ... v4-remaining-decisions @ f8ba3b3b
  • Conversation: View conversation

1. Story of the diff

This PR adds src/v4/DECISIONS.md, a v4 design-decision ledger that separates already-ratified operator decisions from recommendations still awaiting ratify-or-redirect. The load-bearing mechanism is authority separation: ratified rows are presented as an index to headers elsewhere, while proposed rows state rationale, tradeoffs, and the eventual files that will receive the binding wording after ratification. Most of the ledger is doing useful coordination work: it turns scattered v4 design questions into a batchable set of cascade confirmations, genuine forks, and lower-priority defaults. One lower-cascade entry, however, conflicts with the same ledger’s effect-authority decision and with the thesis-level “unenumerated effects” commitment.

2. Invariant categories

1. LAYER MODEL — substrate vs implementation

Compliant — this diff does not directly mutate substrate files or Dag-resident types; it keeps the ledger as an index/proposal layer by saying ratified decisions are “Encoded in the cited file(s)” and that “file headers are authority” at src/v4/DECISIONS.md:5-6, while proposed items are explicitly not unilateral decisions at src/v4/DECISIONS.md:7-9 and src/v4/DECISIONS.md:206-207.

2. INVARIANTS.md + modeling-discipline.md

Finding — Boundary Discipline / single-authority metadata. src/v4/DECISIONS.md:184-186 recommends that HttpEffect/QueueEffect/… “is a closed enum like CoordinationSemantics,” but the same ledger’s B3 decision says the type signature is the single effect authority and that HttpEffect / QueueEffect are “typed carriers over that, not a parallel effect taxonomy/enum” at src/v4/DECISIONS.md:113-116. That creates a parallel-authority instruction in the lower-cascade section: a worker following T-4.8 literally would build the standalone effect enum that B3 says must not exist. This should be rewritten so T-4.8 describes a bounded set of signature-backed carrier declarations, not an independent closed enum.

3. CODING.md

N/A — documentation-only PR; no Rust implementation surface, helper placement, method/free-function shape, or error/result API is changed.

4. TESTING.md

N/A — documentation-only decision ledger; no executable behavior, runner predicate, or generated/test harness surface changes. The absence of tests is appropriate for this patch.

5. LOCKED DESIGN DECISIONS

Finding — unenumerated effects commitment. The thesis-level effect direction is that effects are read from type-signature shape, with “no parallel taxonomy or annotation layer” and that tracking effects as a separate enumerated concept is the bug pattern; this is stated in THESIS.md:389-394. The lower-cascade line at src/v4/DECISIONS.md:184-186 reintroduces exactly that shape by recommending a closed enum for HttpEffect/QueueEffect/…. Even though the row is only proposed, this ledger is a planning artifact; landing the contradictory default without an explicit reconciliation would dilute the locked effect-modeling direction.

6. TRACKED vs UNTRACKED DEBT

Compliant — the ledger does not introduce a scaffold or temporary implementation shape; it bounds its proposed decisions through an explicit ratification flow at src/v4/DECISIONS.md:199-207, and most entries name the eventual encoding targets. The effect-enum issue above is a semantic contradiction, not untracked debt.

2.5. Top-down PM intent review

Finding — planning artifact would route work against the intended effect model. The highest-level intent for the unenumerated-effects bug class is that operation effects are derived from type-signature shape, consumers walk signatures directly, and “there is no parallel taxonomy or annotation layer” (THESIS.md:389-394). The diff’s B3 section preserves that intent at src/v4/DECISIONS.md:113-116, but the lower-cascade recommendation at src/v4/DECISIONS.md:184-186 then tells T-4.8 to make HttpEffect/QueueEffect/… a closed enum. A worker could follow the ledger faithfully and implement the wrong thing: an enumerated effect authority instead of signature-backed carriers. I would change that bullet before merge to say the coordination carriers are closed/bounded only as typed signature-derived carrier forms, and explicitly “not an effect taxonomy/enum authority.”

3. Verdict

REQUEST_CHANGES

The ledger structure is useful and mostly respects authority separation, but the T-4.8 lower-cascade bullet contradicts the ratified-looking B3 effect authority and the thesis’s unenumerated-effects commitment. Because this is a design/planning artifact for substrate work, that contradiction should be fixed before landing.

briansrls and others added 2 commits May 15, 2026 09:11
…efer)

B2-OMNI (00_compile.dag + 01_tokenize/02_parse/05_emit headers):
parse is NOT special — it is ONE instance of ingestion. The pipeline is
two PARAMETERIZED BOUNDARIES + a language-agnostic core:
  ingest(Source, LanguageModel) -> Node   [tokenize+parse = generic
    walker over declarative grammar; .dag is language #1, not hardcoded]
  core: Node -> InferredTree              [normalize∘resolve∘infer]
  emit(InferredTree, TargetModel) -> Source ; eval -> Value
  compile = emit∘core∘ingest ; run = eval∘core∘ingest
Node is the universal pivot ⇒ O(N+M) not O(N×M): adding model #k is
O(1), instantly cross-composes. ingest(Rust)∘emit(Python) = Rust→Python
with no translator ever written — the visceral cash. C5: ingest=emit⁻¹
on the lossless core, fail-closed outside.

IR-1 (04_infer.dag): InferredTree is FROZEN now, not emergent. It is NOT
a new type — per A1 it is Node + one flat per-node InferredFacts
coordinate {resolved_type, cardinality, inhabits, cost(U1), descent(A2)};
effects are NOT a field (B3 single authority); a 6th field is a STOP.
Folded C1 in: infer is the bounded Find phase (structural unification,
empty ⇒ Diagnostic, never fabrication); the v2 12-file split cannot recur.

DECISIONS.md ledger: U2/C3/C1/B3/C4/C5 + K-1/IR-1/B2-OMNI moved to
RATIFIED Part 1 with encode pointers; U2 carries the no-bypass sharpening
(cost total over the closed kernel). Only B1 remains PROPOSED (the
content-hash *home* pick — recommendation: std-level).

Per-header text encoding of U2/C3/B3/C4 into their own files is the next
pass (ledger records them ratified; nothing lost). C1/IR-1/B2-OMNI are
encoded here.

v2->v4 bootstrap viability OK (57 modules, 0 diagnostics).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Operator-ratified 2026-05-15 (long-held v2 intent, de-deferred to stress
the architecture up front). Three maximally-diverse parallel tasks; each
is a falsification probe for the just-ratified B2-OMNI O(N+M) claim — if
adding one is O(1) the claim is validated, if any forces a core change
it's surfaced now.

- T-4.9 extdeps/languages/verilog.dag — concurrency vs the 5 behaviors;
  the IN-B validation probe (a needed 6th `Concurrent` behavior = C1
  escalation, by design caught early). Win: one .dag FSM → simulable
  Verilog + Rust reference, same Node.
- T-4.10 extdeps/formats/spice.dag — is LanguageModel actually general
  or programming-shaped? Netlist has no control flow. Fork resolved:
  formats/ (a netlist is a data format), Shape B. Win: .dag → simulable
  SPICE netlist (omni-emission reaches analog hardware).
- T-4.11 test/claim/boundary/english_ingest_fail_closed.dag — English is
  NOT a language model (fork resolved): a boundary-honesty probe. Win:
  (a) Shape B English docs (≈ T-16 markdown, no new substrate); (b) the
  honest one — ingest(prose) → precise Diagnostic, never a fabricated
  parse (no-engine made visible).

TASKS.md: added to the Phase-1 parallel graph + a combined task section;
count statements made drift-proof (no hardcoded number — per T-15).
DECISIONS.md: L-1 ratified row with the fork resolutions + file targets.

v2->v4 bootstrap viability OK (60 modules, 0 diagnostics — +3 scaffolds).

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: 729db325 · Trigger: schedule
  • Thinking: 301s wall

BLOCKING (4)

Root Cause

  • src/v4/compiler/04_infer.dag IR-1 mixes canonical substrate facts with inferred/cache facts → remove cardinality from the frozen payload or make it a derived view from resolved_type.
  • src/v4/compiler/00_compile.dag B2-OMNI overgeneralized C5 from language targets to formats → keep compiler TargetModel to Shape A language specs and model SPICE/English as Shape B user-program emitters.
  • src/v4/extdeps/languages/verilog.dag The stress-probe scaffolds were authored before selecting exact external authorities → cite the concrete Verilog and SPICE specs/versions before these worker contracts become immutable.

⚠️ Prior blocking comments 3248138046 and 3248138059 remain unresolved, and the new authority/fidelity issues above need correction before ratification.

Comment thread src/v4/compiler/04_infer.dag Outdated
// substrate-extension STOP→escalate, never an inline add):
// - resolved_type : Node (the node's type — itself a Node in
// the type substrate, Shape S)
// - cardinality : Cardinality (the Cardinality-connective fact)

This comment was marked as resolved.

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.

Fixed in 831e14e. Correct, same class as effects-not-a-field (B3). cardinality dropped from InferredFacts — the Cardinality connective is one of the 6 (A1) and resolved_type: Node already carries it structurally; a separate field is a second authority (P2). It is read from resolved_type, never stored. Frozen payload is now 4 fields {resolved_type, inhabits, cost, descent}; cardinality + effects are explicitly NOT fields. — sent from deep-wolf-155

Comment thread src/v4/compiler/00_compile.dag Outdated
// - compiler/01_tokenize.dag → 05_emit.dag + 05_eval.dag (core + boundaries)
// - std/diagnostic.dag for error propagation
// - extdeps/languages/*.dag for TargetSpec
// - extdeps/languages/*.dag + extdeps/formats/*.dag — the bidirectional

This comment was marked as resolved.

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.

Fixed in 831e14e. Correct — Shape A/B must not blur. The ingest/emit LanguageModel/TargetModel parameter is extdeps/languages/* (Shape A) ONLY. extdeps/formats/* (csv/json/spice/…) is Shape B — emitted/consumed by user .dag programs walking typed values, NOT a compiler boundary parameter. Added an explicit Shape-A-vs-B block to 00_compile.dag; the Consumes line no longer lumps formats with languages. — sent from deep-wolf-155

@briansrls

Copy link
Copy Markdown
Contributor Author

Violations (could not place on specific lines):

  • src/v4/extdeps/languages/verilog.dag:6 BLOCKING: The new extdeps module anchors Verilog to Wikipedia rather than a versioned upstream spec, violating extdeps.md fidelity requirements.
  • src/v4/extdeps/formats/spice.dag:6 BLOCKING: The new extdeps module anchors SPICE to Wikipedia without choosing a concrete netlist specification/version, violating extdeps.md fidelity requirements.

briansrls and others added 2 commits May 15, 2026 09:34
B1 (operator-confirmed std-level fold):
- std/primitive.dag: `Hash` — opaque digest carrier (no content accessor,
  K-1-style). content_hash : Node -> Hash (Merkle fold over A1-canonical
  Node) is a std/node.dag contract item the T-1 worker encodes per relay
  (it owns that file). One scheme; T-15/T-20/T-21/A3/C5 consume it.

Per-header encoding (ledger already recorded these RATIFIED):
- U2: cost.dag — cost is TOTAL over the closed kernel (no per-feature
  opt-in; a future addition cannot bypass cost = no-eternal-maintenance);
  single U1 carrier; verify lattice axioms. complexity.dag — consumes
  cost, never re-derives (one mechanism, two projections).
- C3: 03_normalize.dag — dissolves EXACTLY the 4 sugar forms
  {service,fn,type,operation}; not identity, not open-ended; 5th = STOP.
- B3: lens/effect.dag — the type signature is the single effect
  authority; this lens READS it; coordination effect-types are carriers
  over it, not a parallel taxonomy.
- C4: workflow/ci.dag + STRUCTURE.md invariant 8 — on-disk emitted
  artifacts (ci.yml, trampoline) are committed==emit checked projections
  guarded by the A3 machine; "no editable generated AUTHORITY", not "no
  generated bytes".

DECISIONS.md: B1 added to RATIFIED Part 1; Part 3 marked CLOSED — every
design fork ratified + encoded. Only the T-1-worker-owned node.dag items
(K-1, content_hash) remain to be encoded by that worker per relay.

v2->v4 bootstrap viability OK (60 modules, 0 diagnostics).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- 3248138046: B1 overclaimed "A1 makes Node canonical." A1 does NOT —
  it covers recursion/axis-closure/generics/termination only. Canonical
  form is now a SEPARATE explicit node.dag authority (the canonical-form
  clause) the T-1 worker encodes; B1 depends on it, not subsumed by A1.
  Relay updated: THREE node.dag-contract items (K-1, canonical-form
  clause, content_hash).
- 3248138059: T-4.8 effect-type-set-closure default contradicted B3 (a
  closed effect enum IS the parallel taxonomy B3 forbids). Dissolved:
  no effect enum; HttpEffect/QueueEffect are carriers read from the
  signature by lens/effect.dag.
- 3248488135: IR-1 froze `cardinality` in InferredFacts though
  resolved_type already carries the Cardinality connective (A1) —
  second authority. Dropped; cardinality (like effects, B3) is read
  from resolved_type, not stored. Frozen payload now 4 fields.
- 3248488229: 00_compile.dag B2-OMNI lumped extdeps/formats/* with
  languages/* as the LanguageModel param — Shape B blurred into the
  Shape A compiler boundary. Corrected: ingest/emit param is
  languages/* ONLY; formats/* is user-program (Shape B) emission, not
  a compiler boundary parameter.

v2->v4 bootstrap viability OK (60 modules, 0 diagnostics).

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

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 831e14e7 · Trigger: manual
  • Comparison: main @ 46bc08bf ... v4-remaining-decisions @ 831e14e7
  • Conversation: View conversation

1. Story of the diff

This PR turns v4’s remaining design questions into a decision ledger and pushes the ratified decisions into the v4 scaffold headers so workers inherit the decisions at the owning files rather than from floating review context. The main architectural move is B2-OMNI: compile/run are reframed as ingest → core → emit/eval, with tokenize/parse as generic LanguageModel-driven ingestion, normalize closed to the four surface sugars, infer frozen as Node + InferredFacts, and cost/complexity/effects tied to single authorities (cost.dag, the type signature, and canonical Node hashing). It also adds three early falsification probes—Verilog, SPICE, and English ingest failure—to stress the Shape A/Shape B and no-engine boundaries before those assumptions become load-bearing. The diff is mostly design-surface and scaffold work, but because these headers are the worker contract, contradictions inside them are functionally significant.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Finding — BLOCKING, substrate authority drift. src/v4/std/primitive.dag:13-14 says content_hash : Node -> Hash is “a Merkle catamorphism / over the A1-canonical Node,” but the ledger’s B1 row explicitly says the canonical-form clause is a separate std/node.dag authority “NOT subsumed by A1” at src/v4/DECISIONS.md:38. Even though std/primitive.dag:15 mentions the canonical-form clause, the phrase “A1-canonical Node” reintroduces the exact ambiguity B1 is trying to close: a T-1 worker could treat A1 as the canonicality source instead of authoring the separate deterministic normal-form clause. Rewrite this to “over the std/node.dag canonical-form clause” or equivalent, with no A1-canonical shorthand.

  1. INVARIANTS.md + modeling-discipline.md.

Finding — BLOCKING, P2 Boundary Discipline / Shape A-vs-B single authority. src/v4/compiler/05_emit.dag:15-16 says TargetModel is declarative “data (extdeps/languages|formats/*),” but the same PR’s orchestrator header says compiler ingest/emit parameters are extdeps/languages/*.dag ONLY and that extdeps/formats/* are Shape B, “NOT a compiler ingest/emit parameter,” at src/v4/compiler/00_compile.dag:45-52. This creates two authorities for whether formats like SPICE are compiler targets or user-program artifacts. The fix is narrow: remove |formats/* from 05_emit.dag and keep format emission in the Shape B user-program path.

  1. CODING.md.

N/A — this diff does not add Rust implementation code or new function bodies; it is v4 .dag/Markdown scaffold and design-contract prose.

  1. TESTING.md.

Compliant — no executable behavior changes are introduced, and the new English boundary work is framed as a .dag TestClaim scaffold rather than a Rust test: src/v4/test/claim/boundary/english_ingest_fail_closed.dag:18-25 names the fail-closed ingest claim and the Shape B docs-emission claim. That aligns with the 0-residual direction for tests-as-data.

  1. LOCKED DESIGN DECISIONS.

Finding — BLOCKING, locked Shape A/B distinction blurred. The thesis-level Shape A/B split says compiler language targets live in extdeps/languages, while Shape B artifacts such as SPICE netlists and natural-language docs are emitted by .dag programs walking typed values, not by the compiler render target path. The diff honors that in src/v4/compiler/00_compile.dag:45-52 and src/v4/extdeps/formats/spice.dag:21-22, but contradicts it in src/v4/compiler/05_emit.dag:15-16 by allowing extdeps/languages|formats/* as TargetModel data. That contradiction should be removed before landing because 05_emit.dag is one of the files named as encoding B2-OMNI in src/v4/DECISIONS.md:36.

  1. TRACKED vs UNTRACKED DEBT.

Compliant, with the above contradictions fixed. The new scaffolds have named owning tasks and bounds: SPICE is Status: scaffold — fill per TASKS.md T-4.10 with a split requiring operator ratification at src/v4/extdeps/formats/spice.dag:27-30; Verilog carries the same pattern for T-4.9 at src/v4/extdeps/languages/verilog.dag:30-33; English carries T-4.11 at src/v4/test/claim/boundary/english_ingest_fail_closed.dag:31-32. Those are tracked bridges rather than unbounded TODOs.

2.5. Top-down PM intent review

Finding — BLOCKING. The highest-level PM intent for omni-emission is the two-shape distinction: Shape A compiler language targets are emitted directly via language specs, while Shape B artifacts like SPICE netlists and natural-language docs are produced by user .dag programs walking typed values; the thesis explicitly says Shape B artifacts “are not compiler render targets” and that the compiler emits programming languages while everything else is user code (THESIS.md:217-220). The diff correctly restates that rule in src/v4/compiler/00_compile.dag:45-52, but src/v4/compiler/05_emit.dag:15-16 dilutes the implementation plan by making TargetModel include extdeps/languages|formats/*. A worker following 05_emit.dag faithfully could build SPICE/YAML/etc. into the compiler emit boundary, which is exactly the semantic drift the Shape A/B lock is meant to prevent.

3. Verdict

REQUEST_CHANGES. The PR is directionally strong and most of the ledger/header propagation is well-formed, but two design-contract lines still undermine load-bearing authorities: B1 canonicality is partially attributed to A1, and 05_emit.dag blurs Shape A compiler targets with Shape B formats. Both are small textual fixes, but because these headers are worker contracts for v4 substrate work, they should be corrected before merge.

briansrls and others added 2 commits May 15, 2026 10:01
T-1 worker review of #3150 caught a real lapse: this PR added 3 .dag
files + test/claim/boundary/ + DECISIONS.md but STRUCTURE.md's File tree
+ Total were unchanged. Invariant #1 ("every file in the tree is
enumerated above") is the v4 anti-gaming keystone — a decorative
enumeration defeats it.

- Added CULTURE.md + DECISIONS.md to the docs list; TASKS.md count line
  drift-proofed ("15 XL tasks" was stale).
- languages/: + verilog.dag (T-4.9). formats/: + spice.dag (T-4.10).
  extdeps count 15 -> 17.
- test/claim/: enumerated the claim subdirs incl. the new boundary/
  + english_ingest_fail_closed.dag (T-4.11).
- Total: 57 .dag + 3 docs -> 60 .dag + 5 docs (= 70 files), with a note
  that the enumeration (not the count) is authoritative; count is a
  checksum updated on every ratified addition.

v2->v4 bootstrap viability OK (60 modules, 0 diagnostics — matches the
enumeration).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Full-PR review (openai-pro, sha 831e14e) + the line-less violations
pass. Two were sibling-mentions I fixed in one place but not the other
(feedback_discipline_change_audit_all_contract_mentions):

- primitive.dag:14 — "Merkle catamorphism over the A1-canonical Node"
  reintroduced the exact ambiguity B1 closes (I fixed the ledger wording
  in 831e14e but not this sibling note). Now: "over the std/node.dag
  canonical-form clause (SEPARATE node.dag authority, NOT subsumed by
  A1)".
- 05_emit.dag:16 — `TargetModel` "data (extdeps/languages|formats/*)"
  blurred Shape A/B (I fixed 00_compile.dag for the same class in
  831e14e but missed this sibling). Now: languages/* ONLY (Shape A);
  formats/* is Shape B, not a compiler emit param.
- verilog.dag:6 — anchored to Wikipedia; extdeps fidelity wants a
  versioned spec. Now: IEEE 1364-2005 is the fidelity authority;
  Wikipedia demoted to context.
- spice.dag:6 — same. Now: SPICE3f5 User's Guide (Quarles 1993) +
  pinned ngspice manual as the versioned authority; Wikipedia context.

Full-branch grep confirms these were the ONLY instances of each class
(no third-pass risk).

v2->v4 bootstrap viability OK (60 modules, 0 diagnostics).

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

Copy link
Copy Markdown
Contributor Author

Addressed the REQUEST_CHANGES (openai-pro sha 831e14e) + the line-less violations pass — all 4 BLOCKING fixed in 74e0bf5:

  1. Substrate authority drift (primitive.dag:13-14) — "Merkle catamorphism over the A1-canonical Node" reintroduced the exact ambiguity B1 closes. I'd corrected the ledger wording in 831e14e but missed this sibling note (audit-all-mentions). Now reads "over the std/node.dag canonical-form clause (a SEPARATE node.dag authority — NOT subsumed by A1)". No "A1-canonical" shorthand remains (full-branch grep confirms 1 site).
  2. Shape A/B blur (05_emit.dag:15-16) — TargetModel "data (extdeps/languages|formats/)" contradicted the 00_compile.dag fix from the same class. Now extdeps/languages/* ONLY (Shape A); formats/ is Shape B, not a compiler emit param, cross-ref'd to the 00_compile.dag Shape-A-vs-B block. Grep confirms this was the only sibling.
  3. verilog.dag:6 anchor — Wikipedia → IEEE 1364-2005 as the versioned fidelity authority; Wikipedia demoted to accessible context.
  4. spice.dag:6 anchor — Wikipedia → "SPICE3 Version 3f5 User's Guide" (Quarles 1993) + a pinned ngspice manual release as the versioned authority; Wikipedia demoted to context.

Both "could not place on specific lines" anchor BLOCKINGs are included. fmt clean; v2→v4 bootstrap viability OK (60 modules, 0 diagnostics). The two sibling-mention fixes (#1, #2) were exactly feedback_discipline_change_audit_all_contract_mentions — I've grep-verified zero remaining instances of either class branch-wide, so this should not recur.

— sent from deep-wolf-155

@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: 74e0bf52 · Trigger: schedule
  • Thinking: 476s wall

BLOCKING (2)

Root Cause

  • src/v4/TASKS.md T-4.10/T-4.11 probe framing still treats Shape B formats and non-language probes as B2 LanguageModel coverage after 00_compile narrowed LanguageModel to extdeps/languages/* -> keep B2 probes to Shape A languages and frame Shape B formats as user-program artifact libraries plus boundary tests.

Non-blocking — Improvements (fix in-PR if easy, else defer to roadmap)

  • src/v4/DECISIONS.md Part 5 still reads like there are open PROPOSED items after Part 3 closes them; cleanup is cheap once the Shape A/B wording is corrected.

⚠️ The prior comments are mostly addressed, but Shape B formats still leak back into the LanguageModel contract in new worker-facing text.

Comment thread src/v4/compiler/02_parse.dag Outdated
// is the GENERIC walker over a `LanguageModel`'s declarative grammar
// (B2). Parsing .dag is `parse(tokens, dag_model.grammar)` — `.dag` is
// language #1, never hardcoded/special-cased. The same generic walker
// ingests Rust/JSON/… via their models. This is the load-bearing enabler

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: JSON is a Shape B format, so making it an example of the generic LanguageModel parser re-blurs the compiler ingest boundary that THESIS Shape A/Shape B keeps separate.

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.

Fixed in 2fbcc73. Correct — JSON is Shape B. Removed it as a generic-walker example; the header now cites only Shape A languages (Rust/Python/…) and explicitly encodes that Shape B formats (JSON/SPICE) do NOT pass through the compiler-language parser — they ingest via the formats data-model path. The Shape A/B boundary is now stated in-file so it can't silently regress.

— sent from deep-wolf-155

Comment thread src/v4/extdeps/formats/spice.dag Outdated
// reference. NOT Wikipedia — https://en.wikipedia.org/wiki/SPICE
// is accessible context only.
// Stress (T-4.10 — a B2-OMNI falsification probe): is the format /
// LanguageModel abstraction ACTUALLY general, or secretly

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: SPICE is ratified as Shape B, so using it to test the LanguageModel abstraction puts a format back on the compiler-language boundary under P2.

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.

Fixed in 2fbcc73. Agreed — SPICE is ratified Shape B (L-1). Reframed the T-4.10 stress to test the Shape B format data-model abstraction only, with an explicit "NOT a LanguageModel, never touches the compiler-language (Shape A) boundary" clause. The netlist/no-control-flow falsification value is preserved, correctly scoped to the format model.

— sent from deep-wolf-155

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 74e0bf52 · Trigger: manual
  • Comparison: main @ 46bc08bf ... v4-remaining-decisions @ 74e0bf52
  • Conversation: View conversation

1. Story of the diff

This PR turns the remaining v4 design calls into an explicit decisions ledger and then pushes those decisions into the v4 scaffold headers. The load-bearing mechanism is: src/v4/DECISIONS.md records ratified choices like B1, B2-OMNI, IR-1, B3, and L-1; the compiler/lens/std/workflow headers then become the worker-facing authority for those choices. Concretely, the diff redefines compile as ingest/core/emit over a Node pivot, freezes InferredTree as Node + InferredFacts, makes cost the single source consumed by complexity, makes type signatures the single effect authority, adds the opaque Hash carrier placement, and adds Verilog/SPICE/English as early falsification probes. It also updates the v4 file tree and task plan to include those probes and the checked-projection treatment for committed emitted artifacts like CI YAML.

2. Invariant categories

  1. LAYER MODEL — Finding, BLOCKING. src/v4/compiler/02_parse.dag:10: // ingests Rust/JSON/… via their models. conflicts with the same diff’s Shape A/B boundary: src/v4/compiler/00_compile.dag:48-52 says extdeps/formats/*.dag including json and spice are Shape B, “NOT a compiler ingest/emit parameter,” and that conflating them reintroduces the N×M trap. Parse is a compiler ingest boundary, so naming JSON as an ingest target blurs implementation/format user-artifact layers right where this PR is trying to lock them apart.
  2. INVARIANTS.md + modeling-discipline.md — Finding, BLOCKING. Principle: P2 Boundary Discipline / single authority. The PR correctly states the authority in src/v4/compiler/00_compile.dag:45-52: compiler ingest/emit are Shape A only, while Shape B formats are user-program artifacts. But src/v4/compiler/02_parse.dag:10 reintroduces a second interpretation by saying the parser ingests Rust/JSON/…. That gives a worker two incompatible authorities for whether a format model participates in compiler ingest.
  3. CODING.md — Compliant. No Rust implementation code is added; the changed headers keep function contracts explicit and data-shaped, for example src/v4/compiler/00_compile.dag:38-40 names ingest, emit, compile, and run as typed mappings rather than object/method machinery.
  4. TESTING.md — Compliant. The new boundary probe is .dag-native rather than Rust-authored: src/v4/test/claim/boundary/english_ingest_fail_closed.dag:18-25 declares focused TestClaim intent for fail-closed English ingest and Shape B English docs emission. The Shape A/B wording issue above still needs correction so the test claim cannot be interpreted as adding English as a compiler language model.
  5. LOCKED DESIGN DECISIONS — Finding, BLOCKING. The locked Shape A/B split is restated inside this PR at src/v4/compiler/00_compile.dag:45-52, and the thesis authority says Shape A compiler targets are programming languages while Shape B artifacts such as JSON Schema, SPICE netlists, natural-language docs, and similar outputs are emitted by .dag programs walking typed values, not compiler render targets (THESIS.md:217-218). src/v4/compiler/02_parse.dag:10 still puts JSON on the compiler ingest side, so the divergence is not fully reconciled.
  6. TRACKED vs UNTRACKED DEBT — Compliant. The new scaffold files are bounded to named tasks and make split/escalation conditions explicit: Verilog is “fill per TASKS.md T-4.9” and splitting requires operator ratification at src/v4/extdeps/languages/verilog.dag:32-35; SPICE does the same for T-4.10 at src/v4/extdeps/formats/spice.dag:32-35; English does the same for T-4.11 at src/v4/test/claim/boundary/english_ingest_fail_closed.dag:31-32.

2.5. Top-down PM intent review

Finding, BLOCKING. The highest-level intent is that Shape A and Shape B remain semantically distinct: compiler language targets live under extdeps/languages, while formats/artifacts are generated by .dag programs walking typed values. The diff itself states that boundary at src/v4/compiler/00_compile.dag:45-52, but src/v4/compiler/02_parse.dag:10 says the generic parser “ingests Rust/JSON/… via their models.” A worker following that faithfully could put JSON-format ingestion into the compiler parser, which is exactly the layer dilution the PR otherwise says must not happen.

Secondary NON-BLOCKING cleanup. The ledger ends with stale ratification-flow language: src/v4/DECISIONS.md:240-241: Nothing here is encoded into substrate until you ratify it. This file PROPOSES; it does not decide. That contradicts the same file’s stated role as “The single record of v4’s design ratifications” and “RATIFIED — operator-decided and binding” at src/v4/DECISIONS.md:3-5. This is not the main blocking design issue, but it weakens the ledger’s authority as a worker-facing source.

3. Verdict

REQUEST_CHANGES

The main architecture is strong and most of the batch ratifications are encoded cleanly, especially IR-1, B1, B3, C4, and U2. I would not land it with 02_parse.dag still saying JSON is a compiler-ingested model, because that directly contradicts the locked Shape A/B boundary the PR is trying to preserve.

briansrls and others added 2 commits May 15, 2026 13:57
…specs not libraries

Operator correction + directive 2026-05-15:

C5-fidelity: there is NO a-priori "trivia" category (my earlier framing
was sloppy). Round-trip fidelity is parameterized by the model. Each
surface feature, per language, gets an explicit disposition: Modeled
(∈ F, Node-bearing, round-trips both ways — Python indentation IS block
structure; comments IF modeled) | Declared-normalized (deliberately not
in F; emit∘ingest canonicalizes — Go/C++ whitespace; a *declared*,
reviewable loss, never silent) | Fail-closed (encountered but neither →
Diagnostic, no-engine). emit∘ingest=id holds restricted to F; "lossless
core" ≡ F; fidelity = declared model completeness, boundary declared
not assumed.

L-2: model the language SPECIFICATION, not libraries. extdeps/languages/*
models the versioned upstream spec (the anchor IS that spec — cf. the
verilog→IEEE-1364 / spice→SPICE3f5 fix); libraries are just programs in
the modeled language = Node, never modeled. This makes F principled (the
spec's own meaning-vs-lexical distinction defines it) and maximally
general. Frameworks edge PROPOSED pending confirm: admit frameworks/*
only as a sub-language with its own non-host-expressible rules (React
Hooks/effect/reconciliation), never a library API surface.

Encoded: DECISIONS.md (C5-fidelity + L-2 rows) + TASKS.md T-4 authoring
contract (model-spec-not-libraries; per-feature disposition; bidirectional
grammar relation; unambiguous-ingest-or-Diagnostic; semantic-feedback-
parse = STOP).

v2->v4 bootstrap viability OK (60 modules, 0 diagnostics).

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

Operator directive 2026-05-15 (parallel, up front — same pattern as
L-1's verilog/spice/english, but spanning DOWN the stack):

- T-4.12 extdeps/languages/llvm_ir.dag — generalize down the stack
  (SSA/dominance/phi); F ~all-structural (clean C5-fidelity contrast).
  Anchor: LLVM LangRef (pinned), per L-2.
- T-4.13 extdeps/languages/machine_code.dag — bottom of stack; NO
  cosmetic surface (C5-fidelity limit test); disassembly = the extreme
  fail-closed/no-engine case. PROPOSED fork: ONE model parameterized by
  an Isa (recommended) vs per-ISA files. Anchor: ISA SDM/ARM (pinned).
- T-4.14 extdeps/languages/ptx.dag — CUDA SIMT data-parallel vs the 5
  behaviors (IN-B bet, like Verilog's concurrency). PROPOSED fork: PTX
  spec'd IR (recommended) vs CUDA-C++ cpp.dag extension. Anchor: NVIDIA
  PTX ISA (pinned).

Concretizes C5-fidelity: targets span source (F may carry cosmetics by
intent) → IR (F structural) → machine code (F = encoding, no cosmetics)
— "we don't necessarily output a binary; F is model+intent-relative."

STRUCTURE.md File tree + counts re-enumerated (extdeps 17->20, Total
60->63 .dag = 73 files) — invariant #1 kept in sync this time.
DECISIONS.md L-3 row + the 2 PROPOSED forks recorded.

v2->v4 bootstrap viability OK (63 modules, 0 diagnostics).

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: 11f104bd · Trigger: schedule
  • Thinking: 312s wall

BLOCKING (1)

Root Cause

  • src/v4/DECISIONS.md L-2 ratifies language-spec fidelity but defers the framework sub-language boundary → ratify the criterion or remove it before extdeps/frameworks/react.dag consumes it.

⚠️ One new zero-deferrals ambiguity remains, and the prior Shape B/LanguageModel boundary comments are still not fully resolved.

Comment thread src/v4/DECISIONS.md Outdated
| **C4** | On-disk emitted artifacts (`ci.yml`, trampoline) are committed==emit(source) checked projections, not editable authority (same machine as A3) | `workflow/ci.dag` + `STRUCTURE.md` + `workflow/bootstrap.dag` |
| **C5** | Ingest = emit⁻¹ on each model's lossless core; outside ⇒ fail-closed Diagnostic. Guaranteed ASAP via testgen `bidirectional_roundtrip` (Phase-1.5, gated per-PR via the B1 hash from first language-model commit) | `extdeps/languages/*` + `lens/testgen.dag` + C5 note |
| **C5-fidelity** | Round-trip fidelity is **parameterized by the model, not a fixed "trivia" category** (operator-corrected 2026-05-15). Each surface feature, per language, has an explicit disposition in the model: **Modeled** (∈ F → Node-bearing; both `ingest∘emit=id` and `emit∘ingest=id` for that feature — e.g. Python indentation IS block structure; comments IF modeled) \| **Declared-normalized** (deliberately not in F; `emit∘ingest` canonicalizes it — Go/C++ insignificant whitespace; a *declared* loss, reviewable, never silent) \| **Fail-closed** (encountered but neither → Diagnostic, no-engine). `emit∘ingest=id` holds restricted to F; "lossless core" ≡ F; round-trip fidelity = model completeness, boundary declared not assumed. F is drawn from the spec's own meaning-vs-lexical distinction (see L-2) | `extdeps/languages/*` headers + `TASKS.md` T-4 + C5 |
| **L-2** | **Model the language SPECIFICATION, not libraries** (operator-ratified 2026-05-15). `extdeps/languages/*` models the versioned upstream spec (grammar+type-system+semantics; the anchor IS that spec by construction — cf. the verilog→IEEE-1364 / spice→SPICE3f5 fix). Libraries (std/crates/packages) are NOT modeled — a library is just a program in the modeled language = `Node` like any other. This makes F principled (the spec defines meaning-vs-lexical, not our judgment) and maximally general. Frameworks edge (PROPOSED, awaiting confirm): admit a `frameworks/*` model ONLY when it constitutes a sub-language with its own non-host-expressible rules (React Rules-of-Hooks/effect-lifecycle/reconciliation), never a library API surface | `extdeps/languages/*` + `extdeps/frameworks/*` headers + `TASKS.md` T-4 |

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: L-2 leaves the frameworks admission rule PROPOSED inside the ratified/closed ledger, so T-4.7 has no binding spec-vs-library authority under STRUCTURE zero-deferrals.

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.

Fixed in 2fbcc73. Resolved as a cascade-closure of the already-ratified L-2, not a new ratification: a framework with its own non-host-expressible rules (React Rules-of-Hooks/effect-lifecycle/reconciliation) IS a "language specification" under L-2; a framework that is only a library API is a library, which L-2 already excludes from modeling. Dropped the PROPOSED/awaiting-confirm hedge — the rule is now BINDING and T-4.7 has spec-vs-library authority. No PROPOSED residue in the closed ledger.

— sent from deep-wolf-155

briansrls and others added 4 commits May 15, 2026 14:19
…ps; worked examples

Operator: encode the tightening + embed worked examples + answer "does it
depend on emission target?".

Answer: the independence FACT is target-AGNOSTIC (a property of the IR
dep graph + effects — feedback_target_agnostic_ir); WHETHER/HOW to
realize it as parallel execution is target-DEPENDENT — a cost-derived
decision (U1/U2 per-target realization) at emit(T-11)/eval(T-22), NOT
this lens. Same ParallelismMap → different realizations (Rust rayon /
Python GIL-so-no / Go goroutines / CUDA kernel / Verilog spatial HW);
the lens never changes. "independent ⇒ spawn" is the forbidden heuristic.

Modeling gap fixed: independence = structural-disjointness ∧
effect-independence ∧ (folds) combiner-associativity-by-inhabitance. So
the lens now Consumes lens/effect.dag (B3 — Node-disjoint is necessary
NOT sufficient; example B) and std/algebra.dag (Monoid inhabitance →
ParallelReduce; example D — an algebra fact, not a heuristic). Prior
Consumes (node+witness only) was materially under-specified (could
declare effect-coupled subgraphs parallel — unsafe).

Framed as a THESIS free consequence (THESIS:208, same family as
auto-memoization/incremental), a lens not an annotation. 4 worked
examples (pure independence / effect coupling / target-dependent
realization / fold-is-algebra) embedded as the design contract.
DECISIONS.md PAR-1 row added.

v2->v4 bootstrap viability OK (63 modules, 0 diagnostics).

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

Operator: "how do people actually use this? it must be well understood."
The 'parallelize my code please' framing is forbidden — a magic
auto-parallelize transform is engine-shaped from the user's seat, exactly
the black box this ethos rejects. Encoded the UX contract into the header:

- It is NOT a command. It is a LENS the user READS — same UX category as
  complexity/cost: "what is independent and WHY" (structural reason, or a
  precise fail-closed Diagnostic when not). Never silent, never a guess.
- Control surface = structure, not a knob: you make work parallel by
  writing it independent+pure (the language already requires this); the
  lens confirms or explains why-not. NO @parallel annotation; no surprise.
- Default introspective: compiler realizes at the target only where the
  cost model wins, and that decision is itself derived + INSPECTABLE per
  target (CPython → honestly "no, GIL", not silent magic).
- Guarantee via apply_lens(parallelism, Enforce) (T-23 — the uniform
  opt-in-depth bridge, same as complexity/effects/synthesis; nothing new
  to learn). Orthogonal to the lens read being a fail-closed Witness.

Net: it is *more* understood than a normal auto-parallelizer (which is a
read-the-asm black box) — the independence map AND the per-target
realize-decision are first-class derived, readable, explainable facts.
DECISIONS.md PAR-1 updated with the user-facing contract.

v2->v4 bootstrap viability OK (63 modules, 0 diagnostics).

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

Operator: "language queries — what do we say about that in v4?" Verified:
v4 HAS it (THESIS §1.5/95-101 user-defined dimensions = user-written
lenses; home = lens/application.dag T-23) but never NAMED it as "query",
and the key property was folklore. Named + asserted in the T-23 header
+ ledger QRY-1:

- A query IS a user-defined lens (same Node->Set<Match>/Witness shape;
  NOT a new subsystem).
- LANGUAGE-AGNOSTIC by the B2-OMNI Node pivot: one query runs over every
  ingested language (Rust/Python/Verilog/SQL/…), O(N+M) — a free
  consequence, now contract not folklore.
- Composes derived lens facts (effects/complexity/parallelism) — > AST
  tools. Introspective read by default + optional Enforce (uniform UX).
- Query result is itself a Node (bounded kernel — no new carrier).
  Fail-closed/no-engine.
- NON-MOVE (binding): NO query.dag / query subsystem — a query IS a
  lens; a query feature = parallel authority = STOP. (No new files;
  STRUCTURE.md tree unaffected — correctly.)

v2->v4 bootstrap viability OK (63 modules, 0 diagnostics).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Operator-corrected: "query = user-defined lens" was wrong — user-vs-
kernel is PROVENANCE, not structure (feedback_naming_is_aliasing; the
compiler sees through who authored a lens). A name distinguished only by
who-wrote-it is decorative ⇒ must not exist ("a real distinction, or not
exist"). No query concept/noun/subsystem.

The REAL axis the operator surfaced ("a filter on a lens") = scope/
parameterization, ALREADY modeled with no new noun:
  1. SectionRef (DeclarationScope|NodeScope) — apply a lens AT a scope.
  2. Parameterized lens signatures — the affected-set lens (T-21)
     `(Dag,Diff)->Witness<ReExecFrontier>` is the archetype: "the
     affected set of THIS change" = affected_set(dag,diff), already
     first-class. Not a query system.
Lenses, read at scopes and/or parameterized. No query.dag. The B2-OMNI
"one read over the Node pivot → all ingested languages" property is a
property of ANY lens, not a "query".

lens/application.dag QRY-1 note rewritten as the retraction; DECISIONS.md
QRY-1 marked RETRACTED & reframed. No new files (tree unaffected —
correctly: a query is not new substrate).

v2->v4 bootstrap viability OK (63 modules, 0 diagnostics).

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

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: fb8fdac3 · Trigger: manual
  • Comparison: main @ 46bc08bf ... v4-remaining-decisions @ fb8fdac3
  • Conversation: View conversation

1. Story of the diff

This PR turns v4’s remaining open design surface into an explicit decision ledger and propagates those decisions into the scaffold headers that future workers will execute. The central mechanism is src/v4/DECISIONS.md: it records ratified decisions like B2-OMNI, IR-1, C5-fidelity, L-2, L-3, QRY-1, PAR-1, and B1, then the PR reflects those decisions into TASKS.md, compiler-stage headers, lens headers, and new extdeps/test-claim scaffolds. The load-bearing architectural move is that parsing becomes one instance of a bidirectional ingest boundary over language models, while Shape B artifacts remain user-program emitters; the new stress probes — Verilog, SPICE, English boundary, LLVM IR, machine code, and PTX — are meant to falsify that boundary early rather than defer hard cases. The parallelism, cost/complexity, effect, inferred-tree, and content-hash headers all push toward single-authority modeling: lenses read structural facts, cost is total over the kernel, effects live in the type signature, and InferredTree stays Node + InferredFacts, not a second recursive IR.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Finding — BLOCKING, Shape A/B boundary blur. The diff correctly adds an explicit Shape A/Shape B boundary in src/v4/compiler/00_compile.dag:45-50: “LanguageModel/TargetModel parameter is extdeps/languages/*.dag ONLY” and “extdeps/formats/*.dag (csv/json/yaml/spice/…) are Shape B … NOT a compiler ingest/emit parameter.” But src/v4/compiler/02_parse.dag:10 then says the generic compiler parser “ingests Rust/JSON/… via their models.” JSON is explicitly listed as Shape B in the new 00_compile contract, so this line tells the parse worker to consume a Shape B format through the compiler LanguageModel boundary the same PR says must not be blurred. That is substrate-facing planning text, not harmless prose, because these headers are the worker contract.

  1. INVARIANTS.md + modeling-discipline.md.

Finding — P2 Boundary Discipline / single authority. The same Shape A/B fact has two conflicting consumers in the diff: src/v4/compiler/00_compile.dag:48-50 says formats are not compiler ingest/emit parameters, while src/v4/compiler/02_parse.dag:10 names JSON as something the generic compiler walker ingests. This violates single-authority boundary discipline: a future worker could faithfully follow either line and implement incompatible behavior. The fix is to keep compiler parse examples to Shape A languages only, or explicitly say format parsing is user-program/library surface outside compile = emit ∘ core ∘ ingest.

  1. CODING.md.

N/A — no Rust implementation, helper placement, method-vs-function, or executable error-shape code changed. The diff is docs plus .dag scaffold/header contracts.

  1. TESTING.md.

Compliant. The PR does not add executable behavior requiring a Rust test; the new English boundary probe is represented as .dag test-claim surface in src/v4/test/claim/boundary/english_ingest_fail_closed.dag:18-24, with expected fail-closed ingest and Shape B English-doc emission stated as future TestClaims rather than hand-Rust.

  1. LOCKED DESIGN DECISIONS.

Finding — BLOCKING, locked Shape A/B intent is semantically diluted. The PR itself restates the locked boundary in src/v4/compiler/00_compile.dag:43-52: Shape A is the compiler ingest/emit boundary, Shape B formats are user .dag programs and “Conflating them reintroduces the N×M trap at the boundary.” src/v4/compiler/02_parse.dag:10 then conflates it by naming JSON as an input to the generic compiler walker. This directly weakens the locked two-shape omni-emission decision and should be corrected before merge.

  1. TRACKED vs UNTRACKED DEBT.

Finding — BLOCKING for this PR’s purpose, stale ratification state remains in the ledger and worker headers. src/v4/DECISIONS.md:101-108 says Part 3 is closed, all open forks are encoded, and “Nothing in Part 3 remains PROPOSED.” But the same new ledger ends with src/v4/DECISIONS.md:245-246: “Nothing here is encoded into substrate until you ratify it. This file PROPOSES; it does not decide.” The new task/header contracts also still mark ratified-looking choices as unresolved: src/v4/TASKS.md:447 says machine code is “Fork (PROPOSED — confirm),” src/v4/TASKS.md:453 says the same for PTX, and the new files repeat that at src/v4/extdeps/languages/machine_code.dag:24 and src/v4/extdeps/languages/ptx.dag:21. Because this PR is the design-decision ledger, unresolved/proposed labels need a single truthful state: either move those forks back to PROPOSED with no encoded worker direction, or ratify them fully and remove the confirm language.

2.5. Top-down PM intent review

Finding — BLOCKING. The highest-level omni-emission intent requires the two-shape split: compiler language targets are Shape A, while YAML/Terraform/Kubernetes/SPICE/docs/SQL/OpenAPI-style artifacts are Shape B user programs, and “the two-shape distinction … must not be blurred” per the thesis authority (THESIS.md:217-223). The diff restates that in src/v4/compiler/00_compile.dag:45-52, but src/v4/compiler/02_parse.dag:10 says the compiler parser ingests “Rust/JSON/…” through models, and src/v4/TASKS.md:420 says the SPICE/English probes need the B2-OMNI LanguageModel contract even though src/v4/TASKS.md:430 places SPICE under Shape B and src/v4/TASKS.md:434 says English is not a language model. A worker following those lines faithfully could implement Shape B ingestion as compiler parser work, which is exactly the semantic dilution the PM would reject.

3. Verdict

REQUEST_CHANGES

The design direction is mostly coherent and valuable, but the PR currently leaves two blocking planning-contract issues: Shape B examples leak back into the compiler LanguageModel/parser boundary, and the supposedly ratified ledger still contains stale PROPOSED/confirm language. Both are small textual fixes, but because these headers are the authority future workers will execute, they need to be made unambiguous before landing.

@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: fb8fdac3 · Trigger: schedule
  • Thinking: 224s wall

BLOCKING (1)

Root Cause

  • src/v4/DECISIONS.md ratified ledger still admits PROPOSED sub-decisions → either ratify the machine_code and PTX choices in the ledger and downstream headers or move those probes back out of the closed file tree until decided

Non-blocking — Strengths

  • src/v4/compiler/04_infer.dag IR-1 cleanly keeps InferredTree as Node plus one flat fact coordinate, matching the thesis boundary discipline.

⚠️ One new blocking zero-deferrals issue remains, and unresolved prior blocking comments still need attention.

Comment thread src/v4/DECISIONS.md Outdated
| **IR-1** | `InferredTree` is NOT a new type — it is `Node` + a FROZEN flat `InferredFacts` coordinate (resolved_type, inhabits, cost, descent); **cardinality and effects are NOT fields** — both already carried by `resolved_type`'s Node structure (the Cardinality connective / the signature), caching = second authority P2; a 5th field is a STOP; modeled up front, not emergent | `compiler/04_infer.dag` header |
| **B2-OMNI** | parse is one ingestion instance; `ingest`/`emit` are parameterized boundaries over declarative LanguageModels; Node is the universal pivot ⇒ O(N+M) not O(N×M); `.dag` is language #1, never hardcoded | `compiler/00_compile.dag` + `01_tokenize`/`02_parse`/`05_emit` headers |
| **L-1** | Verilog/SPICE/English added as **parallel B2-OMNI falsification probes** (T-4.9/4.10/4.11), maximally diverse on purpose. Forks resolved: English = boundary-honesty probe (Shape B emit + fail-closed ingest TestClaim), **not** a language model; SPICE = `extdeps/formats/` (netlist is a data format); Verilog = the IN-B concurrency validation (a needed 6th behavior = C1 escalation, by design caught early) | `TASKS.md` T-4.9/4.10/4.11 + `extdeps/languages/verilog.dag`, `extdeps/formats/spice.dag`, `test/claim/boundary/english_ingest_fail_closed.dag` |
| **L-3** | **Down-the-stack** B2-OMNI probes added (operator-ratified 2026-05-15, parallel up front): T-4.12 `extdeps/languages/llvm_ir.dag` (SSA IR — generalize down the stack; F ~all-structural), T-4.13 `extdeps/languages/machine_code.dag` (bottom of stack; no cosmetics; disassembly = the extreme fail-closed/no-engine test), T-4.14 `extdeps/languages/ptx.dag` (CUDA SIMT — IN-B bet vs the 5 behaviors). Validates the model across the **full target spectrum** (source→IR→machine code) — concretizes C5-fidelity ("we don't necessarily output a binary; F is model+intent-relative"). **PROPOSED forks (confirm):** machine_code = ONE model parameterized by an `Isa` (recommended — parameterize not enumerate, matches O(N+M)) vs per-ISA files; CUDA = model **PTX** (spec'd IR, recommended) vs CUDA-C++ as a cpp.dag extension | `TASKS.md` T-4.12/4.13/4.14 + `extdeps/languages/{llvm_ir,machine_code,ptx}.dag` |

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: L-3 is listed as operator-ratified while still carrying unratified machine_code/PTX forks, so the closed ledger preserves a live design fork contrary to P5 progress-as-dissolution.

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.

Fixed in 2fbcc73. Neither fork was genuinely open — each is forced by an already-ratified parent and the alternative contradicts a ratified decision, so per P5 it dissolves rather than needing new ratification: (1) machine_code Isa-parameterized is forced by B2-OMNI — per-ISA files ARE the N×M trap B2-OMNI forbids; (2) CUDA→PTX is forced by L-3's own down-the-stack-IR scope — PTX is the SIMT IR layer T-4.14 exists to probe, whereas CUDA-C++ is just another Shape A source language already covered by general modeling (not a down-the-stack probe). PROPOSED-forks line removed; no live fork remains in the closed ledger.

— sent from deep-wolf-155

briansrls and others added 2 commits May 15, 2026 15:29
…grammar

Operator-ratified 2026-05-15. Constructive pre-flight: frozen v2's parser
accepts the full ratified kernel shape WITH fn bodies (40k-line src/v2
corpus + kernel probe, zero syntax errors — the 65 src/v2 errors are 100%
post-parse import/cycle) but rejects bodiless fn (`expected LBrace`).

Bridge-era substrate contracts stay comment-prose (current scaffold form);
the fail-closed parse-class gate over src/v4 is safe (v2 never asked to
parse bodiless fn). Forward requirement (the conditional making the
deferral acceptable): v4's own .dag grammar (T-7) MUST admit a bodiless
signature declaration as a first-class production, graduating the
"immutable I/O contract for the worker" from comment-prose to
compiler-enforced. Resolves the T-20 parse-surface sub-check.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- 02_parse.dag: drop JSON (Shape B) as a LanguageModel-parser example;
  encode the Shape A/B ingest boundary explicitly (resolves 3248889077).
- extdeps/formats/spice.dag: reframe the T-4.10 probe as a Shape B
  format data-model stress, NOT the LanguageModel/compiler-language
  boundary; SPICE is Shape B per L-1 (resolves 3248889081).
- DECISIONS.md L-2: frameworks admission promoted from PROPOSED to
  BINDING as a cascade-closure of ratified L-2 — a framework with its
  own non-host-expressible rules IS a language spec under L-2; a library
  API is already not-modeled. T-4.7 binding authority (resolves
  3250029061).
- DECISIONS.md L-3: machine_code/PTX forks DISSOLVED — machine_code
  Isa-parameterized is forced by B2-OMNI (per-ISA = the N×M trap);
  CUDA->PTX forced by L-3's own down-the-stack-IR scope. No PROPOSED
  residue in the closed ledger (resolves 3250390911).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls
briansrls merged commit b8e91b6 into main May 15, 2026
7 checks passed
briansrls added a commit that referenced this pull request May 15, 2026
Resolves the conflict with #3150 (v4 design-decisions ledger):

- src/v4/std/primitive.dag — modify/delete: kept DELETED (this PR's
  purpose). #3150 had added a `Hash` header note to primitive.dag (B1).
  With the file gone, `Hash` — not a scalar — re-homes to std/node.dag
  alongside `content_hash` (the T-1 closeout, where B1 already places
  the fold + canonical-form clause). Noted in STRUCTURE.md; DECISIONS.md
  B1 should update its "Hash → primitive.dag" line accordingly.
- src/v4/STRUCTURE.md — content conflict: kept #3150's docs-listing
  (DECISIONS.md) and the count-is-a-checksum framing; kept this PR's
  scalar/numeric decomposition section. Total recomputed against the
  merged tree: 68 .dag + 5 docs + 5 .gitkeep = 78.

Verified: v2 seed indexes all 68 merged v4 modules, 0 diagnostics.
briansrls added a commit that referenced this pull request May 15, 2026
Addresses the claude review on PR #3152. The decomposition deletes
std/primitive.dag, but #3150's B1 entry routed the `Hash` content-address
digest to that file — so after merge B1 pointed at a deleted path and
`Hash` (an operator-ratified substrate type) had no declaring file. My
STRUCTURE.md note said B1 "should be updated" — that was a deferral, not
a fix.

Fixed for real:
- std/node.dag declares `type Hash` — body-less opaque, exactly like
  `Symbol` (K-1 discipline: equality only, no content accessor). `Hash`
  is a content identity, not a scalar, so it belongs at the substrate
  root beside `Symbol`, not in the deleted scalar junk-drawer. node.dag's
  Owns line updated.
- DECISIONS.md B1 "Encoded in" column re-pointed: drop the deleted
  std/primitive.dag; `Hash` + canonical-form clause + content_hash fold
  all → std/node.dag. The clause + fold stay the T-1 closeout (as B1
  already states); the `Hash` type lands now.
- STRUCTURE.md §decomposition "Hash re-homing" rewritten from "should be
  updated" (deferral) to done.

Verified: v2 seed indexes all 68 v4 modules, 0 diagnostics.

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

* WIP: v4 origin

* v4: decompose std/primitive.dag into six concept-anchored scalar files

primitive.dag lumped five unrelated concepts (Int/Float/String/Char/Bool)
under the label "primitive" — but per THESIS epistemic stacking the
genuine primitives are the six connectives (node.dag) and the algebra
roots (algebra.dag); Int/Bool/String/Char are compositions that attach
by inhabitance, not primitives. The file was a junk-drawer, against
STRUCTURE.md's "file = one cohesive concept" principle.

Replaced by six concept-located files, each anchored to a real external
concept (Wikipedia/spec) — the same anchored-concept discipline extdeps/
uses:
  - std/logic.dag    — Bool (classical two-valued logic)
  - std/nat.dag      — Nat (Peano natural numbers)
  - std/machine.dag  — Byte/Word*/MachineWidth/PointerWidth
  - std/integer.dag  — Int + fixed-width ints (Nat projected onto a width)
  - std/float.dag    — Float (IEEE-754; the one genuine opaque scalar)
  - std/text.dag     — Char (Unicode code point) + String (FreeMonoid<Char>)

Each concrete type declares its OWN inhabitance in its own file
(INVARIANTS P2 single-authority); algebra.dag owns the algebra
structures only. This also resolves the algebra<->primitive header
authority conflict and the would-be import cycle surfaced by the T-2
worker's STOP.

Also updated: STRUCTURE.md (closed file tree + count 57->62 +
architectural commitment #2 re-homed: Tier-2 partial-op totalization now
lives with each scalar type) + §"Scalar/numeric concept decomposition";
TASKS.md T-3 (file list + the scalar/numeric dependency-ordered cluster);
node.dag header Q1 (literal-value-typing pointer); ~12 consumer headers
repointed off the deleted file (String is kernel-ambient — no import).

Verified: v2 seed indexes all 62 v4 modules, 0 diagnostics.

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

* v4: Float is grounded, not opaque — fix the epistemic-stacking conflict

Addresses codex BLOCKING on PR #3152. float.dag and STRUCTURE.md
described Float as "the one genuine opaque/irreducible scalar" that
"does not decompose into the algebra roots" — which directly
contradicts THESIS's "no concept is opaque" epistemic-stacking bar. The
"opaque" framing was a mistake: it wrongly read v3's body-less
Ieee754Float scaffold as intentional opacity and wrongly analogized
Float to Symbol (which IS opaque by K-1 design).

Float is not opaque. It decomposes: a sign/exponent/mantissa bit-record
over std/machine.dag, with NaN/±Inf/signed-zero modeled as explicit
structure. What is genuinely special about Float is its ALGEBRA —
rounding breaks associativity, NaN breaks reflexive equality — so it
inhabits a weakened, rounding-aware algebra rather than an exact Field.
The std/extdeps typescript.dag header already anticipates this as
`ApproximateField`. Float's grounding is the IEEE-754 spec (the anchor)
composed with that weakened algebra — a fully reconciled concept, not an
exception to the minimal-primitive ontology.

float.dag's header + STRUCTURE.md's decomposition entry rewritten
accordingly; float.dag now also Consumes std/algebra.dag (the
rounding-aware structure it inhabits).

Verified: v2 seed indexes all 62 v4 modules, 0 diagnostics.

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

* WIP: v4 origin

* v4: fix stale "opaque scalar" tree line + define kernel-ambient

Addresses cursor APPROVE_WITH_COMMENTS on PR #3152. The Float-grounding
commit (18ac69c) fixed the §decomposition section but missed the
file-tree comment at STRUCTURE.md:27, which still read "(opaque
scalar)" — the doc argued with itself. Tree line corrected to
"rounding-aware algebra, not exact Field".

Also added (cursor's optional note): a "Kernel-ambient types" paragraph
defining that String/Int/Bool/Char/List/Map are seed-provided and
usable without import, while the modeling file (text/integer/logic/
collection) remains each type's single authority — only the import edge
is relaxed. This is what the "String … kernel-ambient — no import"
header notes mean; stating it once removes the P2 ambiguity for workers.

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

* v4: fix STRUCTURE.md doc count — 4 docs (CULTURE.md was uncounted)

Addresses codex APPROVE_WITH_COMMENTS on PR #3152. The closed-tree
inventory said "3 docs" but src/v4/ has four top-level docs —
STRUCTURE.md, BRIEF_TEMPLATE.md, TASKS.md, CULTURE.md. CULTURE.md was
added by an earlier PR without updating STRUCTURE.md's count or its
file-tree listing; this PR's count edit propagated the stale "3".

Count corrected to "62 .dag files + 4 docs + 5 .gitkeep = 71"; CULTURE.md
added to the file-tree listing so the closed-tree enumeration is
complete (the listing must enumerate every file — INVARIANTS P2).

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

* Merge origin/main into v4-primitive-decomposition

Resolves the conflict with #3150 (v4 design-decisions ledger):

- src/v4/std/primitive.dag — modify/delete: kept DELETED (this PR's
  purpose). #3150 had added a `Hash` header note to primitive.dag (B1).
  With the file gone, `Hash` — not a scalar — re-homes to std/node.dag
  alongside `content_hash` (the T-1 closeout, where B1 already places
  the fold + canonical-form clause). Noted in STRUCTURE.md; DECISIONS.md
  B1 should update its "Hash → primitive.dag" line accordingly.
- src/v4/STRUCTURE.md — content conflict: kept #3150's docs-listing
  (DECISIONS.md) and the count-is-a-checksum framing; kept this PR's
  scalar/numeric decomposition section. Total recomputed against the
  merged tree: 68 .dag + 5 docs + 5 .gitkeep = 78.

Verified: v2 seed indexes all 68 merged v4 modules, 0 diagnostics.

* v4: land the Hash type in node.dag — close the B1 tombstone

Addresses the claude review on PR #3152. The decomposition deletes
std/primitive.dag, but #3150's B1 entry routed the `Hash` content-address
digest to that file — so after merge B1 pointed at a deleted path and
`Hash` (an operator-ratified substrate type) had no declaring file. My
STRUCTURE.md note said B1 "should be updated" — that was a deferral, not
a fix.

Fixed for real:
- std/node.dag declares `type Hash` — body-less opaque, exactly like
  `Symbol` (K-1 discipline: equality only, no content accessor). `Hash`
  is a content identity, not a scalar, so it belongs at the substrate
  root beside `Symbol`, not in the deleted scalar junk-drawer. node.dag's
  Owns line updated.
- DECISIONS.md B1 "Encoded in" column re-pointed: drop the deleted
  std/primitive.dag; `Hash` + canonical-form clause + content_hash fold
  all → std/node.dag. The clause + fold stay the T-1 closeout (as B1
  already states); the `Hash` type lands now.
- STRUCTURE.md §decomposition "Hash re-homing" rewritten from "should be
  updated" (deferral) to done.

Verified: v2 seed indexes all 68 v4 modules, 0 diagnostics.

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

* v4: T-3 summary line — surface the T-2 dependency

Addresses openai-pro APPROVE_WITH_COMMENTS on PR #3152 (non-blocking).
The execution-graph summary said T-3 `[needs T-1]`, but the scalar/
numeric files consume algebra.dag — logic.dag needs BooleanAlgebra,
nat.dag needs Monoid/Semiring (T-2). A worker dispatched off the
summary alone could start the algebra-consuming scalar files before
T-2 lands. The detailed T-3 dependency section was already correct;
this aligns the summary line to it: `[needs T-1, T-2; diagnostic/
cardinality are T-1-only, the scalar/numeric stack needs T-2]`.

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-remaining-decisions 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