LITE-045: orthogonal views and renderers — view/ makes hunks, render/ makes bytes

Now
OPEN
Sev
MED
Ask
gritzko
Rep
///lite
See
LITE-001
See
LITE-003
See
LITE-017
See
LITE-034

lite/ has three output modes — plain, color (tty), html — over one good hunk model, but the axes are tangled: color exists only inside the pager (no ANSI-to-pipe), the plain leg is five hand-rolled copies in main.js (runPlain/runLog/runCommit/runDiff/runView), verbs return four different shapes (rows, text+hunks, hunks, hunks+plain/bytes), and bro.js mixes hunk building, row geometry, the ANSI painter and the plain sink in one file, with TOK_TAG and banner chrome mirrored again in html.js. Target: N views x 3 renderers with no pairwise code, a new renderer = one file in render/.

Input

Context

The current seams, mapped 2026-08-15 on the main tree lite/:

Goals

Views and renderers become orthogonal axes; the tree says which is which.

Constraints

WIP

Design decisions

The reorg is stepwise, cheapest-risk first; every step ends with all suites green and the golden bytes identical. Steps:

  1. Goldens: script captures plain output of every verb x fixture and a served page set; this is the parity oracle for all later steps.
  2. Contract: all verbs return {hunks} (log/commit/list/tree reshaped, out.plain/out.bytes retired into per-hunk plain); main.js's five plain legs collapse into one runVerb; goldens byte-identical.
  3. Carve render/: move theme.js; split bro.js into render/plain.js, render/ansi.js, render/wrap.js and view/fs.js; update requires; bro.js deleted.
  4. html.js -> render/html.js consuming the same painter tables (its TOK_TAG/chrome mirror deleted); mark/ embeds unchanged.
  5. door.js: openTarget/seatOf/splitRef/VERBS move out of main.js; pager.js and serve.js re-point; main.js is dispatch + mode pick only.
  6. Verb modules move index/ -> view/; index/ keeps the readers (index.js, read.js, resolve.js, weave.js, perma.js, hook.js).
  7. New legs: --color (ansi.render to a pipe) and --html, one flag scan in main.js; new tests pin both.

TODOs

Blockers and bummers

Outcome

All seven steps landed on the main tree, uncommitted; 22/24 suites green, the 3 known pre-existing fails unchanged (diff 1/34 "a non-repository is refused", pager pty 1/33, rst 1/92 LITE-043 autolink). Golden bytes IDENTICAL after every step.