Repository navigation
feat(v3): minimal method-declaration registry + MethodRef refinement - #1193
Conversation
# Conflicts: # src/v3/compiler/src/bootstrap_generated.rs # src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
- Add method_template_contract_test.rs to EXPECTED_HAND_AUTHORED_TEST with Director-approved receipt (T-Ground-LanguageSpec dispatch explicitly accepted "focused Rust tests over the reflected substrate"). - Refresh parse_corpus_manifest.txt entry for src/v3/std/emit_model.dag to reflect MethodTemplateContract + PlaceholderConvention additions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # src/v3/compiler/src/bootstrap_generated.rs # src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
Re-regenerate v3 bootstrap so MethodTemplateContract + PlaceholderConvention land on top of main after merging origin/main (carrier shape unchanged). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
First substrate slice for the lens framework (docs/design-lens-framework.md, docs/briefs/r2-substrate-manager.md). Director-locked option (c) on parent inbox #1130. Substrate changes: - New src/v3/std/lens.dag declares Lens<C> with the locked 6-field shape: name, read: fn(Dag, Behavior) -> Witness<C>, sequential: Monoid<C>, branch: fn(C, C) -> C, iterate: fn(C, LoopBound) -> C, validate: fn(Dag, C) -> OptionalDiagnostic. Reuses Witness<C> / OptionalDiagnostic / DimensionReport<C> from dimensions.dag and Monoid<C> from dsl/std/algebra.dag — no parallel reps introduced. - diagnostics.dag: Q6.5 two-layer authority. Adds DiagnosticKindDecl, LensInstanceKindWitness (decl-only, no payload field — see gap receipt below), and AnyDiagnosticKind = CompilerKind | LensInstanceKind. Widens Diagnostic.kind from CompilerDiagnosticKind to AnyDiagnosticKind. CompilerDiagnosticKind closed sum unchanged (anti-bridge invariant). Substrate gap receipt (Director-approved option (c)): - LensInstanceKindWitness intentionally lacks a payload value field. Today's .dag grammar cannot express `payload: <inhabits kind_decl.payload>` (refinement-type-on-sibling- field). The flat alternative ratifies the illegal-state Q6.5 rejected (Lens / name / payload-shape three independent coords). Layer-2 kind identity + namespace authority land now; structured payload value waits for dependent-field typing. Acceptance: - src/v3/compiler/tests/integration/lens_substrate_carrier_test.rs: Lens<C> 6-field shape, Diagnostic.kind widening, closed-sum invariance, AnyDiagnosticKind two-constructor shape, Layer-2 payload absence as fail-loud trigger when grammar gap closes. - SG-0 ratchet receipt added with Director acceptance citation. - parse_corpus_manifest.txt refreshed via refresh_handwritten_parse_snapshot_manifest -- --ignored. Out of scope (deferred to subsequent lanes): - Migration of cost.dag / complexity.dag / idempotency.dag / parallelism.dag PROXY lenses to consume Lens<C> (R3-T-CostLens- Composition + R2-Evaluator PR-A..E). - fold_lens<C> generic fold machinery (I2 in design doc). - User-authored lens TestClaim wiring (I7 in design doc). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Strengthen LensInstanceKindWitness SCAFFOLD comment to call out that bare `DeclarationRef` for `kind_decl` is part of the SAME dissolution trigger as the deferred payload typing — substrate-level refinement-typing-on-DeclarationRef closes both the payload-typing gap and the kind-decl resolution gap in one move. Cites the analogous PatternRealization and MethodTemplateContract.dag_method patterns. Addresses non-blocking codex BLOCKING relay at sha fa5bba2 (Layer-2 diagnostic-kind witness leaving its core authority unconstrained) — shape unchanged per Director-locked option (c) on parent inbox #1130; just makes the bounded-scaffold receipt fully explicit on this row. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # src/v3/compiler/src/bootstrap_generated.rs # src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
Re-regenerate v3 bootstrap so Lens<C> + Q6.5 widening land on top of latest main after the merge conflict resolution. Refresh parse manifest. Carrier shape unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # src/v3/compiler/src/bootstrap_generated.rs # src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
Re-regenerate v3 bootstrap so Lens<C> + Q6.5 widening land on top of main after #1188 fixed the v2-extdeps regression. Refresh parse manifest. Carrier shape unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Early manager feedback on draft #1193: The registry direction is right: new But the draft is incomplete against the dispatch. Please add the missing load-bearing pieces before marking ready:
Keep scope tight: do not rewrite |
Closes the dag_method: DeclarationRef substrate gap from #1175 by landing the smallest structurally honest method-name registry and refining MethodTemplateContract.dag_method to typed MethodRef. Director-locked options A/A/(a) on parent inbox #1130. Substrate changes: - New dsl/std/methods.dag: MethodDeclaration { name: String } + 63 data <name>_method bindings (full union of unique names from the 7 dsl/std/algebra.dag per-profile template lists). - New src/v3/std/methods.dag: MethodRef { decl: DeclarationRef }. Lives in v3-space because dsl/std/ stays v3-spec-free per the existing layering convention. - src/v3/std/emit_model.dag: MethodTemplateContract.dag_method refined from bare DeclarationRef to MethodRef. - src/v3/compiler/src/bootstrap_regen_fresh.rs: dsl/std/methods.dag added to the v3 std-fixture allow-list. Acceptance: - src/v3/compiler/tests/integration/method_registry_test.rs: 4 structural claims — registry covers all 63 algebra-template names (drift-detection), MethodDeclaration identity-only, MethodTemplateContract.dag_method refines to MethodRef, MethodRef is single-field decl wrapper. - SG-0 ratchet receipt added with Director-acceptance citation. - parse_corpus_manifest.txt refreshed. Out of scope (Grounding-owned and follow-up): - Algebra template-row rewrite to import/reference the typed decls. - Grounding MethodTemplateContract row population. - MethodTranslation / SimpleMethodSpec retirement. - Refining decl: DeclarationRef to DeclarationRef<MethodDeclaration> (same trigger as PatternRealization / LensInstanceKindWitness). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review metadata
Verdict: APPROVE — clean, narrowly scoped substrate slice. The non-generated diff is small and disciplined:
The scaffold meets the tracked-debt bar (documented + bounded + named dissolution trigger). No INVARIANTS / MODELING / CODING / TESTING violations grounded in the diff. |
|
Manager shape read: this now matches the dispatch. Confirmed from the current PR metadata/diff:
Remaining blocker: GitHub reports |
# Conflicts: # src/v3/compiler/src/bootstrap_generated.rs # src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
|
Review metadata
Findings
Verdict: REQUEST_CHANGES. The implementation shape looks otherwise narrow and well-documented, and the targeted test command passes, but the new acceptance test does not actually enforce the registry authority it claims to enforce. I ran |
Per codex REQUEST_CHANGES at sha d6216b8: existence-by-name was behavioral rather than enforced. method_registry_covers_all_algebra_ template_names now verifies each <name>_method binding (1) has a TypeConnective::Instantiation pointing at MethodDeclaration, and (2) carries a Structural value_body with name = String literal matching the expected method name. The drift trigger named in the .dag file's documentation is now actually enforced fail-closed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review metadata
Findings:
Verdict: REQUEST_CHANGES. The substrate shape and |
Per codex REQUEST_CHANGES at sha fdaaee5: hand-maintained EXPECTED_METHOD_NAMES could drift in lock-step with the registry, both staying out-of-sync with algebra.dag without failing the test. method_registry_covers_all_algebra_template_names now include_str!s `dsl/std/algebra.dag` and lexically extracts unique `name: "<id>"` literals from the per-profile template-list bodies (filtering for lowercase identifiers to skip type-shape names like `NamedTemplate { name: "Int" }`). algebra.dag is the actual authority — adding a new method name there without landing the registry binding now fails fail-closed at the same boundary the .dag SCAFFOLD comment promises. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review metadata
Verdict: APPROVE Diff is narrowly scoped and the transitional substrate pieces are documented, bounded, and covered by focused acceptance tests. I don’t see concrete violations of the pinned modeling, coding, or testing guidance. Verified with |
…lans (#2775) * docs: decomposition-algebra modeling project (DRAFT) Operator-supplied premise: project decomposition as algebra where children sum to parent meaning; walk-back when integration contradicts construction. This draft formalizes: - §1 The contradiction trigger (algebraic imbalance | claim contradiction) - §2 Types sketch (Node, Claim, Decomposition, Witness, WalkBackEvent) — gunbc-lens-style; eventual home in dsl/std/ as MeaningDecomposition lens analogous to Cost lens - §3 Walk-back algorithm (procedure with StableAncestor | RootContested termination) - §4 Worked example — PR #2745 misread retroactively traced through procedure (2026-05-12 PM execution error) - §5 Dashboard comms application sketch — message-as-walk-back-signal mapping - §6 Open questions (coefficient semantics, claim equivalence, root-asker, rebalance cost, implementation surface) - §7 Next step: validate on N=3-5 real cases before .dag formalization Iteration expected. * docs: decomposition-algebra rewrite for ctrl/ migration scoping Replaces procedural walk-back draft (d534fd4) with structural-integration shape per operator directive 2026-05-12: migrate ctrl/ processes into .dag substrate; algebra is authoritative, ctrl/ TS becomes projected emission. Audit-grounded with grep-verified citations across dsl/std/ + ctrl PR refs (#1192/#1193/#1195/#1197). Identifies 4 modeling gaps (EventLog<T> primitive, Lens<A,B> type, bounded multiplicity, unified Witness) + workflow-types dissolution scope (dsl/gunbc/workflow/types.dag overlaps with decomp-algebra; proposed dissolution rather than coexistence). First-cut migration target recommended: review-verdict-parser (today's parser-lag pain validates the heuristic-pass cost per feedback_lenses_not_passes). Phase 1 substrate-file skeleton (~50 lines) sketched. Cost-of-change contract = 1 file for new Mode variants / Operation arms. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(decomp-algebra): inline §13 validation case study; drop git-history cross-ref Addresses claude #10308 review finding: §13's pointer to "previous draft in git history at d534fd4" was a quirk for a brand-new file (per reviewer: harmless but worth fixing). Inlines the PR #2745 misread walk-back trace self-contained so readers don't need to git-log to follow the validation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: ctrl/ → .dag migration project plan (parallel program tree) Companion to docs/design-decomposition-algebra.md. Authored per operator directive 2026-05-12: parallel program tree beside zesty-bear-812, model dependencies, migrate as much ctrl/ as possible ASAP. Audit of ctrl/ via gh API identifies: - 3 partial .dag files already in ctrl (workflows/review.dag etc.) - ~17 TS subsystems with documented designs in scripts/session-dashboard/ - 4 in-flight algebra PRs #1192-#1197 (decomposition algebra series) - Top-level constitutional docs (AGENTS/AUDIT/CODING/INVARIANTS/REVIEW_*/SCOPE_*/TESTING) Plan structure: - Phase 1: algebra substrate (dsl/std/process_algebra.dag) - Phase 1.5: 5-8 parallel subsystem modeling PRs (doc-only, type-only) Items 1/3/4/5/6 can start NOW without Phase 1 - Phase 2: CLI projection to Rust binary - Phase 3: HTTP/SQL/audit-event extdeps (R4 emission targets) - Phase 4: ctrl/ cut-over per subsystem - Phase 5: generalize Proposes Ctrl-Migration Director parallel to gunbc R3-close Director; 3 Mgrs (Substrate/Subsystem-Modeling/Verification), Emission-Targets Mgr spawned later. First-week concrete actions named. 6 open Qs for operator decision: file placement (gunbc vs ctrl), Director shape, workflow-types dissolution scope, first migration target, ctrl PR #1192-#1197 disposition, cross-Director coordination protocol. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(project-plan): comprehensive ctrl/ subsystem catalog (16 subsystems) Per operator directive 2026-05-12T~18:55Z: audit ALL session-dashboard work + identify what can migrate today. Gh-API audit of gunb-ai/ctrl identified ~21,800 TS LOC across 16 subsystems. Key findings: - Existing demo precedent at research/.../inbox_delivery_slice.dag proves the `service` + typed-functions shape works today (~90% done already) - 237 .mjs files in scripts/session-dashboard/ organized into ~16 subsystems - ~20 .mjs in chatgpt-reviewer/ (browser DOM walking; partial-doable now) - 3 .mjs in api-reviewer/ (CLI backend selection) - 3 partial .dag in workflows/ (review, branch_review, review_config) Strategy shift: model SERVICE CONTRACTS (types + typed function signatures + pure helpers), not just types. Demo proves it works today. Subsystems classified: - 8 items independent NOW (no Phase 1 dependency) — parallel first wave - 6 items consume Phase 1 algebra substrate — second wave - 2 items partial-NOW (chatgpt-reviewer browser, server HTTP routes) - ~16 PRs total for Phase 1.5 (bundled by subsystem) Operator-resolved Qs: - Q-A: gunbc-side placement (dsl/ctrl/*.dag) - Q-D: review-verdict already in flight per operator New Qs added: - Q-G: service-contract authority claim (future vs co vs substrate) - Q-H: per-subsystem PR cadence (bundle by subsystem, ~16 PRs total) First-wave dispatch updated: 8 workers parallel Day 2-5; 6 more Day 6-10. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(project-plan): replace-ASAP framing + parallel critical paths Per operator directive 2026-05-12T~19:05Z: this is replacement, not "future authority"; emission targets are critical-path parallel with algebra substrate, not deferred. 4 Mgrs spawn Day 1 (not 3). Changes: - §1 Mission: replace dashboard ASAP; intent layer THIN, substrate rigor; compositional-modeling discipline (M9 DFS, lens-not-pass, cost-of-change = 1) - §5 Program tree: orthogonal to zesty-bear-812 confirmed; 4 Mgrs (Substrate / Subsystem-Modeling / Emission-Targets / Verification) spawn together Day 1 - §6 Phase sequencing: Phase 1 + 1.5 + 3 in PARALLEL, all critical path. Per-subsystem cut-over fires as trio converges. - §10 First-week actions: Emission-Targets Mgr spawns Day 1 not Day-N - §11 Q-G RESOLVED: substrate becomes authority immediately when emission proves out per subsystem; no co-authority window Three operator Qs resolved this session: A (gunbc-side), D (review- verdict in flight), G (replace-immediately). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: address codex BLOCKING review #10331 (5 findings on PR #2775) All 5 findings valid; substantive review, real gaps. Fixed in-place rather than reply-without-fix. Finding 1 — audit scope correction (LIVE V3 LENS SUBSTRATE): prior audit scoped to dsl/std/ only; missed src/v3/std/lens.dag (Director-locked 6-field Lens<C>) + src/v3/std/dimensions.dag:35 (Witness<Carrier> = Inhabits | Violates) + src/v3/std/coproduct_projection.dag (Practice 4 dispatch substrate) + ~16 worked lens instances in src/v3/lenses/. §3 mapping table corrected with these as ✓ EXISTS. Finding 2 — workflow-types dissolution axis conflation: §4 initial proposal conflated decomposition axis (Mode) with workflow phase axis (IssueLifecycleStage). Corrected to preserve both as structural coordinates (Mode × Phase product) per Practice 4 dimensional dissolution. Phase open enum staged with dissolution trigger = per-consumer enumeration. Until proof lands, workflow-types stay extant; decomp-algebra co-located not replacing. Finding 3 — Reopen/Regress operations added: prior §6 claimed monotonicity (canCloseNode ≥ on composition) without explicit reverse operations. Added Reopen { ReopenWitness } + Regress { RegressionWitness } operations with typed witness payloads. Replaced monotonicity claim with closure-decision lattice: forward-stable subset preserves; Reopen/Regress/Replan/Escalate explicitly retract closure state with witnessed cause. No silent regression. Finding 4 — staging discipline for catalog: §3 catalog preamble corrected: every "doable NOW" row is STAGED with explicit dissolution trigger, NOT authoritative-on-arrival. Trigger = per-subsystem realization receipt + consumer parity (emission target + parity test + cut-over PR deletes TS). 🟡 STAGED until trigger fires. Finding 5 — Practice 4 coverage widened: §8 brief template gate 2 changed from "Practice 4 receipts on any open enum" to "every enum/sum with ≥2 variants" (closed sums need dissolution analysis too). Receipt format named (classification + pattern + trigger). STOP criterion added: closed sum with no clear dissolution pattern surfaces to Director. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(decomp-algebra): address codex inline BLOCKING — Lens/Witness parallel authority Codex BLOCKING inline at docs/design-decomposition-algebra.md:154 + queued companion: §5 Gap 2 proposed `Lens<S, A> { view, update }` and Gap 4 proposed `Witness { author, ... }` — both create parallel authority with v3 substrate (Lens<C> at src/v3/std/lens.dag, Witness<C> at src/v3/std/dimensions.dag:35). Fixes per INVARIANTS P2 (single-authority) + MODELING.md M9 (DFS concept DAG before defining): 1. Gap 2 RETRACTED — no new Lens carrier. State-projection in decomp-algebra reuses FreeMonoid<TimestampedEvent<Operation>> + fold (already in dsl/std/algebra.dag:390). If a future bidirectional-update use case surfaces, escalate to Substrate Mgr for shape audit. 2. Gap 4 RENAMED — decomp-algebra's "Witness" → "Attestation" to avoid name collision with v3 Witness<Carrier>. The carriers are structurally distinct (Attestation is human-intent attestation; v3 Witness<C> is per-Behavior inhabitance proof). Cascade applied: - Operation variants: attestation: Attestation - WitnessedOverride → AttestedOverride - ReopenWitness → ReopenAttestation - RegressionWitness → RegressionAttestation - Evidence enum → AttestationEvidence - StructuralLens → StructuralLensReceipt (refs v3 Lens<C> instance) - §7 dissolution receipt updated - §9 substrate skeleton updated - §13 worked example refs updated Per feedback_self_hosting_md_authority_audit_before_substrate_naming.md: same-name carriers across namespaces invite confusion; namespace clarity preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(decomp-algebra): preserve stage-bound pipeline facts (codex inline BLOCKING #2) Codex BLOCKING inline at docs/design-decomposition-algebra.md:108: prior dissolution proof would drop stage-bound pipeline coordinate facts (StageRunKey, ClaimLease, SignalType, PipelineArtifact, ArtifactType, MetricRecord) used downstream — violates P2 facts-flow-forward. Grep verified at dsl/gunbc/workflow/types.dag: - StageRunKey:159 — threads through StageOutcome / PipelineArtifact / MetricRecord / RetryDue / TerminalStateReached - ClaimLease:166 — lease-execution claim - SignalType:235 — idempotency-keyed signal payload tag - PipelineArtifact:120,212-214 — stage-output artifact - ArtifactType:214,226 — artifact taxonomy - Metrics:225,318 — per-stage telemetry Fix: only stage-VALUE collapses to (Mode, Phase); run-keyed pipeline facts remain structurally distinct as forward-flowing coordinates. Per feedback_projections_must_compose_facts.md + INVARIANTS P2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(decomp-algebra): drop false monotonicity claim (codex inline BLOCKING #3) Codex BLOCKING inline at docs/design-decomposition-algebra.md:231: prior "forward-stable subset" framing was still false. Decompose adds children → retracts parent closure (COMPOSITE_HAS_OPEN_CHILDREN). Replan adds reconcile child → same. Declare(Bucket) introduces BUCKET_NOT_DRAINED. No Operation subset is universally monotonic in canCloseNode. Fix: drop the monotonicity claim entirely. Replace with typed effects- per-operation classification — each operation's effect on closure- eligibility is type-signature-visible. Consumers MUST NOT assume monotonicity across event-log composition. Effects-per-operation classification added: Declare/Decompose/Drain/ Replan/Escalate/Pause/Reopen/Regress/AttestedOverride each with explicit closure-eligibility effect (neutral / improves / retracts). The only operational invariant retained: every closure-eligibility transition is witnessed by an explicit Operation; no silent transitions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(project-plan): correct authority claim per P2 staging discipline (codex inline BLOCKING #4) Codex BLOCKING inline at docs/r4-ctrl-dag-migration-project-plan.md:61: §3 strategy paragraph claimed "contract becomes authority from PR-merge" which contradicted line 73 staging discipline AND violated INVARIANTS P2 (declarations alone are staging, not landed authority). Fix: §3 strategy paragraph now explicitly states .dag files are 🟡 STAGED on merge, NOT 🟢 AUTHORITY. Authority requires generated consumer or emission target. Trio convergence (emission + parity + cut-over PR deletes TS file) is the named dissolution trigger. Consistent with feedback_no_textual_enforcement_bridges.md: textual claims of authority don't substitute for structural enforcement. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(project-plan): Ctrl-Migration Director spawned + line 303 receipt scope (codex inline BLOCKING #5) Two changes: 1. Codex BLOCKING at line 303: brief template scope bullet still said "Practice 4 receipts for any open enum" while acceptance gate #2 (line 314) said "every enum/sum with ≥2 variants". Aligned scope bullet with gate per codex inline BLOCKING #5. 2. Operator directive 2026-05-12T~19:20Z: deep-wolf-155 operates at CEO/PM tier above gunbc R3-close Director zesty-bear-812. Ctrl- Migration Director spawned as CHILD under PM via dashboard-ops work-items create — node://adhoc-dc298bc7-9f7 (status=ready, 2026-05-12T19:20:39Z). Auto-spawn fires within ~30s. §5 tree updated to reflect: - deep-wolf-155 (CEO/PM, root) above zesty-bear-812 - Ctrl-Migration Director as new child of deep-wolf-155 - PM owns inter-program coordination - Each Director independent on program scope Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: C compiler + LLVM in .dag execution promotion plan Per operator directive 2026-05-12T~19:30Z: parallel program plan to ctrl-migration. Promotes existing research-viability artifacts at ~/ctrl/research/.../c-compiler-in-dag/ to executing production program. Existing research is well-developed: - PLAN.md (Brian-approved 2026-05-04 with A1-A10 locks) - W0 shared IR primitives (5 files in extdeps/common/ir/) - W4 LLVM IR spike (DONE — substrate + emit + types + trivial program) - W7 XLS/Verilog spike (DONE) - Phase-2 expression evaluator (DONE) - 3 lens-counterfactual real-world bug case studies - gunbc src/v3/lenses/ has 16 production lens instances ready to consume This doc proposes the EXECUTION shape that consumes the research plan: - Phase A (~1-2 weeks): promote research → production substrate (~6-9 PRs moving W0/W4/W7/phase-2-evaluator into gunbc dsl/extdeps/) - Phase B (~6-12 months parallel): Frontend (W3a + W11) + IR (W2 + W2d) + Lens-Application (W8 + W10) + Pressure-Test - Phase C (multi-month): emission targets (codegen, runtime, linker) - Phase D (open-ended): "LLVM entirely" if pursued Proposed program tree: NEW C-Compiler+LLVM Director under PM/CEO, parallel to zesty-bear-812 (gunbc R3-close) + clever-ant-97 (ctrl- migration). 5 Mgrs (Substrate, Frontend, IR, Lens-Application, Pressure-Test). Scope decision required (Q-A): interpretation (a) "C frontend + LLVM IR substrate" (existing research scope; proposed) vs (b) "LLVM entirely" (optimizer + codegen as .dag; multi-year). 6 open Qs for operator decision (§9). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(project-plan): Wave-1-trio checkpoint + staged-debt throttle (claude #10327 exploratory observations) Per claude #10327 review observations on PR #2775 (APPROVE-with-exploratory): 1. "Ambitious blast radius for a plan in DRAFT; worth a checkpoint after Wave 1 lands one full trio (algebra ✓ + subsystem ✓ + emission ✓) before fanning the rest out, otherwise you risk 16 staged .dag files with no dissolution receipts firing." → §7 now requires WAVE-1-TRIO CHECKPOINT at ~Day 7-10 before Wave 2 dispatch. If trio doesn't converge by Day 10, pause Wave 2 + surface to PM for re-scope. 2. "Parallel ≠ independent: Phase 1.5 PRs that land before their matching Phase 3 emission target are deliberately accepting staged- debt, and the Verification Mgr is the throttle." → §6 now states parallel-with-throttle explicitly. Verification Mgr enforces staged-debt budget: if 3+ subsystems merged with no matching emission, Subsystem-Modeling Mgr PAUSES new dispatch until catch-up. Both observations were exploratory (review verdict was APPROVE not BLOCKING), but substantive design feedback worth incorporating structurally rather than acknowledging. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(r3): remaining-work dependency graph + max-parallelization plan Per operator directive 2026-05-12T~20:00Z: "define the remainder of R3 now, including all dependencies, so we can max parallelize all the work." Comprehensive audit of §1.8 ledger: - 102 R3-load-bearing gates total - ~32 CLOSED (31%); ~40 IN-FLIGHT (39%); ~31 OPEN (30%) - 2 lanes 100% done: T-Omni-Shape-B, T-Free-Consequences-Demonstration - Standing gate #75 PASSING Critical-path identified: - Cluster M (T-Tests-As-Data-Completeness): gate #84 dissolves ~80-90 of 101 SG-0 hand-Rust test entries in single closure. Phase 1 (#85/#86 substrate) dispatch-ready NOW. Total 4-8w to full Cluster M closure. - Cluster F (T-LP-Retirement): gates #81/#82/#83/#95 carve-promoted-IN-R3 per Director 2026-05-09. F-α + F-β.1 parallel-dispatchable NOW. Total 3-4w to full Cluster F closure. 14 gates identified as dispatch-ready NOW (no prerequisite blocking). Wave-1 dispatch plan covers 13-15 parallel workers across 3 R3 Mgrs. Worker spawn capacity analysis: - Substrate Mgr: 16 max, 1 active → +15 budget - Debt-Paydown Mgr: 8 max, 0 active → +8 budget - Verification Mgr: 8 max, 3 active → +5 budget - Total +28 R3 spawn budget; currently at ~5; can scale 5-6x Throughput levers ranked: 1. Land review-parser fix (eliminates per-PR PM bypass overhead) 2. Pre-author Wave-1 briefs in bulk 3. Spawn to Mgr capacity 4. Cluster M Phase 1 immediate dispatch (critical-path) 5. F-β.1 canvas immediate authoring 6. PB Mgr successor spawn (currently no active session) 7. Class-authorization batch merges (Director-ratified) 6 open Qs for operator decision. Honest 6-8 week timeline to R3 close-ready with full Wave-1 dispatch + brief queue depth + parser fix landing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…wording (#2780) * docs: decomposition-algebra modeling project (DRAFT) Operator-supplied premise: project decomposition as algebra where children sum to parent meaning; walk-back when integration contradicts construction. This draft formalizes: - §1 The contradiction trigger (algebraic imbalance | claim contradiction) - §2 Types sketch (Node, Claim, Decomposition, Witness, WalkBackEvent) — gunbc-lens-style; eventual home in dsl/std/ as MeaningDecomposition lens analogous to Cost lens - §3 Walk-back algorithm (procedure with StableAncestor | RootContested termination) - §4 Worked example — PR #2745 misread retroactively traced through procedure (2026-05-12 PM execution error) - §5 Dashboard comms application sketch — message-as-walk-back-signal mapping - §6 Open questions (coefficient semantics, claim equivalence, root-asker, rebalance cost, implementation surface) - §7 Next step: validate on N=3-5 real cases before .dag formalization Iteration expected. * docs: decomposition-algebra rewrite for ctrl/ migration scoping Replaces procedural walk-back draft (d534fd4) with structural-integration shape per operator directive 2026-05-12: migrate ctrl/ processes into .dag substrate; algebra is authoritative, ctrl/ TS becomes projected emission. Audit-grounded with grep-verified citations across dsl/std/ + ctrl PR refs (#1192/#1193/#1195/#1197). Identifies 4 modeling gaps (EventLog<T> primitive, Lens<A,B> type, bounded multiplicity, unified Witness) + workflow-types dissolution scope (dsl/gunbc/workflow/types.dag overlaps with decomp-algebra; proposed dissolution rather than coexistence). First-cut migration target recommended: review-verdict-parser (today's parser-lag pain validates the heuristic-pass cost per feedback_lenses_not_passes). Phase 1 substrate-file skeleton (~50 lines) sketched. Cost-of-change contract = 1 file for new Mode variants / Operation arms. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(decomp-algebra): inline §13 validation case study; drop git-history cross-ref Addresses claude #10308 review finding: §13's pointer to "previous draft in git history at d534fd4" was a quirk for a brand-new file (per reviewer: harmless but worth fixing). Inlines the PR #2745 misread walk-back trace self-contained so readers don't need to git-log to follow the validation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: ctrl/ → .dag migration project plan (parallel program tree) Companion to docs/design-decomposition-algebra.md. Authored per operator directive 2026-05-12: parallel program tree beside zesty-bear-812, model dependencies, migrate as much ctrl/ as possible ASAP. Audit of ctrl/ via gh API identifies: - 3 partial .dag files already in ctrl (workflows/review.dag etc.) - ~17 TS subsystems with documented designs in scripts/session-dashboard/ - 4 in-flight algebra PRs #1192-#1197 (decomposition algebra series) - Top-level constitutional docs (AGENTS/AUDIT/CODING/INVARIANTS/REVIEW_*/SCOPE_*/TESTING) Plan structure: - Phase 1: algebra substrate (dsl/std/process_algebra.dag) - Phase 1.5: 5-8 parallel subsystem modeling PRs (doc-only, type-only) Items 1/3/4/5/6 can start NOW without Phase 1 - Phase 2: CLI projection to Rust binary - Phase 3: HTTP/SQL/audit-event extdeps (R4 emission targets) - Phase 4: ctrl/ cut-over per subsystem - Phase 5: generalize Proposes Ctrl-Migration Director parallel to gunbc R3-close Director; 3 Mgrs (Substrate/Subsystem-Modeling/Verification), Emission-Targets Mgr spawned later. First-week concrete actions named. 6 open Qs for operator decision: file placement (gunbc vs ctrl), Director shape, workflow-types dissolution scope, first migration target, ctrl PR #1192-#1197 disposition, cross-Director coordination protocol. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(project-plan): comprehensive ctrl/ subsystem catalog (16 subsystems) Per operator directive 2026-05-12T~18:55Z: audit ALL session-dashboard work + identify what can migrate today. Gh-API audit of gunb-ai/ctrl identified ~21,800 TS LOC across 16 subsystems. Key findings: - Existing demo precedent at research/.../inbox_delivery_slice.dag proves the `service` + typed-functions shape works today (~90% done already) - 237 .mjs files in scripts/session-dashboard/ organized into ~16 subsystems - ~20 .mjs in chatgpt-reviewer/ (browser DOM walking; partial-doable now) - 3 .mjs in api-reviewer/ (CLI backend selection) - 3 partial .dag in workflows/ (review, branch_review, review_config) Strategy shift: model SERVICE CONTRACTS (types + typed function signatures + pure helpers), not just types. Demo proves it works today. Subsystems classified: - 8 items independent NOW (no Phase 1 dependency) — parallel first wave - 6 items consume Phase 1 algebra substrate — second wave - 2 items partial-NOW (chatgpt-reviewer browser, server HTTP routes) - ~16 PRs total for Phase 1.5 (bundled by subsystem) Operator-resolved Qs: - Q-A: gunbc-side placement (dsl/ctrl/*.dag) - Q-D: review-verdict already in flight per operator New Qs added: - Q-G: service-contract authority claim (future vs co vs substrate) - Q-H: per-subsystem PR cadence (bundle by subsystem, ~16 PRs total) First-wave dispatch updated: 8 workers parallel Day 2-5; 6 more Day 6-10. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(project-plan): replace-ASAP framing + parallel critical paths Per operator directive 2026-05-12T~19:05Z: this is replacement, not "future authority"; emission targets are critical-path parallel with algebra substrate, not deferred. 4 Mgrs spawn Day 1 (not 3). Changes: - §1 Mission: replace dashboard ASAP; intent layer THIN, substrate rigor; compositional-modeling discipline (M9 DFS, lens-not-pass, cost-of-change = 1) - §5 Program tree: orthogonal to zesty-bear-812 confirmed; 4 Mgrs (Substrate / Subsystem-Modeling / Emission-Targets / Verification) spawn together Day 1 - §6 Phase sequencing: Phase 1 + 1.5 + 3 in PARALLEL, all critical path. Per-subsystem cut-over fires as trio converges. - §10 First-week actions: Emission-Targets Mgr spawns Day 1 not Day-N - §11 Q-G RESOLVED: substrate becomes authority immediately when emission proves out per subsystem; no co-authority window Three operator Qs resolved this session: A (gunbc-side), D (review- verdict in flight), G (replace-immediately). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: address codex BLOCKING review #10331 (5 findings on PR #2775) All 5 findings valid; substantive review, real gaps. Fixed in-place rather than reply-without-fix. Finding 1 — audit scope correction (LIVE V3 LENS SUBSTRATE): prior audit scoped to dsl/std/ only; missed src/v3/std/lens.dag (Director-locked 6-field Lens<C>) + src/v3/std/dimensions.dag:35 (Witness<Carrier> = Inhabits | Violates) + src/v3/std/coproduct_projection.dag (Practice 4 dispatch substrate) + ~16 worked lens instances in src/v3/lenses/. §3 mapping table corrected with these as ✓ EXISTS. Finding 2 — workflow-types dissolution axis conflation: §4 initial proposal conflated decomposition axis (Mode) with workflow phase axis (IssueLifecycleStage). Corrected to preserve both as structural coordinates (Mode × Phase product) per Practice 4 dimensional dissolution. Phase open enum staged with dissolution trigger = per-consumer enumeration. Until proof lands, workflow-types stay extant; decomp-algebra co-located not replacing. Finding 3 — Reopen/Regress operations added: prior §6 claimed monotonicity (canCloseNode ≥ on composition) without explicit reverse operations. Added Reopen { ReopenWitness } + Regress { RegressionWitness } operations with typed witness payloads. Replaced monotonicity claim with closure-decision lattice: forward-stable subset preserves; Reopen/Regress/Replan/Escalate explicitly retract closure state with witnessed cause. No silent regression. Finding 4 — staging discipline for catalog: §3 catalog preamble corrected: every "doable NOW" row is STAGED with explicit dissolution trigger, NOT authoritative-on-arrival. Trigger = per-subsystem realization receipt + consumer parity (emission target + parity test + cut-over PR deletes TS). 🟡 STAGED until trigger fires. Finding 5 — Practice 4 coverage widened: §8 brief template gate 2 changed from "Practice 4 receipts on any open enum" to "every enum/sum with ≥2 variants" (closed sums need dissolution analysis too). Receipt format named (classification + pattern + trigger). STOP criterion added: closed sum with no clear dissolution pattern surfaces to Director. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(decomp-algebra): address codex inline BLOCKING — Lens/Witness parallel authority Codex BLOCKING inline at docs/design-decomposition-algebra.md:154 + queued companion: §5 Gap 2 proposed `Lens<S, A> { view, update }` and Gap 4 proposed `Witness { author, ... }` — both create parallel authority with v3 substrate (Lens<C> at src/v3/std/lens.dag, Witness<C> at src/v3/std/dimensions.dag:35). Fixes per INVARIANTS P2 (single-authority) + MODELING.md M9 (DFS concept DAG before defining): 1. Gap 2 RETRACTED — no new Lens carrier. State-projection in decomp-algebra reuses FreeMonoid<TimestampedEvent<Operation>> + fold (already in dsl/std/algebra.dag:390). If a future bidirectional-update use case surfaces, escalate to Substrate Mgr for shape audit. 2. Gap 4 RENAMED — decomp-algebra's "Witness" → "Attestation" to avoid name collision with v3 Witness<Carrier>. The carriers are structurally distinct (Attestation is human-intent attestation; v3 Witness<C> is per-Behavior inhabitance proof). Cascade applied: - Operation variants: attestation: Attestation - WitnessedOverride → AttestedOverride - ReopenWitness → ReopenAttestation - RegressionWitness → RegressionAttestation - Evidence enum → AttestationEvidence - StructuralLens → StructuralLensReceipt (refs v3 Lens<C> instance) - §7 dissolution receipt updated - §9 substrate skeleton updated - §13 worked example refs updated Per feedback_self_hosting_md_authority_audit_before_substrate_naming.md: same-name carriers across namespaces invite confusion; namespace clarity preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(decomp-algebra): preserve stage-bound pipeline facts (codex inline BLOCKING #2) Codex BLOCKING inline at docs/design-decomposition-algebra.md:108: prior dissolution proof would drop stage-bound pipeline coordinate facts (StageRunKey, ClaimLease, SignalType, PipelineArtifact, ArtifactType, MetricRecord) used downstream — violates P2 facts-flow-forward. Grep verified at dsl/gunbc/workflow/types.dag: - StageRunKey:159 — threads through StageOutcome / PipelineArtifact / MetricRecord / RetryDue / TerminalStateReached - ClaimLease:166 — lease-execution claim - SignalType:235 — idempotency-keyed signal payload tag - PipelineArtifact:120,212-214 — stage-output artifact - ArtifactType:214,226 — artifact taxonomy - Metrics:225,318 — per-stage telemetry Fix: only stage-VALUE collapses to (Mode, Phase); run-keyed pipeline facts remain structurally distinct as forward-flowing coordinates. Per feedback_projections_must_compose_facts.md + INVARIANTS P2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(decomp-algebra): drop false monotonicity claim (codex inline BLOCKING #3) Codex BLOCKING inline at docs/design-decomposition-algebra.md:231: prior "forward-stable subset" framing was still false. Decompose adds children → retracts parent closure (COMPOSITE_HAS_OPEN_CHILDREN). Replan adds reconcile child → same. Declare(Bucket) introduces BUCKET_NOT_DRAINED. No Operation subset is universally monotonic in canCloseNode. Fix: drop the monotonicity claim entirely. Replace with typed effects- per-operation classification — each operation's effect on closure- eligibility is type-signature-visible. Consumers MUST NOT assume monotonicity across event-log composition. Effects-per-operation classification added: Declare/Decompose/Drain/ Replan/Escalate/Pause/Reopen/Regress/AttestedOverride each with explicit closure-eligibility effect (neutral / improves / retracts). The only operational invariant retained: every closure-eligibility transition is witnessed by an explicit Operation; no silent transitions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(project-plan): correct authority claim per P2 staging discipline (codex inline BLOCKING #4) Codex BLOCKING inline at docs/r4-ctrl-dag-migration-project-plan.md:61: §3 strategy paragraph claimed "contract becomes authority from PR-merge" which contradicted line 73 staging discipline AND violated INVARIANTS P2 (declarations alone are staging, not landed authority). Fix: §3 strategy paragraph now explicitly states .dag files are 🟡 STAGED on merge, NOT 🟢 AUTHORITY. Authority requires generated consumer or emission target. Trio convergence (emission + parity + cut-over PR deletes TS file) is the named dissolution trigger. Consistent with feedback_no_textual_enforcement_bridges.md: textual claims of authority don't substitute for structural enforcement. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(project-plan): Ctrl-Migration Director spawned + line 303 receipt scope (codex inline BLOCKING #5) Two changes: 1. Codex BLOCKING at line 303: brief template scope bullet still said "Practice 4 receipts for any open enum" while acceptance gate #2 (line 314) said "every enum/sum with ≥2 variants". Aligned scope bullet with gate per codex inline BLOCKING #5. 2. Operator directive 2026-05-12T~19:20Z: deep-wolf-155 operates at CEO/PM tier above gunbc R3-close Director zesty-bear-812. Ctrl- Migration Director spawned as CHILD under PM via dashboard-ops work-items create — node://adhoc-dc298bc7-9f7 (status=ready, 2026-05-12T19:20:39Z). Auto-spawn fires within ~30s. §5 tree updated to reflect: - deep-wolf-155 (CEO/PM, root) above zesty-bear-812 - Ctrl-Migration Director as new child of deep-wolf-155 - PM owns inter-program coordination - Each Director independent on program scope Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: C compiler + LLVM in .dag execution promotion plan Per operator directive 2026-05-12T~19:30Z: parallel program plan to ctrl-migration. Promotes existing research-viability artifacts at ~/ctrl/research/.../c-compiler-in-dag/ to executing production program. Existing research is well-developed: - PLAN.md (Brian-approved 2026-05-04 with A1-A10 locks) - W0 shared IR primitives (5 files in extdeps/common/ir/) - W4 LLVM IR spike (DONE — substrate + emit + types + trivial program) - W7 XLS/Verilog spike (DONE) - Phase-2 expression evaluator (DONE) - 3 lens-counterfactual real-world bug case studies - gunbc src/v3/lenses/ has 16 production lens instances ready to consume This doc proposes the EXECUTION shape that consumes the research plan: - Phase A (~1-2 weeks): promote research → production substrate (~6-9 PRs moving W0/W4/W7/phase-2-evaluator into gunbc dsl/extdeps/) - Phase B (~6-12 months parallel): Frontend (W3a + W11) + IR (W2 + W2d) + Lens-Application (W8 + W10) + Pressure-Test - Phase C (multi-month): emission targets (codegen, runtime, linker) - Phase D (open-ended): "LLVM entirely" if pursued Proposed program tree: NEW C-Compiler+LLVM Director under PM/CEO, parallel to zesty-bear-812 (gunbc R3-close) + clever-ant-97 (ctrl- migration). 5 Mgrs (Substrate, Frontend, IR, Lens-Application, Pressure-Test). Scope decision required (Q-A): interpretation (a) "C frontend + LLVM IR substrate" (existing research scope; proposed) vs (b) "LLVM entirely" (optimizer + codegen as .dag; multi-year). 6 open Qs for operator decision (§9). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(project-plan): Wave-1-trio checkpoint + staged-debt throttle (claude #10327 exploratory observations) Per claude #10327 review observations on PR #2775 (APPROVE-with-exploratory): 1. "Ambitious blast radius for a plan in DRAFT; worth a checkpoint after Wave 1 lands one full trio (algebra ✓ + subsystem ✓ + emission ✓) before fanning the rest out, otherwise you risk 16 staged .dag files with no dissolution receipts firing." → §7 now requires WAVE-1-TRIO CHECKPOINT at ~Day 7-10 before Wave 2 dispatch. If trio doesn't converge by Day 10, pause Wave 2 + surface to PM for re-scope. 2. "Parallel ≠ independent: Phase 1.5 PRs that land before their matching Phase 3 emission target are deliberately accepting staged- debt, and the Verification Mgr is the throttle." → §6 now states parallel-with-throttle explicitly. Verification Mgr enforces staged-debt budget: if 3+ subsystems merged with no matching emission, Subsystem-Modeling Mgr PAUSES new dispatch until catch-up. Both observations were exploratory (review verdict was APPROVE not BLOCKING), but substantive design feedback worth incorporating structurally rather than acknowledging. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(r3): remaining-work dependency graph + max-parallelization plan Per operator directive 2026-05-12T~20:00Z: "define the remainder of R3 now, including all dependencies, so we can max parallelize all the work." Comprehensive audit of §1.8 ledger: - 102 R3-load-bearing gates total - ~32 CLOSED (31%); ~40 IN-FLIGHT (39%); ~31 OPEN (30%) - 2 lanes 100% done: T-Omni-Shape-B, T-Free-Consequences-Demonstration - Standing gate #75 PASSING Critical-path identified: - Cluster M (T-Tests-As-Data-Completeness): gate #84 dissolves ~80-90 of 101 SG-0 hand-Rust test entries in single closure. Phase 1 (#85/#86 substrate) dispatch-ready NOW. Total 4-8w to full Cluster M closure. - Cluster F (T-LP-Retirement): gates #81/#82/#83/#95 carve-promoted-IN-R3 per Director 2026-05-09. F-α + F-β.1 parallel-dispatchable NOW. Total 3-4w to full Cluster F closure. 14 gates identified as dispatch-ready NOW (no prerequisite blocking). Wave-1 dispatch plan covers 13-15 parallel workers across 3 R3 Mgrs. Worker spawn capacity analysis: - Substrate Mgr: 16 max, 1 active → +15 budget - Debt-Paydown Mgr: 8 max, 0 active → +8 budget - Verification Mgr: 8 max, 3 active → +5 budget - Total +28 R3 spawn budget; currently at ~5; can scale 5-6x Throughput levers ranked: 1. Land review-parser fix (eliminates per-PR PM bypass overhead) 2. Pre-author Wave-1 briefs in bulk 3. Spawn to Mgr capacity 4. Cluster M Phase 1 immediate dispatch (critical-path) 5. F-β.1 canvas immediate authoring 6. PB Mgr successor spawn (currently no active session) 7. Class-authorization batch merges (Director-ratified) 6 open Qs for operator decision. Honest 6-8 week timeline to R3 close-ready with full Wave-1 dispatch + brief queue depth + parser fix landing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: fix cursor #10356 findings — correct INVARIANTS labels + Phase A scope wording Both BLOCKING findings on already-merged PR #2775 (cursor/composer-2 review #10356): 1. docs/design-decomposition-algebra.md:492 — INVARIANTS labels were wrong: - P1 is "Modeling Faithfulness" (single-authority is a consequence) - P2 is "Boundary Discipline" (illegal-states-unrepresentable is docs/modeling-discipline.md Practice 2, downstream of P2) - P5 is "Progress Is Dissolution" (Pure Bootstrap is the separate docs/design-pure-bootstrap-zero.md thesis) 2. docs/r4-c-compiler-and-llvm-in-dag-program-plan.md:246 — §8 said Phase A is "doc-shape promotion only" but §3 describes ~6-9 PRs promoting .dag substrate into dsl/extdeps/. Reconciled: "no compiler runtime code in Phase A" — typed .dag substrate promotion IS the work (real tree additions); Rust runtime / parser-emitter execution / codegen invocation are Phase B / Phase C scope. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Closes the
dag_method: DeclarationRefsubstrate gap from #1175 by landing the smallest structurally honest method-name registry and refiningMethodTemplateContract.dag_methodto a typedMethodRef. Director-locked options A/A/(a) on parent inbox #1130.This is the first slice; Grounding (#1133) can use the typed refs for
MethodTemplateContractrow population once this lands. No row population, noMethodTranslation/SimpleMethodSpecretirement, no §6aMethodContractcost-shape changes, no algebra template-row rewrite in this PR.P1 / P2 receipt
MethodDeclarationis a new top-level type at the method-identity layer below the per-profileAlgebraFieldTemplaterecords (which carry signature/cost). Its 63databindings are sibling concepts to the algebra-profile values; method identity is not owning-algebra identity (Director Q2 guardrail).MethodDeclarationis identity-only (name: Stringand nothing else). No parameter lists, return types, size effects, cost shapes, profile fields, or render-template facts — those live inAlgebraFieldTemplate(signature/cost) and §6aMethodContract(target-agnostic cost/complexity) and per-target extdeps tables (templates).dsl/std/methods.dagis the sole declaration site for the method-name registry;MethodTemplateContract.dag_method: MethodRefis the sole consumer this slice updates. Algebra template lists indsl/std/algebra.dagcontinue to carry method names asStringuntil a follow-up consumer/refinement PR cuts them over.Director-locked decisions (parent #1130)
dsl/std/algebra.dagper-profile template lists. 63 entries. Not the demand-shaped extdeps subset.join/length/contains/map/etc. each get one decl regardless of how many algebra profiles inhabit them. Per-target render templates already disambiguate.MethodRefshape): option (a) —type MethodRef { decl: DeclarationRef }. Single-field record wrapper.Layering
dsl/std/methods.dagdeclaresMethodDeclaration+ the 63data <name>_method: MethodDeclaration = { name: "<name>" }bindings. Stays v3-spec-free per the existingdsl/std/convention (noimport v3.spec.*).src/v3/std/methods.dagdeclaresMethodRef { decl: DeclarationRef }, importingDeclarationReffromv3.spec.v3_l1. Companion file; lives in v3-space becauseDeclarationRefdoes.src/v3/std/emit_model.dagimportsv3.std.methods { MethodRef }and refinesMethodTemplateContract.dag_methodfrom bareDeclarationReftoMethodRef.Substrate gap residual
The bare-
DeclarationRefadmits-anything residual is now bounded by theMethodRefwrapper (the dispatch's stated goal). The innerdeclstill admits any declaration at the type level — same residual class asPatternRealization(emit_model.dag:140-152empty_variant/cons_variant) andLensInstanceKindWitness.kind_decl(#1186). The resolution check (decl→MethodDeclarationdata binding) is enforced fail-closed at the boundary. Refining toDeclarationRef<MethodDeclaration>is part of the same dissolution trigger named in the lens slice — substrate-level refinement-typing-on-DeclarationRef.Acceptance
src/v3/compiler/tests/integration/method_registry_test.rs— four structural claims:method_registry_covers_all_algebra_template_names— drift-detection: all 63 unique names from algebra-template lists resolve to<name>_methodMethodDeclarationbindings. Adding a template-list name without registry growth fails fail-closed.method_declaration_carries_only_name_field— identity-only discipline.method_template_contract_dag_method_refines_to_method_ref— field type now points atMethodRef, not bareDeclarationRef.method_ref_wraps_declaration_ref—MethodRefis the single-field decl wrapper.SG-0 ratchet receipt added with Director-acceptance citation.
parse_corpus_manifest.txtrefreshed.dsl/std/methods.dagadded to the v3 bootstrap fixture allow-list atsrc/v3/compiler/src/bootstrap_regen_fresh.rs.Commands run
Out of scope (Grounding-owned and follow-up)
dsl/std/algebra.dagAlgebraFieldTemplaterows to import + reference the typed method decls (kept as Director-locked follow-up).MethodTemplateContractrow population using the newMethodReftargets (tracked at session/silent-ant-322 · silent-ant-322 #1133).MethodTranslation(runtime.dag) /SimpleMethodSpec(emit.dag) parallel authorities.decl: DeclarationReftoDeclarationRef<MethodDeclaration>(substrate refinement-typing trigger; same dissolution path asPatternRealization/LensInstanceKindWitness.kind_decl).Test plan
method_template_contractpost-refinement.cargo fmt --all --checkclean.🤖 Generated with Claude Code