Repository navigation
feat(v3): classify string_contains in method registry; populate Python+Go contract rows - #1561
Conversation
…n+Go contract rows Closes #1549 audit Gap 1 (Phase-2 blocker for full `{python,go}_method_template_contracts` parity). Receipt against ROADMAP.md:512 / docs/debt/r3-debt-paydown-ledger-2026-05-02.md:85 ("Method-template consumer migration"). Substrate change in `dsl/std/methods.dag`: adds `data string_contains_method: MethodDeclaration = { name: "string_contains" }` and broadens the registry's documented scope to include target-only emit-shortcut method names (the legacy emit map disambiguates the substring shape from collection-membership `contains` by name — v3's flat-name registry preserves that disambiguation by promoting `string_contains` to a first-class `MethodRef` row key). Per-target row population: - `src/v3/std/python_method_template_contracts.dag` adds `string_contains_method` to imports and a row carrying Python's `{arg} in {recv}` template (matches `dsl/extdeps/languages/python/emit.dag:95`). - `src/v3/std/go_method_template_contracts.dag` adds the same import and a row carrying Go's `strings.Contains({recv}, {arg})` template (matches `dsl/extdeps/languages/go/emit.dag:87`). - Both files retire their "deferred to Phase 2 / Modeling" headers for this row; `chars` (Go-only, escaped-empty-string tokenizer issue) remains skipped per #1549 Gap 4 and is out of scope here. Snapshot/manifest refreshes mechanically follow: - `bootstrap_{generated,generated_without_parse_surface,std_generated}.rs` via `cargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap`. - `parse_corpus_manifest.txt` via `cargo test -p v3-compiler --test integration refresh_handwritten_parse_snapshot_manifest -- --ignored`. Out of scope (per dispatch): Phase-2 deletion of legacy `*_method_templates`, `LanguageSpec` rewrite, PB projection work, Go `chars` row. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review metadata
Findings: None. The substantive change is registry plus contract data: Verdict: APPROVE — Small, coherent closure of the documented |
|
Review pass on #1561: the implementation matches the Gap 1 dispatch. Checked the diff against current Generated churn looks proportionate: I did not rerun the full local validation here; the PR body already reports full v3, targeted method registry/template/substrate tests, clippy, fmt, bootstrap regen, and manifest verification. |
…-disp2 # Conflicts: # src/v3/compiler/src/bootstrap_generated.rs # src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
|
Review metadata
APPROVE — Diff is narrowly scoped and clean: adds |
…-disp2 # Conflicts: # src/v3/compiler/src/bootstrap_generated.rs # src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
71061a1b· Trigger:schedule - Thinking:
399s wall
Non-blocking — Improvements (fix in-PR if easy, else defer to roadmap)
dsl/std/methods.dagBecause dsl/std/algebra.dag already has FreeMonoid scalar contains, the new target-only string_contains entry should explicitly say it is a legacy emit alias and name its dissolution trigger under #1549 Gap 1/R3 if deferred.
✅ No blocking concerns; the Python and Go contract rows preserve MethodRef authority and the target template shapes look consistent.
Per #1561 review feedback (codex): the previous comment risked reading as if algebra `contains` was collection-only. `dsl/std/algebra.dag` already declares `contains` once on `free_monoid_scalar_templates` (String substring) and once on collection profiles (element/key membership) under the same method name; the algebra-profile coordinate carries the disambiguation. The `string_contains` registry entry is specifically a *legacy v2 emit-map alias* that exists only because v2's emit pipeline keys by bare method-name string and disambiguates by minting a separate name. Naming the dissolution trigger explicitly (v2 emit migrating to algebra-profile-keyed dispatch — #1549 audit Recommendations §3-§4 / R3 Method-template-consumer-migration debt row) closes the loop. Comment-only edit; bootstrap snapshots regenerated mechanically because include_str! captures source bytes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review metadata
Findings: None. The substantive diff adds a documented legacy-alias Verdict: APPROVE — Narrowly scoped, consistent with the rubric, and the legacy-alias story is explicitly bounded and dissolvable. Exploratory observations (optional): |
Per #1561 reviewer's optional follow-up: the companion typed-MethodRef file referenced `dsl/std/methods.dag` as carrying "the 63 per-method data bindings", which silently went stale once the dsl file gained the `string_contains_method` legacy emit alias. Acknowledge the alias convention and point at the dsl file's dissolution trigger so the two headers stay in sync. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review metadata
Findings
VerdictAPPROVE — The diff wires Exploratory observations (optional)
|
…-disp2 # Conflicts: # src/v3/compiler/src/bootstrap_generated.rs # src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
Per #1561 reviewer nit. Cosmetic prose cleanup; bootstrap snapshots regenerated mechanically. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review metadata
Reviewed the rubric excerpts and the full substantive diff ( Findings: None. The legacy Verdict: APPROVE — Narrowly scoped registry + contract alignment; no concrete violations of |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
0acc4528· Trigger:schedule - Thinking:
245s wall
Non-blocking — Strengths
dsl/std/methods.dagThe alias classification is tracked bridge debt: documented, bounded to v2 bare-string emit dispatch, and tied to algebra-profile-keyed dispatch as the dissolution path.src/v3/std/python_method_template_contracts.dagThe new row preserves MethodRef authority and matches the legacy Python substring render shape.src/v3/std/go_method_template_contracts.dagThe new row preserves MethodRef authority and matches the legacy Go strings.Contains render shape.
✅ No blocking concerns; the prior classification gap is resolved cleanly.
…-disp2 # Conflicts: # src/v3/compiler/src/bootstrap_generated.rs # src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
|
Review metadata
Verdict: APPROVE The diff is narrowly scoped and the |
…-disp2 # Conflicts: # src/v3/compiler/src/bootstrap_generated.rs # src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
|
Review metadata
APPROVE — narrow, well-documented change. Adds No findings. |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
f7284f55· Trigger:schedule - Thinking:
225s wall
Non-blocking — Strengths
dsl/std/methods.dagThe string_contains alias is documented, bounded to legacy v2 bare-string emit dispatch, and has a named dissolution trigger into algebra-profile-keyed contains dispatch.src/v3/std/go_method_template_contracts.dagThe Go row preserves MethodRef authority and matches the legacy strings.Contains({recv}, {arg}) render shape for substring contains.src/v3/std/python_method_template_contracts.dagThe Python row preserves MethodRef authority and matches the legacy {arg} in {recv} render shape for substring contains.
✅ No blocking concerns.
Bundle 1 + 4b dispatch closure receipts: - row 77 (duplicate record-literal fields) → Retired by PR #1551 - row 91 (SubValueRelation BoundedLattice claim) → Retired by PR #1543 Bundle 3 Phase 1 progress: - row 85 (method-template consumer migration) → Partial; PR #1549 audit landed; Phase 2 in flight (#1560, #1561) Per-PR Debt-Paydown receipt against rows 77, 85, 91. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…l blocked (#1569) * docs(r3): retire rows 77, 91 + Phase-1 partial-close row 85 Bundle 1 + 4b dispatch closure receipts: - row 77 (duplicate record-literal fields) → Retired by PR #1551 - row 91 (SubValueRelation BoundedLattice claim) → Retired by PR #1543 Bundle 3 Phase 1 progress: - row 85 (method-template consumer migration) → Partial; PR #1549 audit landed; Phase 2 in flight (#1560, #1561) Per-PR Debt-Paydown receipt against rows 77, 85, 91. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(r3): correct row-85 framing — #1568 is oracle-only, Gap 4/5 still blocked Per Director correction (#828 reply 4365998510): #1568 is a Rust projection / test-oracle helper only, not the Phase-2 consumer-surface closure. Gap 4 (build-step consumer surface) + Gap 5 remain blocked on substrate build-pipeline support for ephemeral generated-source-root .dag imports (tied to #1558 dissolution-first reframe), or on a Gap 5 design that avoids that surface. Records the routing of all 5 gaps from the #1549 Phase 1 audit: - Gap 1, Gap 2: active in Substrate - Gap 3: reference-only via BootstrapAuthority carrier #1554 (landed) - Gap 4, Gap 5: blocked, calm-tern Phase 2 leaf migration parked Per-PR Debt-Paydown receipt against ledger row 85. 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
docs/debt/r3-debt-paydown-ledger-2026-05-02.md:85— Method-template consumer migration. Closes one of the five Phase-2 blockers from the docs(grounding): method-template consumer migration audit-to-retirement #1549 audit (Gap 1 —string_containsclassification + skipped Python/Go contract rows).dsl/std/methods.dagaddsstring_contains_method: MethodDeclaration = { name: "string_contains" }and broadens the documented registry scope to include target-only emit-shortcut method names. Rationale: the legacy emit map (dsl/extdeps/languages/{python,go}/emit.dag) disambiguates the String-substring shape from the collection-membershipcontainsshape by name; v3's flat-name registry preserves that disambiguation by promotingstring_containsto a first-classMethodRefrow key rather than overloadingcontains_method.src/v3/std/python_method_template_contracts.dag—{arg} in {recv}(matchespython/emit.dag:95).src/v3/std/go_method_template_contracts.dag—strings.Contains({recv}, {arg})(matchesgo/emit.dag:87).bootstrap_{generated,generated_without_parse_surface,std_generated}.rsandparse_corpus_manifest.txt.Out of scope (per dispatch): Phase-2 deletion of legacy
*_method_templates,LanguageSpecrewrite, PB projection work, Gocharsrow (#1549 Gap 4 — separate tokenizer-level issue).Test plan
cargo test -p v3-compiler --test integration -- method_registry method_template_contract m2_substrate_inhabitance— 78 passed (coversmethod_registry_covers_all_algebra_template_names,method_template_contract_per_target_dag_method_unique,bootstrap_method_template_contracts_lower_to_list_with_empty_diagnostics).cargo test -p v3-compiler --test integration— 768 passed; 26 ignored; 0 failed.cargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap— clean regen.cargo test -p v3-compiler --test integration handwritten_parse_snapshot_matches_manifestpasses after refresh.cargo clippy -p v3-compiler --all-targets -- -D warnings.cargo fmt --all --check(pre-push hook).🤖 Generated with Claude Code