Rendering pipeline Stage 1: ownership ledger core + first ten tests#424
Merged
Juliusolsson05 merged 1 commit intoJul 6, 2026
Merged
Conversation
…aring tests First implementation slice of docs/rendering/rendering-rewrite-plan- 2026-07.md (Stage 1: spec-first build, zero app wiring — nothing imports this yet). model/types.ts — the ledger contract from plan §3: block-level RenderCandidate (D2) with plural identity fields (no single id spans providers; toolUseId reserved first-class for the subagent surface, rule 14), the fixture-gated RenderReason enum (rule 15), the ownership_decision debug schema (D5), and the UnknownBehavior structured-finding contract with #115 redaction rules. model/order.ts — the D4 ordering law: true chronological merge with phase ranks, the trust-hierarchy timestamp comparison (null sorts after timestamped, never as 'now'), and the five-way tiebreak. This is the #239 buried-prompt fix at the model layer. model/ownership.ts — committed-ownership suppression with the suppress-vs-reorder discriminator (D3): whole-turn suppression is a provider POLICY bit (claude true, codex/opencode false — an id- presence heuristic would wrongly whole-turn-suppress opencode, whose committed rows carry message ids; drift report item 12), exact/ normalized text keys (never prefix/fuzzy), itemId keys (#194), and tool-use vs tool-result ownership kept separate (dump invariant 10). model/ledger.ts — the composed pass with the D11 identity-stability contract: unchanged input references return the previous ledger BY REFERENCE (load-bearing for every Feed memo; the render-churn class). __tests__/ledger.test.ts — ten tests, each naming the incident it guards: #239 ordering, #170 resp_*/rollout text split, claude-vs-codex whole-turn asymmetry (#165/#191), tool-use/result separation, #344 decisions-for-every-candidate, D11 reference equality. All green (vitest unit project); tsc node+web 0 errors on main checkout. Test files here are per the plan's explicit exemption from the no-new- tests convention: src/renderer/src/rendering/ IS its tests (plan §4). Next slices: committed projection + candidate collectors (from runtime state), ghost predicate port, fixture corpus directories from the real bundles (buried-prompt-239, opencode-interleave-87f0eeef, ghost-matrix). 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.
First implementation slice of the canonical rewrite plan. Zero app wiring — nothing imports
src/renderer/src/rendering/yet; this is the spec-first build (Stage 1).What's in
model/types.ts— the ledger contract (plan §3): block-level candidates with plural identity fields, the fixture-gated reason enum, theownership_decisiondebug schema, the structured-unknown contractmodel/order.ts— the D4 ordering law (chronological merge, trust hierarchy, null-after-timestamped, five-way tiebreak) — the Optimistic submitted user prompts are buried behind semantic/work rows #239 fix at model levelmodel/ownership.ts— committed-ownership suppression: whole-turn as a provider policy bit (not id-presence — that would wrongly suppress OpenCode), exact/normalized text keys, itemId keys, tool-use vs tool-result separationmodel/ledger.ts— the composed pass with the D11 identity-stability contract (unchanged inputs ⇒ previous ledger by reference)Verification
vitest run --project unit src/renderer/src/rendering— 10/10tsc -bnode +tsc --noEmitweb on main checkout — 0 errorsTest files are per the plan's explicit exemption (rendering/ IS its tests).
Next slices (same stage)
Candidate collectors from runtime state, committed projection (incl.
synthetic-user-filtered#338), ghost predicate port (10-case matrix), and the first bundle-derived fixture directories.🤖 Generated with Claude Code