Archilyzer · Source

archilyzer

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

commit d67228d8f627c06dc93c19488dc515dff7a0cbdf
parent 2a4c2f251582019c4cb674a03cbf24d14c514184
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 14 Oct 2026 05:21:37 -0400

plans: umtool redesign — P2b as shipped (the Running list, drafts as decisions); CHANGELOG

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

Diffstat:
Meditor/CHANGELOG.md | 3+++
Mplans/umtool-redesign.md | 113+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 116 insertions(+), 0 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -43,6 +43,9 @@ - **umtool: Work lists every piece.** `/work` is every article (with the video projects made from it) and every project no article claims, one lit line each: its stage on a four-step bar, what it is, its lifecycle and how many calls wait on it, with **Park**, **Mark done** and **Reactivate** on the line. Facets: stage, kind, site, lifecycle (active by default) and a search (`/` puts the cursor there); **By site** groups by site, each site's name linking its page. It reads the old lists' keys, so an old link lands on the same set. - **umtool's addresses moved, and every old one redirects.** `/browse` → `/work`; `/browse/<project>[/…]` → `/projects/<project>[/…]` (cuts, clip and claim benches, takes, narration, review); `/browse/decisions` → `/`; `/browse/find`, `/browse/faces`, `/browse/sources`, `/browse/trim/<set>` → `/tools/…`; `/mix` → `/tools/mix`; `/sort`, `/salvage`, `/verify`, `/keeps` → `/tools/song/<pile>`; `/bench` → `/tools/bench`; `/articles` → `/work?kind=article&site=articles` (the store's articles, as before); `/sites` → `/work?by=site`. Redirects are temporary (307) and keep the query string, so a decision's `…?note=<id>` link and every bookmark still land. `/projects` is the project grid by folder (the old `/browse` page, with **+ new project**); `/tools` and `/tools/song` list the tools; `/sites/<site>` and the article pages are unchanged. A project named `find`, `faces`, `sources`, `trim` or `decisions` is no longer shadowed by a tool page; only `at` (`/projects/at?path=`, for a name that cannot be a URL) is reserved. - **umtool: the rail is Inbox · Research · Work · Tools · Settings, and ⌘K jumps anywhere.** Inbox and Work show their counts; Tools opens into its tools (find, mix, the song piles, faces, sources, the verdict bench) while you are in one; Settings is `/settings/system`, which holds the old dashboard's panels (tools and disk, recent jobs, project states, sources, deliverables) and links the generation policy. ⌘K (or Ctrl+K), from any page including a bench, opens a jump list of every piece, place, tool and create action: type to narrow, ↑ / ↓, Enter. Research is linked ahead of its page. The "resume" chip on the Inbox offers where an old remembered address lands now. +- **umtool's rail shows what is running, the editor's jobs too, and what it costs.** The foot of the rail lists umtool's own job and the editor's live ones (`GET /api/ops/jobs?active=1`): each with what it is, what it works on, how far it is, queued or running, and a report draft's spend so far; the label row says **Running N** and the day's Claude API spend. A row links to its article when it has one, else to the editor's `/jobs`. Queued syncs and the editor's lane runners fold into one line ("+ 140 queued · 3 lanes"). When the editor's jobs cannot be read the rail says why — **Editor unreachable**, **Editor's WORKER_TOKEN not set** (it answered 503) — and never just "nothing running". It asks every 8 s, and not while the tab is hidden. +- **umtool's Inbox has a card for drafts nobody has reviewed.** A report video whose fields a model drafted (narration, on-screen text, the teaser, the cut, flips, threads, the YouTube text) and that are not approved is one card under **Review** ("Narration draft · 5 fields · by qwen3:8b"); **Review drafts** opens the project's review page, and the card goes once they are approved. The decisions API carries them as `drafts-unreviewed` rows, one per field. +- **umtool waits at most 5 s for the editor.** A read from the editor's ops API is given 5 s (a write 30 s) and a read is kept 2 s, so the rail, a page and a poll asking at once ask once; an editor that does not answer is said to be unreachable rather than hanging the page. - **Articles, iterations, report-video projects and takes can be deleted, and every delete shows its plan first.** `archilyzer reports delete <id>` prints what would go — each path with its size, what is kept and why, and anything that stops it — and deletes nothing until `--apply`; `--iteration <n>` deletes one iteration. Deleting an article removes its directory (report, video, history, notes, iterations), each iteration's video project under `settings.generation.projectsRoot` and its staged exports. A published article is refused unless `--force`, which unpublishes it first; an article with a running iteration is always refused. An iteration is refused while it is the current article or video, the one the article's report came from, running, or the parent or original of another iteration, and its number is never given out again. The usage ledger, the shared prepared-media cache and the corpus's git history are kept. The same deletes run over HTTP as `pnpm ops delete-article {id, force?, dryRun?}` and `pnpm ops delete-iteration {id, n, dryRun?}`, which answer a refusal as a 409 with the plan. - **umtool: Delete article, `Delete i<n>`, Delete project and `Delete take <id>`.** Each button reads the plan, shows it (what goes with sizes, what is kept, what refuses) and deletes only on **Confirm delete**; **Keep it** closes it. **Delete article** is on an article's page (one in the making too) and returns to `/articles`, which says what went; `Delete i<n>` is on each iteration of the Iterations tab. **Delete project** on a report-video project removes its directory, and its `out/` or deliverables on the media drive when they are its own copy; it is refused while a job works in the project, for an article's current video, and — unless you tick **delete anyway** — for a project whose manifest names an article with a video attached. `Delete take <id>` removes `takes/<id>/`; the take whose manifest is the project's own needs **delete anyway**, and its verdict and notes are kept. - **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. diff --git a/plans/umtool-redesign.md b/plans/umtool-redesign.md @@ -901,3 +901,116 @@ the article-new memo miss — both fixed in `b7c49fb5`), 6 skipped; **at `b7c49f - The MCP `notes` tool lists the 14 open notes. - No `.umtool/` state written yet. - **Inbox on the real reports:** 51 calls waiting, against the old 518 "blocking". + +### P2b, as shipped + +**What.** What is running, in the rail, with spend; drafts nobody has reviewed, in the Inbox. Built on P3's rail +and P2a's inbox engine; no P3 behaviour changed. + +- **`askEditor`** (`lib/articles/generation.ts`): a GET is given 5 s and its answer kept 2 s per URL, on globalThis + (the promise is kept, so callers asking at once share one request; a refusal is kept as long as an answer). A + POST is given 30 s (it may have written by the time it is late), never kept, and drops every kept GET. `fresh` + asks again. `EditorError` gains a `reason`: `no-token` (umtool has none, 400), `unreachable` (refused, reset, or + no answer in time: 502 / 504), `editor-token` (the editor answered 503: its own WORKER_TOKEN is unset), `denied` + (401: the tokens differ), `refused` (its words). +- **The Running list** (`lib/activity.ts` `readRunning`, `GET /api/running`, `components/shell/RunningList.tsx`): + - Source: umtool's own running jobs (a chain and a render may run at once) and the editor's + `GET /api/ops/jobs?active=1&limit=200` — no `kind`; the choosing is umtool's. + - `lib/running.mjs` (pure, `node --test`): rank 0 generation (`report-draft`, `bench-verdicts`, `tts-file`), + rank 1 a research run's acquisition (its job id is a proposal's) or a clip window umtool asked for, rank 2 the + rest. Rows: every running job (umtool's own first, then by rank, oldest first), then the queued rank-0/1 jobs, + at most 5. The rest folds into one foot line, "+ 2 running · 140 queued · 3 lanes". The lane runners + (`auto-download`, `auto-transcribe`, `auto-digest`, `auto-backfill`, `auto-publish`) are never rows: they run as + long as the editor does. + - A row: the kind in words (common's `jobKindLabel`; umtool's chain is "Make the video", draft-all "Draft + everything"), the target (an article's iteration, a channel, a project), queued or running ("queued · 1 ahead"), + progress (the editor's snapshot: the runner's `current`, else `initial`, over `target`), and a generation job's + spend in Meter. One `JobProgress` presentation (`components/shell/JobProgress.tsx`): the words and a 2 px bar, + no bar when a job reports no fraction. + - Placing a report draft: the iteration whose `jobId` (or a step's) is the job's, from the article store, kept + 10 s and read only when an editor job that is not a lane is live; else the log's first line + (`sweep of <article> i<n> on <model>`). Such a row links the article's iterations; any other links the editor's + `/jobs`. + - Spend: a running draft's log (`~$0.41`, the agent tasks' per-turn line; `GET /api/ops/job/<id>?tail=200`), else + the ledger by job id; a chain sums the ledger's rows for its iteration since it started. The label row says the + day's total from the ledger ("$0.42 today"). + - Three sentences, never one: **Editor unreachable**, **Editor's WORKER_TOKEN not set** (503), **Nothing running** + (plus **WORKER_TOKEN not set here** and **WORKER_TOKEN does not match the editor's**). The editor's words are + the line's tooltip. + - Polling: on mount, then every 8 s while the tab is visible, none while hidden, one request at a time. The server + renders the last view if it is under 15 s old, else umtool's own jobs and "Asking the editor…" — a page never + waits on the editor. +- **Drafts as decisions** (`lib/inbox.ts`, `lib/inbox/drafts.mjs`): `drafts-unreviewed`, one row per drafted field a + final build would refuse for want of an approval (`unreviewed`, or `edited`: changed since approved), from r28's + `draftsView()`, for every project with a manifest. Kept per project against `reportSignature`. Group **Review** + (ranked after `iteration-ready`), one card per piece ("Narration draft · 5 fields · by qwen3:8b"), action + **Review drafts** → `/projects/<p>/review`. `reportSignature` (`lib/projects/report.mjs`) now signs + `drafts.review.json`, `narration.review.json` and every `<task>-draft.json` (mtime and size), so an approve — + which writes only the review file — refreshes it and the project caches keyed on it. +- `verdict-proposed` (r28 M8) is not built: M8 waits for the operator's bench bar (`plans/release-28.md`). +- **The editor stub**: `GET /api/ops/jobs` (the active filter, `limit`) answers the jobs a spec sets through + `POST /__stub/ops-jobs {mode, jobs, live}` (no token, the stub's own door) plus its own live drafts unless + `live: false`; mode `editor-token` answers 503, `unreachable` drops the socket. A set job's `log` is its + `GET /api/ops/job/<id>?tail=N`. The poll is not recorded in the stub's request log. + +| Commit | What | +| --- | --- | +| `892ae991` | `askEditor` timeout, memo and reasons; `readRunning`, `lib/running.mjs` + tests, `/api/running`, `RunningList`, `JobProgress`; the stub's jobs route | +| `6ff36c1f` | `drafts-unreviewed` (`lib/inbox/drafts.mjs` + tests, the inbox source, the group rules); `reportSignature` signs the review and draft files; `e2e/running.spec.ts` | +| `46bc0c84` | a row's percent on the right, its progress words under it | +| `4c3ddd9b` | running.spec leaves the stub's own drafts out (`live: false`) | +| `3a33905b` | a drafts card names up to three kinds of field | + +**Gates.** + +| Gate | Result | +| --- | --- | +| repo-wide `tsc --noEmit` | clean at every commit | +| `pnpm --filter umtool typecheck` | clean | +| umtool unit (`node --test umtool/lib/*.test.mjs umtool/lib/*/*.test.mjs umtool/report-to-video/*.test.mjs`) | 814 tests, 812 pass, 2 skipped, 0 fail (10 new: `running.test.mjs` 6, `inbox/drafts.test.mjs` 4, the second a `reportSignature` test on a temp dir) | +| `pnpm --filter umtool test` | 11/11 | +| `pnpm run test:scripts` (reads the capped build) | 965 tests, 962–963 pass, 2–3 skipped, 0 fail | +| mcp | 363/363 (not touched) | +| capped umtool `next build` (corpus linked, `MemoryMax=5G`) | exit 0, compiled 9.6 s, 31.4 s wall, 1.38 GB max RSS; the link removed | +| full umtool e2e, run 1 (`46bc0c84`) | 390 tests: 382 passed, 2 failed, 6 skipped, 7.6 min. Both reds were `running.spec`: a report draft another spec had left running in the stub was counted (`Running 3`, not 2) — fixed in `4c3ddd9b` (`live: false`); then `running.spec` + `article-iterations.spec` 7/7 | +| full umtool e2e, run 2 (`3a33905b`) | **390 tests: 384 passed, 0 failed, 6 skipped** (the song-data capability skips), 9.6 min | + +`e2e/running.spec.ts` (3): the rail with stub jobs — two lanes, a running draft (its kind, `zeta i7 · 3/12 turns` +placed by its log, `$0.31` from it, a 25% bar, linking `/articles/zeta?tab=iterations`), a running sync (its +channel, `2/8 downloads`, 25%, linking the editor's `/jobs`), a queued draft (`queued · 1 ahead`, no bar), three +queued syncs folded (`+ 3 queued · 2 lanes`), `Running 2`, `$0.42 today`, the API's counts and no token in it; +"Nothing running" with "1 lane", then the 503 (**Editor's WORKER_TOKEN not set**, the editor's words as the +tooltip), then a dropped socket (**Editor unreachable**, the day's spend still said); a project with three drafted +fields written in the spec — three `drafts-unreviewed` rows in Review on the API, one card of 3 on the Inbox, +**Review drafts** to `/projects/reports/p2b-drafts/review`, three approves there, and the card gone from the Inbox +and the API on the next read. + +**Screenshots** (job scratch `p2b-shots/`): the Inbox and `/tools` at 1366×768, dark and light, on the e2e fixture +with stub jobs set (a running draft with spend, a sync at 62%, a post walk, a queued draft, three queued jobs and +three lanes folded) and a five-narration drafts project. Against the canvas's rail foot: the label row with the +count and "$0.42 today" in Meter, rows of kind and target with the Meter bar, the folded line. The Inbox's Review +group shows the drafts cards beside the iteration cards. + +**The real reports and editor, read-only (offline tsx, a scratch copy of the umtool cache, 2026-10-14).** +- **Drafts cards today: 0.** The walk finds two projects with draft files: `articles/r28-smoke/i1` has 18 drafted + fields, all 18 approved in its `drafts.review.json` (release 28's live smoke); `articles/piratesoftware-ai-friends/i1` + has a release-25 `narration-draft.json` and no drafted mark in its manifest. The Review group is the three + `iteration-ready` cards it had. `draftsDecisionsAll` 4.2 s cold (every project's signature and manifest), 85 ms warm. +- **The live editor's `GET /api/ops/jobs?active=1`** (one read-only GET, WORKER_TOKEN from `editor/.env`): 3 jobs, + all lane runners (`auto-publish`, `auto-download`, `auto-transcribe`), 624 bytes in 9 ms. The rail would say + **Running 0 · $5.73 today** (15 jobs in the ledger today), **Nothing running**, and "3 lanes". `readRunning` 63 ms. + +**Found and left.** +- A running job's spend is known only where the job says it: the agent tasks (sweep, research, the revisions) log + `~$x` per turn; a media draft or a narration logs none until it ends, so its row shows no spend while it runs and + the ledger has it after. The day's total is the ledger's (finished jobs), so it does not count a running job's. +- A `report-draft` step queued behind another (a narration, a media draft) is not placed on its article until it + starts: no iteration names its job id before then, and a queued job has no log. It links the editor's `/jobs`. +- The editor's `GET /api/ops/jobs` carries no spec, so a research acquisition is found only by the `jobId` its + proposal records in `proposals.json`; a job the editor enqueued for it any other way ranks with the rest. +- A stub draft another spec leaves running (`article-iterations`' cancel aside, a media draft whose article is + deleted mid-run) stays `running` in the stub; specs that count the editor's jobs pass `live: false`. +- `app/page.tsx`'s `WHAT` has no entry for `drafts-unreviewed` (P3's file), so a card reads "… · drafts + unreviewed" by the fallback; the sentence under it says what was drafted. +- Not touched: `JobProgress` on the project page's chain panel and the Iterations tab's job view (P4b unifies them), + `verdict-proposed` (M8 not built).