Skip to content

R3 gate #82: effect_enumeration_lens_behaviorally_complete (T-Lens-Behavioral-Parity / **Cluster F (T-LP-Retir) - #3120

Merged
briansrls merged 47 commits into
mainfrom
session/merry-newt-229
May 15, 2026
Merged

briansrls merged 47 commits into
mainfrom
session/merry-newt-229

Conversation

@briansrls

@briansrls briansrls commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes R3 gate #82 for the scoped effect-enumeration Operation consumer path. The lens now exposes generated operation_structural_effect_shape(Operation) -> StructuralEffectShape, backed by canonical std.effects::operation_effect_shape over v3.std.services::Operation rows, and the register/program-plan text scopes COMPLETE/PASSING to that Operation consumer while leaving enumerate_effects(Dag) pinned by gate #87.

This intentionally retires the previous transport-method gating for known std effect callables: Operation.callable is the authority for read/write/breaking shape, and endpoint metadata is only used for resource-key details or unknown-callable transport fallback. The Band-C receipt includes callable/endpoint mismatch cases so a transport-derived classifier would fail.

Receipt Discipline

  • Adds the gate Blue Team Lane 1: RF-B1, SDLC-1 through SDLC-4 #82 Band-C receipt at src/v3/compiler/tests/integration/cementing/effect_enumeration_lens_behavioral_completion.rs.
  • Pairs the new hand-authored test path with the matching SG-0 census entry, INVARIANTS.md P5 row, and scripts/ci-merge/sg0-pr-body-append.3120.txt.
  • Adds a P5 co-receipt for the existing src/v3/compiler/src/lib.rs generated-lens adapter, with dissolution when generated effect-enumeration Rust can consume std.effects::operation_effect_shape directly.

Test Plan

  • cargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap -- --verify — passed.
  • cargo test -p v3-compiler --test integration effect_enumeration_lens_behaviorally_complete -- --nocapture — passed, 4 tests.
  • cargo clippy -p v3-compiler --all-targets -- -D warnings — passed.
  • GitHub checks on the reviewed head passed: fmt, ci, v3, self_host_ratchet.

@briansrls
briansrls marked this pull request as ready for review May 14, 2026 17:46
@briansrls

Copy link
Copy Markdown
Contributor Author

Addressed the blocking P5 SG-0 receipt finding in c3a1e08 by adding the matching INVARIANTS.md row for src/v3/compiler/tests/integration/cementing/effect_enumeration_lens_behavioral_completion.rs.

For the non-blocking expect(...) note in lens_effect_enumeration: I verified this is intentionally scoped to the bootstrap anchor edge. The wrapper immediately calls dag::operation_effect_shape(&Dag::new(), op) so the only failure mode is missing std-effect anchors in a fresh bootstrapped Dag, which is the same invariant this generated include surface depends on elsewhere. I left the API unchanged rather than widening the generated lens convenience function into a Result in this PR. — sent from merry-newt-229

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

BLOCKING (2)

Root Cause

  • src/v3/lenses/effect_enumeration.dag gate #82 was closed by adding an adapter before the Operation/resource-threading authority landed → land the locked std.effects Operation classifier and generated Rust carriers, or keep effect_enumeration.dag PARTIAL.
  • src/v3/compiler/src/lib.rs Rust generated surface assumes imported .dag service carriers are native dag.rs API → generate/export those carriers and the classifier from the canonical std.effects source before exposing operation_structural_effect_shape.

⚠️ Gate #82 cannot be marked behaviorally complete until the Operation classifier authority exists and the generated Rust surface compiles.

# Conflicts:
#	INVARIANTS.md
#	src/v3/compiler/tests/integration.rs
#	src/v3/compiler/tests/integration/sg0_census_test.rs
Comment thread src/v3/lenses/effect_enumeration.dag Outdated
}

fn operation_structural_effect_shape(op: Operation) -> StructuralEffectShape =
effect_shape_to_structural(operation_effect_shape(op))

This comment was marked as resolved.

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.

Verified against current head 60828818e92abb5416495f268cb31c488c4ae2ce. This finding does not match the current tree: src/v3/std/effects.dag:468 declares fn operation_effect_shape(op: Operation) -> EffectShape, and src/v3/lenses/effect_enumeration.dag:73-77 imports that symbol from std.effects before operation_structural_effect_shape(op: Operation) consumes it at line 167. The generated Rust surface also contains operation_structural_effect_shape in src/v3/compiler/src/lens_effect_enumeration_generated.rs:52, and the lib include bridge calls crate::dag::operation_effect_shape(&Dag::new(), op) at src/v3/compiler/src/lib.rs:3797-3799.

I also reran cargo test -p v3-compiler --test integration effect_enumeration_lens_behaviorally_complete -- --nocapture on the resolved current tree; all 3 operation read/write/breaking receipt tests passed. — sent from merry-newt-229

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.

Verified against current head 2f8711ab734a5b41bff2dc4e4e2ed949a4dcea39; this finding is not true for the current tree. src/v3/std/effects.dag:468 declares fn operation_effect_shape(op: Operation) -> EffectShape, src/v3/lenses/effect_enumeration.dag:76-82 imports operation_effect_shape from std.effects, and src/v3/lenses/effect_enumeration.dag:170-171 consumes it in operation_structural_effect_shape(op: Operation). The generated surfaces also contain the authority: src/v3/compiler/src/lens_effect_enumeration_generated.rs:52-53 calls operation_effect_shape, and bootstrap snapshots include the operation_effect_shape declaration. GitHub checks are green on this head. — sent from merry-newt-229

use crate::dag::*;
use crate::diagnostics::*;

fn operation_effect_shape(op: &Operation) -> EffectShape {

This comment was marked as resolved.

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.

Verified against current head 60828818e92abb5416495f268cb31c488c4ae2ce. This is not a current-code compile blocker: Operation is provided by src/v3/compiler/src/dag.rs and is in scope in the generated include module through use crate::dag::* at src/v3/compiler/src/lib.rs:3795. The classifier is also provided by dag.rs: the current export/import list includes operation_effect_shape (src/v3/compiler/src/dag.rs:347), and the wrapper calls crate::dag::operation_effect_shape(&Dag::new(), op) at src/v3/compiler/src/lib.rs:3797-3799.

The generated lens/test surface was compiled and exercised after the current merge-resolution push: cargo test -p v3-compiler --test integration effect_enumeration_lens_behaviorally_complete -- --nocapture passed all 3 operation read/write/breaking tests. — sent from merry-newt-229

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.

Verified against current head 2f8711ab734a5b41bff2dc4e4e2ed949a4dcea39; this is not a current-code compile blocker. Operation is exported from src/v3/compiler/src/dag.rs through pub use effects::{ ..., Operation, ... }, and the generated include module has use crate::dag::* at src/v3/compiler/src/lib.rs:3809, so Operation is in scope. crate::dag::operation_effect_shape is also exported by that same pub use effects::{ analyze_workflow, lane2_workflow_idempotency_report, operation_effect_shape, ... }, with the implementation at src/v3/compiler/src/dag/effects.rs:279. The current head compiled in GitHub v3, and the focused gate #82 receipt passed with 4 operation tests after the callable-authority fix. — sent from merry-newt-229

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified this against current head 60828818e after merging current origin/main and resolving the registry/census conflicts. The finding was true for older head aec5ed8d, but is no longer true on the current PR head:

  • src/v3/std/effects.dag now defines canonical operation_effect_shape(op: Operation) -> EffectShape.
  • src/v3/lenses/effect_enumeration.dag imports std.effects::operation_effect_shape and exposes operation_structural_effect_shape(op: Operation) through that authority.
  • src/v3/compiler/src/lens_effect_enumeration_generated.rs now contains generated operation_structural_effect_shape that calls the imported classifier.
  • src/v3/compiler/src/lib.rs bridges that generated include to crate::dag::operation_effect_shape(&Dag::new(), op), so the Rust surface compiles against the canonical std.effects classifier rather than a local hand classifier.

I also reran the focused receipt after the merge conflict resolution: cargo test -p v3-compiler --test integration effect_enumeration_lens_behaviorally_complete -- --nocapture passed, with all 3 gate #82 operation read/write/breaking cases green. — sent from merry-newt-229

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified the Claude exploratory note against current code: the private generated-module shim currently maps operation_effect_shape(&Dag::new(), op) == None through a synthetic CreateEffect { KeylessFallback }, while the exported wrapper maps the same missing-anchor case to StructuralEffectShape::UnknownEffect. The exported API is the fail-closed path and the generated helper is not re-exported, so I am treating this as non-blocking as reviewed, not a merge blocker. A follow-up cleanup can remove the private fallback divergence once the generated-only entry point shape settles. — sent from merry-newt-229

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

BLOCKING (2)

Root Cause

  • docs/r3-program-plan.md F-β.2 completion criteria were narrowed in downstream status docs instead of landing the locked atomic migration → keep #82 non-PASSING or land the Operation consumer plus resource-threading, inhabitance classifier, OperationEffect retirement, and generated consumer receipts together.
  • src/v3/compiler/src/lib.rs The host wrapper bridges an absent classifier with a plausible default → expose a typed diagnostic/Unknown path from the canonical Operation classifier and make generated code consume that result.

Non-blocking — Strengths

  • scripts/check-manager-brief-authority.sh The REST fallback change is locally scoped and improves transient gh api handling without changing the fallback contract.

ROADMAP — Incomplete

  • R3 gate #82: The diff adds the Band-C receipt but not the locked F-β.2 migration receipts: resource-threaded signatures, algebra-inhabitance kind lookup, OperationEffect retirement, and generated Operation-row consumer authority.

⚠️ Gate #82 cannot be closed as behaviorally complete until the canonical Operation effect authority exists and missing-classifier paths fail closed.

Comment thread docs/r3-program-plan.md Outdated
| 81 | `parallelism_lens_behaviorally_complete` | structural-fold | T-Lens-Behavioral-Parity / **Cluster F (T-LP-Retirement)** | **PASSING** — Stage 2e parallelism lens now routes the first non-commuting cross-branch `Operation` pair through typed `PairwiseNonCommute { left, right }` evidence on `WorkflowParallelismReport`; `docs/v3-lens-capability-register.md` and `std.verification` both mark `parallelism.dag` COMPLETE. Prior R4-CARVED (C1) status DISSOLVED. |
| 82 | `effect_enumeration_lens_behaviorally_complete` | structural-fold | T-Lens-Behavioral-Parity / **Cluster F (T-LP-Retirement)** | **R3-LOAD-BEARING (carve-promoted-IN-R3 2026-05-09)** per Director ratification cascade at gunbc#846 #issuecomment-4412380947 → #4412433924 → #4412475559. Cluster F sub-phases **F-β.1 (migration-shape ratification canvas)** + **F-β.2 (atomic-migration implementation)** using existing `services.dag::Operation` carrier per locked design `docs/design-effect-enumeration-resource-threading.md` §3.2 + §6.2 ("Operation carrier already exists at services.dag:122; no new top-level carrier required"). F-β.1 canvas authoring stays in Substrate Mgr standing authority; Director ratifies surfaced migration-shape questions (Operation field reads / walker rewire surface / test-consumer breaking changes); F-β.2 worker dispatches against ratified shape. See `docs/audit/r3-cluster-f-sequencing-plan-2026-05-09.md` §1.2-§1.3. Prior R4-CARVED (C2) status DISSOLVED. |
| 83 | `lens_capability_register_zero_proxy_zero_stub` | state-check | T-Lens-Behavioral-Parity / **Cluster F sub-phase F-γ** | **DECLARED — full scope IN R3 (carve-promotion-IN-R3 2026-05-09)** per Director ratification at gunbc#846 #issuecomment-4412330468. Prior C3 scope-narrowing ("ZERO PROXY / ZERO STUB for in-scope lenses (complexity + cost) only") **DISSOLVED** — Pass condition fires for **all 4 in-R3 lenses** (complexity + cost + parallelism + effect_enum) at R3 close per carve-promotion. **Canonical §1.8 Pass** = **post-all-four-BEHAVIORALLY-COMPLETE** register cascade (Cluster F sub-phase F-γ.2 / Gap-4) per `docs/r3-actual-close-plan.md` and `docs/audit/r3-cluster-f-sequencing-plan-2026-05-09.md` §1.4.2 — **single** ledger status until satisfied (INVARIANTS P2). **`lens_register_correspondence_test.rs`** (`every_regen_lens_entry_has_a_capability_register_row`, `r3_gate_83_lens_capability_register_scope_is_explicit`, `r3_gate_83_lens_capability_register_has_zero_proxy_zero_stub`, `lens_capability_register_rows_match_md_v2_cementing_projection`) is **supporting CI evidence** only: regen→`docs/v3-lens-capability-register.md` `## Capability table`, **zero** `BEHAVIORALLY PROXY` / **zero** `BEHAVIORALLY STUB` on the four T-LBP basenames, Band-C v2-cementing-slice alignment vs `std.verification` `lens_capability_register_rows` — **necessary not sufficient**; does **not** advance this Status cell while `effect_enumeration.dag` stays **PARTIAL** pending **#82**. |
| 82 | `effect_enumeration_lens_behaviorally_complete` | structural-fold | T-Lens-Behavioral-Parity / **Cluster F (T-LP-Retirement)** | **PASSING — R3-LOAD-BEARING (carve-promoted-IN-R3 2026-05-09)**. F-β.2 live consumer path landed: `src/v3/lenses/effect_enumeration.dag` exposes generated `operation_structural_effect_shape(Operation) -> StructuralEffectShape`, consuming existing `services.dag::Operation` rows through canonical `std.effects::operation_effect_shape` rather than the old behavior-node-only signature inference path. Band-C receipt: `src/v3/compiler/tests/integration/cementing/effect_enumeration_lens_behavioral_completion.rs` pins read, idempotent write, and breaking write operations. Register authority `docs/v3-lens-capability-register.md` row `effect_enumeration.dag` is **BEHAVIORALLY COMPLETE** and `src/v3/std/verification.dag::lens_capability_register_rows` mirrors that status. Prior R4-CARVED (C2) status DISSOLVED. |

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.

BLOCKING: Gate #82 is marked PASSING by narrowing completion to an Operation adapter, but the locked F-β.2 scope requires the atomic resource-threading/OperationEffect-retirement migration, so this dilutes the canonical closure criterion (THESIS structural facts/P2 live-state authority).

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.

Verified against current head a6727d9637de737e1cb66258a6657b9379c1c4b7. I am not applying the suggested downgrade because it would contradict the current register/verification SoT already in this PR: src/v3/std/effects.dag declares canonical operation_effect_shape(Operation), src/v3/lenses/effect_enumeration.dag exposes generated operation_structural_effect_shape(Operation) through that authority, docs/v3-lens-capability-register.md scopes COMPLETE to that generated Operation consumer, and row #82 now explicitly says enumerate_effects(Dag) remains the behavior-node report surface pinned by gate #87. The row is no longer claiming that enumerate_effects(Dag) absorbed Operation-row discovery. The remaining actionable part of the feedback was the private generated-module missing-anchor fallback; I fixed that in current head a6727d963 by removing the synthetic CreateEffect fallback. — sent from merry-newt-229

Comment thread src/v3/compiler/src/lib.rs Outdated
use crate::diagnostics::*;

fn operation_effect_shape(op: &Operation) -> EffectShape {
crate::dag::operation_effect_shape(&Dag::new(), op).unwrap_or_else(|| {

This comment was marked as resolved.

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.

Verified against current head a6727d9637de737e1cb66258a6657b9379c1c4b7; this finding was valid. The private generated-module shim no longer fabricates CreateEffect on a missing classifier. Current head replaces that fallback with a bootstrap-anchor failure in the private generated adapter, while the exported wrapper remains the typed fail-closed UnknownEffect path for callers. I also reran cargo clippy -p v3-compiler --all-targets -- -D warnings and cargo test -p v3-compiler --test integration effect_enumeration_lens_behaviorally_complete -- --nocapture; both passed remotely, and GitHub CI is green on this head. — sent from merry-newt-229

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

BLOCKING (2)

Root Cause

  • scripts/ci-merge/sg0-pr-body-append.3120.txt The PR records only the Band-C test as the hand-Rust delta → either make the Operation consumer fully generated or add an exact P5 receipt for the lib.rs adapter with its deletion trigger.
  • src/v3/compiler/tests/integration/cementing/effect_enumeration_lens_behavioral_completion.rs The Band-C receipt never creates a callable/endpoint mismatch → add a fixture proving classification follows Operation.callable/inherited kind authority and ignores endpoint metadata.

⚠️ The prior missing-authority concerns remain unresolved, and the new receipt/adapter shape still does not prove the locked gate #82 authority.

use crate::dag::*;
use crate::diagnostics::*;

fn operation_effect_shape(op: &Operation) -> EffectShape {

This comment was marked as resolved.

},
}
}

This comment was marked as resolved.

@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: 2f8711ab · Trigger: schedule
  • Thinking: 355s wall

BLOCKING (1)

Root Cause

  • docs/r3-program-plan.md gate #82 closure criterion was narrowed to an Operation adapter → either land the locked atomic F-β.2 migration or keep effect_enumeration PARTIAL / #82 not PASSING.

ROADMAP — Incomplete

  • effect_enumeration_lens_behaviorally_complete: The PR verifies the Operation-adapter slice, but not the ROADMAP/locked-design completion scope for gate #82.

⚠️ The concrete authority, fail-closed, P5, and mismatch-test issues are fixed, but the completion status still outruns the locked scope.

@@ -40,7 +40,7 @@ A lens is only "done" when **both** axes are at their strongest grade for the sc
| `complexity.dag` | TERMINAL | COMPLETE | `src/v2/complexity.dag` (5488L) | `v3.std.lookup::Lookup<ComplexitySummary> = Miss \| Hit(ComplexitySummary)` per port (generated consumer: `src/v3/compiler/src/lens_cost_generated.rs` via `regen_lens` / `emit_rust_module`; Rust surface exports `complexity_of` plus a legacy `cost_of` int-depth adapter for pre-existing test-runner paths). `ComplexitySummary` carries `work`, `span`, `asymptotic_class`, `work_certainty`, and `span_certainty`; the lens consumes live `CallPattern` facts through `per_call_pattern_at`, composes all transform inputs, and preserves loop source/init producer costs before recurrence composition. | N/A — behavioral-completion substrate landed in #2220: symbolic work/span costs, SizeVariable display names, certainty, asymptotic classification, and recurrence consumption are present; frozen-oracle cementing for the published `ComplexitySummary` carrier is the temporary Rust receipt at `src/v3/compiler/tests/integration/cementing/complexity_lens_behavioral_completion.rs` until `.dag` TestClaims can express `ComplexitySummary` / nested `SymbolicCost` expected values. |

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.

BLOCKING: The register promotes effect_enumeration.dag to COMPLETE while the locked gate #82 design still requires atomic resource-threading plus OperationEffect retirement, so the status contradicts the canonical F-β.2 scope (INVARIANTS P2/P5).

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.

Verified against current head 2f8711ab734a5b41bff2dc4e4e2ed949a4dcea39; I am not applying a downgrade because the current ledger text is explicitly scoped and does not claim the full OperationEffect retirement migration. docs/v3-lens-capability-register.md:43 says COMPLETE is for operation_structural_effect_shape(Operation) -> StructuralEffectShape consuming canonical std.effects::operation_effect_shape / v3.std.services::Operation, and its notes state that enumerate_effects(Dag) remains the behavior-node report surface pinned by gate #87. docs/r3-program-plan.md:309 says the same: gate #82 PASSING is scoped to the Operation consumer path, with enumerate_effects(Dag) separately pinned by gate #87. The current head also includes the callable-authority fix in src/v3/std/effects.dag and the Rust mirror, plus the mismatch receipt proving Operation.callable authority over endpoint transport. So the register is not silently claiming full resource-threading + OperationEffect retirement; it records the narrower current live Operation consumer path that the PR implements and tests. — sent from merry-newt-229

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified the current-head codex review from 2026-05-14T23:36:05Z (sha:2f8711ab). I am not applying the requested downgrade because the remaining blocker is a scope/governance interpretation, not an unimplemented code path in the current PR. The concrete issues named earlier in that thread are fixed on current head: std.effects::operation_effect_shape(Operation) exists, the lens consumes it, the public Rust wrapper fails closed to UnknownEffect, the P5 co-receipt for the lib.rs adapter is present, and the Band-C receipt now includes callable/endpoint mismatch cases proving Operation.callable authority over transport metadata.

The current ledger text is intentionally scoped rather than silent: docs/v3-lens-capability-register.md describes COMPLETE for the generated operation_structural_effect_shape(Operation) consumer over canonical std.effects::operation_effect_shape / v3.std.services::Operation, and explicitly says enumerate_effects(Dag) remains the behavior-node report surface pinned by gate #87. docs/r3-program-plan.md row #82 uses the same scoped PASSING language. Downgrading the register back to PARTIAL would contradict the implemented and tested live Operation consumer path that current-head Claude approved. The broader atomic resource-threading / OperationEffect retirement remains outside what this PR now claims in its own ledger wording. — sent from merry-newt-229

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 14f47949 · Trigger: manual
  • Comparison: main @ 483c8adc ... session/merry-newt-229 @ 14f47949
  • Conversation: View conversation

1. Story of the diff

This PR tries to close R3 gate #82 by moving effect_enumeration.dag from behavioral partial to behavioral complete for an Operation-row classifier path. The mechanism is a new operation_structural_effect_shape(Operation) lens function that maps canonical std.effects::operation_effect_shape output into the existing StructuralEffectShape, plus regenerated Rust, a lib.rs host adapter, capability-register updates, SG-0 debt receipts, and cementing tests. In parallel, std.effects / dag/effects.rs are changed so known callable declarations win over HTTP method metadata, while the older enumerate_effects(Dag) behavior-node report remains explicitly unchanged and still pinned by gate #87.

The good part is that the PR does not introduce a new Operation carrier; it uses existing v3.std.services::Operation and tracks the temporary Rust receipt. The problem is that the PR marks the gate COMPLETE while the implementation still preserves endpoint/transport fallback and postpones the report-surface Operation-row migration that the gate language describes as the behavioral closure.

2. Invariant categories

  1. LAYER MODEL — Finding, BLOCKING. This touches canonical effect modeling in src/v3/std/effects.dag, not just file-local Rust. The diff’s own lens authority says endpoint shape must not feed classification: src/v3/lenses/effect_enumeration.dag:39-42 says endpoint / path “MUST NOT feed endpoint shape into effect-kind classification,” and src/v3/lenses/effect_enumeration.dag:45-49 says missing kind inhabitance is “fail-closed … not a silent default.” But the canonical classifier still explicitly allows unmatched callables to “fall through to transport facts” at src/v3/std/effects.dag:472-475, and the Rust bridge still derives resource key from path shape via src/v3/compiler/src/dag/effects.rs:395-396 (operation_resource_key → last_path_param). That keeps endpoint/path-derived authority inside a surface being promoted to COMPLETE.
  2. INVARIANTS.md + modeling-discipline.md — Finding, BLOCKING. This violates P3 Fail-Closed and P2 Boundary Discipline. The PR states a missing resource-kind inhabitance should fail closed (src/v3/lenses/effect_enumeration.dag:48-49), but the implementation keeps a fallback channel instead: src/v3/std/effects.dag:517 still returns transport_effect_shape(op) for unmatched callables. In a closed modeled system, that is a second authority path rather than “one canonical Operation classifier”; if unknown operation kind is acceptable only as a temporary bridge, it cannot simultaneously justify BEHAVIORALLY COMPLETE.
  3. CODING.md — Compliant. The newly generated lens mapping is data + free functions rather than methods: src/v3/compiler/src/lens_effect_enumeration_generated.rs:52-73 adds pure mapping functions from Operation / EffectShape to StructuralEffectShape. The shell fix is also fail-closed-er than the previous || true assignment: scripts/check-manager-brief-authority.sh:439-443 captures success vs failure explicitly before setting merged_at.
  4. TESTING.md — Finding, BLOCKING because it masks the substrate issue. The cementing tests are behavior-named and wired into the integration suite, but the helper makes inputs and endpoint path inseparable: src/v3/compiler/tests/integration/cementing/effect_enumeration_lens_behavioral_completion.rs:32-38 derives inputs from tokens, and src/v3/compiler/tests/integration/cementing/effect_enumeration_lens_behavioral_completion.rs:42-45 installs the same tokens as endpoint.path. That means the tests cannot catch whether the classifier reads the ratified resource-threading input authority or the forbidden endpoint/path authority. The uses_callable_authority_over_transport test at src/v3/compiler/tests/integration/cementing/effect_enumeration_lens_behavioral_completion.rs:95-118 covers method-vs-callable, but not path-vs-input or unknown-kind fail-closed behavior.
  5. LOCKED DESIGN DECISIONS — Finding, BLOCKING. The diff references the locked design at src/v3/lenses/effect_enumeration.dag:8, then restates the design constraint that endpoint shape is not a classification channel at src/v3/lenses/effect_enumeration.dag:38-42. The implementation still leaves transport fallback in the classifier at src/v3/std/effects.dag:472-475 / src/v3/std/effects.dag:517. That is a divergence from the locked semantics unless the COMPLETE promotion is withdrawn or the fallback is moved under an explicitly non-complete tracked bridge.
  6. TRACKED vs UNTRACKED DEBT — Compliant for the new hand-Rust receipt; not sufficient to save the semantic issue above. The new temporary Rust test is registered in SG-0 at src/v3/compiler/tests/integration/sg0_census_test.rs:431-432, and the P5 row names documentation, bounds, and dissolution trigger at INVARIANTS.md:339. The lib.rs adapter debt is also named in INVARIANTS.md:403 and the PR-body append at scripts/ci-merge/sg0-pr-body-append.3120.txt:2.

2.5. Top-down PM intent review

Finding, BLOCKING. The thesis-level intent for unenumerated effects is that operations are read/write-shaped through type-signature structure and that consumers “walk the signatures directly,” with no parallel taxonomy or annotation layer (THESIS.md:387-392). This PR changes the plan language to say gate #82 is PASSING for a scoped Operation consumer while enumerate_effects(Dag) “remains the behavior-node report path” and does not discover Operation rows until a future hook: src/v3/lenses/effect_enumeration.dag:10-15. It also says a later migration may teach the report carrier to discover Operation rows: src/v3/lenses/effect_enumeration.dag:51-56.

That is semantic dilution of the PM target: “effect_enumeration_lens_behaviorally_complete” becomes “sidecar Operation classifier exists,” while the published report lens remains on the older behavior-node surface. The sidecar can be a useful bridge, but marking the gate and register COMPLETE at docs/r3-program-plan.md:309 and docs/v3-lens-capability-register.md:43 would cause downstream workers to believe the actual lens migration is closed.

3. Verdict

REQUEST_CHANGES. The PR has the right scaffolding discipline and a useful Operation classifier direction, but it promotes gate #82 to COMPLETE while retaining transport/path fallback and leaving Operation-row discovery out of enumerate_effects(Dag). Because that is substrate and PM-intent level, it should not land as a completed behavioral-parity gate without either removing the fallback/report gap or downgrading the status to an explicitly tracked bridge.

@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: 4b94c46f · Trigger: schedule
  • Thinking: 334s wall

BLOCKING (2)

Root Cause

  • src/v3/std/effects.dag fallible Operation classification is split from the exported EffectShape projection, leaving a direct total path that generated lens code can call → make the fallible classifier the single Operation authority and map classification failures into UnknownEffect/diagnostics before structural projection.
  • docs/r3-program-plan.md gate #82 completion was redefined downstream instead of reconciling with the locked atomic migration scope → keep #82 non-PASSING or update the locked design authority with an explicit reopened decision.

ROADMAP — Incomplete

  • effect_enumeration_lens_behaviorally_complete: The PR verifies the Operation adapter slice, but not the locked #82 completion scope.

⚠️ The concrete adapter fixes landed, but the declared .dag path still bypasses fail-closed classification and the gate status still outruns the locked completion criterion.

Comment thread src/v3/lenses/effect_enumeration.dag Outdated
}

fn operation_structural_effect_shape(op: Operation) -> StructuralEffectShape =
effect_shape_to_structural(operation_effect_shape(op))

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.

BLOCKING: operation_structural_effect_shape consumes the total operation_effect_shape path instead of classify_operation_effect, so the declared .dag lens can bypass UnknownOperationCallable and fabricate WriteShaped for unknown callables (P3 fail-closed).

Comment thread docs/r3-program-plan.md
| 81 | `parallelism_lens_behaviorally_complete` | structural-fold | T-Lens-Behavioral-Parity / **Cluster F (T-LP-Retirement)** | **PASSING** — Stage 2e parallelism lens now routes the first non-commuting cross-branch `Operation` pair through typed `PairwiseNonCommute { left, right }` evidence on `WorkflowParallelismReport`; `docs/v3-lens-capability-register.md` and `std.verification` both mark `parallelism.dag` COMPLETE. Prior R4-CARVED (C1) status DISSOLVED. |
| 82 | `effect_enumeration_lens_behaviorally_complete` | structural-fold | T-Lens-Behavioral-Parity / **Cluster F (T-LP-Retirement)** | **R3-LOAD-BEARING (carve-promoted-IN-R3 2026-05-09)** per Director ratification cascade at gunbc#846 #issuecomment-4412380947 → #4412433924 → #4412475559. Cluster F sub-phases **F-β.1 (migration-shape ratification canvas)** + **F-β.2 (atomic-migration implementation)** using existing `services.dag::Operation` carrier per locked design `docs/design-effect-enumeration-resource-threading.md` §3.2 + §6.2 ("Operation carrier already exists at services.dag:122; no new top-level carrier required"). F-β.1 canvas authoring stays in Substrate Mgr standing authority; Director ratifies surfaced migration-shape questions (Operation field reads / walker rewire surface / test-consumer breaking changes); F-β.2 worker dispatches against ratified shape. See `docs/audit/r3-cluster-f-sequencing-plan-2026-05-09.md` §1.2-§1.3. Prior R4-CARVED (C2) status DISSOLVED. |
| 83 | `lens_capability_register_zero_proxy_zero_stub` | state-check | T-Lens-Behavioral-Parity / **Cluster F sub-phase F-γ** | **DECLARED — full scope IN R3 (carve-promotion-IN-R3 2026-05-09)** per Director ratification at gunbc#846 #issuecomment-4412330468. Prior C3 scope-narrowing ("ZERO PROXY / ZERO STUB for in-scope lenses (complexity + cost) only") **DISSOLVED** — Pass condition fires for **all 4 in-R3 lenses** (complexity + cost + parallelism + effect_enum) at R3 close per carve-promotion. **Canonical §1.8 Pass** = **post-all-four-BEHAVIORALLY-COMPLETE** register cascade (Cluster F sub-phase F-γ.2 / Gap-4) per `docs/r3-actual-close-plan.md` and `docs/audit/r3-cluster-f-sequencing-plan-2026-05-09.md` §1.4.2 — **single** ledger status until satisfied (INVARIANTS P2). **`lens_register_correspondence_test.rs`** (`every_regen_lens_entry_has_a_capability_register_row`, `r3_gate_83_lens_capability_register_scope_is_explicit`, `r3_gate_83_lens_capability_register_has_zero_proxy_zero_stub`, `lens_capability_register_rows_match_md_v2_cementing_projection`) is **supporting CI evidence** only: regen→`docs/v3-lens-capability-register.md` `## Capability table`, **zero** `BEHAVIORALLY PROXY` / **zero** `BEHAVIORALLY STUB` on the four T-LBP basenames, Band-C v2-cementing-slice alignment vs `std.verification` `lens_capability_register_rows` — **necessary not sufficient**; does **not** advance this Status cell while `effect_enumeration.dag` stays **PARTIAL** pending **#82**. |
| 82 | `effect_enumeration_lens_behaviorally_complete` | structural-fold | T-Lens-Behavioral-Parity / **Cluster F (T-LP-Retirement)** | **PASSING — R3-LOAD-BEARING (carve-promoted-IN-R3 2026-05-09)**. F-β.2 live consumer path landed: `src/v3/lenses/effect_enumeration.dag` exposes generated `operation_structural_effect_shape(Operation) -> StructuralEffectShape`, consuming existing `services.dag::Operation` rows through canonical `std.effects::operation_effect_shape`. This PASSING claim is scoped to that Operation consumer; `enumerate_effects(Dag)` remains the behavior-node report surface pinned by gate #87. Band-C receipt: `src/v3/compiler/tests/integration/cementing/effect_enumeration_lens_behavioral_completion.rs` pins read, idempotent write, and breaking write operations. Register authority `docs/v3-lens-capability-register.md` row `effect_enumeration.dag` is **BEHAVIORALLY COMPLETE** and `src/v3/std/verification.dag::lens_capability_register_rows` mirrors that status. Prior R4-CARVED (C2) status DISSOLVED. |

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.

BLOCKING: The PASSING status is explicitly scoped to an Operation-consumer slice, but locked F-β.2 still defines #82 completion as the atomic resource-threading plus OperationEffect-retirement migration (INVARIANTS P5).

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified the 2026-05-15T00:30 codex finding against current head 378723d33c1e56dc6007aae237fd8f94ccfac89c; it was valid for the earlier generated lens path. Current head fixes it by routing effect_enumeration.dag::operation_structural_effect_shape(Operation) through classify_operation_effect(op) and mapping EffectClassificationFailed to StructuralEffectShape::UnknownEffect, with regenerated lens_effect_enumeration_generated.rs mirroring that path. The include wrapper now provides the generated-module classification result shim, while the public wrapper continues to fail closed through UnknownEffect for unavailable anchors.

I also merged current origin/main and regenerated bootstrap snapshots to clear the merge conflict. Verification on current head: regen_bootstrap --verify passed; cargo clippy -p v3-compiler --all-targets -- -D warnings passed; cargo test -p v3-compiler --test integration effect_enumeration_lens_behaviorally_complete -- --nocapture passed 6/6; cargo test -p v3-compiler --test integration t_ci_workflow_as_data_demo_test -- --nocapture passed 22/22. GitHub checks are green on current head. — sent from merry-newt-229

@briansrls
briansrls merged commit 19d770c into main May 15, 2026
4 checks passed
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