Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit d761fecc8d6488a5d1f9cab72948a508e36c8b7f
parent bd36860bc3586e3dea66c6c11b759bc5c8688fc6
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 13 Oct 2026 13:57:59 -0400

docs: release 27 — Generate and iterate, Research runs, iterations in REPORT.md, the CHANGELOG pass, STATE and FACTS

- OPERATING.md: "Generate and iterate" (the umtool pages, `pnpm ops report-draft`, `job cancel`, the
  chain, the policy and presets, caps, the API key file, the local model's limits) and "Research runs"
  (autonomy, limits, approve and reject, phases, continue, the standing rules); the MCP's generation
  tools.
- umtool/docs/authoring.md: "Generating with a model".
- REPORT.md (from lib/report/docs.ts): "Iterations", "Checking quotes" with `inexact`; an article may
  not be called `new`.
- editor/CHANGELOG.md: release 27's bullets ordered user-visible first, two pairs merged, the import
  command's bullet.
- AGENTS.md: the `mcp__archilyzer__` prefix rule names `gen.md`; `/gen` in one line.
- plans/STATE.md "Now" for release 27; plans/FACTS.md, the facts it established.
- `docs cli --check` knows `pnpm ops job <verb>` (the verbs from its usage line).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
MAGENTS.md | 14++++++++------
MOPERATING.md | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MREPORT.md | 26+++++++++++++++++++++++++-
Mcommon/bin/cli-docs.test.ts | 4+++-
Mcommon/bin/cli-docs.ts | 6++++++
Mcommon/lib/report/docs.ts | 62+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Meditor/CHANGELOG.md | 27+++++++++++++--------------
Mplans/FACTS.md | 30++++++++++++++++++++++++++++++
Mplans/STATE.md | 30+++++++++++++++++++++++++++++-
Mumtool/docs/authoring.md | 33+++++++++++++++++++++++++++++++++
10 files changed, 310 insertions(+), 24 deletions(-)

diff --git a/AGENTS.md b/AGENTS.md @@ -102,11 +102,11 @@ pnpm 11 may install first after a pull, and that output goes to stdout either wa build off disk. The server never writes to an archive — `fetch_clip` asks the editor, and the editor writes. -**Register it as `archilyzer`.** `.claude/commands/{ask,sweep}.md` are tracked in git -and call `mcp__archilyzer__ask_plan` / `mcp__archilyzer__sweep_plan`. That tool name -embeds the server name as registered on this machine, so any other name silently breaks -both commands. Either use `archilyzer` or edit the `mcp__<name>__` prefix in those two -files. +**Register it as `archilyzer`.** `.claude/commands/{ask,sweep,gen}.md` are tracked in +git and call `mcp__archilyzer__ask_plan` / `mcp__archilyzer__sweep_plan` / +`mcp__archilyzer__generate`. That tool name embeds the server name as registered on this +machine, so any other name silently breaks all three commands. Either use `archilyzer` or +edit the `mcp__<name>__` prefix in those three files. **The corpus discipline lives in `mcp/src/instructions.ts`, not in prose.** Citation format, extractor budget, base-link expansion and the coverage rule are returned *by @@ -114,7 +114,9 @@ the `*_plan` tools as a plan an agent then follows*. Fix guidance there, not by another markdown file that will drift from it. Use `/ask` for a question answered in the conversation and `/sweep` for a cited report -written to a file. +written to a file. `/gen` runs a generation task where `settings.generation` routes it (the +editor's Claude API or local model, or this session) and reviews what it made; +[OPERATING.md](OPERATING.md), "Generate and iterate". **Running an archive — adding channels, syncing, importing, transcribing, tagging, reports, publishing — is [OPERATING.md](OPERATING.md)**: recipes over `pnpm ops` (the diff --git a/OPERATING.md b/OPERATING.md @@ -148,6 +148,106 @@ pnpm ops reports-export --json '{"siteId":"example-site","formats":["html","md" `pnpm archilyzer reports export <siteId>`. - One cited moment's media, from an agent: the MCP's `fetch_clip`. +## Generate and iterate + +```sh +pnpm ops report-draft --json '{"task":"sweep","article":"example-article","question":"What does she say about the shop?","channels":["example"]}' --wait +pnpm ops report-draft --json '{"task":"revise-report","article":"example-article","iteration":1,"feedback":"Drop the second finding."}' --wait +pnpm ops report-draft --json '{"task":"revise-video","article":"example-article","iteration":2,"feedback":"Trim the opening clip."}' --wait +pnpm ops report-draft --json '{"task":"narrate","article":"example-article","iteration":3}' --wait +pnpm ops report-draft --json '{"task":"sweep","article":"example-article","copyOf":1,"model":"qwen3:8b"}' +pnpm ops job cancel <jobId> +pnpm archilyzer reports iterations example-article +umtool chain example-article 3 +``` + +- In umtool: `/articles/new` starts an article (question, channels, dates, model, cap); the article's **Iterations** + tab (`/articles/<id>?tab=iterations`) lists its iterations and runs the rest (**New iteration**, **Copy with + model**, **Narrate**, **Cancel**, **Make the video**, **Use this iteration**); `/articles/<id>/compare?a=&b=` + puts two side by side. The pages: [umtool/docs/sites.md](umtool/docs/sites.md). +- Each generation is an **iteration** of the article, `i1`, `i2`, … in `transcripts/reports/<id>/iterations/<n>/`, + never published ([REPORT.md](REPORT.md), "Iterations"). The article's `report.json` changes only when you choose + **Use this iteration**. An article with iterations and no `report.json` is in the making: not listed, not a + draft. +- `report-draft` is a job on `draft:api` (a Claude model) or `draft:local` (the local model). Its log ends with + `@@report-draft {article, iteration, task, status, summary, usd, minutes}`. A sweep makes a new iteration; a + revision makes one from the iteration it names and your feedback; `copyOf` runs an iteration again on another + `model`; a narration is a step on a done iteration. The model is the one named, else the task's route. The + corpus is `source`, else `build`, else the newest build that holds the channels. +- Every quote a model writes must be the record's words within 90 s of its link, or the finding is dropped. Links + cite the archive, never the platform. +- **Make the video** (or `umtool chain <id> <n>`) runs ten steps over an iteration, each recorded in it: make it + current, fetch the cited windows, prepare `--only`, capture its posts, the manifest, the voices, the video, the + podcast, attach, dedupe. A re-run resumes at the first step not done. The project is + `<projectsRoot>/<id>/i<n>/` (default `~/reports/articles`), off the corpus disk. + +**The policy** is `settings.generation`: where each task runs (`code` = Claude Code, `api` = the Claude API, +`local` = the local model), the models, the caps. + +```sh +pnpm archilyzer gen policy +pnpm archilyzer gen preset balanced +pnpm archilyzer gen set narrate local +pnpm archilyzer gen run sweep "What does she say about the shop?" --article example-article --channels example --wait +pnpm ops get generation-usage +``` + +- The presets: `code` (everything in Claude Code), `balanced` (sweeps in Claude Code, report revisions and research + on the API, video revisions and narration local), `api`, `local`. Choosing one writes its routes; the panel on + `/articles/new` writes the same settings. +- `gen run` exits 3 and runs nothing for a task routed to `code`. In Claude Code, `/gen` and the MCP's `generate` + run a routed task through the editor and review what it made; `generation_policy` reads the policy and moves it + when you ask. `/sweep` follows the policy too. +- **Caps (USD, Claude API only):** a job's `maxUsd`, else $5 a sweep or research run, $2 a revision, $1 a narration; + never above `caps.max` ($10). The editor refuses a job once the day's API spend (UTC) reaches `caps.daily` ($20), + naming the day's total; a job already running stops at its own cap. The ledger is `.generation/usage.jsonl` in + the checkout. A local job has no dollar cap. +- **The API key** is a file, never a setting: `settings.generation.apiKeyFile` (default + `~/.config/archilyzer/anthropic.env`), mode 600 (refused when group or others have any bit). `ANTHROPIC_API_KEY` + in the editor's environment wins. A key typed where the path goes is refused and never stored. Nothing prints it. +- **The local model** (`qwen3:8b`) shares the 8 GB GPU with transcription and TTS. A prompt is at most 8k tokens and + `num_ctx` at most 12k (a prompt over is refused before it is sent); a larger model does not fit. Each call waits + while a transcription or a synthesis runs, and the model is unloaded when its job ends. A local sweep is the + code-driven pipeline (the model proposes terms, judges, extracts and groups; code reads, cites and checks). It + reads the web through the editor's paced `web-search` / `web-fetch`; a Claude model uses its own web search. +- The stopgap's kept runs (`~/reports/local-reports`) are imported once by + `pnpm archilyzer reports import-local-runs` (a dry run; `--apply` writes). + +## Research runs + +```sh +pnpm ops report-draft --json '{"task":"research","article":"example-article","question":"Where did the shop story start?","autonomy":"propose"}' --wait +pnpm ops research-approve --json '{"article":"example-article","iteration":1}' +pnpm ops research-approve --json '{"article":"example-article","iteration":1,"ids":["p01","p03"],"approve":true}' +pnpm ops research-approve --json '{"article":"example-article","iteration":1,"ids":["p02"],"approve":false,"note":"wrong channel"}' +pnpm ops report-draft --json '{"task":"sweep","article":"example-article","iteration":1}' --wait +``` + +- A research run searches the corpus, the web and archive.org (an item's file list included), then proposes the + acquisitions it needs, each with its reason, evidence links and estimated size: an archive.org import, a video, a + new channel, posts (a walk, a capture, one post by URL), a transcription, a priority bump, persisting a video. They + are kept in the iteration's `proposals.json`. +- **Autonomy**, per run (default `settings.generation.research.autonomy`, `propose`): + - `propose`: every acquisition waits for your yes or no. + - `limits`: an acquisition into an existing channel under the caps runs at once; a new channel or a post walk + waits when its setting says so; a priority bump always waits. + - `auto`: everything runs, until a cap. +- **Limits** (`settings.generation.research`): `maxItemsPerRun` 20, `maxGbPerRun` 5, `maxTranscribeHours` 6, + `newChannelsNeedApproval`, `postWalksNeedApproval`. A proposal past a cap, or of unknown size, waits in every + mode. +- **Approve or reject** in umtool (the run's queue in the Iterations tab, yes or no per proposal) or with + `research-approve`. A yes runs it through the editor's own action, past the run's autonomy and caps. With no ids + it answers the run's state. It is refused while the run's job is still going. +- **Phases:** `discover` (the job runs), `wait` (a proposal waits for you, or an acquisition's job has not ended), + `ready` (nothing pending), `continued`. Each read refreshes the acquisitions from their jobs. +- **Continue** is a sweep with `"iteration"` naming the research run: its question, over its channels and every + channel an acquisition wrote into. It is refused while the run waits, unless `"force": true`. A channel on no site + is in no build: put it on a site and build before continuing. Nothing continues on its own. +- **The standing rules hold in every mode**, and a proposal that breaks one is refused: a new channel is created on + no site; an X channel never goes on a site; a Twitch VOD URL is refused (look for the stream on archive.org); every fetch goes through the + editor's queues, holds and cooldowns (one stream, real gaps, backing off on a 429), never yt-dlp or gallery-dl by + hand. Keep a local-only subject on no site. + ## Publish ```sh @@ -181,4 +281,6 @@ pnpm archilyzer publish build example-site --out /srv/example-private transcribe-bucket, fetch-posts, import-video), follows it (`get_job`), reports what a channel holds by date and where the gaps are (`channel_coverage`), and reads a video not yet published (`get_transcript`). The operator's notes: `notes` (with `UMTOOL_URL`). Settings, storage and deletes stay `pnpm ops`. +- `generation_policy` and `generate` route a generation task by the policy ("Generate and iterate" above); `/gen` + wraps them. - Tools and their arguments: [mcp/README.md](mcp/README.md). diff --git a/REPORT.md b/REPORT.md @@ -6,7 +6,7 @@ One cited report, format `"archilyzer-report"`, version 1, persisted as `report. A report lives in one of two stores: -- **An article** — `transcripts/reports/<reportId>/report.json`, published by the project homepage. `transcripts/reports/index.json` — `{"published": [ids]}` — is the published, ordered list; an article directory it does not name is a draft. An article's `audience` (below) says which homepage build carries it: the public one only `"public"` articles, the private one every published article. An article may cite any channel of the corpus. +- **An article** — `transcripts/reports/<reportId>/report.json`, published by the project homepage. `transcripts/reports/index.json` — `{"published": [ids]}` — is the published, ordered list; an article directory it does not name is a draft. An article's `audience` (below) says which homepage build carries it: the public one only `"public"` articles, the private one every published article. An article may cite any channel of the corpus. An article may not be called `new` (umtool's `/articles/new` is a page). - **A site's page** — `transcripts/sites/<siteId>/reports/<reportId>/report.json`, published by its site at `/pages/<reportId>/`: the site's `pages` list in `site.json` is the published, ordered list — see [SITE.md](SITE.md). A page cites the site's `channels` and `citedChannels`. `index.json` and an article's `audience` are written ONLY through `common/lib/report/registry.ts` (`configureArticle`, `setPublished`, `setArticlesOrder`, `patchArticle`, `writeArticle`: locked, validated, atomic) and `pnpm ops articles-config` (`{"id", "audience"?, "published"?, "position"?}`), never by hand. Only a sound article (no problem below) is published; a patch may not add a problem to an article. @@ -116,6 +116,30 @@ The shared vocabulary (`common/lib/report/verdicts.mjs` — the one copy; report | `NOT_FOUND` | Not found | `#8b93a7` | | `UNTESTABLE` | Untestable | `#7d8fd6` | +## Iterations + +An article made or revised by a model keeps each generation as an **iteration**, `i1`, `i2`, … (`common/lib/report/iterations.ts`), in `transcripts/reports/<id>/iterations/<n>/`: + +| File | What | +|---|---| +| `iteration.json` | its kind (`sweep`, `revise-report`, `revise-video`, `research`), model, `parent` (the iteration it revises), `copyOf` (the iteration it repeats on another model), question or feedback, scope, status (`queued`, `running`, `done`, `failed`, `cancelled`), spend and tokens per model, ops applied and refused, minutes, checks, steps (narration, the video chain) and `projectDir` | +| `report.json` | the report it made (a `revise-video` iteration has none: its report is its nearest ancestor's) | +| `sweep.md` | the sweep's markdown | +| `turns.jsonl` | the model's turns | +| `proposals.json` | a research run's acquisitions | + +`iterations/current.json` names the iteration the article is, and the one its video is. + +- **Use this iteration** (umtool's Iterations tab) writes the article's `report.json` from a done iteration through the registry's writer: locked, validated, the article's `audience` and attached `video` kept. Nothing a generation runs writes the article's `report.json`; the next export records the change as the next Revision. +- Iterations are never published: compose, the homepage and the site history read only the article's own files. +- A directory with iterations and no `report.json` is an article **in the making**: the registry lists it neither as published nor as a draft until an iteration is made current. +- An iteration's video project is off the corpus disk, in `<settings.generation.projectsRoot>/<id>/i<n>/` (blank: `~/reports/articles`). +- `archilyzer reports iterations <id>` lists an article's iterations; `pnpm ops get iterations <id>` reads them from the editor. + +## Checking quotes + +`archilyzer reports verify-quotes <report.json> | --article <id>` checks every quote against its record as compose does (token recall, on every track) and names a quote that matches a served `en` rewrite but not `en-orig` (`en-orig-drift`). A quote that passes recall but is not verbatim (case, punctuation and curly quotes aside) within ±90 s of its cited second is **`inexact`**: a warning, printed and counted, that does not change the exit code; compose and publish do not use it. A GENERATED quote must pass that strict check: a finding whose quote fails it is dropped. The statuses: `ok`, `drift`, `en-orig-drift`, `inexact`, `missing-record`, `no-cues`, `missing-post`, `unreadable`. + ## Making a report from what exists `archilyzer reports convert <sweep|ask|manifest> <in> --out <report.json>` makes a report of a /sweep report (markdown: its `#` heading the title, each `##` section a section, each list item or paragraph that cites a claim), an /ask answer (its `[n @ mm:ss]` markers resolved against its sources) or a report-to-video manifest (chapter cards the sections, `claim` entries the claims, clips, stills and posts the citations), and writes it only when it validates. A /sweep or /ask citation carries one second: `--channels-dir <transcripts/channels>` widens it through the record's cues to whole sentences (else it is the second plus 10 s) and finds the channel that keeps a post cited by its platform link. `archilyzer reports to-manifest <report.json> --out <manifest.json>` goes the other way: a starter manifest — a title card, a chapter card per section, each claim's still and clips stamped with its verdict, its posts. The converters are `common/lib/report/convert*.ts`; the warnings say what a conversion left out. diff --git a/common/bin/cli-docs.test.ts b/common/bin/cli-docs.test.ts @@ -116,13 +116,15 @@ test("unknownCommandsIn names what no action, getter or command answers to", () "pnpm ops list", "pnpm ops get channel x and pnpm ops get bogus", "pnpm ops frobnicate --wait", + "pnpm ops job cancel <id> and pnpm ops job explode <id>", "`pnpm archilyzer publish build <id>`, `pnpm archilyzer doctor`.", "pnpm archilyzer publish destroy x", ].join("\n"); - const usage = OPS_USAGE.replace("pnpm ops list", "pnpm ops list\n pnpm ops get channel <slug>"); + const usage = OPS_USAGE.replace("pnpm ops list", "pnpm ops list\n pnpm ops get channel <slug>\n pnpm ops job cancel|retry <id>..."); assert.deepEqual(unknownCommandsIn(md, cli, usage), [ "pnpm ops get bogus", "pnpm ops frobnicate", + "pnpm ops job explode", "pnpm archilyzer publish destroy x", ]); }); diff --git a/common/bin/cli-docs.ts b/common/bin/cli-docs.ts @@ -200,10 +200,16 @@ export function unknownCommandsIn( ): string[] { const actions = new Set(opsActions(opsUsage)); const nouns = new Set([...opsUsage.matchAll(/pnpm ops get ([a-z][a-z-]*)/g)].map((m) => m[1])); + // `pnpm ops job <verb> <id>` (a /jobs row's button): the verbs its usage line lists. + const jobVerbs = new Set((/pnpm ops job ([a-z|-]+)/.exec(opsUsage)?.[1] ?? "").split("|").filter(Boolean)); const bad = new Set<string>(); for (const m of markdown.matchAll(/pnpm ops ([^\s`'"]+)(?:[ \t]+([^\s`'"]+))?/g)) { const [, word, next] = m; if (word.startsWith("<") || word === "list") continue; + if (word === "job") { + if (!next || !jobVerbs.has(next)) bad.add(`pnpm ops job ${next ?? ""}`.trim()); + continue; + } if (word === "get") { if (!next || !nouns.has(next)) bad.add(`pnpm ops get ${next ?? ""}`.trim()); continue; diff --git a/common/lib/report/docs.ts b/common/lib/report/docs.ts @@ -49,7 +49,8 @@ export function renderReportMarkdown(): string { "the published, ordered list; an article directory it does not name is a draft. " + "An article's `audience` (below) says which homepage build carries it: the public " + "one only `\"public\"` articles, the private one every published article. An " + - "article may cite any channel of the corpus.", + "article may cite any channel of the corpus. An article may not be called `new` " + + "(umtool's `/articles/new` is a page).", ); out.push( "- **A site's page** — `transcripts/sites/<siteId>/reports/<reportId>/report.json`, " + @@ -150,6 +151,65 @@ export function renderReportMarkdown(): string { out.push(`| \`${v}\` | ${cell(d.label)} | \`${d.color}\` |`); } out.push(""); + out.push("## Iterations"); + out.push(""); + out.push( + "An article made or revised by a model keeps each generation as an **iteration**, `i1`, " + + "`i2`, … (`common/lib/report/iterations.ts`), in `transcripts/reports/<id>/iterations/<n>/`:", + ); + out.push(""); + out.push("| File | What |"); + out.push("|---|---|"); + out.push( + "| `iteration.json` | its kind (`sweep`, `revise-report`, `revise-video`, `research`), model, " + + "`parent` (the iteration it revises), `copyOf` (the iteration it repeats on another model), " + + "question or feedback, scope, status (`queued`, `running`, `done`, `failed`, `cancelled`), " + + "spend and tokens per model, ops applied and refused, minutes, checks, steps (narration, " + + "the video chain) and `projectDir` |", + ); + out.push("| `report.json` | the report it made (a `revise-video` iteration has none: its report is its nearest ancestor's) |"); + out.push("| `sweep.md` | the sweep's markdown |"); + out.push("| `turns.jsonl` | the model's turns |"); + out.push("| `proposals.json` | a research run's acquisitions |"); + out.push(""); + out.push("`iterations/current.json` names the iteration the article is, and the one its video is."); + out.push(""); + out.push( + "- **Use this iteration** (umtool's Iterations tab) writes the article's `report.json` from a " + + "done iteration through the registry's writer: locked, validated, the article's `audience` " + + "and attached `video` kept. Nothing a generation runs writes the article's `report.json`; " + + "the next export records the change as the next Revision.", + ); + out.push( + "- Iterations are never published: compose, the homepage and the site history read only " + + "the article's own files.", + ); + out.push( + "- A directory with iterations and no `report.json` is an article **in the making**: the " + + "registry lists it neither as published nor as a draft until an iteration is made current.", + ); + out.push( + "- An iteration's video project is off the corpus disk, in " + + "`<settings.generation.projectsRoot>/<id>/i<n>/` (blank: `~/reports/articles`).", + ); + out.push( + "- `archilyzer reports iterations <id>` lists an article's iterations; `pnpm ops get " + + "iterations <id>` reads them from the editor.", + ); + out.push(""); + out.push("## Checking quotes"); + out.push(""); + out.push( + "`archilyzer reports verify-quotes <report.json> | --article <id>` checks every quote " + + "against its record as compose does (token recall, on every track) and names a quote that " + + "matches a served `en` rewrite but not `en-orig` (`en-orig-drift`). A quote that passes " + + "recall but is not verbatim (case, punctuation and curly quotes aside) within ±90 s of its " + + "cited second is **`inexact`**: a warning, printed and counted, that does not change the " + + "exit code; compose and publish do not use it. A GENERATED quote must pass that strict " + + "check: a finding whose quote fails it is dropped. The statuses: `ok`, `drift`, " + + "`en-orig-drift`, `inexact`, `missing-record`, `no-cues`, `missing-post`, `unreadable`.", + ); + out.push(""); out.push("## Making a report from what exists"); out.push(""); out.push( diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,31 +1,30 @@ # Changelog ## [Unreleased] -- **umtool makes and iterates articles: `/articles/new` and an article's Iterations tab.** `/articles/new` takes a question, channels picked from the editor's list, dates, the sweep (the agent on a Claude model or the pipeline on the local model), the model and a cap (the policy's default, which can only go down); **Start** has the editor run it as a report draft and opens the article's iterations. Each iteration shows its kind, model, parent, copy, status, cost per model, minutes, ops applied and refused, and checks, and which one is the article and which the video. On an iteration: **Use this iteration** (the article's report becomes its report), **New iteration** (a revision of the report or the video from your feedback, on a model), **Copy with model**, **Narrate**, **Cancel** (with the running job's log), and **Make the video** (the pipeline chain as a umtool job, step by step, resumable). An article whose only content is iterations is listed on `/articles` as in the making. Needs a restart of umtool. +- **Reports and their revisions can be generated by the editor: `pnpm ops report-draft`.** `{"task": "sweep", "article", "question", "channels"}` drafts a new report of an article as its next iteration; `{"task": "revise-report" | "revise-video", "article", "iteration", "feedback"}` revises one; `{"task": "narrate", "article", "iteration"}` drafts the narration of an iteration's video cut; `"copyOf": N` runs iteration N again on another `"model"`. Each is a **Report draft** job on /jobs, on the Claude API (`draft:api`) or the local model (`draft:local`) by the model, and `pnpm ops job cancel` stops one. Every quote a model writes must be the transcript's words within 90 seconds of its link, or the finding is dropped; links cite the archive, never the platform. The answer names the job and the iteration; the job's log ends with the outcome. Needs a restart of the editor. +- **umtool makes and iterates articles: `/articles/new` and an article's Iterations tab.** `/articles/new` takes a question, channels picked from the editor's list, dates, the sweep (the agent on a Claude model or the pipeline on the local model), the model and a cap (the policy's default, which can only go down); **Start** has the editor run it as a report draft and opens the article's iterations. Each iteration shows its kind, model, parent, copy, status, cost per model, minutes, ops applied and refused, and checks, and which one is the article and which the video. On an iteration: **Use this iteration** (the article's report becomes its report), **New iteration** (a revision of the report or the video from your feedback, on a model), **Copy with model**, **Narrate**, **Cancel** (with the running job's log), and **Make the video** (the pipeline chain as a umtool job, step by step, resumable). An article whose only content is iterations is listed on `/articles` as in the making. umtool's `/drafts` page is gone; it opens `/articles/new`. Needs a restart of umtool. - **Two iterations side by side: `/articles/<id>/compare?a=&b=`.** Each side's report, section by section, with what the other side lacks marked; the ops its revision applied and refused (and why); its failed checks; and, when both have one, the two video cuts with their narration. Tick **compare** on two iterations to open it. - **The generation policy is on `/articles/new`.** The presets (`code`, `balanced`, `api`, `local`), where each task runs, the models and the caps, saved into the editor's `settings.generation`; the editor refuses a cap it would not keep, in its words. The API key is never shown or taken: the panel shows the key file's path and whether the file is there. The day's API spend is shown against the daily cap. -- **umtool's `/drafts` page is gone; it opens `/articles/new`.** +- **Spending on the Claude API is capped.** A job is capped by its task ($5 a sweep, $2 a revision, $1 a narration, or the `maxUsd` it asks for, never above `settings.generation.caps.max`), and the editor refuses a job once the day's API spend (UTC) has reached `caps.daily` ($20), naming the day's total. Each finished API job adds its spend to a ledger beside the checkout (`.generation/usage.jsonl`), which is where the day's total comes from. +- **Research runs: the editor finds what an article's archive lacks and asks for it.** `pnpm ops report-draft --json '{"task": "research", "article", "question", "channels"?, "autonomy"?}'` runs a research iteration: a model searches the corpus, the web and archive.org (an item's file list included), then proposes each acquisition it needs (an archive.org import, a video, a new channel, a post, a transcription, a persist) with its reason, evidence links and estimated size. Under `propose` every one waits for your yes or no; under `limits` imports into existing channels under the caps run at once; under `auto` everything runs, through the editor's own queues and holds, until a cap. A new channel is always created on no site, an X channel is never put on one, and a Twitch VOD is never fetched, in every mode. The proposals are kept in the iteration's `proposals.json`. +- **`pnpm ops research-approve` settles a research run.** `{"article", "iteration", "ids": ["p01", …], "approve": true | false, "note"?}` runs the approved proposals through the editor (past the run's autonomy and caps, never past a standing rule) or rejects them; with no ids it answers the run's state. Every call first checks the jobs of what was enqueued, so the run moves from waiting to ready as they finish. `report-draft {"task": "sweep", "article", "iteration": <the research run>}` then continues it: a sweep over the run's channels and every channel it acquired into, its question by default (refused while the run still waits, unless `"force": true`). - **Claude Code follows the generation balance: `/gen`, and the MCP's `generation_policy` and `generate`.** `generation_policy` shows where each generation task runs (`code` = this Claude Code session, `api` = the Claude API, `local` = the local model), on which model, the caps and the day's Claude API spend against the daily cap; with a preset or a task and route it moves the balance, only when you ask. `generate` runs a task as a `report-draft` job on the editor (a sweep, a revision of a report or its video, a narration, a research run with its autonomy, or a sweep continuing a research run), refuses one routed to Claude Code, and with `wait: true` follows the job and answers the iteration it made: its cost, the ops it applied and refused, its checks and where its files are, with what to review before it is made current. `/gen` (`.claude/commands/gen.md`, in the repo) wraps both: tasks routed away are run through `generate` and reviewed, tasks routed to Claude Code are done in the session. It replaces the stopgap's user-level `/gen`. Claude Code picks the tools up on its next start; they need the MCP registered with `ARCHILYZER_EDITOR_URL` and `WORKER_TOKEN`. - **`/sweep` follows the policy too.** When sweeps are routed to the API or the local model, the `/sweep` plan's first step is `generate`, then a review of what it made — read the iteration's report, spot-check its quotes with `get_transcript`, then recommend making it current or a revision — instead of running the sweep in the session. `via=code` (or `api`, `local`) in the request overrides the policy for that plan, and `article=` names the article. With no editor configured the plan is unchanged. `/ask` still answers in the conversation, and names the tasks the policy routes away. - **`archilyzer gen policy | preset | set | run`** is the same balance from a terminal: through the editor when it answers, else `settings.json` through the settings writer when no editor is listening (never beside one that is there but silent). `gen run <task> [<question or feedback>] --article <id> …` enqueues the job as `pnpm ops report-draft` does (`--wait` follows it) and exits 3, running nothing, when the task is routed to Claude Code; `--via` overrides once. - **Two new reads: `pnpm ops get generation-usage [<day>]`** (the day's Claude API spend and the daily cap) **and `pnpm ops get iterations <article>`** (an article's iterations and which is current). Needs a restart of the editor. -- **Research runs: the editor finds what an article's archive lacks and asks for it.** `pnpm ops report-draft --json '{"task": "research", "article", "question", "channels"?, "autonomy"?}'` runs a research iteration: a model searches the corpus, the web and archive.org (an item's file list included), then proposes each acquisition it needs (an archive.org import, a video, a new channel, a post, a transcription, a persist) with its reason, evidence links and estimated size. Under `propose` every one waits for your yes or no; under `limits` imports into existing channels under the caps run at once; under `auto` everything runs, through the editor's own queues and holds, until a cap. A new channel is always created on no site, an X channel is never put on one, and a Twitch VOD is never fetched, in every mode. The proposals are kept in the iteration's `proposals.json`. -- **`pnpm ops research-approve` settles a research run.** `{"article", "iteration", "ids": ["p01", …], "approve": true | false, "note"?}` runs the approved proposals through the editor (past the run's autonomy and caps, never past a standing rule) or rejects them; with no ids it answers the run's state. Every call first checks the jobs of what was enqueued, so the run moves from waiting to ready as they finish. `report-draft {"task": "sweep", "article", "iteration": <the research run>}` then continues it: a sweep over the run's channels and every channel it acquired into, its question by default (refused while the run still waits, unless `"force": true`). -- **New settings: `generation.research`** (SETTINGS.md): a research run's default autonomy (`propose`), and its limits — 20 items, 5 GB and 6 hours of transcription a run, new channels and post walks waiting for approval under `limits`. `generation.routes.research` says where a research run runs (`api` in the balanced preset); a settings file from before keeps its preset. -- **Reports and their revisions can be generated by the editor: `pnpm ops report-draft`.** `{"task": "sweep", "article", "question", "channels"}` drafts a new report of an article as its next iteration; `{"task": "revise-report" | "revise-video", "article", "iteration", "feedback"}` revises one; `{"task": "narrate", "article", "iteration"}` drafts the narration of an iteration's video cut; `"copyOf": N` runs iteration N again on another `"model"`. Each is a **Report draft** job on /jobs, on the Claude API (`draft:api`) or the local model (`draft:local`) by the model, and `pnpm ops job cancel` stops one. Every quote a model writes must be the transcript's words within 90 seconds of its link, or the finding is dropped; links cite the archive, never the platform. The answer names the job and the iteration; the job's log ends with the outcome. Needs a restart of the editor. -- **Spending on the Claude API is capped.** A job is capped by its task ($5 a sweep, $2 a revision, $1 a narration, or the `maxUsd` it asks for, never above `settings.generation.caps.max`), and the editor refuses a job once the day's API spend (UTC) has reached `caps.daily` ($20), naming the day's total. Each finished API job adds its spend to a ledger beside the checkout (`.generation/usage.jsonl`), which is where the day's total comes from. -- **New settings block `generation`** (SETTINGS.md): where each task runs (`code` = Claude Code, `api`, `local`, with the presets `code`, `balanced`, `api`, `local`), the models, the caps, the API key FILE (mode 600; the key itself is refused as a setting and never stored), and where video projects live (`projectsRoot`, which `umtool chain` now reads too). -- **Text to speech and local drafting take turns on the GPU.** An Orpheus synthesis waits while a local model is drafting, and a local-model draft call waits while a transcription or a synthesis is running; digests still yield to transcription as before. The local model is unloaded when its draft job ends, so its memory is free for the next transcription. -- **The `/sweep` plan says a claim carries no quoted words, and quotes are verbatim.** The MCP's `sweep_plan` now tells Claude Code, at the merge step, that every quoted span before a link becomes that link's quote (so a claim that quotes words breaks its own citation), and that a quote is the transcript's words, copied, within 90 seconds of its link. The same rules, from one place in the code, are what release 27's generation jobs are held to. Claude Code picks it up on its next start. -- **`umtool chain <article> <n>` takes an article's iteration to a video and a podcast.** One step a process, each recorded in the iteration: make it current, have the editor fetch every cited clip window (padded to the cut's 3 s, so the article's clips and the video share one fetch), `reports prepare --article <id> --only`, have the editor capture this article's missing post screenshots, make the video manifest in `~/reports/articles/<id>/i<n>/` (its narration and voices carried over from the parent iteration's project), voice the narration through the editor, build the video and the podcast, attach the video to the article and check it, and hard-link the segments and voices the article's projects share. Run again, it resumes at the first step not done; `--from <step>` runs from one, `--dry` prints the steps, `--final` crossfades. Nothing is fetched, captured or voiced but by the editor. -- **`reports prepare --article <id> --only` answers for that article.** Its problems fail the run, another article's are printed as warnings, and only it is exported, so a draft being readied is no longer held up by a gap in a published article. The media of every published article is still prepared (their cache is shared). -- **A report video made by `reports to-manifest` no longer shows "undefined" under its title or ends on a silent card.** The title card now has an empty third line (and a manifest made before this renders one too), and a section with nothing to show — a trailing Coverage note, a section of posts only — gets no chapter card; the article keeps the section. -- **`umtool build <project> --dry` names the real pipeline directory wherever it is run from** (it printed `<cwd>/report-to-video`). - **`archilyzer reports iterations <id> [--json]` lists an article's iterations.** Release 27 keeps each generation of an article (a sweep, a revision of its report or its video, a research run) as an ITERATION under `transcripts/reports/<id>/iterations/<n>/`, with its kind, model, status, cost, parent and the iteration it copies; the command lists them with their lineage (`i1 › i3 › i4`), and marks the current article and the current video. Iterations are never published: compose, an article's history and the homepage ignore them, and an article whose only content is iterations (no report.json yet) is not listed anywhere until one of them is made current. +- **`umtool chain <article> <n>` takes an article's iteration to a video and a podcast.** One step a process, each recorded in the iteration: make it current, have the editor fetch every cited clip window (padded to the cut's 3 s, so the article's clips and the video share one fetch), `reports prepare --article <id> --only`, have the editor capture this article's missing post screenshots, make the video manifest in `~/reports/articles/<id>/i<n>/` (its narration and voices carried over from the parent iteration's project), voice the narration through the editor, build the video and the podcast, attach the video to the article and check it, and hard-link the segments and voices the article's projects share. Run again, it resumes at the first step not done; `--from <step>` runs from one, `--dry` prints the steps, `--final` crossfades. Nothing is fetched, captured or voiced but by the editor. +- **The stopgap's kept runs come into the app: `archilyzer reports import-local-runs`.** A dry run unless `--apply`: it prints what it would do and writes nothing. Each run named (by default the two kept ones) becomes `i1` of its article through the iterations store, with its model, question, channels, spend, checks and turns; an article the registry already has gets `i1` made current only when the run's report is the article's (and current for the video when one is attached), and its video project is copied (`--move-projects`: moved) to the projects root. A run with no article becomes an article in the making, not made current. The stopgap's `generation.json`, when there is one, becomes `settings.generation`'s routes and models. The stopgap's test runs, projects and drafts are listed with their sizes, to delete after your OK; the command deletes nothing. - **Import one post by its URL.** `pnpm ops import-post --json '{"slug", "url"}'` imports one X status or one Bluesky post into a posts channel of that platform that archives that account, as an `import-post` job on the platform's queue, through the channel's own fetcher (gallery-dl with the channel's X login; the public Bluesky API). It is refused before any job when the URL is not a post, when the channel is not a posts channel of that platform (or its fetcher cannot read one post), when the post is another account's, or while the platform is held or cooling down after a rate limit. A post already archived is not read again. Needs a restart of the editor. - **archive.org from the command line, read only.** `pnpm ops archive-search --json '{"query", "limit"?}'` answers the items an archive.org search finds, and `pnpm ops archive-item --json '{"item"}'` one item's files with their sizes, formats and lengths, which are the media an import would take, and what archive.org restricts. Both go through the editor's archive.org client, paced like an import, and download nothing. Needs a restart of the editor. - **`pnpm ops web-search` and `pnpm ops web-fetch` read the web, politely.** `web-search` (`{"query", "n"?}`) answers DuckDuckGo's results as titles, links and snippets; `web-fetch` (`{"url", "maxChars"?}`) answers one page as plain text. Both are read only and go through one queue in the editor: one request at a time, three seconds apart, backing off when a site answers 429 or 503. A page on a private or local address (`localhost`, `192.168.…`, a name that resolves to one) is refused before anything is sent, and so is a file that is not a page (a PDF, an image). Needs a restart of the editor. - **`archilyzer reports verify-quotes` flags an inexact quote.** A quote that passes the usual check but whose words are not, word for word, in the transcript within 90 seconds of its cited second — a word dropped that reverses its meaning, a quote from another moment — is now reported as `INEXACT (warning)`, with the first fragment that was not found. It is a warning: it is counted in the summary line and does not change the exit code; compose and publish are unchanged. Quotes a model writes in release 27's generation are held to it. +- **The `/sweep` plan says a claim carries no quoted words, and quotes are verbatim.** The MCP's `sweep_plan` now tells Claude Code, at the merge step, that every quoted span before a link becomes that link's quote (so a claim that quotes words breaks its own citation), and that a quote is the transcript's words, copied, within 90 seconds of its link. The same rules, from one place in the code, are what release 27's generation jobs are held to. Claude Code picks it up on its next start. +- **Text to speech and local drafting take turns on the GPU.** An Orpheus synthesis waits while a local model is drafting, and a local-model draft call waits while a transcription or a synthesis is running; digests still yield to transcription as before. The local model is unloaded when its draft job ends, so its memory is free for the next transcription. +- **`reports prepare --article <id> --only` answers for that article.** Its problems fail the run, another article's are printed as warnings, and only it is exported, so a draft being readied is no longer held up by a gap in a published article. The media of every published article is still prepared (their cache is shared). +- **A report video made by `reports to-manifest` no longer shows "undefined" under its title or ends on a silent card.** The title card now has an empty third line (and a manifest made before this renders one too), and a section with nothing to show — a trailing Coverage note, a section of posts only — gets no chapter card; the article keeps the section. +- **`umtool build <project> --dry` names the real pipeline directory wherever it is run from** (it printed `<cwd>/report-to-video`). +- **New settings block `generation`** (SETTINGS.md): where each task runs (`code` = Claude Code, `api`, `local`, with the presets `code`, `balanced`, `api`, `local`), the models, the caps, the API key FILE (mode 600; the key itself is refused as a setting and never stored), and where video projects live (`projectsRoot`, which `umtool chain` now reads too). Its `research` block: a research run's default autonomy (`propose`), and its limits — 20 items, 5 GB and 6 hours of transcription a run, new channels and post walks waiting for approval under `limits`. `generation.routes.research` says where a research run runs (`api` in the balanced preset); a settings file from before keeps its preset. - **Orpheus speaks as the operator picked by ear: zac, calmer, quicker, in longer runs.** The default Orpheus voice is now `zac` (leah stays available); the sampler is cooler (temperature 0.55, top_p 0.85) and its repeat penalty higher (1.2), which reads less acted and less over-enunciated; a chunk holds up to 5 sentences and 420 characters, with shorter joins (0.2 s after a sentence, 0.1 s after a clause, 0.4 s after a paragraph), so the voice restarts its phrasing less often; and a very short line gets at least four seconds of budget, so it can no longer fail every take. Orpheus narration made before this is made again the next time it is asked for. Needs a restart of the editor. - **A site's reports are its pages.** site.json `reports` is now `pages` (a file that still says `reports` reads as `pages` for this release; saving writes `pages`). Each page is served at `/pages/<id>/` and linked from the site's header by its title, after Ask AI; there is no Reports index any more. A site with search off shows its first page as its home, and saving a site with search off and no pages is refused. The site form lists them as **Pages**. Rebuild each site that has pages. - **Site ids `articles` and `new` are refused.** The editor's `/sites/articles` and `/sites/new` (and umtool's `articles/`) would hide a site of either name, so a save under one is refused, naming why. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -9146,3 +9146,33 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri record (`buildIndex.ts`, the `mtimes.put` after processing writes the same `metaMs`/`transcriptMs`/…). So a record the pass took from no text to text keeps `hasTranscript: false` and its old `cueCount` in the stats until something else moves its record. + +## Release 27: generation in the application (verified 2026-10-13, against `r27/integration` `1575479b`) + +- **An iteration's files** are `transcripts/reports/<id>/iterations/<n>/{iteration.json, report.json, sweep.md, + turns.jsonl, proposals.json}`; `iterations/current.json` is `{report, reportFrom, video}`. Every write is + `common/lib/report/iterations.ts` under the registry's lock (`withArticleStoreLock`); `writeIterationFile` takes only + `ITERATION_FILES`. The article's `report.json` is written from an iteration only by `makeCurrent` + (`writeArticleHoldingLock`, audience and video kept). +- **An article in the making** is a directory with `iterations/` and no `report.json` (`isPendingArticleDir`, + `registry.ts`). `listArticleDirs` and `readArticleState` leave it out; `listPendingArticles` lists it. The + registry has no delete: an article directory is removed by hand only after the operator's OK. +- **An article may not be called `new`** (`RESERVED_ARTICLE_IDS`, `assertArticleId`): umtool's `/articles/new` is a + page. +- **Generation jobs** are job kind `report-draft` on the queues `draft:api` and `draft:local` (`DRAFT_API_QUEUE`, + `DRAFT_LOCAL_QUEUE`, `common/lib/queueKeys.ts`), enqueued by `enqueueReportDraft` (`common/controller/reportDraft.ts`). + A `sweep` body with `iteration` CONTINUES a research run; a copy is `copyOf` with no `iteration`. +- **The spend ledger** is `<repo>/.generation/usage.jsonl` (`paths.generationUsageFile`, `GENERATION_USAGE_FILE`), + gitignored; one line per model per finished API job. The daily cap is a scan of the day's lines (UTC). +- **`settings.generation.apiKeyFile` is redacted by the editor's settings read** (`redactSecrets`, + `editor/app/api/ops/_read.ts`: its name matches the secret pattern), so umtool and `archilyzer gen` read the PATH + from `settings.json` and never through the API. The settings write refuses a key-looking value without echoing it + (`looksLikeApiKey`). +- **`projectsRoot` blank = `~/reports/articles`**, resolved in three places that must agree: + `projectsRootOf` in `common/controller/reportDraft.ts` and `umtool/lib/articles/generation.ts`, and + `DEFAULT_PROJECTS_ROOT` in `umtool/lib/report/chain.mjs`. +- **A fetch window's `from`/`to` are the padded window; `pad` is provenance** (S7): every caller pads before it asks. +- **verify-quotes `inexact`** is a warning only (`QUOTE_WARNING_STATUSES`, `common/bin/reports-check.ts`); `drift` and + `en-orig-drift` take precedence over it. +- **The stopgap's `~/.config/archilyzer/generation.json` is retired** (absent on this machine at 2026-10-13); its runs + come in once through `archilyzer reports import-local-runs` (`common/bin/reports-import-local-runs.ts`). diff --git a/plans/STATE.md b/plans/STATE.md @@ -3,7 +3,35 @@ The working memory for the local-AI derived-corpus work. Rewritten at the end of every session, before context is cleared. See [`README.md`](README.md) for the protocol. -**Now (2026-10-09): release 18 is complete on `r18/integration`, and `main` is merged into it (`4cffda3f`, 94 +**Now (2026-10-13): release 27 — report and video generation inside the application — is built on +`r27/integration`, not on `main` and not live** (plan and record: [`release-27.md`](release-27.md); D1–D9 ratified as +recommended). `main` is `9f05d557`. +- **Merged into `r27/integration`:** S0 (test kit), S1 (providers and the agent loop), S2 (strict quote check and op + engines), S3 (corpus tools in process, `web-search` / `web-fetch`), S3b (`archive-search`, `archive-item`, + `import-post`, the acquisition tools), S4 (iterations store), S5 (tasks), S6 (`report-draft` jobs, GPU arbiter, caps, + `settings.generation`), S7 (the umtool chain and the four owed bugs), S8 (umtool `/articles/new`, Iterations, + compare, policy panel), S9 (`generation_policy` / `generate`, `/gen`, `archilyzer gen`), S11's backend (research + runs, `research-approve`). In flight: S11's umtool research queue (`r27/research`), S10 (`r27/migrate-docs`: + `archilyzer reports import-local-runs` and the docs). +- **Owed, in order:** merge S11's queue and S10; the gate round on the integration tip (typecheck, unit suites, docs + checks, the four capped builds, `pnpm e2e:all` with `article-new`, `article-iterations`, `article-compare`, + `article-research` and `report-draft`), including the two runs no lane could make under the memory floor (a + standalone editor `next build`; umtool's `build.spec.ts` and its capped build); the privacy greps; fast-forward + `main`; the rollout (editor rebuild and restart, umtool build and restart, Claude Code restart for the MCP tools, + the homepage source-mirror publish; no public site changes); the live smoke on the operator's key (≤ $3, the list in + the plan's Gates). +- **Then the stopgap:** the operator reads the import's dry run (`pnpm archilyzer reports import-local-runs`), then + `--apply`; then the test runs, projects and drafts it lists are deleted on the operator's OK (15 items, 307 MB, three + of them registry drafts with no registry delete verb); the user-level `~/.claude/commands/gen.md` is retired; the + stopgap stays read-only until the operator deletes it. +- **Found during release 27, not fixed:** transcription leaves `/tmp/parakeet-stitch-*` directories behind (21 since + 2026-10-02, ~210 MB of the RAM tmpfs). `controller/relocateChannelMedia.test.ts` ("reconcile: an extra and a + changed file") failed once in a full common run on `r27/migrate-docs` and passes alone. +- **Later candidates:** a research run under `auto` continuing into its sweep by itself (r27 keeps continuing + explicit); a per-job extractor model (r27: policy-level only); a turns meter on the `report-draft` job; release 28's + media tasks on the same machinery (D5). + +**Previously (2026-10-09): release 18 is complete on `r18/integration`, and `main` is merged into it (`4cffda3f`, 94 commits ahead of `main` `e921f82f`, 0 behind: a fast-forward).** The merge brought main's ~70 commits since 2026-10-06 (umtool articles + notes, `ops transcribe` with word timings, fetch-windows, metadata refresh, channel create/rename/delete over ops; record: [`landed-2026-10.md`](landed-2026-10.md)); the changelogs keep both sides, r18 diff --git a/umtool/docs/authoring.md b/umtool/docs/authoring.md @@ -106,6 +106,39 @@ umtool build <slug> --preset final Watch the fast pass end to end. It is the only way to find a clip that is technically correct and editorially wrong. +## Generating with a model + +A model can make the report and the cut in place of steps 0–2: in umtool, +`/articles/new` and then the article's Iterations tab ([sites.md](sites.md)), +or from a shell: + +```sh +pnpm ops report-draft --json '{"task":"sweep","article":"<id>","question":"…","channels":["<slug>"]}' --wait +umtool chain <id> <n> # the iteration to a video and a podcast +pnpm ops report-draft --json '{"task":"revise-video","article":"<id>","iteration":<n>,"feedback":"…"}' --wait +pnpm ops report-draft --json '{"task":"narrate","article":"<id>","iteration":<n>}' --wait +``` + +- **The chain** writes the project in `<projectsRoot>/<id>/i<n>/` (default + `~/reports/articles`). The editor fetches each cited window, padded by the + cut's 3 s. `siteOrigin` comes from the sweep's links, else `--site-origin`; + a manifest without one says so. The manifest is seeded from the parent + iteration's project: narration by card id, else by heading, and the voices + hard-linked. +- **A video revision** applies checked ops to its parent's cut: drop, move, + heading, narration, trim (inside the clip's citation span), add a clip (from + the report's citations), title. Quotes never change. A refused op is listed + with its reason on the compare page. +- **Narration** is drafted per title and chapter card from the card's + evidence. Numbers and names must be in the report, no quote is read aloud, + and a card gets 35 words (a title) or 45 (a chapter). A sentence that fails + is removed. The manifest before it is kept in + `revisions/<stamp>-auto-before-narration.manifest.json`, the draft in + `narration-draft.json`. +- **Then review it as a hand-made cut:** `umtool check`, steps 4–6, and a fast + pass watched end to end. A generated window is the cue span plus its pad, so + widen or lock it as in step 4. + ## The checklist - [ ] `siteOrigin` is the archive's real origin