Skip to content

docs/plans: lens-input-authority — resolve once, share by reference (P1 declaration lane) - #6426

Merged
briansrls merged 7 commits into
mainfrom
session/loyal-wren-398
Jul 10, 2026
Merged

briansrls merged 7 commits into
mainfrom
session/loyal-wren-398

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Records the lens-input-authority design lane (co-authored with merry-moth-539, #6375): every v2 lens is a pure reader over the resolved graph, so N lenses demanding one resolve-identity with no share is the materialization ladder's rule-1 AuthoredDuplication. Affected-set is the flagship — it needs the whole-tree resolve and OOMs at corpus scale (24 GiB, exit 137), which is why affected-set-in-CI is fed an empty roster and failing witnesses slip through.

The doc grounds the fix in merry-moth's ladder (#6375) and splits the resolve-identity into two providers:

  • P1 — in-process share (ReferenceTier @ SharedStateFrame, process_shared_index): already rewired by union-resolve S1 (Union resolve S1: one shared index per process (prelude + discovery + shards) #6234); this lane declares it so it's typed + countable and a new lens that resolves privately is the undeclared-provider shape. Grain-corrected per merry-moth: identity = union-index-build (index built once), distinct from the K per-entry closure resolves (their receipt) and the K readers (this lane's reader_count).
  • P2 — cross-process store (resolved_graph_cache, content-keyed, on main): the isolation-LCA discharge, owned by graph-major S2b. This lane only records the P1↔P2 one-identity relation (fnv1a64 dual-surface discipline) with its dissolution trigger.

Scope: design doc only (precedent: dozens of docs/plans/*.md on main). The .dag this doc specifies (dag/gunbc/floor_materialization.dag + witness) imports std.materialization_ladder, which is on #6375, not main — committing it to a main-based branch reds the compile-clean gate. It is authored, verified green-by-execution against #6375's ladder in-session (all 3 witnesses PASS incl. the providers=[] RED control), and held off-branch; it lands as a follow-up PR the moment the ladder is on main.

Test plan

  • Markdown only — no code changed; compile-clean is unaffected (the doc is not ingested).
  • The specified .dag was run in-session via claim_batch against Duplicate Computation #6375's ladder HEAD (confirmed byte-identical): floor_index_build_share_is_shared_by_reference, floor_index_build_has_plural_readers, floor_index_build_reds_without_reference_provider — 3/3 PASS, RED control discriminates. Held off this branch by construction (imports a Duplicate Computation #6375-only module).
  • Backing oracles cited (run under the rust nextest gate): memo_deduplicates_resolve_count, memo_warm_cold_results_are_identical (claim_executor.rs); union_view_result_equals_private_resolve_in_every_order, union_resolve_typechecks_each_node_once (src/v1/tests/src/union_resolve_receipts_test.rs).

Note on branch history

Intermediate commits briefly carried an in-session verification overlay (the held .dag + #6375's ladder file); it was removed — the net diff is the single design doc. Squash-merge flattens the churn.

briansrls and others added 4 commits July 9, 2026 23:14
…s-runner binding lane

The consumer side of merry-moth-539's materialization ladder (#6375): N lenses
reading one resolve = rule-1 AuthoredDuplication at a SharedStateFrame; fix is a
reference-tier rewire, not a cache. Audit findings: the .dag lens contract is
already clean (8 lenses take InferredTree/DependencyView as params, no resolve
door) and union-resolve S1 (#6234) already resolves once per (thread,roots) via
process_shared_index (NodeFrontierSeeds deleted) — the share exists but is
UNDECLARED. This lane declares P1 (in-process ReferenceTier share) + witness +
the contract wall; P2 (cross-process content-keyed resolved_graph_cache) is
graph-major S2b. Poses the 3 ladder-cell questions to merry-moth for review.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…hare (P1)

Declares union-resolve S1's process_shared_index as a ReferenceTier provider row
(merry-moth-539's ladder ruling Q-A): provider_row(id: process_shared_index,
scope: [claim_executor-process SharedStateFrame], coverage: [union-resolve(dag,src/v2)],
tier: ReferenceTier, eviction: scope_exit). NOT provider_from_catalog — ReferenceTier
is keyless by shape; the catalog births STORE tiers (P2 = resolved_graph_cache, graph-major
S2b). value_materialization asserts the plural readonly reads discharge as
ValueSharedByReference. P1<->P2 convergence note + dissolution triggers included.

UNVERIFIED — std.materialization_ladder is only on #6375 (not main); this .dag imports
it, so it lands behind #6375. Verify by claim_batch once #6375 is merged in. Witness +
enrollment + consumer-roster live-fold follow merry-moth's roster-source confirm.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…in (fix #6426 red)

The .dag imports std.materialization_ladder, which lives only on #6375, not main —
so compile-clean cannot resolve it and the gate reds (the #6426 failure). The lane
has a hard dependency on #6375; #6426 cannot compile or merge before it. Hold the
.dag + witness off the branch (authored + staged in-session per merry-moth's rulings,
union-index-build grain) and keep #6426 as the design doc only, which compiles clean.
Land + verify the .dag the moment #6375's ladder reaches main. Design doc §6 records
the authored shape + the exact re-land steps.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Draft intentionally — blocked-in-progress on #6375, not abandoned.

This lane's payload (dag/gunbc/floor_materialization.dag + dag/test/claim/floor_materialization_witness_test.dag) imports std.materialization_ladder, which lands with #6375 (the materialization ladder). Committing the .dag on a main-based branch reds compile-clean (the import can't resolve — fixed in e275970 by holding it off-branch), so this PR carries only the design doc until #6375's ladder reaches main.

Status: the .dag + witness are authored per merry-moth-539's ladder rulings (union-index-build grain, ReferenceTier provider_row, live-roster fold, ValueSharedByReference + RED control) and staged; design doc §6 records the exact shape + re-land steps. Blocked on #6375, which is currently an open draft, mergeState BLOCKED.

Flips ready when #6375's ladder is on main: merge main → drop in the two authored files → claim_batch green-by-execution (+ RED control) → enroll the CommitWitnessClaim row.

briansrls and others added 3 commits July 10, 2026 01:08
…anch

An auto-commit (9f53709) swept the in-session verification overlay back
onto the branch, re-adding dag/gunbc/floor_materialization.dag, its witness,
and #6375's dag/std/materialization_ladder.dag (963 lines that are NOT this
PR's to ship). Remove all three; #6426 carries only the design doc, which
compiles clean on main.

The floor .dag + witness are verified green-by-execution against #6375's
ladder in-session (all 3 witnesses PASS incl. the providers=[] RED control)
and held in scratchpad; they land the moment the ladder is on main.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gunbai-bot gunbai-bot Bot changed the title affected set processing docs/plans: lens-input-authority — resolve once, share by reference (P1 declaration lane) Jul 10, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 10, 2026 01:31
@briansrls
briansrls merged commit 5492d3c into main Jul 10, 2026
4 of 6 checks passed
@briansrls
briansrls deleted the session/loyal-wren-398 branch July 10, 2026 01:51
briansrls added a commit that referenced this pull request Jul 10, 2026
… (P1) + enrolled witness (#6432)

* sketch: lens-input-authority (resolve once, share by reference) — lens-runner binding lane

The consumer side of merry-moth-539's materialization ladder (#6375): N lenses
reading one resolve = rule-1 AuthoredDuplication at a SharedStateFrame; fix is a
reference-tier rewire, not a cache. Audit findings: the .dag lens contract is
already clean (8 lenses take InferredTree/DependencyView as params, no resolve
door) and union-resolve S1 (#6234) already resolves once per (thread,roots) via
process_shared_index (NodeFrontierSeeds deleted) — the share exists but is
UNDECLARED. This lane declares P1 (in-process ReferenceTier share) + witness +
the contract wall; P2 (cross-process content-keyed resolved_graph_cache) is
graph-major S2b. Poses the 3 ladder-cell questions to merry-moth for review.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* draft: gunbc.floor_materialization — declare the in-process resolve share (P1)

Declares union-resolve S1's process_shared_index as a ReferenceTier provider row
(merry-moth-539's ladder ruling Q-A): provider_row(id: process_shared_index,
scope: [claim_executor-process SharedStateFrame], coverage: [union-resolve(dag,src/v2)],
tier: ReferenceTier, eviction: scope_exit). NOT provider_from_catalog — ReferenceTier
is keyless by shape; the catalog births STORE tiers (P2 = resolved_graph_cache, graph-major
S2b). value_materialization asserts the plural readonly reads discharge as
ValueSharedByReference. P1<->P2 convergence note + dissolution triggers included.

UNVERIFIED — std.materialization_ladder is only on #6375 (not main); this .dag imports
it, so it lands behind #6375. Verify by claim_batch once #6375 is merged in. Witness +
enrollment + consumer-roster live-fold follow merry-moth's roster-source confirm.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* WIP: affected set processing

* hold floor_materialization.dag off-branch until #6375 ladder is on main (fix #6426 red)

The .dag imports std.materialization_ladder, which lives only on #6375, not main —
so compile-clean cannot resolve it and the gate reds (the #6426 failure). The lane
has a hard dependency on #6375; #6426 cannot compile or merge before it. Hold the
.dag + witness off the branch (authored + staged in-session per merry-moth's rulings,
union-index-build grain) and keep #6426 as the design doc only, which compiles clean.
Land + verify the .dag the moment #6375's ladder reaches main. Design doc §6 records
the authored shape + the exact re-land steps.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* WIP: affected set processing

* Keep #6426 design-doc-only: hold floor .dag + witness + ladder off-branch

An auto-commit (9f53709) swept the in-session verification overlay back
onto the branch, re-adding dag/gunbc/floor_materialization.dag, its witness,
and #6375's dag/std/materialization_ladder.dag (963 lines that are NOT this
PR's to ship). Remove all three; #6426 carries only the design doc, which
compiles clean on main.

The floor .dag + witness are verified green-by-execution against #6375's
ladder in-session (all 3 witnesses PASS incl. the providers=[] RED control)
and held in scratchpad; they land the moment the ladder is on main.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* WIP: affected set processing

* WIP: affected set processing

* Regen ci.yml: floor resolve-count gate 3 -> 4 (paired with ci_materialization.dag bump)

Enrolling the floor_materialization P1 witness adds one cold closure resolve
against the shared index (a third std.materialization_ladder-importing entry
outside compile-clean's witness_layer_roots closure), so the floor's
resolves_total moves 3 -> 4. ci_floor_declared_resolve_count was bumped
consciously in the same PR; this regenerates the derived ci.yml resolve-receipt
gate to match (the only emission input that changed — witness enrollment is
runtime, not baked into ci.yml). gunbc ci emit is unavailable headless (its
doc-only-shortcut git step exits non-zero under this env), so the three count
occurrences were edited to exactly what to_string(ci_floor_declared_resolve_count)
emits; CI's drift gate is the confirming authority.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* WIP: affected set processing

* Fix diverged prelude path: entry-selection consumer is v2.lens.affected_set.entry_selection

#6432 review (claude-opus-4-7) flagged the prelude entries as duplicating the Rust
constants FLOOR_RUNNER_ENTRY/ENTRY_SELECTION_ENTRY. Verifying the finding revealed the
hand-copied pair had already DIVERGED: prelude entry #2 named
"src/v2/workflow/affected_set_selection.dag" (module v2.workflow.affected_set_selection,
never resolved by the host) instead of the host's actual
ENTRY_SELECTION_ENTRY = "src/v2/lens/affected_set/entry_selection.dag"
(resolved against the shared index at cli_run.rs:6175). Corrected to match the host
authority; reader_count is unchanged (same count, right label). The note now records the
drift and raises the single-authority follow-on priority (§3: a single authority would
make this drift unwritable).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Convert prelude follow-on prose to a proper dissolve-on scaffold marker

#6432 review (claude-opus-4-7, advisory): the prelude parallel-representation was
marked only with prose "FOLLOW-ON", so the hygiene backstop can't track it and it
risks calcifying (operator standing directive: every scaffold lands with a named
dissolution trigger). Convert to a 🟡 dissolve-on: floor_prelude_entries_single_authority
marker naming the shared-authority conversion as the dissolution condition. No behavior
change; the corrected path stands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* WIP: affected set processing

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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