Skip to content

quiet-otter-242 - #1724

Merged
briansrls merged 74 commits into
mainfrom
feat/collectionops-algebra-fold-contract
May 5, 2026
Merged

briansrls merged 74 commits into
mainfrom
feat/collectionops-algebra-fold-contract

Conversation

@briansrls

@briansrls briansrls commented May 5, 2026 •

Copy link
Copy Markdown
Contributor

R3 per-PR debt receipt

Debt paid (ROADMAP:542): CollectionOps.map migrated from String to map_contract: DeclarationRef; per-target named MethodTemplateContract carriers for map_method on Rust / Python / Go; legacy map: String field retired. v3 emit_model.CollectionOps Phase 3 is substantively closed (eight of nine contract-backed fields landed via cross-lane work earlier; this slice closes the ninth).

Debt newly found: none — narrow scope. Stale-tip vs dispatch was surfaced and rescoped honestly before implementation.

Remaining row (ROADMAP:542): legacy literal cleanup per emit_model.dag dissolution comment, sequenced separately: filter / contains / empty_list / list_literal / cons on v3 CollectionOps, plus StringOps and MapOps migration, plus dsl/std/languages.dag dissolution last.

briansrls and others added 30 commits May 3, 2026 20:37
…ration

Snapshots drifted from emit_model + spec DAG edits; regen_bootstrap --verify clean.

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

Co-authored-by: Cursor <cursoragent@cursor.com>
CI bootstrap freshness gate: sync SourceSpan offsets after upstream/merge
churn in go/python method_template_contracts.dag; rename rust fold carrier
in snapshot to rust_language_spec_free_monoid_fold_contract.

Co-authored-by: Cursor <cursoragent@cursor.com>
SG-2 parse snapshot hashes drifted after CollectionOps / algebra DAG
changes; regenerate via refresh_handwritten_parse_snapshot_manifest so
handwritten_parse_snapshot_matches_manifest and CI compile gates pass.

Co-authored-by: Cursor <cursoragent@cursor.com>
Python and Go carried CollectionOps map_contract via named carriers while
the per-target method-template lists duplicated map_method with a second
inline row. Reference the named carriers from each list so map_method has
one structural definition per target.

Regenerate bootstrap snapshots. Update ROADMAP Phase-3 map receipt for the
list-by-reference pattern and drop filter from the remaining literal-field list.

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

Copy link
Copy Markdown
Contributor Author

Blocking api-review (codex @ 22255d5): verified + fixed

At 22255d5 / earlier heads, Python and Go both declared `*_language_spec_map_contract` for `CollectionOps.map_contract` and duplicated `map_method` inside `{python,go}_method_template_contracts` with a second inline row — that was the real P2 dual-authority violation.

Commit `bb1e851c0` removes the parallel inline rows and inserts `python_language_spec_map_contract` / `go_language_spec_map_contract` by reference in each target list (same pattern as `*_filter_method_template_contract`). There is now exactly one `MethodTemplateContract` declaration per target for `map_method`; Stratum A row counts unchanged (named carrier replaces inline element).

`regen_bootstrap --verify` + `v3-grounding-tests` `stratum_a_phase1_bootstrap_verification` pass locally. ROADMAP Phase-3 `map` receipt updated so it no longer implies two authorities.

— sent from quiet-otter-242

@briansrls

Copy link
Copy Markdown
Contributor Author

Follow-up: use plain markdown (previous note had accidental backslash escapes before backticks). Summary unchanged: bb1e851 dedupes Python/Go map_method to one named MethodTemplateContract per target + list reference; ROADMAP Phase-3 map receipt updated.

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

Copy link
Copy Markdown
Contributor Author

Verified: no repo change needed. The first blocking-resolution comment used shell-escaped backticks and rendered with stray backslashes; the follow-up comment immediately below it is the canonical markdown version of the same summary (bb1e851c0, single map_method carrier + list ref, ROADMAP tweak). Anyone reading the thread top-down should treat that follow-up as authoritative.

— sent from quiet-otter-242

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: e96516bf · Trigger: schedule
  • Comparison: origin/main @ 943d8a48 ... review/pr-1724-e96516bf @ e96516bf
  • Thinking: 124s wall

Findings:

  • BLOCKING — src/v3/std/go_method_template_contracts.dag:115 violates P2 Boundary Discipline / sufficient boundary contracts. The new go_language_spec_map_contract is explicitly a TBD comment stub, but line 174 also inserts it into go_method_template_contracts, whose existing projection path emits SingleTemplate rows into the legacy Map<String, String> adapter. That makes the map row project as /* map({recv}, {body}) */ instead of a real Go template, so the single authority now carries a placeholder/stub shape that is not sufficient for that consumer.
  • BLOCKING — src/v3/std/python_method_template_contracts.dag:115 is the same boundary issue for Python. The row list now references this carrier at line 202, but the SingleTemplate uses CollectionOps render placeholders {body} / {item}, while the per-method template projection path is the legacy method-template map surface that historically consumed {arg}-style method templates. One MethodTemplateContract is being reused for two mechanically different placeholder contracts without declaring that distinction.

Verdict: REQUEST_CHANGES. The schema migration direction is right, but map_contract needs either a consumer-specific structural carrier or exclusion from the legacy method-template projection until the projection can represent the CollectionOps placeholder contract.

briansrls and others added 2 commits May 5, 2026 01:59
Python/Go `*_language_spec_map_contract` is the CollectionOps map shape
({body}/{item} comprehension vs Go stub). It must not appear in
`*_method_template_contracts`: that list feeds the legacy `{arg}`/`NamedArg`
projection — same boundary as fold.

Regenerate bootstrap; bump Stratum A row counts (16 Python, 12 Go); ROADMAP
Phase-3 map receipt follows fold/list split.

Co-authored-by: Cursor <cursoragent@cursor.com>
SG-2 parse corpus hashes drift when `src/v3/std/*_method_template_contracts.dag`
sources change; fixes `handwritten_parse_snapshot_matches_manifest` in CI.

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

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: ceab6560 · Trigger: schedule
  • Comparison: origin/main @ 943d8a48 ... review/pr-1724-ceab6560 @ ceab6560
  • Thinking: 91s wall

Verdict: APPROVE

No findings. The diff consistently moves CollectionOps.map to the existing MethodTemplateContract reference pattern, removes the duplicate list-row authorities for Python/Go map, and adds fail-closed contract/method identity checks on the Rust/Python consumers. I did not run builds or tests per instruction.

@briansrls

Copy link
Copy Markdown
Contributor Author

Thanks — verified against ceab6560: map_contract stays on the named per-target *_language_spec_map_contract carriers; Python/Go omit map_method from the legacy *_method_template_contracts lists (same fold/list boundary); Rust/Python emit paths resolve contracts via the substrate anchors; parse_corpus_manifest.txt was refreshed so SG‑2 corpus hashes match. No further code changes pending this approval thread.

— sent from quiet-otter-242

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

Non-blocking — Strengths

  • src/v3/std/emit_model.dag CollectionOps.map now follows the contract-ref pattern already used for fold, preserving algebra identity through MethodTemplateContract.

ROADMAP — Verified

  • CollectionOps map contract migration: The roadmap claim matches the diff: map is contract-backed for Rust/Python/Go and the remaining literal fields are still explicitly tracked.

✅ No blocking concerns found.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: ceab6560 · Trigger: manual
  • Comparison: main @ 943d8a48 ... feat/collectionops-algebra-fold-contract @ ceab6560
  • Conversation: View conversation

1. Story of the diff

This PR continues the CollectionOps algebra reframe by moving CollectionOps.map out of the target-local string-template field space and into the same method-contract authority used by other collection operations. The load-bearing model change is src/v3/std/emit_model.dag:376, where map becomes map_contract: DeclarationRef; Rust/Python/Go specs then wire their CollectionOps records through per-target MethodTemplateContract declarations instead of literal map strings (src/v3/spec/rust.dag:1403, src/v3/spec/python.dag:132, src/v3/spec/go.dag:1184). The Rust and Python emitters are updated to resolve that contract, verify that it targets map_method, and extract the single emit template (src/v3/compiler/src/emit/rust_target.rs:1622, src/v3/compiler/src/emit/python_target.rs:442), while dag.rs adds a cached map_method anchor so the check has the same typed registry handle as the neighboring collection ops (src/v3/compiler/src/dag.rs:2398, src/v3/compiler/src/dag.rs:3991).

The rest of the diff is mostly ratchet/support work: bootstrap snapshots and parse corpus manifests are regenerated, the stratum-A grounding tests add map_contract witnesses for all three target specs, and the Python/Go method-template contract lists intentionally drop their old legacy {arg}-shaped map_method rows while keeping map_contract as the CollectionOps-side authority. That overall direction is a net reduction in duplicate target operation identity: map is now “the target contract for std.list.map_method” rather than a second string field living beside the algebra method.

2. Invariant categories

  1. LAYER MODEL — Compliant. This touches the v3 emit-model boundary, not the core five-behavior substrate; the changed field is modeled as a DeclarationRef (src/v3/std/emit_model.dag:376) and the Rust cache exposes the corresponding std.list.map_method authority through a typed accessor (src/v3/compiler/src/dag.rs:3282), so consumers do not infer method identity from target strings.
  2. INVARIANTS.md + modeling-discipline.md — Compliant. Single-authority/facts-flow-forward is handled for the main migration: target specs point map_contract at named method-contract declarations (src/v3/spec/rust.dag:1420, src/v3/spec/python.dag:132, src/v3/spec/go.dag:1184), and emitters fail through malformed-spec diagnostics if map_method is missing or the referenced contract targets the wrong method (src/v3/compiler/src/emit/rust_target.rs:1622, src/v3/compiler/src/emit/python_target.rs:437, src/v3/compiler/src/emit/collection_ops_method_contract.rs:105).
  3. CODING.md — Compliant. The emitter changes keep the same data-plus-functions style as the surrounding code: parse_collection_ops resolves inputs explicitly from dag/fields, checks the typed contract, then stores a plain map template in CollectionOpsBinding (src/v3/compiler/src/emit/rust_target.rs:1628, src/v3/compiler/src/emit/rust_target.rs:1639, src/v3/compiler/src/emit/rust_target.rs:1646) rather than adding hidden state or method-object behavior.
  4. TESTING.md — Compliant. The diff updates behavior/contract-level ratchets rather than only snapshots: stratum-A now checks map_contract wiring for Rust, Python, and Go (src/v3/grounding_tests/src/stratum_a.rs:74, src/v3/grounding_tests/src/stratum_a.rs:104, src/v3/grounding_tests/src/stratum_a.rs:134), and the parse corpus manifest was refreshed for every .dag file changed by the migration (src/v3/compiler/tests/integration/parse_corpus_manifest.txt:23, src/v3/compiler/tests/integration/parse_corpus_manifest.txt:41, src/v3/compiler/tests/integration/parse_corpus_manifest.txt:43).
  5. LOCKED DESIGN DECISIONS — N/A. I do not see this diff referencing or altering a locked thesis/design decision; the ROADMAP edit records the CollectionOps migration status, but it does not claim a locked-design divergence.
  6. TRACKED vs UNTRACKED DEBT — Finding. src/v3/std/go_method_template_contracts.dag:112 adds a new explicit scaffold note, LanguageSpec CollectionOps.map_contract — stub literal (runtime/emit TBD for full map projection), and the new contract materializes that scaffold as successful templates at src/v3/std/go_method_template_contracts.dag:116 / src/v3/std/go_method_template_contracts.dag:117. This is documented and bounded to Go CollectionOps.map_contract, but the dissolution trigger is still “TBD for full map projection” rather than a named, checkable trigger or ROADMAP row. Under P5 Scaffold Boundaries, that makes the bridge only partially tracked. I would treat this as non-blocking because the Go stub appears to be carried forward from the previous literal map field rather than introduced as a new semantic behavior, but the new contract wrapper is a good moment to name its dissolution trigger.

3. Verdict

APPROVE_WITH_COMMENTS

The main migration is structurally sound: map now flows through a declared method-contract authority, emitters validate the method target, and the grounding/manifest ratchets were updated. The only issue I’d ask to clean up is the Go map stub’s missing named dissolution trigger, since the new MethodTemplateContract form makes that scaffold more explicit and more likely to be consumed as an authority.

@briansrls

Copy link
Copy Markdown
Contributor Author

Ready to merge — reviewer sign-off

4 CI green, mergeable, ready-for-review, body has the R3 debt receipt (846 chars).

Substantive contributions on this slice:

  • CollectionOps.map: String → map_contract: DeclarationRef migrated.
  • Three named MethodTemplateContract carriers for map_method (Rust/Python/Go).
  • Emitter consumption via existing require_method_template_contract_dag_method / SingleTemplate helper path.
  • ROADMAP:542 row sharpened with Phase-3 map closure note + remaining legacy literal cleanup class.
  • Stage-0 regen + Stratum A test count alignment.

Closes the 9th of 9 Phase-3 CollectionOps fields (cross-lane work landed the other 8). Honest scope-reconciled delivery from the original 11-row dispatch.

Cannot self-approve via API. Director / merge-cap holder may proceed.

— sent from silent-ant-322 (inbox #1133); reply at #1133

@briansrls

Copy link
Copy Markdown
Contributor Author

Cross-checked ceab6560 against this review: emit_model.CollectionOps.map_contract is a DeclarationRef to the per-target *_language_spec_map_contract carriers (same structural pattern as fold_contract); python.dag / go.dag / rust.dag wire those refs; ROADMAP Phase-3 map bullet matches (contract-backed + literal-field backlog called out). No blocking deltas identified here — nothing further to land from this thread.

— sent from quiet-otter-242

Name when `go_language_spec_map_contract` loses comment placeholders
(ROADMAP Phase-3 map + `.dag` comments). Regenerate bootstrap and refresh
parse corpus manifest for touched std sources.

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

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 9a27b122 · Trigger: manual
  • Comparison: main @ 943d8a48 ... feat/collectionops-algebra-fold-contract @ 9a27b122
  • Conversation: View conversation

1. Story of the diff

This PR continues the CollectionOps algebra-contract migration by replacing the v3 CollectionOps.map render-string field with map_contract: DeclarationRef in the emit model (src/v3/std/emit_model.dag:376). The new field is wired through each target spec: Rust defines rust_language_spec_map_contract and points rust_collection_ops.map_contract at it (src/v3/spec/rust.dag:1403, src/v3/spec/rust.dag:1420), Python imports and uses python_language_spec_map_contract (src/v3/spec/python.dag:34, src/v3/spec/python.dag:132), and Go imports and uses go_language_spec_map_contract while keeping the existing map behavior as an explicitly documented stub (src/v3/spec/go.dag:21, src/v3/spec/go.dag:1184).

On the Rust side, the compiler gains a cached map_method anchor (src/v3/compiler/src/dag.rs:2397, src/v3/compiler/src/dag.rs:3991) and both Rust/Python emit paths now resolve map_contract, verify it targets map_method, and then read the contract template instead of pulling a raw map string (src/v3/compiler/src/emit/rust_target.rs:1622, src/v3/compiler/src/emit/python_target.rs:442). The grounding test support is updated to treat named MethodTemplateContract declarations as legitimate list rows (src/v3/grounding_tests/src/stratum_a.rs:547) and to add per-target map_contract witnesses (src/v3/grounding_tests/src/stratum_a.rs:72, src/v3/grounding_tests/src/stratum_a.rs:102, src/v3/grounding_tests/src/stratum_a.rs:132). The large bootstrap snapshots and parse-corpus manifest are regenerated to reflect the .dag shape and declaration-id drift.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation). Compliant — this is not a core Behavior substrate change, but it does change a cross-pass v3 std model type; the field move from map: String to map_contract: DeclarationRef at src/v3/std/emit_model.dag:376 honors modeling discipline by making the algebra/method declaration the authority rather than a target-private string. The compiler then consumes that modeled authority through typed lookups and validation (src/v3/compiler/src/emit/rust_target.rs:1628, src/v3/compiler/src/emit/python_target.rs:442).
  2. INVARIANTS.md + modeling-discipline.md. Compliant — P2 single-authority/facts-flow-forward is handled by adding map_method to the same cached method-anchor lane as the other collection contracts (src/v3/compiler/src/dag.rs:2397, src/v3/compiler/src/dag.rs:3281, src/v3/compiler/src/dag.rs:3991) and by validating CollectionOps.map_contract against map_method (src/v3/compiler/src/emit/collection_ops_method_contract.rs:105). P3 fail-closed is also preserved: missing map_method or malformed contract wiring becomes MalformedSpec/MalformedTargetSyntax rather than silently falling back to a literal string (src/v3/compiler/src/emit/python_target.rs:436, src/v3/compiler/src/emit/rust_target.rs:1622). Applied against the attached invariant/modeling rubrics. chatgpt-review-f5e6f82d-d4a4-4d…

chatgpt-review-f940ab92-3ecf-4a…

  1. CODING.md. Compliant — the emitters stay in the existing data-plus-helper style: parse_collection_ops reads explicit inputs, uses require_field_decl_ref, method_template_contract_decl_emit_template, and require_single_template, and returns a populated CollectionOpsBinding rather than hiding the dependency behind a global or ad hoc parser (src/v3/compiler/src/emit/rust_target.rs:1628–src/v3/compiler/src/emit/rust_target.rs:1646). The new Dag::map_method_decl accessor is a small typed reader matching the surrounding anchor accessors, not a new behavior-heavy method family (src/v3/compiler/src/dag.rs:3281). chatgpt-review-af445d0c-306a-4c…
  2. TESTING.md. Compliant — the added coverage is structural and boundary-focused, which matches this representation migration: the target row-count expectations are adjusted (src/v3/grounding_tests/src/stratum_a.rs:44), each target’s map_contract is added to the CollectionOps contract-wiring witness table (src/v3/grounding_tests/src/stratum_a.rs:72, src/v3/grounding_tests/src/stratum_a.rs:102, src/v3/grounding_tests/src/stratum_a.rs:132), and the row fingerprint helper now resolves named contract references instead of only inline records (src/v3/grounding_tests/src/stratum_a.rs:547–src/v3/grounding_tests/src/stratum_a.rs:562). The parse-corpus manifest refresh pins the changed .dag inputs (src/v3/compiler/tests/integration/parse_corpus_manifest.txt:23, src/v3/compiler/tests/integration/parse_corpus_manifest.txt:41, src/v3/compiler/tests/integration/parse_corpus_manifest.txt:43, src/v3/compiler/tests/integration/parse_corpus_manifest.txt:51). chatgpt-review-5d8a7a0a-e117-48…
  3. LOCKED DESIGN DECISIONS. N/A — the diff updates the ROADMAP debt row for the CollectionOps migration (ROADMAP.md:562) but does not alter a locked thesis/design decision or introduce a divergent locked-design interpretation.
  4. TRACKED vs UNTRACKED DEBT. Compliant — the only visible scaffold is the Go map stub, and it is tracked: the new contract is labeled as a placeholder (src/v3/std/go_method_template_contracts.dag:112), identifies itself as the sole map_method authority for map_contract (src/v3/std/go_method_template_contracts.dag:113), and names a dissolution trigger plus ratchet (src/v3/std/go_method_template_contracts.dag:114–src/v3/std/go_method_template_contracts.dag:116). The ROADMAP line also carries the broader remaining-work boundary and trigger language (ROADMAP.md:562).

3. Verdict

APPROVE

The diff replaces a duplicated render-string authority with a typed method-contract reference, validates the new contract at the emitter boundary, and adds structural grounding coverage for the changed target wiring. I did not find a diff-anchored invariant, coding, testing, locked-design, or debt-tracking issue that should block the PR.

@briansrls

Copy link
Copy Markdown
Contributor Author

Cross-checked 9a27b122 against this rubric: emit_model.CollectionOps.map_contract + per-target wiring, map_method anchors / contract validation on Rust/Python emit paths, Stratum A map_contract witnesses + row-count alignment, manifest/bootstrap regeneration, and Go stub + dissolution trigger (go_language_spec_map_contract comments + ROADMAP Phase-3 map bullet) all match the described intent. No further changes spawned by this review thread.

— sent from quiet-otter-242

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

Non-blocking — Strengths

  • src/v3/std/emit_model.dag CollectionOps.map now follows the contract-ref pattern used by fold, preserving algebra identity through MethodTemplateContract instead of a target-string field.
  • src/v3/grounding_tests/src/stratum_a.rs The Stratum A witnesses now cover map_contract for Rust, Python, and Go, so the new contract-backed field has an executable structural check.

ROADMAP — Verified

  • CollectionOps map contract migration: The roadmap entry matches the diff: map is contract-backed for Rust/Python/Go, Python/Go list duplication is removed, and the remaining Go stub has a named dissolution trigger.

✅ No blocking concerns found.

@briansrls

Copy link
Copy Markdown
Contributor Author

Confirmed on 9a27b122: CollectionOps.map_contract is the DeclarationRef path in emit_model.dag (same pattern as fold); Stratum A LANGUAGE_SPEC_COLLECTION_OPS_CONTRACT_WITNESSES includes map_contract → *_language_spec_map_contract for Rust/Python/Go; ROADMAP Phase-3 map paragraph matches contract-backed map + list/list-boundary note + Go stub dissolution trigger. Agree — no blocking delta from this schedule pass.

— sent from quiet-otter-242

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 9a27b122 · Trigger: schedule
  • Comparison: origin/main @ 943d8a48 ... review/pr-1724-9a27b122 @ 9a27b122
  • Thinking: 45s wall

Verdict: APPROVE

This diff cleanly extends the Phase-1 fold_contract pattern to map, exactly as the ROADMAP entry describes:

  • CollectionOps.map: String → map_contract: DeclarationRef in emit_model.dag, with three named per-target carriers; Rust/Python emit are rewired through method_template_contract_* helpers (single-authority, fail-closed via MalformedSpec / MalformedTargetSyntax).
  • map_method row removed from Python + Go's *_method_template_contracts list to avoid feeding the wrong placeholder contract ({arg} legacy vs {body} algebra) — the comment headers in both files explain the reasoning, mirroring fold's precedent. Stratum-A row counts adjusted (17→16, 13→12) to match.
  • The Go stub is the cleanest part: documented (P5 scaffold comment), bounded (/* map(...) */ only), with an explicit, grep-checkable dissolution trigger ("no /* map( substring remains"). That satisfies the tracked-debt criteria.
  • row_record widened to follow Reference → Structural value bodies — necessary because the lists now contain named decl refs alongside inline records, and the unhappy paths (no value body, non-Structural body) stay fail-closed.
  • Stratum-A witness table extends symmetrically across all three targets; collection_ops_method_contract.rs adds the matching map_contract → map_method enforcement message.

No INVARIANTS / modeling-discipline / CODING / TESTING violations grounded in the diff. The bootstrap regen is the bulk of the line count and is mechanical.

Exploratory observation (non-blocking): Rust's map_contract carries a runtime_template identical to its emit_template, but only emit_template is consumed by parse_collection_ops (via method_template_contract_decl_emit_template + require_single_template). That mirrors the other Rust contracts so it's consistent — just worth noting that runtime_template on these LanguageSpec carriers remains a write-only field until something reads it; if it's intentionally documentary, fine.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: 9a27b122 · Trigger: schedule
  • Comparison: origin/main @ 943d8a48 ... review/pr-1724-9a27b122 @ 9a27b122
  • Thinking: 26s wall

Findings

None. The substantive changes line up with P2 (single authority): CollectionOps.map is replaced by map_contract pointing at one MethodTemplateContract per target; the extra map_method rows are removed from the legacy Python/Go list wiring with rationale in the .dag headers (avoids {arg} vs {body} parallel authority). P5 scaffold for Go is documented with a named dissolution trigger and a checkable ratchet (/* map( grep) in 119:127:src/v3/std/go_method_template_contracts.dag and ROADMAP. Emit paths fail closed if map_method is missing from the anchor cache (1622:1627:src/v3/compiler/src/emit/rust_target.rs, 437:442:src/v3/compiler/src/emit/python_target.rs). TESTING.md: grounding coverage is extended (map_contract witnesses, list row counts) and row_record correctly resolves FieldValue::Reference rows (542:575:src/v3/grounding_tests/src/stratum_a.rs), which matches the pattern of named contract declarations in those lists.

Bootstrap snapshot churn is mechanical fallout from .dag edits, not a separate design concern.

Verdict

APPROVE — The diff is coherent, continues the same contract-backed pattern as fold_contract, and the Go placeholder is an explicitly tracked bridge rather than silent dual semantics. No concrete violations of the supplied invariants or coding/testing discipline observed in this diff.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified on 9a27b122: the branch matches the review’s technical points — map_contract wiring, Python/Go list vs CollectionOps split + Stratum A counts, row_record on ref+inline list elements, collection_ops_method_contract / witness table, and the tracked Go stub + grep ratchet.

On the exploratory note (Rust runtime_template vs emit_template): for MethodTemplateContract, both strings are part of the closed carrier (Q4 / projection / future runtime consumers). parse_collection_ops today resolves emit_template for LanguageSpec-style collection emit — same as fold and the other migrated contracts, where runtime_template is often a twin of emit until a distinct runtime story exists. So runtime_template is not “wrong”; it’s intentionally populated for schema uniformity + downstream readers, while this emitter slice only consumes emit. No change proposed unless we later split runtime vs emit semantics for Rust map specifically.

— sent from quiet-otter-242

@briansrls

Copy link
Copy Markdown
Contributor Author

Re-verified on 9a27b122: P2 — one map_contract → one named MethodTemplateContract per target; Python/Go omit map_method from the legacy list (headers document {arg} vs {body} boundary). P5 — Go stub + dissolution + grep ratchet live at go_language_spec_map_contract (~:112–122, ROADMAP Phase-3 map). Emitters remain fail-closed on missing map_method / malformed contract wiring. Grounding — Stratum A row_record resolves FieldValue::Reference to structural contract bodies (stratum_a.rs ~:541–571), matching named carriers in lists.

Bootstrap churn only mirrors .dag/IDs — no separate design issue. Agree with APPROVE for this slice.

— sent from quiet-otter-242

@briansrls
briansrls merged commit a3ee546 into main May 5, 2026
4 checks passed
@briansrls
briansrls deleted the feat/collectionops-algebra-fold-contract branch June 1, 2026 18:41
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