Archilyzer · Source

archilyzer

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

commit ce18b5bd35da02b042035b594125aad4f002acab
parent d30d40a2b29d4969fe8bf014ac1bfac878d6f5e1
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 13 Oct 2026 21:48:19 -0400

plans: release 28 lane B — Q1, Q2, Q3, F2 and F3 as shipped; FACTS: the quality and progress contracts; CHANGELOG

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

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

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog ## [Unreleased] +- **Generated narration that speaks as the speaker is refused.** The narrator is third person: a drafted narration sentence with I, me, my, we, us or our outside quotation marks fails its check ("the narrator is third person"), and when the sentence restates a cited quote the reason names whose line it is and its citation (`c03 (Bread day @ 0:45)`). A narration step drops such a sentence as it drops any other failing one; a video revision's narration op is refused with it. "US" in capitals and words that only contain the letters ("Iowa", "myth") are not caught; "mine" the noun is. +- **A generated quote that stops mid-sentence is refused, and the full sentence is offered.** A quote under four words, or one that ends on a word like "as", "to", "the", "and" or "my" without sentence punctuation, is a fragment. In a generated sweep it goes to the repair round with the transcript's whole sentence to quote instead (or is dropped if still a fragment); a revision's added finding is refused with the sentence; the local pipeline extends such a quote to its sentence itself. `archilyzer reports verify-quotes` reports an existing report's fragment quotes as **`fragment`**, a warning with the full sentence, after `drift`, `en-orig-drift` and `inexact`; the exit code is unchanged. Needs a restart of the editor. +- **Report and video revisions on the local model are one request.** A revision on the local model no longer runs a tool conversation: it asks once for the whole batch of edits, over the report or cut trimmed to fit the model's 8k-token prompt (the sections or chapters the feedback names first; long quotes shortened and links cut to their labels in what the model reads, never in the report). Revisions on the Claude API are unchanged. Needs a restart of the editor. +- **A sweep can name its own extractor.** `pnpm ops report-draft --json '{"task": "sweep", …, "extractorModel": "claude-haiku-5-5"}'` reads that sweep's batches with the named Claude model instead of `settings.generation.models.extractor`; the MCP's `generate` takes it too. In umtool, a sweep on a Claude model shows an **extractor** choice on `/articles/new`, beside **Copy with model**, and beside a research run's **Continue into a sweep**. A sweep on the local model has no extractor and says so. Needs a restart of the editor and umtool. +- **Report draft jobs show their progress.** A **Report draft** job's row on /jobs now shows the model turns taken against the task's turn limit (a sweep, a revision, a research run; the repair round counted on), or the recordings read of the worklist for a sweep on the local model. `pnpm ops get job <id>` carries the same as `progress`. Needs a restart of the editor. - **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,12 @@ 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 B: quality and progress (verified 2026-10-13, branch `r28/quality` @ `48dbc5de`) + +- **The narrator is third person** (`grounding.ts`): a first-person word outside double quotes is a HARD grounding problem whose text starts `the narrator is third person`. A media task that calls `checkNarration` refuses it with no change of its own. `GroundingInput.sources` (each quote's speaker and `c03 (label @ m:ss)`) names the line it restates; `groundingInputOf` fills it. +- **A fragment quote** (`lib/citations/fragment.ts`): `fragmentOf(quote)` → `{why, part} | null`; `fullSentenceFor(quote, cues, second)` → the cues' own words or null; `fragmentHint(f, sentence)` is the repair wording. A GENERATED fragment fails (`checkQuotes` problem with `fragment`, the add op's checker); an existing one is verify-quotes' warning `fragment`, after `drift` / `en-orig-drift` / `inexact`. +- **A local revision is one `structuredAnswer`**, never the tool loop: `localOpsBatch(h, {model, system, what, build, apply})` and `fitLocalAsk` (revise-report.ts) fit a view under the cap with `structuredPromptEstimate` (llm/structured.ts, the request localAnswer sends). `trimmedNumberedView` / `trimmedCutView` shorten quotes and links in the VIEW only. +- **`report-draft {extractorModel}`** is a sweep's, a Claude id `isKnownApiModel` accepts; it replaces `generation.models.extractor` for that job. +- **A report-draft job's progress** is the task's: `TaskDeps.progress?({metric: "turns" | "cards" | "entries", current, total?})` → `JobProgress {metric, initial: 0, target, current}`. A task calls `h.progress(...)` (TaskHandle; a throwing listener is swallowed). Media tasks report `cards` / `entries` the same way. + diff --git a/plans/release-28.md b/plans/release-28.md @@ -244,6 +244,74 @@ 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. +### Q1, as shipped (2026-10-13, lane B, `r28/quality`) + +| Commit | What | +| --- | --- | +| `03ece497` | `grounding.ts`: `FIRST_PERSON_WORDS`, `firstPersonWords`, `firstPersonProblems`, `THIRD_PERSON_MESSAGE`; `GroundingInput.sources` (`QuoteSource`, `reportQuoteSources`, filled by `groundingInputOf`); `checkNarration` adds each first-person sentence to `hard`; the taste's third-person rule; revise-video's narration op names it; 3 tests | + +- A sentence with I, I'm, I've, I'd, I'll, me, my, mine, myself, we, we're, we've, we'd, we'll, us, our, ours or ourselves outside double quotation marks is a HARD problem: `the narrator is third person (“I've”, “mine”): …`. When the sentence restates a cited quote (grounding's own `closest` match: two shared content words and half the sentence's), the reason names it: `this is the speaker's line from c03 (Bread day @ 0:45), “…”` (the citation's `speaker` when it has one). +- Word-bounded and case-insensitive; curly apostrophes read as straight. Not hits: "Iowa", "myth", "mineral", the all-caps "US". Accepted collateral: "mine" the noun, a roman numeral I. +- narrate needs no change: its grounding call puts the problem in `hard`, so the re-ask, the better attempt and the failing-sentence removal refuse it. videoOps' narration op is refused with it. +- The rule is stated once, in `NARRATION_TASTE` (narrate's prompt reads it). + +Gates: in the lane's totals below. + +### Q2, as shipped (2026-10-13, lane B, `r28/quality`) + +| Commit | What | +| --- | --- | +| `e023db71` | `citations/fragment.ts` (`FRAGMENT_END_WORDS`, `FRAGMENT_MIN_WORDS`, `fragmentOf`, `isFragmentQuote`, `fullSentenceFor`, `fragmentHint`); `checkQuotes` and `strictCheckerOver` refuse a fragment with its sentence; the pipeline extends one in code; revise-report's parent fragments a warning; verify-quotes `fragment`; `WHOLE_SENTENCE_QUOTE_RULE`; REPORT.md; `testing/draft/sweeps/fragment.md`; 8 tests | + +- **A fragment**: fewer than 4 words in the whole quote, or an ellipsis part ending on one of `FRAGMENT_END_WORDS` (the brief's list) without sentence punctuation (. ! ? …). A part ending on punctuation is a sentence whatever its last word. +- **`fullSentenceFor(quote, cues, second, {windowSeconds?, maxWords?})`** → the cues' own words from the quote's first word to sentence punctuation, or to a cue boundary whose next cue starts with a capital (not the pronoun I); unpunctuated, the end of the quote's cue, then one more cue while still a fragment; under 4 words, widened back to the sentence's start. Cap: max(30, quote + 15) words. Null when the quote is not there verbatim or nothing whole fits. The result passes the strict check wherever the quote did. +- **Generated quotes:** `checkQuotes` gives a fragment as a problem (`fragment: {why, part, sentence}`, `why` = `a fragment (ends on “of”): "…" — quote the whole sentence: "…"`), so the sweep agent's repair round is handed the sentence; still a fragment after it, the finding is dropped. The `add` op's checker (`strictCheckerOver`, `fragments: false` turns it off) refuses one with the same words. **sweep-pipeline** replaces a fragment with its sentence from the window in code (≤ 60 words), else drops it (`a fragment (…)`). +- **revise-report:** a fragment the parent already quoted is a warning in the `quotes` check, not a failure (as verify-quotes says of existing reports); one this revision added is dropped as before. +- **verify-quotes:** `fragment` is in `QUOTE_WARNING_STATUSES`; precedence `drift` / `en-orig-drift` > `inexact` > `fragment` > `ok`; the result carries `sentence`. The summary's note names whichever warnings occur. +- A `fragment` from the editor's verify-quotes is not one more problem in `checkQuotes` (its own check is the one). + +### Q3, as shipped (2026-10-13, lane B, `r28/quality`) + +| Commit | What | +| --- | --- | +| `f93ac191` | `structuredPromptEstimate` (llm/structured.ts); `sweepModel` `trimmedNumberedView`, `sectionsNamedBy`, `shortEvidence`; `videoOps` `trimmedCutView`, `chaptersOf`, `chaptersNamedBy`, `entryLine`; revise-report `LOCAL_REVISE_RULES`, `fitLocalAsk`, `localOpsBatch`, `REPORT_OPS_TEXT(origin, local?)`; revise-video's local path; 5 tests | + +- On an ollama model, revise-report and revise-video make ONE `structuredAnswer` (no tools; the rules name none) and apply its ops; the API path is the tool loop and its one-ask fallback, unchanged. +- **The fit:** `fitLocalAsk` builds the user text at a character budget from the model's prompt cap (`promptCapOf` × 3.5) and shrinks it by 15% until `structuredPromptEstimate` — the very messages and format localAnswer sends, counted as `ollamaChat` counts them — is under the cap. +- **The report view:** sections the feedback names first (a title, `section N`, or a finding number in what is left once titles are taken out; seconds and percentages are not finding numbers), then the rest in document order, finding by finding while the budget lasts; shown in document order; a section's left-out findings named (`(findings [96]–[100] not shown)`). Quotes over 12 words cut to 8 and `…`, links cut to their labels — in the view only; ops number against the whole document. +- **The cut view:** every entry listed in timeline order; the chapters the feedback names (an entry id, a card heading, `chapter N`) in full first, the rest while the budget lasts, else `- clip c07 (not shown in full)`; citations the feedback names first, then the rest, with the count left out. +- Unit, against fakeOllama: a 45k-character report's view under the 8k estimate, one request, the named section in full, the op landing on finding 220 of the whole document, links whole in the report; the cut's one batch. + +### F2, as shipped (2026-10-13, lane B, `r28/quality`) + +| Commit | What | +| --- | --- | +| `c9e99c51` | `report-draft {extractorModel}` (`REPORT_DRAFT_BODY_KEYS`, `parseReportDraftBody`, `isKnownApiModel`); the route's comment and the ops help; COMMANDS.md; the MCP's `generate` argument; umtool `ExtractorSelect` / `extractorBody` on `/articles/new`, Copy with model and a research continuation; `DRAFT_KEYS`; editor unit 2, MCP checks, umtool `article-new.spec` | + +- `extractorModel` is a sweep's (`task: "sweep"`, a copy of one or a research continuation included) and a Claude model id the price table knows (`isKnownApiModel`: a `PRICES` key, or a dated id of one). It replaces `settings.generation.models.extractor` for that job. On a sweep whose model is local it is unused and the answer carries a warning. +- The MCP's `generate` checks it (a sweep's, `claude-…`) and passes it through. +- umtool shows the extractor only beside a sweep on a Claude model and sends it only when it is not the policy's (so the bodies its specs pin are unchanged). + +### F3, as shipped (2026-10-13, lane B, `r28/quality`) + +| Commit | What | +| --- | --- | +| `48dbc5de` | `JobProgressMetric` `turns` / `cards` / `entries`; `TaskProgress`, `TaskDeps.progress`, `TaskHandle.progress`; `reportDraft.ts` wires `setProgress`; sweep-agent, revise-report, revise-video and research report turns, sweep-pipeline entries; the editor's bars label them; editor unit, MCP and `report-draft.spec` assertions | + +- `TaskDeps.progress?(p: {metric: "turns" | "cards" | "entries"; current: number; total?: number})`; a task calls `h.progress`, which never throws into it. The job maps it to `{metric, initial: 0, target: max(total ?? current, current), current}` — the runner's own `current`, as fetch-windows' clips. +- Agent tasks report every model turn against their turn cap (sweep-agent 150, the repair round counted on; revisions 30; research 60); a local revision's one batch is 1/1; sweep-pipeline reports the recordings gone through of its worklist (`entries`, from 0). The media tasks (narrate, phase 2's) are not wired here. +- `common/views/jobRowView.ts` imports the union (no re-spelling to change); `JobProgressBars.tsx`'s three records gained the metrics (Model turns ⇄, Cards ▤, Entries ≡). + +**Lane B's gates** (at `48dbc5de`; counts at the branch start → the tip): +- tsc clean (all packages) before every commit. +- common 4018 (1 failed at the start, not reproduced at the tip) → 4031/4031 (13 new); mcp 343 → 346/346; editor unit 288 → 290/290; `test:scripts` 860 + 3 skipped → 860 + 3 skipped. +- `docs cli|files|env --check`, `settings example --check`: clean. +- Editor build: the e2e prebuild's capped `next build` (heavy slot, 5 GB) at `48dbc5de`, clean. +- e2e `report-draft.spec.ts` (editor suite, alone): 3 passed, 0 failed, 17.8 s wall (after 40 s in the queue). +- umtool e2e `article-new.spec.ts` + `article-iterations.spec.ts`: 7 passed, 0 failed, 44.8 s (its prebuild's capped `next build` 35 s, clean). + +Not done here: the MCP's `sweep_plan` / `ask_plan` text (Claude Code's own /sweep) does not state `WHOLE_SENTENCE_QUOTE_RULE` (`mcp/src/instructions.ts` is not this lane's; one line where the claim-quotes and verbatim rules are). + ## Not in this release Comment and thread generation for social posts (X/Bluesky promotion); auto-publishing to YouTube (r28 writes the text