commit 96e812651c94a684f303de02b8c17ba6501c6c4b
parent e6505b7cb81d47d069545b6bf8fa2dfda5aafee5
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 12 Nov 2026 20:52:02 -0500
umtool lint: a ledger*.json beside the manifest is named stale (or newer) against the manifest's live ledger
Cause: nothing in umtool reads a ledger file beside the manifest -- the build, the instruments and
umtool ledger read video.manifest.json's `ledger` only -- and nothing said so. quartering-diet's
ledger.draft.json (186 rows, 30 Aug; still read by the project's own make-shadow-channels.mjs) sat
beside the manifest's 564 live rows looking like a second source.
Fix (lintCli.mjs ledgerFileWarnings, in `umtool lint`, not in report-to-video/lint.mjs): when the
manifest carries a `ledger`, each ledger*.json beside it is one warning naming the live ledger (the
manifest's, rows and date) and the file (rows and date) as stale -- or as NEWER than the manifest,
its rows not in the cut. A warning, never an error; the file is never touched (one source of truth by
saying which is live, since a project script still reads the other). LINT_USAGE and groups.mjs
(cli.md regenerated) say it.
Test: lib/report/ledgerFiles.test.mjs.
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
5 files changed, 102 insertions(+), 4 deletions(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -113,6 +113,7 @@
- **umtool: the quote check can judge a take.** `umtool quote-check` only judged the project's draft, so a take with clips of its own was never checked (on 12 Nov, 25 rows blocked the draft and the take went unjudged), and a take's render was gated by the draft's rows alone. `umtool quote-check <p> --take <t>` now judges the take's clips as it renders them and keeps the rows in `takes/<t>/quote-check.json`; the project's `quote-check.json` is not touched. A take's render, the new `umtool check <p> --take <t>` and `umtool window <p> <clip> --take <t> --align` read the take's rows first; a clip the take has not been checked for keeps the project's row, as before. `--status --take <t>` lists the take's rows and says which came from the project.
- **umtool: editing a take from a terminal no longer says it is deprecated.** `umtool window … --take`, `timeline <p> --take <t> <verb>`, `posts <verb> … --in-take` and `take --id <t> --import-item` printed "deprecated — edits land in the draft now; open the take there first (umtool takes open …)" on stderr. They are the supported way to edit a take without touching the draft (as `set --take` and `look --take` already were): they write only the take's patch, with an undo point. The advice was the problem, since `takes open` writes the take over the draft. The line is gone; what the commands do, their stdout and `--json` are unchanged. The old take walk's route (`/api/report/takes/timeline`) still says it.
- **umtool: the by-date weight chart no longer piles a recent run of weights into its right edge.** The chart's width was shared by days alone, so on rev9-a9 the nine weights said for July–November 2026 shared 31 px of a 2023–26 stretch, under a pixel apart. Now half the width goes by days and half by how many weights each stretch holds: the same run spreads over about 100 px, no two weights closer than 11 px, and a long empty stretch still reads as longer. Breaks, years, the line and the reflow are unchanged.
+- **umtool: `umtool lint` says which ledger is live.** A `ledger*.json` beside a video's manifest (quartering-diet's `ledger.draft.json`: 186 rows from 30 Aug) looked like the ledger, but the build, the instruments and `umtool ledger` read only the manifest's own `ledger` (564 rows). `umtool lint` now warns once per such file, naming the manifest's ledger as the live one and the file as stale — or as newer than the manifest, with rows that are not in the cut — with both row counts and dates. The file is never changed or moved (a project's own script may still read it); it is only said when the manifest carries a ledger.
## [0.12.0] - 2026-10-28
- **An X post's screenshot is of the post, not of a page in the middle of laying itself out.** On 2026-10-27 a forced capture of TheQuartering's post 2114859155022389342 came out shifted about 100 px: its left edge cut off, X's menu laid over its words and the gap beside the column showing; another post once came out as a strip of the post above it. The shot was a full-page capture, which resizes the page for the moment of the capture — in the X session profile the page saw its window go to 1×1 — and X laid itself out again for that size while it was being captured, so the shot was cut from a different layout than the one measured. A post is now shot from the window as it stands: scrolled into it, the window made taller first when the post is taller than it, so nothing is resized under the shot; and the post is measured again after the shot and shot again if it moved. An X Article's shot is taken the same way. Posts taller than the tallest window (16,384 px) are still shot from a full-page capture. Needs a restart of the editor.
diff --git a/umtool/docs/cli.md b/umtool/docs/cli.md
@@ -70,7 +70,7 @@ Inbox cannot disagree about what is wrong with one.
| `notes …` | operator notes: list, read, reply, resolve ([notes.md](notes.md)) |
| `modules list [--json]` · `modules apply <project> [--config FILE] [--dry-run] [--json]` · `modules apply <project> [--config FILE] --take <id> [--label L] [--at S --dur S \| --full] [--quick] [--force] [--from TAKE] [--keep-frames] [--patch-out FILE]` | the **video modules** (release 39): `list` every module, its kind, slot and where its settings live; `apply` maps the project's `module-config.json` (the modules a video wants, in MODULES-DESIGN's vocabulary) into the manifest's homes (`report-to-video/modules/config-loader.mjs`) — the preset, the deck's subtitle and QR, the counter's series and each clip's marks, the stamps, the rail's markers, the chapters, the pairs, the status ledger, the intro, the finale — and lists every field with no home, by path. Without `--take` the manifest is rewritten through `replaceManifest` (a snapshot first); with `--take` it is that take's patch (`takes/<id>.modules-patch.json`, or `--patch-out`) and the take is made from it as `take` makes one, the manifest untouched. **Exit 1** when the result would not build (the build's sentences) ([knobs.md](knobs.md#look-presets)) |
| `preset list [--json]` · `preset show <name> [--json]` · `preset save <name> --from <project> [--description D] [--force]` · `preset apply <name\|none> <project> [--replace] [--json]` | the **look presets** (`umtool/presets/<name>.json`, or `UMTOOL_PRESETS_DIR`; built in: `plain-deck` `huck-deck` `ember-deck` `archive-catalog` `basic`): a render block a manifest stands on (`"preset": "<name>"`), laid under it — preset → manifest → style → take patch. `save` keeps a project's look and leaves its content out; `apply` names the preset on the cut through `updatePreset` (nothing copied in), refused when the cut over it would not build (a basic cut's chrome is not checked); `--replace` also clears the manifest's own value of every key the preset sets, after an undo point (`revisions/…-auto-before-preset-replace`), and prints what went ([knobs.md](knobs.md#look-presets)) |
-| `lint <project> [--take <take>] [--variant sourced\|full] [--final] [--json]` | **the manifest lint** (`report-to-video/lint.mjs`, what a build runs before it renders a frame) from umtool: the project's manifest, or with `--take` the take's (its patches applied, written beside the project's manifest for the lint as its render's is, then removed) -- plus the **files its post items name**: a picked read, an attachment or a context post's media not in the project is an ERROR, another kept take a warning. Run it after an import and before queueing the render. `--json`: `{ok, entries, errors, warnings}`. **Exit 0 no error · 1 an error · 2 usage** |
+| `lint <project> [--take <take>] [--variant sourced\|full] [--final] [--json]` | **the manifest lint** (`report-to-video/lint.mjs`, what a build runs before it renders a frame) from umtool: the project's manifest, or with `--take` the take's (its patches applied, written beside the project's manifest for the lint as its render's is, then removed) -- plus the **files its post items name**: a picked read, an attachment or a context post's media not in the project is an ERROR, another kept take a warning. A `ledger*.json` beside a manifest that carries its own `ledger` is a warning naming the live one (the manifest's: what the build and `umtool ledger` read) and the file as stale, or newer with its rows not in the cut, with both dates; the file is never touched. Run it after an import and before queueing the render. `--json`: `{ok, entries, errors, warnings}`. **Exit 0 no error · 1 an error · 2 usage** |
| `take <project> --id <id> --label L [--group G] [--kind similar\|different] [--summary S] [--style NAME] [--patch FILE \| --patch-json JSON \| --set path=value …] [--effect NAME] [--at S --dur S \| --full] [--quick] [--force] [--progress ndjson]` | one **take**: the manifest with a montage style's patch, then an overlay effect's (`--effect`, release 35), then the take's own, rendered into `takes/<id>/` (the Takes page's New take); `--id <id> --rebuild` makes one again from its own `take.json` ([report-video.md](report-video.md#making-takes)) |
| `take <project> --id <id> --label L [--patch F \| …] --draft` (`--no-render`) · `take <project> --id <id> [--full \| --at S --dur S]` · `take <project> --id <id> --rebuild [--full \| --at S --dur S]` · `take <project> --id <id> --promote [--anyway] [--json]` | a **draft** take: recorded with nothing rendered, to be walked first; a draft named with no patch flags is rendered from its stored (walked) patch, and `--rebuild` takes a window flag; **make it the cut**: the take's patch applied to the manifest now, one undo point (`revisions/…-auto-before-promote-take`), refused (exit 1) when its timeline would replace a cut that changed since, until `--anyway` ([report-video.md](report-video.md#walking-a-take-drafts-edits-into-the-take-and-making-it-the-cut)) |
| `take <project> --id <id> … --uncensored` · build-video `--uncensored` | the **uncensored cut** ([knobs.md](knobs.md#the-slur-filter-slurs-masked-in-what-is-published-off-for-the-uncensored-cut)): the same cut with the post items' slur filter off -- `render.posts.slurs.on: false` in the take's patch (a `--rebuild` keeps it; a censored take is not rebuilt uncensored, **exit 2**: make a take of its own), its label gains "(uncensored)", take.json's `slurs` records `censored` or `uncensored`. The redaction of private words and censored attachments stay on |
diff --git a/umtool/lib/cli/groups.mjs b/umtool/lib/cli/groups.mjs
@@ -570,7 +570,7 @@ export const GROUPS = [
],
docs: [
["`lint <project> [--take <take>] [--variant sourced\\|full] [--final] [--json]`",
- "**the manifest lint** (`report-to-video/lint.mjs`, what a build runs before it renders a frame) from umtool: the project's manifest, or with `--take` the take's (its patches applied, written beside the project's manifest for the lint as its render's is, then removed) -- plus the **files its post items name**: a picked read, an attachment or a context post's media not in the project is an ERROR, another kept take a warning. Run it after an import and before queueing the render. `--json`: `{ok, entries, errors, warnings}`. **Exit 0 no error · 1 an error · 2 usage**"],
+ "**the manifest lint** (`report-to-video/lint.mjs`, what a build runs before it renders a frame) from umtool: the project's manifest, or with `--take` the take's (its patches applied, written beside the project's manifest for the lint as its render's is, then removed) -- plus the **files its post items name**: a picked read, an attachment or a context post's media not in the project is an ERROR, another kept take a warning. A `ledger*.json` beside a manifest that carries its own `ledger` is a warning naming the live one (the manifest's: what the build and `umtool ledger` read) and the file as stale, or newer with its rows not in the cut, with both dates; the file is never touched. Run it after an import and before queueing the render. `--json`: `{ok, entries, errors, warnings}`. **Exit 0 no error · 1 an error · 2 usage**"],
],
},
{
diff --git a/umtool/lib/report/ledgerFiles.test.mjs b/umtool/lib/report/ledgerFiles.test.mjs
@@ -0,0 +1,52 @@
+// A ledger file beside the manifest (quartering-diet's ledger.draft.json, 30 Aug: 186 rows) is not the ledger the
+// build reads -- that is video.manifest.json's `ledger` (564 rows, 12 Nov) -- and nothing said so. `umtool lint` now
+// says which is live and that the other is stale, naming the file and the newer date. The file is never touched.
+import assert from "node:assert/strict";
+import { mkdir, mkdtemp, readFile, rm, utimes, writeFile } from "node:fs/promises";
+import { tmpdir } from "node:os";
+import path from "node:path";
+import test from "node:test";
+import { ledgerFileWarnings, lintCommand } from "./lintCli.mjs";
+
+const row = (id) => ({ id, date: "2026-01-01", scope: "weight", population: "self", value: 300 });
+
+async function project() {
+ const root = await mkdtemp(path.join(tmpdir(), "umtool-ledger-files-"));
+ const dir = path.join(root, "diet");
+ await mkdir(dir, { recursive: true });
+ const manifest = { schemaVersion: 1, slug: "diet", title: "T", render: { width: 640, height: 360, fps: 15 }, ledger: [row("d1"), row("d2"), row("d3")], timeline: [{ type: "clip", id: "c1", channel: "ch", video: "v", start: 0, end: 5 }] };
+ await writeFile(path.join(dir, "video.manifest.json"), JSON.stringify(manifest));
+ await writeFile(path.join(dir, "ledger.draft.json"), JSON.stringify([row("d1")]));
+ // The draft from 30 Aug, the manifest from 12 Nov.
+ await utimes(path.join(dir, "ledger.draft.json"), new Date("2026-08-30T13:18:00Z"), new Date("2026-08-30T13:18:00Z"));
+ await utimes(path.join(dir, "video.manifest.json"), new Date("2026-11-12T16:51:00Z"), new Date("2026-11-12T16:51:00Z"));
+ return { root, dir, manifest };
+}
+
+test("a ledger file beside the manifest: lint says the manifest's ledger is live and the file stale, with both dates", async () => {
+ const p = await project();
+ try {
+ const before = await readFile(path.join(p.dir, "ledger.draft.json"), "utf8");
+ const w = await ledgerFileWarnings(p.dir, p.manifest);
+ assert.equal(w.length, 1);
+ assert.match(w[0], /ledger\.draft\.json/);
+ assert.match(w[0], /live ledger is video\.manifest\.json's `ledger` \(3 rows, 2026-11-12\)/);
+ assert.match(w[0], /ledger\.draft\.json \(1 row, 2026-08-30\) is stale/);
+ // Through `umtool lint`: a warning, not an error -- the exit is the lint's own.
+ const out = [];
+ const code = await lintCommand(["diet"], { reportsRoot: p.root, log: (l) => out.push(l), err: (l) => out.push(l) });
+ assert.match(out.join("\n"), /ledger\.draft\.json \(1 row, 2026-08-30\) is stale/);
+ assert.notEqual(code, 2);
+ assert.equal(await readFile(path.join(p.dir, "ledger.draft.json"), "utf8"), before, "the operator's file is never touched");
+ // Newer than the manifest: said so -- rows there are not in the cut.
+ await utimes(path.join(p.dir, "ledger.draft.json"), new Date("2026-11-13T09:00:00Z"), new Date("2026-11-13T09:00:00Z"));
+ const newer = await ledgerFileWarnings(p.dir, p.manifest);
+ assert.match(newer[0], /ledger\.draft\.json \(1 row, 2026-11-13\) is NEWER than the manifest/);
+ // No ledger in the manifest, or no such file: nothing said.
+ assert.deepEqual(await ledgerFileWarnings(p.dir, { ...p.manifest, ledger: undefined }), []);
+ await rm(path.join(p.dir, "ledger.draft.json"));
+ assert.deepEqual(await ledgerFileWarnings(p.dir, p.manifest), []);
+ } finally {
+ await rm(p.root, { recursive: true, force: true });
+ }
+});
diff --git a/umtool/lib/report/lintCli.mjs b/umtool/lib/report/lintCli.mjs
@@ -6,7 +6,7 @@
// item (a take's imported items are hard-linked in by `umtool take --import-item`; this says when one is not).
//
// exit 0 no error (warnings said) · 1 an error · 2 usage
-import { rm, stat, writeFile } from "node:fs/promises";
+import { readdir, readFile, rm, stat, writeFile } from "node:fs/promises";
import path from "node:path";
import { REPORTS_ROOT, resolveProject } from "../projects/core.mjs";
@@ -17,6 +17,8 @@ export const LINT_USAGE = [
" picked read, an attachment, a context post's media not in the project is an ERROR; another named file a warning.",
" And the cast's guard (umtool cast): a picked read that says a cast character in another voice than now is a",
" warning (umtool cast reread); a cast voice the project's voice map overrides on purpose is a note.",
+ " A ledger*.json beside a manifest that carries its own `ledger` is a warning: the manifest's is the live one (what",
+ " the build and umtool ledger read), the file stale -- or newer, its rows not in the cut; the file is never touched.",
" Exit 0 no error · 1 an error · 2 usage.",
].join("\n");
@@ -24,6 +26,48 @@ const isObj = (v) => !!v && typeof v === "object" && !Array.isArray(v);
const exists = async (f) => !!(await stat(f).catch(() => null));
/**
+ * THE LEDGER'S ONE SOURCE OF TRUTH (12 Nov): the build, the instruments and `umtool ledger` read the manifest's
+ * `ledger`; a `ledger*.json` beside it (quartering-diet's ledger.draft.json, 30 Aug, 186 rows against the manifest's
+ * 564) is read by none of them. One warning per such file, naming which is live, each one's rows and date, and
+ * which is newer. Only said when the manifest carries a ledger. The file is never touched (a project's own script
+ * may read it).
+ * @param {string} dir the project's dir
+ * @param {Record<string, any>} manifest
+ * @returns {Promise<string[]>}
+ */
+export async function ledgerFileWarnings(dir, manifest) {
+ if (!Array.isArray(manifest?.ledger)) return [];
+ const names = (await readdir(dir).catch(() => [])).filter((n) => /^ledger.*\.json$/i.test(n)).sort();
+ if (!names.length) return [];
+ const day = (ms) => new Date(ms).toISOString().slice(0, 10);
+ const rows = (n) => `${n} row${n === 1 ? "" : "s"}`;
+ const man = await stat(path.join(dir, "video.manifest.json")).catch(() => null);
+ const live = `video.manifest.json's \`ledger\` (${rows(manifest.ledger.length)}${man ? `, ${day(man.mtimeMs)}` : ""})`;
+ const out = [];
+ for (const name of names) {
+ const st = await stat(path.join(dir, name)).catch(() => null);
+ if (!st?.isFile()) continue;
+ let doc = null;
+ try {
+ doc = JSON.parse(await readFile(path.join(dir, name), "utf8"));
+ } catch {
+ /* not JSON: counted as unknown */
+ }
+ const list = Array.isArray(doc) ? doc : Array.isArray(doc?.ledger) ? doc.ledger : Array.isArray(doc?.rows) ? doc.rows : null;
+ const it = `${name} (${list ? rows(list.length) : "rows unknown"}, ${day(st.mtimeMs)})`;
+ const newer = man && st.mtimeMs > man.mtimeMs;
+ out.push(
+ `${name} is not the ledger the build reads: the live ledger is ${live}; ` +
+ (newer
+ ? `${it} is NEWER than the manifest -- rows added there are not in the cut (umtool ledger <p> add …)`
+ : `${it} is stale -- the manifest is newer`) +
+ "; the file is left as it is",
+ );
+ }
+ return out;
+}
+
+/**
* The files the post items of `manifest` name that are not in `dir`: `{ errors, warnings }`.
* An error: the picked narration take, an attachment (`media[].src`), a context post's or a link's media.
* A warning: any other narration take the item keeps.
@@ -146,8 +190,9 @@ export async function lintCommand(args, { reportsRoot = REPORTS_ROOT, log = cons
const lint = await lintManifestFile(file, { variant, final: flags.has("--final") });
const files = await namedFileProblems(selectVariant(manifest, variant), project.dir);
const voices = await castProblems(selectVariant(manifest, variant), project, reportsRoot);
+ const ledgers = await ledgerFileWarnings(project.dir, manifest);
const errors = [...lint.errors, ...files.errors];
- const warnings = [...lint.warnings, ...files.warnings, ...voices.warnings];
+ const warnings = [...lint.warnings, ...files.warnings, ...voices.warnings, ...ledgers];
if (flags.has("--json")) log(JSON.stringify({ ok: errors.length === 0, project: project.id, take, variant, entries: manifest.timeline?.length ?? 0, errors, warnings, notes: voices.notes }, null, 2));
else {
for (const line of lintReport({ errors, warnings })) log(line);