Repository navigation
feat(rendering): slice 12 — Stage 2 shadow mode behind AGENT_CODE_RENDER_SHADOW - #439
Merged
Juliusolsson05 merged 1 commit intoJul 6, 2026
Conversation
…DER_SHADOW shadowDiff.ts normalizes both renderers to the coarsest grain they share (committed/optimistic/ghost rows by stable id, semantic turns by turnId, work/empty flags) so representation differences — block-level vs turn-level, plane prefixes vs folded uuids — never read as divergence, while real ones (missing/extra/mis-ordered rows) always do. Set difference before order comparison so one missing row is one finding, not a cascade of order mismatches. useRenderShadow mounts in TileLeaf (the one component holding the full runtime): probes the flag once app-wide via the existing dev-debug config channel, recomputes the legacy model from the same pure functions Feed uses, runs the adapter+ledger per-session (refs, so the D11 caches are actually exercised on real ticks), and records divergences to a ring buffer on globalThis.__agentCodeRenderShadow + console.warn once per signature. Zero cost when the flag is off; DELETE-fated at Stage 3. 72 pipeline tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 2 opens: the new pipeline now runs beside the legacy renderer on real sessions when
AGENT_CODE_RENDER_SHADOW=1.shadow/shadowDiff.ts— normalizes both renderers to the coarsest shared grain (rows by stable id, semantic turns by turnId, work/empty flags). Representation differences (block-level vs turn-level, plane prefixes vs ghost-folded uuids) never read as divergence; real ones (missing / extra / mis-ordered rows) always do. Set difference before order comparison — one missing row is one finding, not an order-mismatch cascade.shadow/useRenderShadow.ts— mounted in TileLeaf (the one component holding the fullSessionRuntime). Probes the flag once app-wide, recomputes the legacy comparable from the same pure functions Feed uses (flag-gated, zero prod cost), runs adapter+ledger per session via refs so the D11 identity caches are exercised on real ticks, and records divergences toglobalThis.__agentCodeRenderShadow(ring of 50, each report a fixture seed) + oneconsole.warnper divergence signature.renderShadowEnabledrides the existingdev-debug:get-configchannel (no channel proliferation); flag + shadow + diff are all DELETE-fated at Stage 3 cutover together.Next: run real sessions with the flag on across all three providers; every untriaged divergence class becomes a fixture per the plan's Stage 2 exit criterion.
72 pipeline tests; tsc gate (node + web) clean.
🤖 Generated with Claude Code