Archilyzer · Source

archilyzer

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

commit bf99e379e84cea54e158b627036207781c44eeb9
parent cbfef853acc4d300408d4ed22132599d06e2d5e3
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 13 Oct 2026 22:04:04 -0400

plans: release 28 lane C — M7, H1, H2 and H5 (code), as shipped; FACTS: the bench's files and contracts; CHANGELOG

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

Diffstat:
Meditor/CHANGELOG.md | 5+++++
Mplans/FACTS.md | 26++++++++++++++++++++++++++
Mplans/release-28.md | 131+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 162 insertions(+), 0 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog ## [Unreleased] +- **The verdict bench: could a model propose a fact-check verdict well enough to review?** `archilyzer reports bench-verdicts --models claude-sonnet-5-5,claude-opus-5-5,qwen3:8b` asks each model about every claim of the fact-check articles that carries your verdict and a citation with a transcript — one claim per call, shown the claim, its quotes and the transcript a minute either side, never your findings or your verdict — and scores the answers against your rulings: agreement, CONTRADICTED and NOT_FOUND recall, PARTLY counted strictly and as close to CORROBORATED, beside a model that always says CORROBORATED, with the cost and the time each took. `--dry` lists the claims it would ask and what the run would cost, asking nothing. The run goes through the editor (`pnpm ops bench-verdicts`; a local model takes its turn on the GPU and is unloaded after), stops at `--max-usd` (default $5, the whole run), and a run with the same `--run` id carries on where it stopped. The results stay on this machine, in `.generation/bench/verdicts/`. +- **umtool: `/bench` shows a bench run, and is where you set the bar.** Per model its agreement and recalls against the always-CORROBORATED baseline and its cost, the confusion matrix (your verdict against the model's), and every claim with each model's verdict and reason, disagreements first, filtered by model or by your verdict. The bar — the least agreement, CONTRADICTED recall and NOT_FOUND recall a model must reach — is saved into the editor's settings (`settings.generation.verdicts`), each model reads as passing or failing it, and verdict proposals will run only on the passing models you tick. Linked from `/articles` ("verdict bench"). +- **`pnpm ops delete-site {"id", "dryRun"?, "force"?}` deletes a site, plan first.** It removes the site's directory (its settings, pages, tags, charts and reports), its last build and publish state, and its export staging, and says what it keeps: every channel's data (never touched), the Pages project and anything already deployed (a delete does not undeploy), a deployed hub until it is rebuilt. A site with a Pages project, a recorded deploy or reports of its own is refused unless `force`; a missing site, a linked site directory or a publish stage running is refused whatever. +- **A paused parakeet transcription no longer leaves its working files in the temp directory**, and each run clears what a crashed or killed run left there more than a day ago (unless another run still owns it). +- **New settings key `generation.verdicts`** (SETTINGS.md): the verdict bench's bar (`agreement`, `contradictedRecall`, `notFoundRecall`, fractions) and the passing models you ticked (`models`, never set automatically). - **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/FACTS.md b/plans/FACTS.md @@ -9185,3 +9185,29 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri ops batch as a `structuredAnswer`; a revision with no ops at all is a failing `ops` check, never "done, 0 applied". - **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`). + +## Release 28 lane C: the verdict bench, site delete (verified 2026-10-13, branch `r28/bench-house`) + +- **A verdict bench run** lives in `<repo>/.generation/bench/verdicts/<run>/` (`benchRootOf(paths)` = the usage ledger's + directory + `bench/verdicts`; gitignored, local-only): `items.jsonl` (one `BenchItem` per ruled claim — key + `<article>/<claim>`, the claim text, quotes, windows, and the operator's `verdict`, the answer key), `results.jsonl` + (one `BenchResult` per (item, model): `verdict` or null with `failure` `parse`|`error`, `reason` ≤ 300 chars, ms, usd, + tokens) and `summary.json` (format `archilyzer-verdict-bench`, status `running|done|capped|cancelled|failed`, + `stopped`, params, `spentUsd`, `skipped`, `score`). Every file is rewritten whole, atomically; the same run id + resumes (answered pairs skipped, failures asked again). Readers re-score from items + results (`scoreBench`), never + trust `summary.score` alone. Code: `common/lib/report/draft/bench/` (`index.ts`; import `…/bench/index`, a directory + import does not resolve through the package exports). +- **The bench runs as job kind `bench-verdicts`** (`controller/benchVerdicts.ts`, `POST /api/ops/bench-verdicts`): on + `draft:local` when any model is local (the GPU arbiter's `gpuGatedFetch`, ollama unloaded at the end), else + `draft:api`; refused past `caps.daily`; its API spend goes to the usage ledger as rows with `task: "bench-verdicts"`, + `article: ""`, `iteration: 0`. The cues are the local corpus's (`diskCuesOf`), not a build's. `archilyzer reports + bench-verdicts` is `--dry` (read only), through the editor (default), or `--here` (API models only). +- **`settings.generation.verdicts` = `{bar: {agreement, contradictedRecall, notFoundRecall}, models: string[]}`**: + fractions 0..1 (all 0 = no bar), and the passing models the operator ticked on umtool's `/bench` (never set + automatically). umtool writes the whole block through the editor's settings action (a nested object replaces). + `passesBar(score, bar)` (`bench/score.ts`) is the one pass rule: strict agreement and the two recalls; a recall with + nothing ruled that way is not a miss. +- **A site's delete** (`publish/siteDelete.ts`, `pnpm ops delete-site`) removes `sites/<id>/`, + `export/.export-builds/<id>/` and `export/.export-index/sites/<id>/`; nothing else on disk names a site by id + (channel membership is site.json's own pool). The editor's Danger → Delete (`deleteSiteAction` → `deleteSite`) still + removes `sites/<id>/` alone. diff --git a/plans/release-28.md b/plans/release-28.md @@ -244,6 +244,137 @@ source-mirror publish; the hub deploy (H6). No public site changes otherwise. Gates: common tsc clean; `testing/fakes.test.ts` 10/10; `fixtures-r28.test.mjs` 3/3. +### M7, as shipped (2026-10-13, lane C, `r28/bench-house`) + +The verdict bench: ruled fact-check claims asked of models one claim per call, scored against the operator's rulings. + +| Commit | What | +| --- | --- | +| `dc21f2c8` | `common/lib/report/draft/bench/` (`items.ts`, `prompt.ts`, `score.ts`, `store.ts`, `run.ts`, `index.ts`, `bench.test.ts`); `controller/benchVerdicts.ts`; job kind `bench-verdicts`; `POST /api/ops/bench-verdicts` (+ `_benchVerdicts.test.ts`); the ops ACTIONS row and help; `archilyzer reports bench-verdicts` (`bin/reports-bench-verdicts.ts` + test); `settings.generation.verdicts`; COMMANDS.md, SETTINGS.md, settings.json.example | +| `c31bedd0` | umtool `/bench` (`app/bench/page.tsx`, `components/bench/BarForm.tsx`, `lib/bench.ts`, `/api/bench/bar`), the `/articles` link; e2e `verdict-bench.spec.ts` + `fixtures/bench-fixture.mjs` | +| (this commit) | the records, FACTS, CHANGELOG | + +- **Items:** every claim of a `kind: "factcheck"` article (the registry's `listArticleDirs` / `articleFile` / `parseReport`) + with an operator `verdict` and a span citation whose recording has cues within ±`window` s (default 60) of the cited + span; overlapping windows of one recording merged. The rest are `skipped` with a reason (`no operator verdict`, `no + citation`, `no video or audio citation`, `no cited recording has cues around the cited seconds`). An item carries the + claim text, its quotes and windows, and the verdict (the answer key); `findings`, `gist`, `flag` and `title` are + never copied, and the prompt never reads the verdict. +- **The call:** `structuredAnswer` with `{verdict: VERDICTS enum, reason}`; the system prompt is the five verdicts' + meanings and "judge only the transcript shown" (no example); the reason is cut at 300 chars in code. A local prompt + is held under 7 800 estimated tokens (the client's 8k less a margin) by dropping the cues farthest from a cited span + first; the claim and quotes are never trimmed. +- **Where it runs (decided here):** not a `report-draft` (no iteration, no task) — a job of its own, `bench-verdicts`, + in the editor, because the GPU arbiter's holds are in-process there: any local model puts the run on `draft:local` + with `llmConfigOf(…, {onLog, signal})` (every ollama call through `gpuGatedFetch`) and ollama is unloaded at the end; + API-only runs go on `draft:api`. Calls are sequential. The day's cap refuses an API run at the ask and at its turn; + its spend is appended to the usage ledger (`task: "bench-verdicts"`). The CLI is `--dry` (offline, read only), + through the editor (`pnpm ops bench-verdicts`, the default), or `--here` (in process, API models only). +- **The cap:** `maxUsd` (default 5, refused above 50) for the whole run, resumed spend included, checked before each + API call against the spend so far plus that call's estimate; past it the run ends `capped` with what it did. A model + with three errors in a row is stopped and the run goes on. +- **Scoring (pure):** agreement (a failure counts as a miss), agreement with PARTLY ~ CORROBORATED, the 5×5 matrix (rows + operator) plus each row's unanswered, recall for CONTRADICTED, NOT_FOUND, PARTLY strict and adjacent, cost, latency + (mean, median, p90), parse failures and errors; the always-CORROBORATED baseline scored the same way. `passesBar`: + strict agreement and the two recalls (a recall with nothing ruled that way is not a miss). +- **Results:** `.generation/bench/verdicts/<run>/{items.jsonl, results.jsonl, summary.json}`, gitignored (`/.generation/`), + every write atomic and whole; the same `--run` resumes (answered pairs skipped, failures asked again). +- **umtool `/bench`:** the run picker; a tile per model and the baseline; the bar form (writes + `settings.generation.verdicts {bar, models}` whole through the editor's settings action; a model failing the typed bar + cannot be ticked); the confusion matrices; the items, disagreements first, filtered by model and by the operator's + verdict; the skipped list. Zero client JS but the form. Linked from `/articles` ("verdict bench"), the nav unchanged. +- **Labels (contracts):** link `verdict bench`; regions `models`, `the bar`, `confusion`, `items`; tables `confusion + <model>`; form `bar` with spinbuttons `minimum agreement`, `minimum CONTRADICTED recall`, `minimum NOT_FOUND + recall`, checkboxes `use <model>`, button `Save the bar`, status `Saved.`; attributes `data-bench-run`, + `data-status`, `data-model`, `data-pass`, `data-metric`, `data-cell`, `data-item`, `data-disagree`, `data-run`. + +**The real run (the orchestrator's):** + +``` +pnpm archilyzer reports bench-verdicts --models claude-sonnet-5-5,claude-opus-5-5,qwen3:8b --max-usd 5 --run vb-r28 --wait +``` + +through an editor that has this branch (the route is new). Its `--dry` over the registry (read only, 2026-10-13): 147 +items from 2 fact-checks, 44 claims skipped (23 no operator verdict, 12 no citation, 9 no video or audio citation); +ruled CORROBORATED 78, PARTLY 58, NOT_FOUND 6, CONTRADICTED 4, UNTESTABLE 1; estimate Sonnet 5.5 ~$1.29, Opus 5.5 +~$2.57, qwen $0 — ~$3.86 in all. With 4 CONTRADICTED and 6 NOT_FOUND items the two recalls move in steps of 25% and +17%. + +### H1, as shipped (2026-10-13, lane C, `r28/bench-house`) + +| Commit | What | +| --- | --- | +| `66fd4a04` | `scripts/parakeet-stitch.mjs`: the pause path breaks out of the window loop and exits after the `finally`; the start-up sweep; `main()` only as a program; `scripts/parakeet-stitch.test.mjs` (3) | + +- **The sweep:** a `parakeet-stitch-*` dir in the tmpdir older than 24 h (its mtime; a running run's dir changes with + every window) is removed unless held. **Chosen: an owner file** (`owner.json`: pid and that process's start time from + `/proc/<pid>/stat`, so a reused pid is not the owner), written at creation. A `/proc` scan of open files and cwds alone + would not do: a run holds nothing in its tmp dir between two windows. A dir with no owner file (today's stale ones) is + held while any other parakeet-stitch process runs (its cmdline), or while any process has a file or its cwd in it. +- Unit: the pause path (a fake parakeet-cli sends the SIGTERM mid-window) exits 0 with the window kept and no temp dir + left — red against the old script; the sweep removes an old unheld dir and keeps an owned, a held and a young one. +- The 21 live stale dirs in `/tmp` are the orchestrator's to remove after merge. + +### H2, as shipped (2026-10-13, lane C, `r28/bench-house`) + +| Commit | What | +| --- | --- | +| `4e941835` | the three flakes | + +- **`relocateChannelMedia.test.ts` "reconcile: an extra and a changed file":** each test already has its own + `mkdtemp`; the cause was a directory mtime. Writing `stale.json` moved the target's `v1/` mtime, and when the setup + crossed a second boundary rsync (whole seconds) itemized `.d..t v1/` as a third difference. Both trees' directory + mtimes are pinned now. Proved with a forced 1.1 s delay: red before, green after. + - Found, not changed (not this lane's file): `relocateDir.ts` `diffTrees` reports a directory-mtime-only line as + "changed" in the reconcile sentence, which the verify (`DIR_MTIME_ONLY`) already ignores. +- **`queue-lock.test.mjs` `--with` (:792), and "two weighted jobs" (:632), red in this branch's first run:** fixed holds + (700 ms, 1500 ms) raced the next run's start under parallel test files. The holding runs wait on a gate file the test + opens once what it checks has happened (capped at 20 s, so a wrong admission still fails the order assertion). +- **`backfill.spec.ts` (:516):** the lane is unchecked only once the first save has settled on the page ("Saved.", the + button back, nothing unsaved, still checked), and the second save is seen to settle before the lane is polled. +- Five runs each: `relocateChannelMedia.test.ts` 44/44 ×5; `queue-lock.test.mjs` 37/37 ×5; `backfill.spec.ts` 22/22 ×5 + (1.8, 1.8, 2.0, 1.3 and 0.7 min). + +### H5, as shipped (code) (2026-10-13, lane C, `r28/bench-house`) + +| Commit | What | +| --- | --- | +| `8b11cb7d` | the plan and the delete, `POST /api/ops/delete-site`, the ACTIONS row and help, COMMANDS.md, the unit test | +| `ebf9e60d` | moved to `common/publish/siteDelete.ts` (the architecture test: controller/ may not import publish/) | + +- **The survey — what a site leaves on disk:** `sites/<id>/` (site.json with its pool, tags.json, charts, reports with + their history-git), `export/.export-builds/<id>/` (built.json, deployed.json, out/, a docker build's public/ and + .r2-staging/) and `export/.export-index/sites/<id>/` (report media and exports, summaries, stats). Nothing else names + a site by id: channel membership is site.json's own pool, the hub lists the sites on disk with a siteUrl, and curated + tags' per-site file is in the site dir. +- **Plan, then apply** (as release 27's `reports delete`): `dryRun` answers the plan. Removed: the three directories. + Kept: every channel's data, the Pages project and what was deployed (a delete does not undeploy), a deployed hub until + rebuilt, `export/out` when it links into the site's bundle. Refused unless `force`: a `cloudflareProject`, a deploy + in deployed.json (production, a preview, local), reports of its own. Refused, force or not: no such site (404), a + site dir that is a link, a publish stage running (a live publish-lock holder). +- **The delete:** the publish lock taken without waiting (1.5 s; a stage that started refuses), the site.json lock, + the plan made again, each directory renamed aside to `.deleting-<id>-<stamp>`; the bulk removed after the locks. +- The editor's Danger → Delete (`deleteSiteAction` → `deleteSite`) is unchanged: it still removes `sites/<id>/` alone. +- **The candalyzer plan** (read only, 2026-10-13): not refused, 3 paths, 7 772 files, about 2.7 GiB. The orchestrator + runs `pnpm ops delete-site --json '{"id":"candalyzer"}'` after merge (a `dryRun` first). + +### Lane C gates (2026-10-13) + +- tsc clean (all packages) at every commit. +- Unit, at the branch's start → at its tip: + - common 4017 of 4018 (1 red: "a drain mid-page waits for the page's cursor", not this lane's; green since) → + 4034/4034 (16 new: `bench.test.ts` 8, `reports-bench-verdicts.test.ts` 3, `siteDelete.test.ts` 4, the verdicts + settings 1); + - editor 288 of 289 (1 red: `whisperFromContainer.test.ts`, not this lane's; green since) → 291/291 (3 new: `_benchVerdicts.test.ts`); + - `test:scripts` 858 pass, 2 red (the queue-lock pair H2 fixed), 3 skipped → 864 pass, 0 red, 2 skipped (3 new: + `parakeet-stitch.test.mjs`); + - mcp 343/343 (not touched). +- `docs env|files|cli --check`, `settings example --check`: clean. +- Builds (heavy slot, 5 GB cap): umtool 31 s with the corpus linked for the build only and removed (`/bench`, + `/api/bench/bar`); umtool's e2e start build 29 s; the editor's e2e start build 57 s at `66fd4a04` + (`/api/ops/bench-verdicts`); the editor at `ebf9e60d`, 123 s (`/api/ops/bench-verdicts`, `/api/ops/delete-site`). +- e2e: umtool `verdict-bench.spec.ts` 2/2, 14.2 s; editor `backfill.spec.ts` 22/22 five times (above). + ## Not in this release Comment and thread generation for social posts (X/Bluesky promotion); auto-publishing to YouTube (r28 writes the text