Repository navigation
emrg: the install tree keeps files no release ships, and the drift guard skips exactly those #2346
Description
The reading
~/.emrg/install/source is the tree the daemon actually loads (_resolve_task_template answers Path(__file__).parent / template, and that __file__ is under this directory). It reports version 0.3.16 and holds 11 files under emrg/gui/renderer/js/ — a directory deleted from the repository on 2026-08-27 (1f7440ef, GUI renderer Batch 5) and absent from the v0.3.16 tag's own tree (git ls-tree -r v0.3.16 | grep gui/renderer/js → 0 rows).
So the installer/upgrade copies a release's files in and never removes the ones a newer release dropped. scripts/check-install-drift.py is the guard for this tree, and its own output says the files are out of its subject:
every file the install tree shares with this checkout holds content the refs a release is built from still reach
(381 file(s) checked, 22 skipped as untracked here)
The 22 skipped are exactly the leftovers. A path the checkout does not track cannot "share content" with it, so the one class this guard cannot see is the one an upgrade creates.
Why it just cost something
Three host rants filed on 2026-10-17 (18:33:39, 18:44:09, 18:45:48) audit that dead tree. Their citations are precise and their targets are stale:
gui/renderer/js/chat.js—updateToolGroup,scrollToBottomat lines 379/434;gui/renderer/js/app.js— threelistHistorycall sites never passingincludeRecords;- "the vanilla renderer stays in
js/until Batch 5".
None of that code has shipped since v0.3.16. The behaviour those rants ask for is already implemented in the React renderer that the packaged app loads: Shell.tsx keeps turnStartBySid from turn_start and resume_result.meta.turn and ticks against it; TranscriptView.tsx pins auto-scroll to "already near the bottom" and keeps a user-expanded group from collapsing; Shell.tsx loads history with includeRecords: true and a beforeIndex cursor, and its tests pin the 80-character preview regression.
Part of the first rant is not stale and is real work — a persisted role: "system" message and a summary record are still filtered out of the record stream (daemon.py, the rtype == "message" and role in ("user", "assistant") branch), and rewind_result carries no removed_content. Those are separate issues, not this one.
The change
scripts/check-install-drift.pyreports the leftovers by name instead of skipping them silently: the files present in the install tree and absent from the release tree it compares against, with the count and the paths, and a remedy (an upgrade that prunes, or a reinstall). The exit codes keep their meaning — a finding is not "could not measure".- A test that drives both halves: a tree where the install copy carries an extra file must be reported, and the same tree without it must read clean. Finding nothing and not looking must not print the same line.
Acceptance
- On this host the guard names
emrg/gui/renderer/js/*(11 files) and every other leftover, rather than counting them as "skipped". - A synthetic install tree with one extra file yields a finding; without it, a clean reading; with an unreadable tree, an unmeasurable one.
- The remedy names an action a host can take.
Activity
how2how2how2-arch commentedon Oct 17, 2026
Handled by #2347