You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 697254e
Browse filesBrowse the repository at this point in the historyBrowse files
ami3466
committed
log: ship a list, not 200 captures — and reject through the one brain
The Log list sent 4,000 characters of every capture plus up to a hundred cell
diffs per row, ~half a megabyte to paint 200 rows the renderer draws as ONE line
each (`text.split("\n",1)[0]`). Nearly all of it was thrown away on arrival.
The list now carries a 200-char preview and the cell COUNT. The capture in full
and the reviewable before→after diff move to GET /api/log?id=<id>, fetched for
the one row a user actually opens, cached per id and dropped when the record
version bumps — a row opened while pending, then structured, must not keep
showing the empty diff it had. The refetch is quiet: the open row keeps its
content and is refilled in place, no loading flag, nothing unmounts.
list 2,599B for 7 rows vs 31,713B of details — measured in the e2e, not guessed
REJECT WAS A SECOND COPY OF THE BRAIN. The route hand-rolled what cli-core's
logReject already does and had drifted: it never called dropMergeRuleFor, so
rejecting a column merge FROM THE UI left its rule in config and the next import
silently redid the merge the user had just undone (the CLI, on the same brain,
got this right). It also used bare refreshSyncCache, which no-ops when no cache
exists, where logReject lands the sources it rewrote. The route keeps its HTTP
shape — auth, 404, "already rejected" — and delegates the rest.
The e2e was asserting a lie, and had been since d0d9730. Reject used to return
`undo.applied.length`, a constant — "reverted: 2" even when it wrote no cells.
d0d9730 made the undo CONDITIONAL (a cell holding a value someone typed after
the merge is theirs, so it stays) and made `reverted` an honest count of cells
actually moved. The assertion kept expecting the constant, so the suite failed
on correct behavior — and, worse, never once exercised a working undo: both of
its cells were edited before the reject, so zero was the right answer.
reverted = 0 in that scenario, and 2026-07-01 rightly still holds the 1111
the user typed over it
Replaced with checks that pin the real contract and would fail on a broken undo:
nothing the capture wrote survives, the hand-typed cell does, and a SECOND
capture nobody edits is rejected and must take back every cell it wrote, its
column and dates with it, touching no other source. journal-edit gains the same
at the lib level plus the rule this repo runs on — reject's patched cache is
compared byte for byte against a full rebuild.
edit:test · log:test (40 checks) · tsc --noEmit — all green
Neither failure was reachable by CI: release.yml builds the image and runs
verify:tree, and no e2e suite at all.
0 commit comments