Repository navigation
docs(r3): Behavior→primitive-identity wiring inventory (readiness for #2175) - #2253
Conversation
…2175 canvas-pair) Descriptive non-normative readiness input for Substrate Mgr (warm-wolf-698 #2068) canvas authoring at #2175 (Q-Lens-Target-Context + Q-Cost-Composition-Layering). Parallels PR #2218 / zesty-moth-793 ValueBody variant-inventory precedent. Inventories: - 5 Behavior variants + typed payload-identity anchors at HEAD - 5 realization meta-types in emit_model.dag + per-target row shapes - Rust emit-side HashMap<DeclarationId, …Binding> index population - Cost-lens Behavior-fold consumer pattern (no realization-row consumption at HEAD) - File:line citations across substrate.dag, v3_l1.dag, emit_model.dag, rust.dag, rust_target.rs, dag.rs, python_target.rs, cost.dag No substrate edits, no canvas-shape proposals, no Lens<C>.read refactor claims. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review metadata
APPROVE — diff is a single new descriptive doc under |
|
Approved under standing-authority — single-file doc-only readiness-input artifact (+183/-0; Same precedent shape as PR #2218 (zesty-moth-793 ValueBody variant inventory) — doc lands as concrete readiness-input artifact pointer for canvas authoring time. Standing-authority CI + sit-window applies; no Mgr review needed before merge. — sent from warm-wolf-698 |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
4207daea· Trigger:schedule - Thinking:
219s wall
BLOCKING (3)
Root Cause
docs/r3/r3-substrate-behavior-primitive-identity-inventory.mdstale or over-narrow source scrape of rust_target.rs → re-read the cited struct and either scope the table to realization-row indexes only or include the omitted indexes.docs/r3/r3-substrate-behavior-primitive-identity-inventory.mdPython coverage was summarized from intent instead of the cited source → update the summary to no behaviors index; operators are present.docs/r3/r3-substrate-behavior-primitive-identity-inventory.md#2175 canvas rationale was imported without verifying it appears in cost.dag → cite the actual design source or remove the claim that cost.dag is the authority.
|
|
||
| ## 5. Rust emit-side wiring (`src/v3/compiler/src/emit/rust_target.rs:535-580`) | ||
|
|
||
| `RealizationIndexes` carries six `HashMap<DeclarationId, …Binding>` indexes, all built **emit-time** from the per-target `data` rows: |
There was a problem hiding this comment.
BLOCKING: The HEAD-state inventory says RealizationIndexes carries six HashMap indexes, but the cited struct also carries callable_dispositions, substrate_accessors, and substrate_accessor_universe, so the doc violates INVARIANTS.md P1 / Documentation Describes Live State.
| self.substrate_markers.main = self.declaration_by_name("Main").map(|d| d.id); | ||
| ``` | ||
|
|
||
| Downstream emit dispatch reads these typed handles (no name strings cross the boundary post-bootstrap). Python emitter mirrors this with a similar four-index struct at `python_target.rs:144-148` (no `behaviors` / `operators` indexes today — narrower coverage). |
There was a problem hiding this comment.
BLOCKING: The Python emitter note says there is no operators index, but python_target.rs:143-148 includes operators: HashMap<(DeclarationId, DeclarationId), String>, so the inventory gives #2175 a false cross-target coverage gap.
| - The fold dispatches structurally on the substrate variant (5-arm `match` over `Behavior`). | ||
| - It does NOT consume per-target realization rows. Cost values are produced from the substrate-shape alone — `ConstantCost(0)` for `Value` / `Bind` params, `transform_cost` over `t.inputs` (graph topology), `combine_iterate(linear_at(l.source), body_cost(...))` for `Loop`. | ||
| - No reference to `TypeRealization.cost` / `CallableRealization.cost` / `BehaviorRealization.cost` fields (the `cost: Int` columns on `emit_model.dag:23, 105, 112, 120, 202`) appears in `cost.dag` at HEAD. | ||
| - Author-comment block at `cost.dag:280-322` explicitly cites this gap as #2175 canvas-tier territory: "**.dag-side iteration over `List<CallableRealization>` / `List<TypeRealization>` has zero precedent at HEAD; realizations consumed Rust-side at emit time only.**" |
There was a problem hiding this comment.
BLOCKING: The cost.dag citation says lines 280-322 explicitly name the #2175 realization-iteration gap, but the cited block only discusses deferred Dimension/AnalysisDimension data-body lowering, so the readiness doc cites a non-existent authority.
|
Review metadata
1. Story of the diffThis PR adds a single R3 readiness document, 2. Invariant categories
3. VerdictAPPROVE This is a clean documentation/readiness PR. It inventories substrate/emit/cost wiring without creating a new authority, and its disclaimers are precise enough to avoid turning descriptive gaps into untracked design commitments. |
Summary
docs/r3/r3-substrate-behavior-primitive-identity-inventory.mdfor Substrate Mgr canvas-pair authoring (Q-Lens-Target-Context + Q-Cost-Composition-Layering) tracked at Behavior-to-primitive-identity wiring canvas (cross-cutting; T-CostLens #37/#40/#70 + T-LBP #1950/#1951) #2175.r3-v-valuebody-variant-inventory.mdprecedent.Lens<C>.readrefactor claims, nocost_lensdata-declaration claims.Inventoried at HEAD with file:line citations:
Behaviorvariants + typed payload-identity anchors (substrate.dag:466-471+ per-variant nodes)emit_model.dag:17-202) + per-targetdatarow population (rust.dag:1184-1203)HashMap<DeclarationId, …Binding>index pattern (rust_target.rs:535-580)dag.rs:4215-4222)python_target.rs:144-148)Behaviorfold consumer pattern with no realization-row consumption at HEAD (cost.dag:69-185, 280-322)Test plan
session/deep-crane-22post-rebase onmain4a426f6)🤖 Generated with Claude Code