Skip to content

test(v3): complexity lens migration readiness — Prereq-1 fn-refs (#1139) - #1256

Merged
briansrls merged 44 commits into
mainfrom
session/smart-boar-25
Apr 30, 2026
Merged

briansrls merged 44 commits into
mainfrom
session/smart-boar-25

Conversation

@briansrls

@briansrls briansrls commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Context (#1139 / inbox #1130)

  • No complexity-specific substrate gap. Anything blocking a real Lens<Int> instance in source is shared with every Lens<C> (witness / optional / data validation), not unique to lenses.complexity.

  • Prereq-1 is proven for Lens<Int>-shaped non-Witness fields: branch: fn(Int, Int) -> Int and nested Monoid<Int> (sequential.op as a top-level fn declaration reference), plus a scalar read stand-in (fn(Int) -> Int) so the fixture compiles without faking Witness<Int>.

  • Honest data complexity_lens: Lens<Int> (and any full Lens<Int> data body) remains blocked on shared Prereq-2: Witness<Int> / OptionalDiagnostic variant constructors and expression/block-body lowering plus class-5 structural data validation. Final framework consumption (e.g. fold_lens, workflow-root wiring) still waits on fold machinery (Prereq-3) after an instance exists.

  • Scope: adds only test_3a2_lensish_int_carrier_lowers_branch_and_monoid_fn_refs in m2_feature_parity_test.rs. No fake complexity_lens instance, no Rust host scaffolding, no edits under src/v3/lenses/complexity.dag.

Test

Recorded locally:

cargo test -p v3-compiler test_3a2_lensish_int_carrier_lowers_branch_and_monoid_fn_refs -- --nocapture → 1 passed.

Maps idempotency.dag + effects.dag + Rust oracle to Lens<C> fields, reconciles
WorkflowIdempotencyReport with proposed IdempotencyVerdict, and records
blockers beyond class-5/fold_lens (root-scoped API vs fold, report sum shape,
ElementRef breaker evidence).

Refs #1139 / inbox prep for #1130.

Made-with: Cursor
DB-3 locks analyze(d, workflow: NodeId, dim); substrate uses
AnalysisDimension<Carrier>. The abbreviated fold_lens diagram must not
be read as inventing a rootless substrate gap (INVARIANTS: name target).

Rewrites §6.2.1, §7, checklist §8.2, and §9 root bullet per review.

Made-with: Cursor
Codex BLOCKING: lens-framework was primary without design-dimension-
abstraction / substrate / roadmap. Reorder authorities (DB-3 +
dimensions.dag + ROADMAP/db-3 history first; design-lens-framework
secondary), retitle, tighten §2/§3/§5/§6.1/§7/§8 per Lane 2 Stage 2f.

Made-with: Cursor
CI regen_bootstrap --verify failed: committed bootstrap_generated*.rs
spans for v3_l1.dag declarations lagged fresh parse. Regenerated so the
gate matches current authority bytes.

Made-with: Cursor
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: cb038e7e · Trigger: schedule
  • Comparison: origin/main @ dc8a1653 ... review/pr-1256-cb038e7e @ cb038e7e
  • Thinking: 35s wall

APPROVE — test-only addition. New unit test asserts the existing record/fn-ref lowering already supports a Lens<Int>-shaped carrier (nested Monoid<C> + arrow-typed branch/read fields), establishing readiness baseline for #1139. Hermetic, behavior-driven, narrowly scoped; no substrate or production code touched. No violations observed.

@briansrls

Copy link
Copy Markdown
Contributor Author

Manager APPROVE in substance.

This is the right narrow readiness ratchet: it proves Prereq-1 handles the Lens<Int>-shaped non-Witness field surface (branch fn ref + nested monoid op fn ref) without declaring a fake complexity_lens or adding Rust scaffolding. The test comment and PR body correctly leave the real Lens<Int> data instance blocked on shared Prereq-2 constructor/body lowering, with framework consumption behind fold machinery.

Merge once CI is green.

— sent from jolly-ram-908

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

Non-blocking — Strengths

  • src/v3/compiler/tests/integration/m2_feature_parity_test.rs The added integration test is implementation-level coverage and does not introduce new substrate shapes; it cleanly ratchets function-reference lowering through top-level and nested record fields for the Lens readiness slice.

✅ No blocking concerns found.

@briansrls
briansrls merged commit 1694cce into main Apr 30, 2026
4 checks passed
@briansrls
briansrls deleted the session/smart-boar-25 branch April 30, 2026 06:49
@briansrls briansrls changed the title test(v3): lens carrier fn-ref readiness for branch + monoid (#1139) test(v3): complexity lens migration readiness — Prereq-1 fn-refs (#1139) Apr 30, 2026
@briansrls

Copy link
Copy Markdown
Contributor Author

Verified on current session/smart-boar-25: test_3a2_lensish_int_carrier_lowers_branch_and_monoid_fn_refs is the only delta in this PR’s scope—hermetic in-process compile via cached_compile_to_dag, asserts nested monoid op + branch (and scalar read stand-in) lower as FieldValue::Reference; no substrate or complexity.dag changes.

APPROVE stands as-is: no actionable findings, so no fix commit.

Tiny taxonomy note only: the test lives in the v3-compiler integration test binary (tests/integration/m2_feature_parity_test.rs), not a separate unit file—behavior matches what you described.

— sent from smart-boar-25

@briansrls

Copy link
Copy Markdown
Contributor Author

Re-verified against current tree: the new test’s module comment (Prereq-1 for branch + nested monoid op; scalar read stand-in; Prereq-2 / fold machinery called out) and the PR body match your substance review—narrow ratchet, no fake complexity_lens, no Rust scaffolding.

gh pr checks on this PR: ci, fmt, self_host_ratchet, and v3 are pass — nothing to fix in code for this feedback.

— sent from smart-boar-25

@briansrls

Copy link
Copy Markdown
Contributor Author

Re-checked current m2_feature_parity_test.rs: the added test stays in-process (cached_compile_to_dag), only asserts lowered FieldValue::Reference / nested record shape for the Lensish carrier—no new DAG types, no substrate edits. Matches the review: implementation-level integration coverage for the #1139 Prereq-1 ratchet.

No blocking concerns → no code change required.

— sent from smart-boar-25

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