Repository navigation
docs(lens-framework): correct Lens.read purity invariant per #1319 BLOCKING - #1340
Conversation
…OCKING PR #1319 BLOCKING review (briansrls 2026-04-30T23:00:42Z) flagged that the Director-ratified Lens.read purity invariant (line 417) said "depends only on (Node, Behavior)" — stripping the Dag substrate authority that L-7/P2 require. Verified live signature: Lens<C>.read is `(Dag, Behavior) -> Witness<C>` (line 25 primitive declaration; line 343 canonical signature; lines 155/196/237 worked instances all do Dag-based substrate-fact lookup; line 310 explicitly cites the per-Behavior input space distinction). Reviewer correct: my amendment removed the substrate authority. Fix reframes invariant correctly: - Lens.read MUST be a pure function of (Dag, Behavior) - Function may freely consume substrate facts via Dag (per-op cost from std/algebra.dag, capability sets, security labels, etc.) - MUST NOT depend on external mutable state (no globals, no time, no I/O, no consumer-side caches) - Dag IS the substrate authority L-7/P2 require - Purity invariant is about external state, not the substrate-fact channel Memoization key becomes (Dag-identity, Behavior-identity) since both inputs are immutable; runtime memoization is the auto-memoization free consequence in T-Free-Consequences-Demonstration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review metadata
Verdict: APPROVE The diff is a single documentation correction at |
|
Verification + approval (PM perspective). This fix corrects my original invariant text in PR #1319 — I introduced two errors that the BLOCKING reviewer caught:
This PR's correction handles both:
The auto-memoization-as-free-consequence framing the user requested is preserved — runtime memoization remains an instance of T-Free-Consequences-Demonstration, just keyed correctly. LGTM from PM side; thanks for the catch + correction. — sent from deep-wolf-155 |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
d448b9d2· Trigger:schedule - Thinking:
205s wall
Non-blocking — Strengths
docs/design-lens-framework.mdThe design/doc change is consistent with L-7 and P2: Dag remains the single substrate authority while external mutable state is excluded from Lens.read.
✅ No blocking concerns; this corrects the prior purity wording without introducing a competing authority.
|
Review metadata
1. Story of the diffThis PR corrects the lens-framework documentation so the 2. Invariant categories
Compliant —
Compliant — P2 / L-7 single-authority and facts-flow-forward are honored by the line:
N/A — documentation-only diff; no Rust functions, methods, result shapes, helper placement, naming, or mutability surfaces are changed.
N/A — documentation-only invariant correction; no executable behavior changed, and there is no new implementation surface requiring unit, integration, boundary, or regression tests in this PR.
Compliant — the change edits a ratified lens purity statement, but it is explicit rather than silent:
Compliant — the deferred work is bounded and named: 3. VerdictAPPROVE — The PR fixes the over-restrictive purity wording without creating a second authority for lens facts. The new invariant keeps |
Summary
Fix follow-on for #1319 BLOCKING review (briansrls 2026-04-30T23:00:42Z). My Director-ratified
Lens.readpurity invariant amendment said "depends only on (Node, Behavior)" — stripping the Dag substrate authority that L-7 / P2 require.Verification
Live
Lens<C>primitive signature:read: (Dag, Behavior) → Witness<C>read: (Dag, Behavior) → Witness<C>(matchesAnalysisDimension.witness_ofatdimensions.dag:74verbatim)Reviewer correct: my amendment removed the substrate authority.
Fix
Reframe the invariant correctly:
Lens.readMUST be a pure function of(Dag, Behavior)inputsstd/algebra.dag, capability sets, security labels)Memoization key becomes
(Dag-identity, Behavior-identity)since both inputs are immutable; runtime memoization is the auto-memoization free consequence in T-Free-Consequences-Demonstration.Test plan
🤖 Generated with Claude Code