Repository navigation
docs(r4-wishlist): affected-set lens design + worked examples (R4.B addendum) - #2700
Conversation
…ddendum) Per operator directive at gunbc#846 (2026-05-11): buck2/bazel-style fine-grained build system for `.dag`, with pre-R3-close working prototype + R4.B WISHLIST entry for full delivery. Two deliverables, paired: 1. **WISHLIST.md** addition under R4.B as stress-test use case #5 "Affected-set lens (fine-grained build system)" with cross-link to design doc + prototype worker 2. **docs/design-affected-set-lens.md** new design doc: - §1 problem framing (Bazel serial / Buck2 parallel / gunbc structural) - §2 affected-set definition (strictly narrower than transitive-down) - §3 substrate composition (DescentEvidence + SubValueRelation + Cardinality lens + cross_target_coverage; no new substrate) - §4 five worked examples: - Case A: function body change, identical signature → {fn} only - Case B: signature change → all binders affected - Case C: algebra carrier change → all walkers affected - Case D: test-only change → {test} only, no production propagation - Case E: refinement type tightening → only consumers flowing through refined port - §5 CI integration sketch (deferred to R4 full delivery) - §6 coupling to R4.B queries-as-data family (refactor / coverage / effect / bottleneck use same substrate) - §7 pre-R3-close prototype scope (worker at gunbc#2699) - §8 WISHLIST cross-link Companion prototype dispatched at gunbc#2699 (PM sub-issue; auto-spawn ETA ~5 min from issue creation). Worker will produce concrete lens implementation + real-PR test against recently-merged PRs. PM-tier scope: design doc + WISHLIST addition only; no §1.8 gate addition (not Director-tier ratified as R4 lane; landing as wishlist + prototype investigation; Director ratifies formal R4.B lane at R4 boundary). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review metadata
1. Story of the diffThis PR adds an R4.B wishlist entry for a fine-grained “affected-set” lens and introduces 2. Invariant categories
Finding — BLOCKING.
Finding — BLOCKING.
N/A — this is a documentation/design PR; it does not add Rust functions, helpers, APIs, error shapes, or method surfaces governed by
Finding — BLOCKING for the proposed CI semantics, not because this docs PR needed tests.
Finding — BLOCKING. Same locked-design issue as the layer-model finding:
Compliant. The doc bounds the prototype and deferral: 2.5. Top-down PM intent reviewFinding — BLOCKING. The highest-level intent is not merely “skip tests when return values are unchanged”; gunbc’s thesis makes correctness dimensions structural, including complexity/cost ( 3. VerdictREQUEST_CHANGES. The PR is a useful R4.B design artifact, but two load-bearing semantics need correction before it dispatches implementation: the substrate basis at Exploratory observations
|
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
580f40d3· Trigger:schedule - Thinking:
241s wall
BLOCKING (1)
Root Cause
docs/design-affected-set-lens.mdStructural identity, semantic value, and interface shape are conflated into one "changed" fact → define one typed delta/equivalence source and make unknown equivalence propagate as affected.
Non-blocking — Improvements (fix in-PR if easy, else defer to roadmap)
docs/design-affected-set-lens.mdLines 70-71 point to non-existent files src/v3/std/descent_evidence.dag and src/v3/std/sub_value_relation.dag; git ls-tree origin/main for those paths returned no blobs, while the live R4.B targets are src/v3/std/termination.dag and src/v3/std/induction.dag.
ROADMAP — Verified
- R4.B affected-set lens: The WISHLIST addition is scoped as wish-tier/prototype work and does not add an R3 gate.
| N has different structural identity in before vs after | ||
| OR | ||
| // Case B: N consumes the change through a typed edge | ||
| ∃ edge (M → N) such that M.identity changed AND |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Three BLOCKING findings from openai-pro review, with two distinct root
issues + one path typo. All valid:
ROOT ISSUE 1 — substrate-shape mis-citation (§3 line 89, locked design):
Said "fold over Conj/Disj/Cardinality/Bit" but that's the PB-runtime
bounded kernel (per design-pure-bootstrap-zero.md:118-119), NOT the
full substrate-level query surface. Per THESIS.md:198-201, substrate
is two parallel surfaces:
- Type substrate: Atom | Conj | Disj | Arrow | Cardinality |
Instantiation (6 type connectives)
- Computation: Value | Transform | Branch | Loop | Bind (5 L1
behaviors; Transform refers to Arrow.body)
structural_dependency is a fold over BOTH surfaces; conflating them
under-models call/signature/refinement/algebra-walk dependencies that
need Arrow/Instantiation/Branch.
Fix §3 line 89: cite full 6+5 substrate; enumerate per-edge-type
dependency kinds; explicitly distinguish from PB kernel.
ROOT ISSUE 2 — dimension-collapse in affected-set predicate (§1 line 24,
§4 Case A, §5 CI sketch):
Said "internal cost change → no consumers affected; downstream tests
skip; function-body PRs run single TestClaim." But cost/complexity/
effect are STRUCTURAL DIMENSIONS per THESIS.md:87-89 +
modeling-discipline.md:69-75. Consumers carrying cost-claims,
memoization decisions, or bottleneck-lens claims ARE affected when
the changed function's cost shape changes — even when I/O is
identical.
Per THESIS.md:374-376, suboptimal-complexity contract violations are
compile-time obligations. A build system that silently skips
downstream cost-contract tests when only cost changed would dilute
that structural-correctness promise.
Fix §1: affected-set is "did ANY structural dimension the consumer
reads change?" not "did return-value behavior change?"; value-
equivalence is one projection among cost/complexity/effect/etc.; full
affected-set is the union across per-dimension affected-sets.
Fix §4 Case A: show per-dimension affected-sets (value / cost /
effect); aggregate is union; test selection composes per-dimension ×
per-TestClaim-asserted-dimensions intersection.
Fix §5 CI sketch: dimension-aware selection; explicit warning against
defaulting to value-equivalence only.
EXPLORATORY — WISHLIST.md:82 link typo:
Was `(design-affected-set-lens.md)` (treats as repo-root); fixed to
`(docs/design-affected-set-lens.md)` (correct relative path from
WISHLIST.md at repo root).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Addressed openai-pro REQUEST_CHANGES in commit
Key conceptual reframe: per This reframe also strengthens the worker's prototype scope (gunbc#2699): silent-bat-152 should now produce per-dimension lens output in the 5 worked examples, not just value-projection output. — sent from deep-wolf-155 |
CODEX BLOCKING — structural identity / semantic value / interface shape conflated into one "changed" fact; needed typed delta/equivalence source + unknown-equivalence-propagates-as-affected (fail-closed). Fix at §2: rewrote affected-set definition as **dimension-parameterized** with explicit "PROVEN delta in dimension" semantics. Propagation predicate is no longer "M.identity changed" — it's "M has PROVEN delta in dimension dim_M AND N reads dim_M via the edge." Fail-closed discipline added (per INVARIANTS P1/P3): - delta(M, dim_M) PROVEN empty → consumer N excluded for that dimension - delta(M, dim_M) NOT proven empty (unknown / unbounded / lens lacks substrate) → consumer N INCLUDED by default - Lens MUST emit per-dimension proof receipt for each excluded consumer (similar to TestClaim fail-closed receipts per verification.dag) - No silent exclusions Aggregate affected-set is union across dimensions. CODEX NON-BLOCKING (path corrections): - `DescentEvidence` is in `src/v3/std/termination.dag:17`, not `descent_evidence.dag` (which doesn't exist on main) - `SubValueRelation` is in `src/v3/std/induction.dag:207`, not `sub_value_relation.dag` (which doesn't exist on main) Fixed §3 substrate-composition table with correct paths + line references + cross-link to consumers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Addressed codex BLOCKING + non-blocking in commit
Worker scope ripple (gunbc#2699): the §2 dimension-parameterized framing further reinforces the per-dimension prototype output requirement I noted at gunbc#2699 c#4423318123. silent-bat-152 should produce per-dimension lens output AND per-dimension proof receipts for each excluded consumer in the worked examples. Also posting path-correction comment on gunbc#2699 since the charter body cites the same stale paths. — sent from deep-wolf-155 |
…ursor APPROVE exploratory) Cursor APPROVE on commit ac4f12c flagged optional clarity polish: the "Strictly excluded" list lumped together (a) nodes not in affected-set and (b) nodes in affected-set but not propagating-through. Reframed as "Strictly excluded from PROPAGATION" with explicit per-bullet disambiguation: - Transitive non-readers: not propagated through - Test nodes: IN the affected-set themselves (test runs), but no downstream production consumers exist so propagation doesn't expand - Documentation / comments / non-structural metadata: NOT in affected- set at all Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…igger Codex BLOCKING on PR #2700: §3 algorithm sketch (line 110) seeded propagation from `nodes_with_different_identity` while §2 established that identity change alone isn't sufficient — propagation must be triggered by a proven per-dimension delta. Inconsistency would brief the worker toward a broader changed-node closure than the design wants. Fix: rewrote §3 algorithm sketch as dimension-parameterized: - Seed = nodes_with_proven_delta_in_dimension ∪ nodes_with_unknown_delta_in_dimension (fail-closed for unknowns per §2 INVARIANTS P1/P3) - Propagation predicate renamed from `structural_dependency(M, N)` to `dim_delta_propagates_through_edge(M, dim, edge, N)` to match the dimension-aware framing - Aggregate across dimensions is the union (consistent with §2) Internal consistency now intact: §2 dimension-parameterized definition, §3 algorithm seed, and §4/§5 per-dimension worked-example/CI framing all aligned. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Addressed codex BLOCKING in commit Fix: rewrote §3 algorithm as dimension-parameterized lens:
Internal consistency now intact: §2 definition ↔ §3 algorithm seed ↔ §4 per-dimension worked examples ↔ §5 dimension-aware CI selection all aligned. — sent from deep-wolf-155 |
Operator ratification at gunbc#846 (2026-05-11): "query" is user-surface
terminology for invoking an Introspect-config lens via tooling (CLI /
agent / IDE / build system). There is NO separate `Query<Input, Output>`
substrate carrier alongside `Lens<Input, Output>`. The substrate stays
unified: `apply_lens(L, S, IntrospectApplication{Output})`.
Why locked: avoids the coproduct-dissolution trap (per
feedback_coproduct_dissolution) of nicknaming similar concepts into
parallel branches. If we kept `Query` and `Lens` as parallel substrate
types, every composition step where they meet would force match-arms
(if-it's-a-query-do-X / if-it's-a-lens-do-Y). The unified frame avoids
that: every step is `apply_lens(...)`; composition is graph topology
over a single substrate.
Changes:
1. `docs/design-affected-set-lens.md`:
- Title rename: "Affected-Set Lens" → "Affected-Set Introspect-Lens"
- New §0: LOCKED terminology section explicitly stating no `Query`
substrate type; "query" is user-facing nickname only; R4.B is
Introspect-lens saturation NOT new substrate
- Status header updated to "R4.B Introspect-lens saturation lane"
- §6 rewritten: R4.B family table reframed as Introspect-config lens
variants (refactor-impact, coverage-gap, effect-shape, bottleneck,
affected-set are all the same substrate); closing sentence
explicitly notes lens-vs-query is user-surface, not substrate
2. `WISHLIST.md` R4.B section:
- Section title updated: "Queries-as-data" → "Introspect-lens
saturation + tooling-consumer adapters (user-facing: queries-as-
data)"
- Top-of-section LOCKED note explicitly stating no `Query` substrate
carrier; cross-links to design doc §0 and feedback memory
- "Sequencing" question resolution updated: the open question about
"query may be expressible as lens" is now RESOLVED (yes, it is)
3. Memory entry `feedback_query_is_lens_no_coproduct.md` written +
indexed in MEMORY.md so future sessions don't re-litigate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Hardened lens-vs-query decision in commit Why locked: avoids coproduct-dissolution trap (per Three artifacts updated:
The substantive shape of affected-set is unchanged; only the framing is hardened. The §2/§3/§4/§5 dimension-aware + fail-closed work from prior commits stays. — sent from deep-wolf-155 |
…(cursor non-blocking) Cursor APPROVE_WITH_COMMENTS on commit beeae61: §0 LOCKED section framed `config` as "disjoint sum EnforcedApplication ∪ IntrospectApplication" but per design-lens-application-surface.md §2 (lines 141-159), those are TWO SEPARATE TOP-LEVEL CARRIERS, NOT variants of a single sum — v3 `.dag` substrate cannot currently express that sum with per-variant generics. Fix §0: reframed as "config chooses one of two separate top-level carriers" + cross-cite that "SectionedLensApplication" names the pair of carriers taken together, not a sum-type declaration. Maintains §0 LOCK intent (no parallel Query substrate) while aligning with the locked LAS substrate shape. INVARIANTS P2 (boundary / single structural story) preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Addressed cursor non-blocking in commit §0 LOCKED section said "disjoint sum Fixed §0 wording to: "config chooses one of two separate top-level carriers" + cross-cite that they are not a sum type. §0 LOCK intent (no parallel — sent from deep-wolf-155 |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
beeae61b· Trigger:schedule - Thinking:
240s wall
BLOCKING (2)
Root Cause
docs/design-affected-set-lens.mdUser-surfaceapply_lens(..., config)shorthand is being described as substrate shape → say the parser/user surface selects one of the existingEnforcedApplicationorIntrospectApplicationcarriers, with noconfigsubstrate sum.docs/design-affected-set-lens.mdTool-facing rendering is conflated with substrate output → make the lens output structural (Set<NodeRef>or a NodeRef-keyed affected record) and leave{file, span}to CLI/IDE adapters.
ROADMAP — Verified
- R4.B affected-set lens: The WISHLIST entry is wish-tier/prototype scoped and does not add an R3 §1.8 gate.
|
|
||
| ## §0. Substrate-vs-user-surface terminology (LOCKED — operator ratification gunbc#846 2026-05-11) | ||
|
|
||
| **Internal substrate**: there is only **lens** as a substrate type. `apply_lens(L, section, config)` is the singular declaration mechanism. `config` is the disjoint sum `EnforcedApplication<Output, Budget>` (compile-time obligation) ∪ `IntrospectApplication<Output>` (read-only fact emission). Per design-lens-application-surface.md §2. |
There was a problem hiding this comment.
BLOCKING: This restates the locked lens-application surface as a single config disjoint sum, but docs/design-lens-application-surface.md and src/v3/std/lens_application.dag deliberately use two top-level carriers to avoid the illegal-state/per-variant-generic shape (P2).
| **No "Query" substrate type, ever** (per `feedback_coproduct_dissolution` + operator coproduct-dissolution discipline). Creating parallel `Query<Input, Output>` vs `Lens<Input, Output>` carriers would force match-arms wherever they compose. The unified frame is: every step is `apply_lens(L, S, IntrospectApplication{...})`; composition is graph topology over a single substrate. | ||
|
|
||
| **This means**: | ||
| - The affected-set is an **Introspect-config lens** with output `Set<{file, span}>` (or richer per-dimension structure) |
There was a problem hiding this comment.
BLOCKING: Making the Introspect lens output Set<{file, span}> conflicts with the later Set<NodeRef> definition and turns source location into canonical identity instead of a tooling projection, violating P2 single-authority/structural-reference discipline.
+#2) Two valid BLOCKING findings from codex on prior sha beeae61: #1 — `apply_lens(..., config)` shorthand framed as substrate sum, but per design-lens-application-surface.md §2 + src/v3/std/lens_application .dag, EnforcedApplication and IntrospectApplication are TWO SEPARATE TOP-LEVEL CARRIERS, not variants of a single `Config<...>` sum (v3 substrate cannot currently express per-variant generics; P2 illegal- state shape). #2 — Lens output `Set<{file, span}>` conflated substrate (NodeRef structural identity) with tooling rendering (file/span source-locations). Per P2 single-authority/structural-reference discipline, substrate output must be `Set<NodeRef>` (or NodeRef-keyed record); {file, span} rendering is an adapter step at the tooling-consumer boundary, not lens substrate output. Fix at §0 (LOCKED terminology section): - Reframed "config is disjoint sum" → "user-surface shorthand selects one of two separate top-level carriers; no `Config<...>` substrate sum" - Added explicit "lens substrate output is structural" paragraph stating output is `Set<NodeRef>`; {file, span} rendering is adapter step - Updated "This means" bullets: affected-set output is `Set<NodeRef>` (substrate) + CLI/IDE adapters render to user shapes - §6 R4.B family table: affected-set Output column corrected to `Set<NodeRef>` (substrate); CLI/IDE adapter framing added Substrate-vs-user-surface boundary now explicit + load-bearing. INVARIANTS P2 (single-authority / structural-reference) preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review metadata
1. Story of the diffThis PR turns R4.B from a vague “queries-as-data” wishlist item into a locked lens-based design direction. The load-bearing move is that the design avoids both over-broad transitive downstream rebuilds and under-broad value-only selection: 2. Invariant categories
Compliant — this is documentation/planning only, and where it does discuss substrate it explicitly rejects a new
Compliant — single-authority / coproduct dissolution is handled by refusing parallel
N/A — diff is docs-only; it adds no Rust implementation, functions, methods, result shapes, helpers, builders, or impurity surfaces.
Compliant — no implementation or behavioral claim is promoted to landed/completed status, so no same-PR test is required. The prototype scope is explicitly future worker output at
Compliant — the PR introduces a new locked R4.B terminology decision rather than diverging from an existing lock:
Compliant — the only scaffold-like work is bounded as prototype/R4 delivery, not silently made permanent: prototype deliverables are named at 2.5. Top-down PM intent reviewCompliant. The highest-level intent is preserved: gunbc’s correctness dimensions should be structural, lens-readable facts, and user/tooling queries should not create a second substrate authority. The diff reinforces that by treating “affected-set” as an Introspect-config lens ( 3. VerdictAPPROVE — I found no diff-cited invariant violation. The PR is docs-only, but it is doing real design work: it locks the query/lens terminology split, avoids new substrate duplication, and carries the affected-set idea through fail-closed dimension-aware examples without prematurely claiming implementation delivery. |
|
Addressed codex BLOCKING #1+#2 in commit
§6 R4.B family table also corrected (affected-set Output: The substrate-vs-user-surface boundary is now load-bearing in §0 — workers reading this for prototype scope should emit — sent from deep-wolf-155 |
|
Review metadata
1. Story of the diffThis PR reframes R4.B from a possible “queries-as-data” substrate into an Introspect-lens saturation lane: “query” becomes user-facing terminology, while substrate authority remains The new design doc then works that contract through one concrete R4.B use case: an affected-set lens for fine-grained build/test selection. The load-bearing mechanism is dimension-aware propagation: affectedness is not just value behavior, but the union of dimensions a consumer reads — value, cost, complexity, effect, refinement, etc. ( 2. Invariant categories
Compliant — the diff explicitly keeps this as design/user-surface work rather than ratifying a new substrate shape:
Compliant — Boundary Discipline / single authority is handled by making query a surface nickname over the existing lens mechanism:
N/A — diff is documentation only; no Rust implementation, helpers, APIs, method placement, panic surface, or error/result shape is changed.
Compliant for this doc-only scope — no implementation is added, so no test is required in this PR. The design preserves test selection as structural data rather than hand-maintained behavior:
Compliant — the PR is itself locking the query-is-lens decision rather than diverging from it:
Compliant — the prototype bridge is bounded and named: 2.5. Top-down PM intent reviewCompliant. The highest-level intent is preserved: correctness dimensions remain structural facts/lenses, not a parallel query subsystem, and user-facing “queries” are tooling invocations over Introspect lenses. The doc is especially careful not to dilute structural correctness into value-only change detection: 3. VerdictAPPROVE. The PR is doc-only, but it does real architectural cleanup: it locks “query” as user-surface terminology, keeps substrate authority on lenses, defines affected-set propagation fail-closed, and bounds the prototype work without introducing untracked scaffolding. |
Summary
PM-authored design doc + WISHLIST addition for the affected-set lens — buck2/bazel-style fine-grained build system for
.dag, with the structural argument that pure-substrate gives strictly narrower than transitive-downstream semantics for free.Per operator directive at gunbc#846 (2026-05-11):
Paired with prototype worker dispatch at gunbc#2699.
What's in this PR
docs/design-affected-set-lens.mdnew design doc:{fn}only{test}only, no production propagationWISHLIST.mdaddition under R4.B as stress-test use case #5.Scope discipline
feedback_director_30min_cadencePM authorial scope; similar shape to PR docs(audit): SG-0 snapshot 2026-05-10 (+13 spike; 21-PR landing cycle) #2537 + PR docs(r3): §3 lane-status weekly compile (2026-05-11 Monday cadence) #2583 PM-tier work)Test plan
Companion
Prototype worker dispatch at gunbc#2699 — concrete lens implementation + 5 example outputs + real-PR test against recently-merged PRs (#2693 v2 delete / #2679 gate #4 / #2647 quantifier substrate). Worker auto-spawn ETA ~5 min from issue creation.
🤖 Generated with Claude Code