commit 563f6c6a6ddc0cf0ee6b2733e3e6fe20ed8e6de5
parent 347863f03165383738e310d6ca5d61d12e17427d
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 29 Oct 2026 00:26:08 -0400
umtool: umtool look takes pair / chapter / status keys, through updateChrome
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/umtool/lib/report/knobsCli.mjs b/umtool/lib/report/knobsCli.mjs
@@ -28,6 +28,7 @@ import {
LOOK_KEYS,
manifestToken,
updateClaimKnobs,
+ updateChrome,
updateClip,
updateDeckKeys,
updateFactcheck,
@@ -74,6 +75,8 @@ export const LOOK_USAGE = [
" factcheck.tally.showAt.<VERDICT>=first for one cell) .show .position (right|left)",
" deck.markers='[{\"after\":\"c01\",\"label\":\"Arrival\",\"align\":\"left\"}]' deck.markerLayout=stagger|truncate",
" deck.<key>=<json>: any of the deck's own keys (deck.finale='{…}', deck.pip='{…}', …), checked by the build's rules",
+ " pair=<json> | pair.<key>=…, chapter=<json> | chapter.<key>=…, status=<json> | status.<key>=…: the story modules",
+ " (render.chrome.pair / .chapter / .status, docs/knobs.md \"Modules\"), checked by the build's rules",
" variants='[{\"name\":\"master\"},{\"name\":\"720p\",\"height\":720,\"crf\":23},{\"name\":\"fit24\",\"maxMiB\":24}]'",
` the look: ${LOOK_KEYS.join(", ")} (a JSON value each)`,
" `key=` clears it (the default).",
@@ -310,7 +313,11 @@ export async function lookCommand(args, { root = REPORTS_ROOT, out = (s) => cons
const deck = pairs.filter(([k]) => k.startsWith("deck."));
const variants = pairs.filter(([k]) => k === "variants");
const look = pairs.filter(([k]) => LOOK_KEYS.includes(k));
- const unknown = pairs.filter(([k]) => !k.startsWith("factcheck.") && !k.startsWith("deck.") && k !== "variants" && !LOOK_KEYS.includes(k));
+ // The story modules (release 39): `pair=<json>`, `pair.style=…`, likewise chapter and status.
+ const STORY = ["pair", "chapter", "status"];
+ const isStory = (k) => STORY.includes(k.split(".")[0]);
+ const story = pairs.filter(([k]) => isStory(k));
+ const unknown = pairs.filter(([k]) => !k.startsWith("factcheck.") && !k.startsWith("deck.") && k !== "variants" && !LOOK_KEYS.includes(k) && !isStory(k));
if (unknown.length) throw new CliError(`not a knob here: ${unknown.map(([k]) => k).join(", ")}\n\n${LOOK_USAGE}`);
for (const [k] of deck) if (k.split(".").length !== 2 || !k.split(".")[1]) throw new CliError(`${k}: name one of the deck's own keys (deck.<key>=<json>)`);
const done = {};
@@ -334,6 +341,13 @@ export async function lookCommand(args, { root = REPORTS_ROOT, out = (s) => cons
const r = await write((token) => updateDeckKeys(project.dir, patch, { token }));
for (const k of Object.keys(patch)) done[`deck.${k}`] = r.deck[k] ?? null;
}
+ if (story.length) {
+ const m = await readManifest(project.dir);
+ let chrome = m?.render?.chrome ?? {};
+ for (const [k, v] of story) chrome = setPath(chrome, k.split("."), v);
+ const r = await write((token) => updateChrome(project.dir, chrome, { token }));
+ for (const k of new Set(story.map(([k]) => k.split(".")[0]))) done[k] = r.chrome?.[k] ?? null;
+ }
if (variants.length) {
const r = await write((token) => updateVariants(project.dir, variants[0][1], { token }));
done.variants = r.variants;
diff --git a/umtool/lib/report/modulesCli.test.mjs b/umtool/lib/report/modulesCli.test.mjs
@@ -87,3 +87,19 @@ test("modules list and preset list", async () => {
assert.equal(await presetCommand(["list", "--json"], t), 0);
assert.deepEqual(JSON.parse(t.lines[0]).map((p) => p.name).sort(), ["archive-catalog", "huck-deck", "plain-deck"]);
});
+
+test("umtool look takes the story modules' keys, through updateChrome", async () => {
+ const { lookCommand } = await import("./knobsCli.mjs");
+ const { root, dir } = tree();
+ assert.equal(await modulesCommand(["apply", dir], { reportsRoot: root, ...sink() }), 0);
+ const s = sink();
+ const code = await lookCommand([dir, "chapter.style=lower", "pair={\"style\":\"split\"}"], { root, out: s.log, err: s.err });
+ assert.equal(code, 0, s.lines.join("\n"));
+ const m = JSON.parse(readFileSync(path.join(dir, "video.manifest.json"), "utf8"));
+ assert.equal(m.render.chrome.chapter.style, "lower");
+ assert.deepEqual(m.render.chrome.chapter.list, [{ at: "b", title: "Two" }]);
+ assert.deepEqual(m.render.chrome.pair, { style: "split" });
+ const bad = sink();
+ assert.equal(await lookCommand([dir, "status.rows=40"], { root, out: bad.log, err: bad.err }), 1);
+ assert.match(bad.lines.join("\n"), /status\.rows/);
+});