Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
a4d1a45
Rendering pipeline Stage 1: ownership ledger core + first ten load-be…
Juliusolsson05 Jul 6, 2026
de1d20e
Merge pull request #424 from Juliusolsson05/feat/rendering-pipeline-s…
Juliusolsson05 Jul 6, 2026
a7ddfd1
Rendering slice 2: committed collector (+#338 fix) + legacy deletion …
Juliusolsson05 Jul 6, 2026
d24295f
Merge pull request #425 from Juliusolsson05/feat/rendering-slice2-col…
Juliusolsson05 Jul 6, 2026
bf776ae
Rendering slice 3: ghost five-rule predicate as ledger decisions
Juliusolsson05 Jul 6, 2026
42f2443
Merge pull request #426 from Juliusolsson05/feat/rendering-slice3-ghost
Juliusolsson05 Jul 6, 2026
377d443
Rendering slice 4: semantic collector — block-level candidates with m…
Juliusolsson05 Jul 6, 2026
889c697
Merge pull request #427 from Juliusolsson05/feat/rendering-slice4-sem…
Juliusolsson05 Jul 6, 2026
8bed2eb
Rendering slice 5: local collectors + optimistic reconciliation + fir…
Juliusolsson05 Jul 6, 2026
f17c96c
Merge pull request #428 from Juliusolsson05/feat/rendering-slice5-loc…
Juliusolsson05 Jul 6, 2026
79f79ab
Rendering slice 6: dead-committed-channel-159 fixture
Juliusolsson05 Jul 6, 2026
f901f5a
Merge pull request #429 from Juliusolsson05/feat/rendering-slice6-dea…
Juliusolsson05 Jul 6, 2026
8ae6c9a
Rendering slice 7: unknown-behavior registry
Juliusolsson05 Jul 6, 2026
e0ab0e9
Merge pull request #432 from Juliusolsson05/feat/rendering-slice7-unk…
Juliusolsson05 Jul 6, 2026
a0f0f6d
Rendering slice 8: opencode-interleave-87f0eeef fixture
Juliusolsson05 Jul 6, 2026
0850ccc
Merge pull request #433 from Juliusolsson05/feat/rendering-slice8-ope…
Juliusolsson05 Jul 6, 2026
93b12a7
Stage 1 progress marker: slices 1-8 landed, 209/209 unit suite green
Juliusolsson05 Jul 6, 2026
96d4d97
Merge pull request #434 from Juliusolsson05/chore/rendering-stage1-wrap
Juliusolsson05 Jul 6, 2026
d324e41
feat(rendering): slice 9 — ghost plane wired into the ledger pass + s…
Juliusolsson05 Jul 6, 2026
ea37983
Merge pull request #435 from Juliusolsson05/feat/rendering-slice9-gho…
Juliusolsson05 Jul 6, 2026
8e12647
feat(rendering): slice 10 — runtime→collector adapter (the shadow sea…
Juliusolsson05 Jul 6, 2026
33b48cf
Merge pull request #436 from Juliusolsson05/feat/rendering-slice10-ad…
Juliusolsson05 Jul 6, 2026
a8c8841
feat(rendering): slice 11 — fold-policy yield-hatch absorption + queu…
Juliusolsson05 Jul 6, 2026
0bf2e93
Merge pull request #437 from Juliusolsson05/feat/rendering-slice11-fo…
Juliusolsson05 Jul 6, 2026
3d7437d
feat(rendering): slice 12 — Stage 2 shadow mode behind AGENT_CODE_REN…
Juliusolsson05 Jul 6, 2026
8ccc497
Merge pull request #439 from Juliusolsson05/feat/rendering-slice12-sh…
Juliusolsson05 Jul 6, 2026
cac6bc5
test(rendering): slice 13 — shadow parity suite (legacy vs new pipeli…
Juliusolsson05 Jul 7, 2026
97d18be
Merge pull request #441 from Juliusolsson05/feat/rendering-slice13-pa…
Juliusolsson05 Jul 7, 2026
af43b20
feat(rendering): slice 14 — view bridge: ledger rows → legacy FeedRen…
Juliusolsson05 Jul 7, 2026
903ddd4
Merge pull request #443 from Juliusolsson05/feat/rendering-slice14-vi…
Juliusolsson05 Jul 7, 2026
066731a
feat(rendering): slice 15 — bundle-fixture goldmine: 46 real-bug fixt…
Juliusolsson05 Jul 7, 2026
68cc642
Merge pull request #444 from Juliusolsson05/feat/rendering-slice15-co…
Juliusolsson05 Jul 7, 2026
6fc5645
feat(rendering): slice 16 — corpus triage: 121 divergences resolved, …
Juliusolsson05 Jul 7, 2026
0a37a0a
Merge pull request #445 from Juliusolsson05/feat/rendering-slice16-tr…
Juliusolsson05 Jul 7, 2026
7aa7991
feat(rendering): slice 17 — Stage 3 cutover flag: Feed paints from th…
Juliusolsson05 Jul 7, 2026
ffdaf84
Merge pull request #446 from Juliusolsson05/feat/rendering-slice17-cu…
Juliusolsson05 Jul 7, 2026
8df64cd
fix(rendering): corpus triage completion — final 9 untriaged resolved…
Juliusolsson05 Jul 7, 2026
facbc8f
Merge pull request #447 from Juliusolsson05/fix/rendering-corpus-tria…
Juliusolsson05 Jul 7, 2026
b05c038
docs(rendering): Stage 2/3 progress marker — through #447, soak instr…
Juliusolsson05 Jul 7, 2026
af1387f
Merge pull request #448 from Juliusolsson05/feat/rendering-slice18-fi…
Juliusolsson05 Jul 7, 2026
039ff17
fix(rendering): slice 18 — committed tool-ownership gap (corpus new-b…
Juliusolsson05 Jul 7, 2026
7a6d051
Merge pull request #449 from Juliusolsson05/fix/rendering-committed-t…
Juliusolsson05 Jul 7, 2026
45cfb11
feat(rendering): slice 19 — unknown-behavior sightings wired into the…
Juliusolsson05 Jul 7, 2026
46b392b
Merge pull request #450 from Juliusolsson05/feat/rendering-slice19-un…
Juliusolsson05 Jul 7, 2026
0ac2e02
fix(rendering): slice 19 — collapsed-running null-paint (last corpus …
Juliusolsson05 Jul 7, 2026
07a2775
Merge pull request #451 from Juliusolsson05/fix/rendering-dangling-to…
Juliusolsson05 Jul 7, 2026
a8fe3db
fix(rendering): extractor seen-uuid dedupe (corpus tooling)
Juliusolsson05 Jul 7, 2026
791ba06
Merge pull request #452 from Juliusolsson05/fix/rendering-extractor-d…
Juliusolsson05 Jul 7, 2026
5b7c991
feat(rendering): slice 20 — extractor v2: codex committed plane via t…
Juliusolsson05 Jul 7, 2026
aa1b256
merge integration into slice-20: union extractor (codex real-mapper p…
Juliusolsson05 Jul 7, 2026
023b45e
Merge pull request #453 from Juliusolsson05/feat/rendering-slice20-ex…
Juliusolsson05 Jul 7, 2026
f02ba05
docs(rendering): residue plan — post-correctness workstreams from the…
Juliusolsson05 Jul 7, 2026
02fde78
Merge pull request #455 from Juliusolsson05/docs/rendering-residue-plan
Juliusolsson05 Jul 7, 2026
0b18ad2
fix(transcript): tailer scoped-unwatch submodule bumps + dead-tail ob…
Juliusolsson05 Jul 7, 2026
18b745c
fix(rendering): task-notification carve-out (P0b - the cutover data-l…
Juliusolsson05 Jul 7, 2026
937fa28
Merge pull request #457 from Juliusolsson05/fix/rendering-task-notifi…
Juliusolsson05 Jul 7, 2026
503c836
feat(feed): generic JSON tool row - one shared fallback for MCP/unkno…
Juliusolsson05 Jul 7, 2026
91d7e7e
Merge pull request #458 from Juliusolsson05/feat/json-tool-row
Juliusolsson05 Jul 7, 2026
5dc4b42
Merge pull request #456 from Juliusolsson05/fix/tailer-bump-observabi…
Juliusolsson05 Jul 7, 2026
a0d00d8
fix(subagents): #341 lifecycle - wait_agent terminal inference, stale…
Juliusolsson05 Jul 7, 2026
9e74604
Merge pull request #459 from Juliusolsson05/fix/subagent-lifecycle-341
Juliusolsson05 Jul 7, 2026
dd26541
feat(feed): task-notification rows - collapse, join, never a user bub…
Juliusolsson05 Jul 7, 2026
2f11301
Merge pull request #460 from Juliusolsson05/feat/task-notification-rows
Juliusolsson05 Jul 7, 2026
a81aee4
fix(feed): fleet-row eligibility for MCP orchestration spawns (P2c)
Juliusolsson05 Jul 7, 2026
e8d2c29
Merge pull request #461 from Juliusolsson05/fix/task-row-eligibility
Juliusolsson05 Jul 7, 2026
8ad6be0
feat(feed): committed-plane AskUserQuestion row + shared question par…
Juliusolsson05 Jul 7, 2026
5f393b9
Merge pull request #462 from Juliusolsson05/feat/auq-answered-row
Juliusolsson05 Jul 7, 2026
539e11a
feat(opencode): row dispatch gaps from the 07-06 bundles (P3)
Juliusolsson05 Jul 7, 2026
bdf7f26
Merge pull request #463 from Juliusolsson05/feat/opencode-row-dispatch
Juliusolsson05 Jul 7, 2026
b41af69
fix(rendering): repair three import/dup hunks dropped by concurrent m…
Juliusolsson05 Jul 7, 2026
ca53c19
Merge pull request #464 from Juliusolsson05/fix/integration-type-repairs
Juliusolsson05 Jul 7, 2026
5bbb9fb
fix(rendering): collapsed-running tail gate - first live soak catch (…
Juliusolsson05 Jul 7, 2026
14d79b9
Merge pull request #465 from Juliusolsson05/fix/collapsed-running-tai…
Juliusolsson05 Jul 7, 2026
280df65
chore(rendering): standards-audit cleanup across shadow, subagents, J…
Juliusolsson05 Jul 7, 2026
494e70a
fix(rendering): add missing RuntimeSemanticTurn.lookups type field (b…
Juliusolsson05 Jul 7, 2026
e24a5d7
Merge pull request #468 from Juliusolsson05/fix/runtime-turn-lookups-…
Juliusolsson05 Jul 7, 2026
5881b76
fix(claude-queue): reconstruct Claude's priority queue, not FIFO drop…
Juliusolsson05 Jul 7, 2026
f347cc0
Merge remote-tracking branch 'origin/integration/rendering-pipeline' …
Juliusolsson05 Jul 7, 2026
a8ef2b7
Merge pull request #466 from Juliusolsson05/chore/standards-audit-fixes
Juliusolsson05 Jul 7, 2026
668ecb1
Merge pull request #469 from Juliusolsson05/fix/soak-queue-notificati…
Juliusolsson05 Jul 7, 2026
1c88bf2
docs(rendering): Session Recording plan (#467) — continuous input cap…
Juliusolsson05 Jul 7, 2026
5e9e90f
Merge pull request #470 from Juliusolsson05/docs/session-recording-plan
Juliusolsson05 Jul 7, 2026
de1cdc8
feat(recording): Session Recording slice 1 — recorder core + gate + f…
Juliusolsson05 Jul 7, 2026
1cdcca8
Merge pull request #471 from Juliusolsson05/feat/session-recording-sl…
Juliusolsson05 Jul 7, 2026
7af387f
feat(recording): register session-recordings as a budgeted retention …
Juliusolsson05 Jul 7, 2026
0d6e419
feat(recording): gate controls + Attach Recording Note command
Juliusolsson05 Jul 7, 2026
9526d27
feat(recording): slice 6 — redaction + extraction script
Juliusolsson05 Jul 7, 2026
7abef54
feat(recording): slice 7 — golden corpus over recordings
Juliusolsson05 Jul 7, 2026
e470ad8
feat(rendering): session-recording replay harness (slice 4)
Juliusolsson05 Jul 7, 2026
1b40846
feat(rendering): invariant replay over recordings (slice 5)
Juliusolsson05 Jul 7, 2026
b3df8d0
Merge remote-tracking branch 'origin/feat/session-recording-b' into f…
Juliusolsson05 Jul 7, 2026
20faffd
Merge remote-tracking branch 'origin/feat/session-recording-c' into f…
Juliusolsson05 Jul 7, 2026
ef91911
refactor(recording): unify golden corpus onto the shared replay harness
Juliusolsson05 Jul 7, 2026
59943d8
Merge pull request #472 from Juliusolsson05/feat/session-recording-full
Juliusolsson05 Jul 7, 2026
26aa4b2
fix(recording): command-driven Start/Stop (§7) + header fields + plan…
Juliusolsson05 Jul 7, 2026
9991c48
Merge pull request #473 from Juliusolsson05/fix/session-recording-on-…
Juliusolsson05 Jul 7, 2026
76c2a50
fix(rendering): filter subagent sidechain turns from the main feed (#…
Juliusolsson05 Jul 7, 2026
ccde1b9
Merge pull request #479 from Juliusolsson05/fix/sidechain-committed-leak
Juliusolsson05 Jul 7, 2026
6cbe00f
fix(subagents): bump claude-code-headless — subagent proxy-flow attri…
Juliusolsson05 Jul 7, 2026
65f1289
Merge pull request #480 from Juliusolsson05/fix/subagent-flow-bump
Juliusolsson05 Jul 7, 2026
098ac1e
chore(repo): hygiene + docs restructure (workstreams 1-2 of the cleanup)
Juliusolsson05 Jul 7, 2026
0433014
Merge pull request #481 from Juliusolsson05/chore/repo-hygiene-docs
Juliusolsson05 Jul 7, 2026
9814591
chore(rendering): colocate tests, remove the lone __tests__ dir (work…
Juliusolsson05 Jul 7, 2026
69c4366
Merge pull request #482 from Juliusolsson05/chore/colocate-rendering-…
Juliusolsson05 Jul 7, 2026
3bf1018
feat(rendering): ledger is the sole decision core; migrate phone, kil…
Juliusolsson05 Jul 7, 2026
2591178
Merge pull request #483 from Juliusolsson05/feat/rendering-cutover
Juliusolsson05 Jul 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@ A good comment answers questions like:
Don't bother explaining *what* the code does — that's what reading the code is for. Explain *why it exists*, *why it's shaped this way*, and *what would make it wrong*.

Make agentic development and decision-making **transparent in the diff**, not in a doc that drifts.

## Directory conventions

Two top-level folders look superficially similar but mean very different things. Do not mix them.

- `vendor/` — read-only **source code references** kept locally so future-you can grep the original implementation of something we wrap or interoperate with. Never imported, never built, never shipped. Examples: `claude-code-src/`, vendored upstream checkouts for bug-bisection.
- `third_party/` — pinned **runtime artifacts** that we ship inside packaged Agent Code (or that the release pipeline fetches at build time). Each tool gets its own directory with a `manifest.json` (version + per-arch sha256 + URL template), `README.md`, `LICENSE.md`, and a `.gitignore` that keeps `cache/` and `build/` out of git. Binaries are NEVER committed — the manifest plus `scripts/runtime-tools/<tool>` is the source of truth, and version bumps are one-file PRs against `manifest.json`. Examples: `third_party/mitmproxy/`, `third_party/tmux/`. See issues #119 and #120 for the full bundling plan.
19 changes: 0 additions & 19 deletions CODEX.md

This file was deleted.

4 changes: 0 additions & 4 deletions MANIFESTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ The whole app is built for efficient development. All terminals are tmux-persist

## Structure

One of the principles I understood early is that getting open-source contributors on board with something like this is hard. So Agent Code is dependent on 4 separate projects that it imports as packages, all more broadly scoped, which will hopefully attract more open-source attention.

## Structure

One of the principles I understood early is that getting open-source contributors on board with something like this is hard. So Agent Code is dependent on 4 separate projects that it imports as packages — all more broadly scoped, which will hopefully attract more open-source attention.

**1. Headless Claude Code and Codex**
Expand Down
27 changes: 27 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Agent Code docs

Layout and status conventions. Superseded/closed material moves to `archive/`
and carries a `Status:`/`ARCHIVED` header — a doc without one is meant to be
live.

## Live

- **`rendering/`** — the current rendering engine. `rendering-rewrite-plan-2026-07.md`
is canonical; `residue-plan-2026-07.md` and `session-recording-plan-2026-07.md`
are its live follow-ons; `legacy-deletion-manifest.md` is the cutover contract;
`rendering-knowledge-dump.md` is the evidence bible. `research-2026-07/` holds
the supporting research (rewrite research at the top level, the
session-recording research under `session-recording/`).
- **`design/`** — living subsystem design (conditions, ghost system).
- **`plans_and_ideas/`** — active/near-term plans and idea notes.
- **`superpowers/`** — dated planning space: `plans/` (feature/fix plans) and
`specs/` (design specs). Accumulates by date; a plan carries a `Status:` header
once it ships or is superseded.
- **`command-style.md`** — command-authoring conventions.
- **`screenshots/`** — README assets.

## Archived (`archive/`)

- **`codex-rewrite-render/`** — the pre-rewrite rendering notebook (superseded).
- **`issue-investigations/`** — investigations for issues now closed.
- **`audit-plans/`** — the deep-audit roadmap and its completed execution logs.
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
> **ARCHIVED / SUPERSEDED (2026-07-07).** This was the first-principles working
> notebook for the feed-rendering rewrite. It has been fully absorbed into the
> canonical plan `docs/rendering/rendering-rewrite-plan-2026-07.md` and its
> research digest `docs/rendering/research-2026-07/rewrite-notebook-extraction.md`.
> Kept for history; reads present-tense but describes the OLD `deriveFeedRenderModel`
> approach, which the ownership-ledger pipeline (`src/renderer/src/rendering/`) replaced.

# Codex Render Rewrite Notes

This directory is the working notebook for rebuilding feed rendering from first principles while keeping live streaming.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> **ARCHIVED (2026-07-07).** The investigated issue is closed; kept as history.

# Issue #147: Multiple Agent Code Instances

## Issue Summary
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> **ARCHIVED (2026-07-07).** The investigated issue is closed; kept as history.

# Issue 152: Add terminal sessions to Dispatch Mode

## Issue summary
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> **ARCHIVED (2026-07-07).** The investigated issue is closed; kept as history.

# Issue 154: Extend Undo Close History and Retention

## Issue Summary
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> **ARCHIVED (2026-07-07).** The investigated issue is closed; kept as history.

# Issues #180 and #181: Rendered Link Activation

## Issue Summaries
Expand Down
92 changes: 92 additions & 0 deletions docs/rendering/legacy-deletion-manifest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Legacy Rendering — Deletion Manifest

The contract for the complete strip-out of the old rendering system. The old
code is NOT deleted early: Stage 2 shadow mode diffs the new ledger against
the live legacy renderer, so the legacy path must keep working until cutover.
This manifest is what "starting fresh" means in practice — every legacy file
is enumerated with its fate and its deletion point, so nothing survives by
accident. LOC figures from the knowledge dump's Blast Radius appendix
(measured 2026-05-22; drifted slightly since, fates unchanged).

Legend: **DELETE** = removed entirely · **GUT** = file stays, ownership logic
removed (becomes dumb/plumbing) · **ABSORB** = behavior re-encoded in the
ledger, then source deleted · **KEEP** = not ownership code, survives as-is.

## Cutover status — 2026-07 (the ledger is now the sole decision core)

The cutover shipped in two slices because a late discovery split it: the
**remote phone client** (`src/remote-client/`) is a SECOND `<Feed>` consumer
that was mounting the legacy `deriveFeedRenderModel` path. The manifest below
was written assuming one consumer, so "delete deriveFeedRenderModel" was
blocked until the phone also fed the ledger.

**DONE (this cutover PR):**
- The ledger producer (`useLedgerFeedItems`) is UNCONDITIONAL. The
`AGENT_CODE_RENDER_PIPELINE` flag + its whole probe are gone; so is
`AGENT_CODE_RENDER_SHADOW` and the `renderShadowEnabled`/
`renderPipelineEnabled` dev-debug plumbing.
- **The phone was migrated**: `remote/ui/SessionView.tsx` builds a minimal
SessionRuntime view (empty ghost plane — the phone has no optimistic echo)
and drives the SAME `useLedgerFeedItems`, so it now passes
`renderItemsOverride` like the desktop.
- `deriveFeedRenderModel` + its sort/visibility helpers + `FeedRenderModelInput`
**DELETED** from `renderModel.ts`. Feed's legacy branch **DELETED** — it maps
the ledger's items unconditionally.
- Shadow subsystem **DELETED**: `shadow/useRenderShadow.ts` and the
`shadowParity.test.ts` CI diff. `shadow/shadowDiff.ts` KEPT (pure diff util —
bundleCorpus/recordingCorpus still assert ledger output through it).

**STILL ALIVE — the block-level un-collapse slice (next PR):** the view bridge
still COLLAPSES the ledger's block-level semantic rows back into turn-level
items so `SemanticStreamingTurn` can render them. Killing that component (and
with it ghost rule 3, `selectMergedEntries` as Feed's entries source, and
`committedClaudeMessageTurnIds`) requires the ledger to own live turns
block-by-block through the shared registry dispatch — the hardest slice, and
the one that needs live visual verification the turn-grain corpus can't give.
Until then the completeness grep below still returns `SemanticStreamingTurn` /
`selectMergedEntries` / `committedClaudeMessageTurnIds` hits BY DESIGN;
`deriveFeedRenderModel` / `buildSemanticRenderUnits` are already clean.

## Deleted at Stage 3 cutover (the big reviewed PR)

| file | phys LOC | fate | notes |
|---|---:|---|---|
| `features/feed/ui/semantic/StreamingTurn.tsx` | 149 | **DELETE** | atomically with ghost rule 3 (plan D6) — never one without the other |
| `features/feed/model/renderModel.ts` | 430 | **DELETE** | replaced by ledger + view model; `committedClaudeMessageTurnIds` naming lie dies with it |
| `features/feed/ui/semantic/renderUnits.ts` | 359 | **ABSORB** | committed-ownership skips → ledger reasons; collapsed-activity policy → view layer |
| `workspace/mergedEntries.ts` | ~200 | **ABSORB** | five-rule predicate → ledger ghost decisions; the entries pre-pass merge dies |
| `workspace/semantic/foldEvent.ts` | 987 | **GUT→ABSORB** | reducer stays (events→turn state); ALL ownership/suppression gates + fold policies move to ledger candidate rules; yield hatches become policy |
| `features/feed/ui/semantic/BlockRow.tsx` | 495 | **GUT** | becomes dumb rows; hardcoded provider dispatch replaced by the registry (same one committed rows use); all suppression branches deleted |
| `features/feed/ui/Feed.tsx` | 946 | **GUT** | maps view-model rows once; all plane/ownership/debug-derivation logic deleted; scroll/lazy stay per migration hazards |
| `features/feed/ui/rows/Block.tsx` | 204 | **GUT** | dispatch stays, ownership guards deleted |
| `workspace/ghosts.ts` | ~530 | **GUT** | minting/reconcile/persist stay (bookkeeping); render-side selection is ledger's |
| legacy `visible_rows`-only debug derivation | — | **DELETE** | replaced by ownership_decision serialization (visible_rows stays as aggregate) |

## Deleted during Stage 1 (already superseded, no shadow value)

- old fold-policy literals already replaced on main (#415) — nothing to do
- `workspace/queueInvariants.ts` — **ABSORB** into ledger queue-handoff rules
at cutover, not before (echo providers still run through it live)

## KEEP (not ownership code)

| file | LOC | why it lives |
|---|---:|---|
| `markdown/Prose.tsx`, `MarkdownComponents.tsx`, remark plugins | ~250 | TextProse/StreamingProse split is load-bearing (migration hazard) |
| `lib/streamingWriteInput.ts` | 206 | Write-scanner, pure detector — feeds the view layer |
| `WorkIndicator.tsx` + hints | 305 | phase surface; consumes work candidates |
| row components (ToolUseRow/ToolResultRow/ConversationRow/Claude+Codex+OpenCode rows) | ~1600 | become dumb rows; only their embedded ownership guards die (counted under GUT above) |
| `lib/helpers.ts` committed text/tool index builders | 386 | logic ABSORBED into ownership.ts; file gutted at cutover |
| headless packages | ~11k | contract-tested, never rewritten (plan §10) |

## Verification of completeness at cutover

FULL completeness (the final block-level un-collapse PR) is reached when:
`grep -rn "SemanticStreamingTurn\|selectMergedEntries\|deriveFeedRenderModel\|committedClaudeMessageTurnIds\|buildSemanticRenderUnits" src/` returns only
hits inside `src/renderer/src/rendering/` history comments — i.e. every entry
in the DELETE/ABSORB tables above is gone or gutted, with its fixture green.

As of the 2026-07 cutover (see status section up top) `deriveFeedRenderModel`
and `buildSemanticRenderUnits` are already clean; the remaining three tokens
(`SemanticStreamingTurn`, `selectMergedEntries`, `committedClaudeMessageTurnIds`)
stay until the block-level un-collapse slice retires `SemanticStreamingTurn`.
59 changes: 59 additions & 0 deletions docs/rendering/rendering-rewrite-plan-2026-07.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,65 @@ wins; where this one is silent, the dump's Non-Negotiable Rules apply.

Read this first. Then read `research-2026-07/` for the receipts.

## Stage 1 progress (updated 2026-07-06, integration branch)

Landed (slices 1-11, PRs #424-#437 into `integration/rendering-pipeline`):
ledger core (types / ordering law / ownership / identity stability), committed
collector with the #338 synthetic-user filter, ghost five-rule predicate with
the 10-case matrix and failed-fix regressions, semantic collector with the
#345 compaction kill, local collectors + optimistic→committed handoff,
unknown-behavior registry with structural redaction, ghost plane wired into
the ledger pass (#435), the runtime→collector adapter — the shadow seam —
with ghost collector, optimistic partition, plane-level reference stability,
and compile-time seam assertions against real runtime types (#436), the
fold-policy yield-hatch absorption (`policy/foldPolicy.ts` — the two
proxy-literal hatches from legacy foldEvent encoded as policy data with
parity tests) and six end-to-end fixtures: buried-prompt-239,
dead-committed-channel-159, opencode-interleave-87f0eeef, the ghost matrix,
sidecar-tail-ghost, and queue-handoff-race (#437). Suite: 67 pipeline tests.

**Stage 1 is COMPLETE.** (Unknowns plumbing note: the registry exists and
`LedgerInput.unknowns` passes through; POPULATING it from real IPC events
is a shadow-seam concern — unknowns are discovered live, not in fixtures.)

### Stage 2/3 progress (updated 2026-07-07, through PR #447)

Landed since the Stage 1 wrap (slices 12-17 + triage, PRs #439-#447):
- **Shadow mode** (#439): `AGENT_CODE_RENDER_SHADOW=1` runs adapter+ledger
beside the legacy renderer in TileLeaf; `shadow/shadowDiff.ts` normalizes
both to comparable units (rows by id, turns by turnId); divergences land
on `globalThis.__agentCodeRenderShadow` (ring of 50) + one console.warn
per signature. Shadow parity suite (#441) runs the same diff in CI.
- **Bundle corpus** (#444-#445, #447): 46 fixtures extracted from the
manual debug-bundle archive (`scripts/extract-rendering-fixtures.mjs`,
triage rules in `scripts/triage-rendering-fixtures.mjs`) — each is a
real captured rendering failure with the legacy renderer's ACTUAL
painted rows as ground truth. `bundleCorpus.test.ts` asserts the diff
matches checked-in triage exactly (bless via AGENT_CODE_CORPUS_BLESS=1).
State: 0 untriaged. Corpus catches so far: opencode blockless-text turns
invisible (fixed #444); system/compact_boundary rows dropped (fixed
#445); committed tool-ownership mining gap + dangling tool chip
(confirmed #447, fixes queued).
- **View bridge** (#443): `view/ledgerFeedItems.ts` maps ledger rows to
legacy FeedRenderItems — cutover swaps the decision core, row components
survive. **Cutover flag** (#446): `AGENT_CODE_RENDER_PIPELINE=1` makes
Feed paint from the ledger via `renderItemsOverride`; flag off is
byte-identical legacy.

**Soak instructions (the current gate):** run daily work on this branch
with `AGENT_CODE_RENDER_PIPELINE=1 AGENT_CODE_RENDER_SHADOW=1` across all
three providers. Watch for `[render-shadow] divergence` and
`[render-pipeline] dropped candidates` in the console; every divergence
class gets triaged into the corpus. Exit = a week of real use with no
untriaged class.

Remaining before the main merge: the two #447-confirmed collector fixes
(committed tool-ownership mining; dangling tool chip), extractor v2
(codex rollout→Entry mapping unlocks the 122 extraction-gap verdicts),
the soak above, then the final cutover slice — SemanticStreamingTurn +
ghost rule 3 deleted atomically, deletion-manifest grep sweep, flag
default-on — and the reviewed integration→main PR (draft #442).

---

## 0. Why this plan exists and what it refuses to be
Expand Down
Loading