Archilyzer · Source

archilyzer

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

commit 82729ed515955cb4b758a8294d37a987481d1727
parent ec9310d049530f41eaec3ebf33e198808ec030d1
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 13 Oct 2026 21:43:48 -0400

plans: release 28 M0, as shipped — the draft framework and the drafts review; FACTS; CHANGELOG

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

Diffstat:
Meditor/CHANGELOG.md | 3+++
Mplans/FACTS.md | 47+++++++++++++++++++++++++++++++++++++++++++++++
Mplans/release-28.md | 46++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 96 insertions(+), 0 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## [Unreleased] +- **A drafted field of a report video says it was drafted, and a final build refuses it until it is approved.** A field a generation task writes (a card's narration today; on-screen text, a teaser's lines, the cut's order, the flips, the threads and the YouTube text as their tasks land) carries `drafted` — who drafted it, on which model, when — in the manifest. umtool shows **drafted by <model>** and its review state beside the field (the On-screen table, the teaser editor, the narration page) with **Approve** and **Reject** (with a note), and `/browse/<project>/review` (**Review drafts — N** on the project page) lists every drafted field of the cut and what a final build would refuse. Verdicts are kept in `drafts.review.json` beside the manifest, each on the value it was given on, so a re-draft or an edit needs approving again. A **final** build refuses a drafted field not approved (`--drafts-unreviewed` builds the unapproved anyway, never a rejected one); preview and fast builds only warn. A narration written by hand keeps the rule it had, and existing `narration.review.json` verdicts read as they were (new ones are written to `drafts.review.json`). +- **A draft never overwrites what you wrote.** A field with words in it and no `drafted` mark is yours: no generation task replaces it, even when asked to redraft. Its draft is kept aside in `<task>-draft.json` and shown under the field in umtool with **Use this**, which writes it as your own edit. Editing a drafted field in umtool makes it yours (its mark goes). +- **A report video manifest may carry `publish.youtube { title, description }`** — two strings, a title of at most 100 characters — for the YouTube text a later task drafts. - **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,50 @@ 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`). + +## Drafted fields and the drafts review (verified 2026-10-13, release 28 M0, branch `r28/framework`) + +- **The mark.** `common/lib/report/drafted.mjs` (plain JS, typed by `drafted.d.mts`, exported as + `yt-dlp-transcript-common/lib/report/drafted.mjs`) is the one copy. A provenance is + `{ task, model, at, iteration?, attempt }` (`at` ISO, `attempt` 1 or 2). Entry fields: + `entry.drafted.{onscreen | narration | lines}` (on-screen on any entry, narration on a card, lines on a teaser). + Manifest fields: the top-level `drafted` map keyed by path — `timeline` (the cut's ORDER: the entries' ids), + `render.chrome.flips`, `render.chrome.threads` (the list AND every clip's `thread` key), `publish.youtube`. + `validateDrafted` refuses a mark anywhere else or not a provenance; an orphan (a mark whose field is empty) is + not an error: the lint warns, `pruneDrafted` drops it. +- **`publish` is a new top-level manifest key**: only `publish.youtube { title, description }`, two strings, title + one line ≤ 100, description ≤ 5000 (`validatePublish`; the build, the lint and umtool's structural writes run it). +- **Who owns a field** (`ownerOf`): empty → nobody; a value with a mark → the draft; a value with NO mark → the + operator. `applyDraft(manifest, { entry?, field, value, provenance, force? })` is the one writer every task + uses: `{ applied: true }` or `{ applied: false, reason: "operator" | "drafted" | "missing" }`. The operator's + field is never replaced, `force` or not; `force` only re-drafts a field still marked. An entry id names every + entry with it (variant twins). A timeline with no `drafted.timeline` is the operator's — M1 decides what the + converter's order counts as. +- **An edit clears the mark.** umtool's manifest writer (`lib/report/manifest.mjs` `writeManifestAtomic`) + re-reads the file and runs `clearEditedDrafts(before, after)` on EVERY write: a marked field whose + `fieldSignature` changed loses its mark; orphans go. A mark the write itself added is kept. `writeDraftedField` + is "Use this" (onscreen, lines, narration, flips, threads, publish.youtube; not `timeline`). +- **The review file** is `<project>/drafts.review.json`, `{ "<task>/<entry id | *>/<field>": { verdict: + "approved" | "rejected" | null, note, key, text, at } }` (`umtool/report-to-video/drafts-review.mjs`). The + address's task is the FIELD's own (`FIELD_TASKS`: onscreen→`onscreen`, narration→`narrate`, lines→`teaser`, + timeline→`cut`, flips→`flips`, threads→`threads`, publish.youtube→`youtube`), whichever task drafted it. + `key` is `narrationKey` for a narration (words + voice), else `fieldKey` (sha256 of the stable JSON of + `fieldSignature`). Release 25's `narration.review.json` (`{ <cardId>: row }`) is READ as + `narrate/<cardId>/narration`; the drafts file wins; nothing writes the old file. A cleared row the old file + still has stays in the drafts file as an empty verdict so the old approval does not show through. +- **The gate** (`draftsReviewProblems`, run by the lint): a marked field not approved on its current key is a + warning (one line) in preview/fast and an ERROR with `--final` unless `--drafts-unreviewed` + (`--narration-unreviewed` too for a narration); rejected is an error in final whatever the flags, a warning + otherwise. A narration with NO mark keeps release 25's rule in every build, where "the narration has a review" + now means a narration row in either file (an onscreen verdict does not start it). The driver's `final` preset + passes `--final`; `fast` and `preview` do not. +- **The media task scaffold** is `common/lib/report/draft/tasks/media.ts` (`runMediaTask(spec, input, deps)`, + exported from `tasks/index.ts`). A spec: `task`, `units(ctx)` (a unit `{ id, target: { entry?, field } }` or a + skip `{ id, skipped }`), `schema`, `system`, `user`, `parse`, `check` → `{ hard, soft }`, and optional `score`, + `repair`, `retry`, `toField`, `afterApply`, `apply`, `draftFile`, `snapshotOp`, `checkName`, `turnKind`, + `noun`, `verb`, `describe`. A unit whose field has a value is skipped unless `force`. The draft file + (`<task>-draft.json`; narrate keeps `narration-draft.json`) is `{ task, model, at, article, iteration, units: + { <id>: { target, attempts, chosen, applied | skipped } }, checks, alternatives: [{ target, value, provenance, + reason }] }`; alternatives from earlier runs are carried over, newest five per field. The step is recorded in + the iteration's `steps` (a done iteration's status is left). umtool reads alternatives from every + `*-draft.json` beside the manifest (`lib/report/drafts.mjs` `readAlternatives`). diff --git a/plans/release-28.md b/plans/release-28.md @@ -244,6 +244,52 @@ 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. +### M0, as shipped (2026-10-13, lane A, `r28/framework`) + +The draft framework, the drafts review and the final gate, as the orchestrator's eight M0 rulings, with narration +moved onto them. The rulings held as given, with these as built: +- `applyDraft`'s refusals are `operator`, `drafted` (a draft already, no `force`) and `missing` (no such entry, or + flips/threads with no `render.chrome`); a field in the wrong place (narration on a clip) throws. +- A review address's `<task>` is the FIELD's own (`onscreen`, `narrate`, `teaser`, `cut`, `flips`, `threads`, + `youtube`), whichever task drafted it, so a field has one address; narration's is `narrate/<cardId>/narration`. +- A drafted narration follows the drafts gate (a warning in fast, refused in final); one with no mark keeps + release 25's rule in every build. "The narration has a review" is now a narration row in either file, so an + on-screen verdict does not start it. +- Narrate's audit file kept its name, `narration-draft.json`, in the scaffold's shape (`units`, `alternatives`); + `mcp/src/draftTasks.test.ts`'s narrate test reads `units[...]` (two lines, lane B's file) and asserts the mark. +- Badges (ruling 8): the narration page STAYS (it edits and plays the words) and writes the new file; the general + page is `/browse/<project>/review`, linked as **Review drafts — N**. Badges sit in the On-screen table's title + cell, the teaser editor and the narration page. +- "Use this" writes onscreen, lines, narration, flips, threads and publish.youtube; not the cut's order (an order + replaces every entry: the cut task's to apply). A timeline with no `drafted.timeline` is the operator's — M1 + decides what the converter's order counts as. + +| Commit | What | +| --- | --- | +| `e4fe6039` | common: `drafted.mjs` (+ `.d.mts`): the marks, `applyDraft`, `clearEditedDrafts`, `pruneDrafted`, `validateDrafted`, `validatePublish`, review addresses and keys; `tasks/media.ts`, the scaffold (`runMediaTask`); narrate refactored onto it | +| `994fc97b` | umtool: `report-to-video/drafts-review.mjs` (the file, release 25's read unchanged, the gate); the lint and build-video (`--final`, `--drafts-unreviewed`); the driver's `final` passes `--final`; the manifest writer clears an edited draft's mark; `writeDraftedField`; `lib/report/drafts.mjs` and `/api/report/drafts` | +| `1b185182` | umtool: the badges, the alternatives with **Use this**, `/browse/<project>/review` | +| `f281b714` | umtool: e2e `draft-review.spec.ts` and its fixtures; `narration-review.spec.ts` reads the drafts file | +| `da4b123e` | the README's drafts review section, umtool's report-video doc; the scaffold exported from `tasks/index.ts` | +| (this commit) | this record, FACTS "Drafted fields and the drafts review", CHANGELOG | + +Gates (from the worktree root): +- `pnpm -r exec tsc --noEmit`: clean at every commit. +- common: 4018 (2 failing, flaky at the branch's start) → 4029, all pass (+11: `drafted.test.ts` 7, + `media.test.ts` 4). +- `test:scripts`: 863 (+3 skipped) → 874; 869 pass + 3 skipped, 2 failing in `scripts/queue-lock.test.mjs` + (timing, H2's flake) under the full run, 37/37 alone (+11: `drafts-review.test.mjs` 7, `drafted-writer.test.mjs` + 3, `drafts.test.mjs` 1). +- mcp 343/343; editor 288/288. +- `docs env|files|cli --check` and `settings example --check`: clean. +- umtool capped build, corpus linked, through the heavy slot: compiled in 10.2 s (83 s with 50 s waiting for memory). +- umtool e2e, single specs in the foreground: `draft-review.spec.ts` 3/3 (6.9 s; a real offline final build: + refused, approved on the review page, built); `narration-review.spec.ts` + `build.spec.ts` 8 (1 failure: + narration-review read the old file, fixed) then `narration-review.spec.ts` + `onscreen.spec.ts` 10/10; + `timeline-edit.spec.ts` + `undo.spec.ts` 9/9. + +Left for phase 2: the media tasks themselves (M1–M6) on the scaffold; `TaskDeps.progress` (F3) is not wired. + ## Not in this release Comment and thread generation for social posts (X/Bluesky promotion); auto-publishing to YouTube (r28 writes the text