Archilyzer · Source

archilyzer

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

commit d24e12baa87af92d3b5ddff09f30cb27b718da95
parent 9f000c4c60b9525edaca98c99eaf990334b7703b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 13 Oct 2026 13:04:15 -0400

plans: release 27 S6, as shipped — report-draft jobs, the GPU arbiter, settings.generation, caps

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

Diffstat:
Meditor/CHANGELOG.md | 4++++
Mplans/release-27.md | 24++++++++++++++++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog ## [Unreleased] +- **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). diff --git a/plans/release-27.md b/plans/release-27.md @@ -448,6 +448,30 @@ Gates: - editor unit 270/270; `test:scripts` 850 pass + 3 skipped. - No builds (no app code). +### S6, as shipped (2026-10-13, lane D) + +Editor jobs, settings and ops, on `r27/tasks-jobs` after S5. + +| Commit | What | +| --- | --- | +| `12a4f48c` | `controller/{reportDraft,gpuArbiter,generationUsage}.ts`; `lib/generationSettings.ts` + `settingsSchema`/`settingsDocs`; `queueKeys` `DRAFT_LOCAL_QUEUE`/`DRAFT_API_QUEUE`; job kind `report-draft`; `paths.generationUsageFile` (`GENERATION_USAGE_FILE`); `tasks/corpusCues.ts`; `ttsFile.ts` on the arbiter; the `report-draft` route, ACTIONS row, help, COMMANDS.md; `transpilePackages` gains the mcp package; the settings route refuses a key-looking `apiKeyFile` without echoing it; umtool's chain reads `generation.projectsRoot`; SETTINGS.md, settings.json.example, ENVIRONMENT.md; e2e `report-draft.spec.ts`; editor unit `_reportDraft.test.ts` | +| `0a637826` | no key-shaped literal in the key rule or its tests | +| (this commit) | this record; the CHANGELOG bullets | + +- **`pnpm ops report-draft {task, article, iteration?, model?, feedback?, question?, channels?, from?, to?, copyOf?, maxUsd?, source?, build?, cards?, force?}`** → `{ok, jobId, iteration}`. The controller (`enqueueReportDraft`) judges the body, picks the model (the asked one, else the task's route in `settings.generation`; a task routed to `code` with no model is refused), creates the iteration `queued` (a `copyOf` copies it; a narration names a done one and is a step), runs `runManagedFunction` on `draft:api` or `draft:local` by provider, and sets the iteration's `jobId`. A job cancelled or refused before it ran leaves no `queued` iteration behind (its `done` marks it). +- **The job** resolves the corpus (`source`, else `build`, else `pickCorpusBuild` over the channels — a revision's and a narration's from its report's citations) and the citation origin (the build's site, else `generation.citationOrigin`, else the project site), builds the corpus tools through `deps.corpusTools` (the route passes `createCorpusTools`; common cannot import mcp), and runs the S5 task with the job's signal. Cues for convert and the strict check come from the same build (`corpusCuesOf`: get_transcript with timestamps); post text and the post-channel lookup from the corpus on disk; the editor's `verifyReportQuotes` adds only a `drift` / `en-orig-drift` (a record the disk does not hold is the build's to answer). The log ends `@@report-draft {article, iteration, task, status, summary, usd, minutes}`; a failed or cancelled task fails or cancels the job. +- **The GPU arbiter** (`gpuArbiter.ts`): in-process holds (`holdGpu`) around each unit of work. Digests keep yielding to transcription (`digestYield`, unchanged); TTS (a GPU engine) waits for a transcription on a GPU worker and for a held draft call, and holds the GPU while its engine runs; a draft call waits for the transcription lane's signal and a held synthesis. A `draft:local` job's ollama config carries `gpuGatedFetch`: every `/api/chat` waits, then holds until the answer is read; the unload is never held. ollama is unloaded (`keep_alive: 0`) when a `draft:local` job ends, however it ends. `draft:api` touches none of it, nor the heavy slot. +- **Caps (D6).** A job's cap is `maxUsd`, else its task's (`caps.sweep` 5, `revision` 2, `narration` 1), refused above `caps.max` (10). The daily cap (`caps.daily` 20, UTC) is read from the usage ledger at the ask and again at the job's turn; past it, refused naming the day's total. A finished API job appends a row per model (job, article, iteration, task, model, tokens, USD, day) to `paths.generationUsageFile` (`<repo>/.generation/usage.jsonl`, gitignored; the e2e server's is in its fixture). A local job has no dollar cap. +- **`settings.generation`:** `preset` (named by the routes: the preset whose routes they are, else `custom` — choosing one is writing its routes), `routes`, `models {api, local, extractor}` (Sonnet 5.5, qwen3:8b, Haiku 4.5), `caps`, `cacheTtl`, `apiKeyFile` (a key-looking value is the default path, never stored; the ops settings route refuses it without echoing it), `anthropicBaseUrl` (a non-Anthropic base never receives the environment's key, only the file's), `ollamaUrl` (blank = the editor's `OLLAMA_URL`), `projectsRoot`, `web {provider, searchUrl}`, `citationOrigin`. `generation.research` is S11's. +- **Decided here:** the ledger is a JSONL file, not a registry store (one line per model per job; the day's total is a scan). The daily cap refuses at the ask and at the turn; a job already running is not stopped by it (its own cap stops it). + +Gates: +- tsc clean (all packages). +- common 3976/3976 (10 new beyond S5: `gpuArbiter.test.ts` 4, `generationSettings.test.ts` 4, `generationUsage.test.ts` 1, the corpus-cues test); mcp 323/323; editor unit 276/276 (6 new, `_reportDraft.test.ts`: the body, the refusals, an API sweep to done with its ledger rows, the daily cap, a cancel mid-request, a local narration with its unload); `test:scripts` 851 pass + 3 skipped (the chain's projects-root test new). +- `docs env|files|cli --check`, `settings example --check`: clean. +- Editor build: the e2e prebuild's capped `next build` (heavy slot, 5 GB) at `12a4f48c`, 72 s, clean. (A standalone `next build` waited 33 min under the 6000 MB floor at 5.1–5.5 GB available and was stopped; the e2e run's build is the same app.) +- e2e `report-draft.spec.ts` + `digest.spec.ts`, one run: 18 passed, 0 failed, 41.5 s (report-draft 3 in 0.6 s, digest 15 in 21.2 s). The first attempt timed out in the heavy-slot queue and was re-run. + ## Rollout - Fast-forward `main`.