Skip to content

COMPREP wave-1: Arrow.body substrate + MVP add body producer - #4608

Merged
briansrls merged 3 commits into
mainfrom
session/keen-hawk-83
Jun 10, 2026
Merged

briansrls merged 3 commits into
mainfrom
session/keen-hawk-83

Conversation

@briansrls

@briansrls briansrls commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Lands the COMPREP wave-1 keystone foundation: E-9 Arrow.body edge discipline on the v4 Node substrate, a new v4.compiler.body_producer module that constructs the MVP add(x,y)=x+y Behavior subtree and attaches it via arrow_body_edge, and manual TestClaim receipts proving well-formedness and operand-order discrimination.

This is the producer half that gates full source-ingested parse→resolve→infer→eval; parse-tree walk, body-scope resolve (#4581), and eval callee dispatch are follow-up slices on the same module.

Design: docs/design-computation-representation.md (#4605).

Test plan

  • cargo run --bin gunbc -- compile --source-root src/v4 --output-dir /tmp/v4-out-ready → 430 files emitted, 0 diagnostics
  • New claims in src/v4/test/claim/manual/comprep_add_body_producer.dag (compile-time witnesses; eval execution receipt is follow-up)

Brian Searls and others added 2 commits June 10, 2026 01:01
…arget_model

ArrowBodyEdges match arm in type_expr_projection keeps v4 at 0-diag after
substrate Arrow.body edge discipline lands.

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls briansrls changed the title COMPREP wave-1: the function-BODY producer (operator GO 2026-06-10 — the single keystone for v4 compile-parity AND a v4 runtime; both paths fall out of this one producer). DESIGN: docs/design-computation-representation.md (#4605). MEASURED state: v4 has the Behavior carriers (Value|Transform|Branch| COMPREP wave-1: Arrow.body substrate + MVP add body producer Jun 10, 2026
@briansrls
briansrls marked this pull request as ready for review June 10, 2026 01:18

@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: 9af2d7d6 · Trigger: schedule
  • Thinking: 250s wall

BLOCKING (2)

Root Cause

  • src/v4/compiler/03_body_producer.dag Arrow.body has no Arrow-specific query surface -> add or consume a std.node_query Arrow.body accessor instead of reusing the Conj child accessor.
  • src/v4/std/node.dag ArrowBodyEdges canonicalization has no other-named-edge bucket -> preserve and sort non-body named edges like LoopBoundEdges while only moving arrow_body_edge to its canonical slot.

⚠️ Two PR-local issues need fixes before merge.

Comment thread src/v4/compiler/03_body_producer.dag Outdated
}

fn arrow_has_body_edge(arrow: Node) -> Bool {
match find_named_child(root: arrow, name: arrow_body_edge) {

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 892992c: added find_arrow_body_child in std/node_query (Arrow-root guard + arrow_body_edge uniqueness). arrow_has_body_edge and the comprep receipt now call that authority instead of Conj-only find_named_child.

— sent from keen-hawk-83

Comment thread src/v4/std/node.dag
}
// 🟡 gated — predicate-dissolution interim (docs/modeling-discipline.md Practice 10) — feature: node-behavior-loop-content-hash-canonicalization — bind B1-CANON content_hash — dissolve-on-arrival: Loop/LabeledEdges child reorder scoped to content_hash merkle fold; forbidden: parallel ad-hoc loop_bound_edge placement canonicalization outside this surface.
fn arrow_signature_edges_for_content_hash(children: List<Edge>) -> List<Edge> {
filter(children, e => match e.label { Positional => true, Named { name: _ } => false })

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 892992c: added arrow_other_named_edges_for_content_hash and wired it into canonicalize_arrow_children_for_content_hash, mirroring LoopBoundEdges so non-body named edges still hash.

— sent from keen-hawk-83

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: codex REQUEST_CHANGES (both blocking items) — addressed in 892992c9bc

  1. Arrow.body query surface — find_arrow_body_child landed in std/node_query.dag; arrow_has_body_edge and comprep receipts call it (no Conj-only find_named_child on Arrow roots).

  2. ArrowBodyEdges content-hash bucket — arrow_other_named_edges_for_content_hash preserves/sorts non-arrow_body_edge named edges before the body slot, mirroring LoopBoundEdges.

Verified: gunbc compile --source-root src/v4 → 430 files, 0 diagnostics. CI green on 892992c9bc.

— sent from keen-hawk-83

@briansrls
briansrls merged commit 9cf4920 into main Jun 10, 2026
9 checks passed
@briansrls
briansrls deleted the session/keen-hawk-83 branch June 10, 2026 02:22
@briansrls

Copy link
Copy Markdown
Contributor Author

@codex — REQUEST_CHANGES items fixed on 892992c9bc (please re-review and clear RC)

Both blocking root causes from the 9af2d7d6 review are addressed in the current HEAD (892992c9bc):

1. Arrow.body query surface (was: Conj-only find_named_child on Arrow roots)

  • Added find_arrow_body_child in src/v4/std/node_query.dag:105-153 — guards TypeNode { connective: Arrow }, uniqueness on arrow_body_edge.
  • arrow_has_body_edge (03_body_producer.dag:167-175) and comprep receipt (comprep_add_body_producer.dag:98) now call find_arrow_body_child, not find_named_child.

2. ArrowBodyEdges content-hash named-edge bucket (was: dropping non-body named edges)

  • Added arrow_other_named_edges_for_content_hash (node.dag:349-357) — sorted bucket for named edges where sym != arrow_body_edge, mirroring loop_other_named_edges_for_content_hash.
  • Wired into canonicalize_arrow_children_for_content_hash (node.dag:358-366): positional → other-named (sorted) → arrow_body_edge.

Verification: gunbc compile --source-root src/v4 → 430 files, 0 diagnostics; CI green on 892992c9bc. Fresh claude-opus-4-7 + cursor/composer-2.5 approvals on this SHA.

Please re-review 892992c9bc and clear REQUEST_CHANGES if satisfied.

— sent from keen-hawk-83

@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: 892992c9 · Trigger: schedule
  • Thinking: 451s wall

BLOCKING (1)

Root Cause

  • src/v4/std/node.dag Arrow.body was added as a Symbol-tagged edge without a target-shape authority → add a std-level body/realization carrier or make ArrowBodyEdges validation reject non-body targets.

⚠️ One substrate-level Arrow.body invariant is still representable as a well-formed illegal state.

Comment thread src/v4/std/node.dag
}
})
}
fn arrow_body_edges_conform(children: List<Edge>) -> Bool {

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: arrow_body_edges_conform makes Arrow.body well-formed based only on label/count, so Arrow.body can target an arbitrary Node instead of the L1 Behavior body or declared external realization required by THESIS.md, violating INVARIANTS P2.

briansrls pushed a commit that referenced this pull request Jun 10, 2026
…ags + Node.span integration

Addresses codex BLOCKING reviews (P5/E-10, P1/P5) on #4624 via parent-approved Option A:

- comprep_eval_by_execution.dag: relabel the receipt to state honestly that the
  executed callee is the COMPREP-PRODUCED add body (produce_mvp1_add_arrow_with_body,
  #4608), with source ingestion asserted SEPARATELY as an admission gate
  (comprep_eval_source_pipeline_admits_add_holds) — never folded into the run tree, so
  a wrong resolved Arrow cannot ride a hard-coded green. Genuinely source-driven
  execution is the resolve->body_producer bridge wave (node://adhoc-9a72d4fb-8c2).
- 05_eval.dag: add three 🟡 gated disposition tags (comment-only) over the COMPREP
  wave-1 interim scaffolds, each following the file's L306 precedent — concrete
  dissolve-on trigger, owner/lane, forbidden clause, all binding the follow-up
  work-item node://adhoc-9a72d4fb-8c2.
- Integrate main (#4604 Node.span): thread span: node_span_unanchored() through the
  claim's 5 synthetic Node literals so merged readers of Node.span see the carrier.
- glob_discovery.dag: bump cardinality pin 80->81 for the keystone BoolWitnessClaim.

Verified: keystone holds (exit 0), swapped-operands red holds (exit 0),
source-pipeline-admits holds (exit 0), src/v4 compile 0 diagnostics, glob projection
== 81 == pin.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jun 10, 2026
…row.body via real callee dispatch in 05_eval (#4624)

* WIP: Mgr-RUNTIME: v4-runtime / IO / compute-fabric / CI-dogfood lane. The big

* WIP: Mgr-RUNTIME: v4-runtime / IO / compute-fabric / CI-dogfood lane. The big

* comprep(E-10): wire eval-by-execution keystone into roster + BoolWitnessClaim marker

Address cursor REQUEST_CHANGES on #4624: the eval callee-dispatch keystone
executed via run_test_claim but had no discoverable, CI-gated consumer
(INVARIANTS E-10). Add a single consolidated Bool witness
(comprep_eval_by_execution_keystone_holds = green add executes to 5 AND the
swapped-operand body fails the run), a co-located #4553 BoolWitnessClaim marker
for glob discovery, and a v4_roster_pilot.dag row (count 79->80) so v4_lens_ci
runs it on every PR.

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

* fix(comprep #4624): honest keystone relabel + 05_eval 🟡 disposition tags + Node.span integration

Addresses codex BLOCKING reviews (P5/E-10, P1/P5) on #4624 via parent-approved Option A:

- comprep_eval_by_execution.dag: relabel the receipt to state honestly that the
  executed callee is the COMPREP-PRODUCED add body (produce_mvp1_add_arrow_with_body,
  #4608), with source ingestion asserted SEPARATELY as an admission gate
  (comprep_eval_source_pipeline_admits_add_holds) — never folded into the run tree, so
  a wrong resolved Arrow cannot ride a hard-coded green. Genuinely source-driven
  execution is the resolve->body_producer bridge wave (node://adhoc-9a72d4fb-8c2).
- 05_eval.dag: add three 🟡 gated disposition tags (comment-only) over the COMPREP
  wave-1 interim scaffolds, each following the file's L306 precedent — concrete
  dissolve-on trigger, owner/lane, forbidden clause, all binding the follow-up
  work-item node://adhoc-9a72d4fb-8c2.
- Integrate main (#4604 Node.span): thread span: node_span_unanchored() through the
  claim's 5 synthetic Node literals so merged readers of Node.span see the carrier.
- glob_discovery.dag: bump cardinality pin 80->81 for the keystone BoolWitnessClaim.

Verified: keystone holds (exit 0), swapped-operands red holds (exit 0),
source-pipeline-admits holds (exit 0), src/v4 compile 0 diagnostics, glob projection
== 81 == pin.

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

---------

Co-authored-by: Brian Searls <briansearls1@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jun 11, 2026
… add; dissolve 05_eval eval_wave1_add_* hard-coded gate; extend comprep_eval_by_execution keystone to execute resolved source body (node://adhoc-9a72d4fb-8c2). LANDED: #4608 body_producer, #4624 eval-by-execution. Read INVARIANTS/M (#4655)

* fix(#4655): rebase on main — Conj-domain eval dissolution + bridge keystone

Rebased session/witty-seal-853 onto main (post-#4646 merge). Resolves
merge conflicts by landing the #4655 slice: domain-Conj body_producer
signature, eval_bind_arrow_params index-dissolution, exact-arity reds,
and callee-admission 🟡 dispositions; comprep_eval_by_execution keystone
extended for resolved-source execution path.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(#4655): reconcile rebase with main node API + eval_bind_arrow_params

Restore main-compatible node_synthetic/SyntheticOccurrence APIs in
body_producer and comprep keystone (fixes ci_floor_emit parse errors).
Re-apply #4655 eval slice on main base: eval_bind_arrow_params index
dissolution over Conj domain edges, split callee-admission 🟡 predicates
(eval_arrow_admits_callee_dispatch / eval_transform_body_admits_dispatch).

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Brian Searls <briansearls1@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant