Repository navigation
Story-so-far setup, reviews with triage and rulings, and the studio - #10
Merged
Merged
Conversation
…s ledger Weaver's core stays deterministic: it builds work packets, a host (Claude Code interactively, or the `claude` CLI in batch) answers them, and Weaver validates and records the answers with the hashes of their inputs. - engine/host.mjs: runs the configured host with the prompt on stdin, WITHOUT ANTHROPIC_API_KEY in the child environment (so runs stay on the user's Claude subscription). Survives a host that exits early, times out a hung host, and retries once on a transient failure. Batch runs are concurrency-limited. Doctor warns when no host is available. - engine/packets.mjs: deterministic packet ids, JSON extraction, and one repair round for answers that fail validation; interactive `weaver packet` / `weaver submit`. - `weaver state bootstrap [--run]`: per-scene narrative-state records plus facts files for imported books, in reading order, resumable, and never auto-accepted (the author runs state:accept). Anti-invention rule: every fact must quote the scene verbatim, or the answer is repaired or skipped. After acceptance, imported books can release. - continuity/facts.json: a deterministic facts ledger (per character, in reading order, plus where each fact was first established), with a compact summary as packet context. Verified: npm run preflight (55/55) with a fake host covering the happy path through release, invented quotes, repair, retry, early exit, the API key never reaching the host, resume, and the interactive round trip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Session-Id: 04db4d93-9884-44ee-b28f-627e92b33731 Agent: claude-code
…ledger On a simulated 12-chapter book the three reviewer lenses caught what no script can (a character placed where canon says he never goes), but at about 10 findings per lens per chapter. The product is triage and memory. - `weaver review --chapter N [--run]`: continuity/style/critic packets. Continuity gets compact context (facts ledger plus the previous chapter's state records), not every earlier chapter. Paragraph-numbered text; each finding must quote its paragraph verbatim or it is dropped (and counted). Records carry prose and facts hashes and go stale when either changes. - `weaver findings`: one queue across style rules, voice and judgment, with stable ids. Judgment is triaged: definite findings, plus at most 2 items from a failing critic, capped at 6 per chapter; everything else becomes counted notes (--all). - `weaver rule <id> --decision fix|allow|intended`: decide once. An allow/intended ruling suppresses the finding while the passage is unchanged and lapses (with a note) when it changes. Allowing a blocking style finding is audited in check/approve output. `--to-fix` lists what the author wants repaired. Each ruling is its own commit touching only continuity/rulings.json. Verified: npm run preflight (60/60) with the fake host: review records, dropped invented quotes, repair, staleness, triage caps, stable ids, ruling suppression, lapse, audited blocking exceptions, fix resolution, per-ruling commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Session-Id: 04db4d93-9884-44ee-b28f-627e92b33731 Agent: claude-code
The author never uses a terminal or handles files, codes or Git. The
studio is a thin UI over the existing engine: every button calls the same
function as the matching command, through the same doctor refusal.
- `weaver studio [--port]`: node:http bound to 127.0.0.1 only, default
port 4187 (project.json "studio.port" optional). /api/health carries a
body signature. POSTs require X-Weaver-Studio: 1 plus a local Host.
Routes are allow-listed, there is no path traversal, and a restrictive
CSP; only packaged assets are served. Offline, no dependencies.
- Pages: progress ("N of M chapters approved since import"), a book
browser with paragraph numbers and finding markers, character pages
(voice evidence, facts timeline), places and threads derived from the
facts ledger and state records (wiki links and stable slugs), a triaged
findings queue with Fix / Intended / Allow, pending changes side by
side with Approve / Reject, history with Undo, and a doctor footer on
every page.
- Jobs: run a chapter review or the story-so-far setup from the page, one
at a time, with a live log tail.
Verified: npm run preflight (63/63): health signature, all pages, 404s,
POST protection, approve/reject/undo and rulings via the API asserted
against Git, wiki links, progress count, jobs with the fake host, a
127.0.0.1 bind, and the studio starting from the packed tarball.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Session-Id: 04db4d93-9884-44ee-b28f-627e92b33731
Agent: claude-code
MrPickering
marked this pull request as ready for review
September 28, 2026 22:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three slices, as three commits. Draft until two remaining checks are done: a real-Claude review run through the findings queue, and a studio polish pass.
S5a: story-so-far setup (host adapter, work packets, facts ledger)
claudeCLI in batch) answers them; Weaver validates and records the answers with their input hashes.ANTHROPIC_API_KEY. The host also survives early exits, times out, and retries once.weaver state bootstrap [--run]: narrative-state records and facts files for imported books. Every fact must quote the scene verbatim or it is rejected. Nothing is auto-accepted. After acceptance, imported books can release.continuity/facts.json: a deterministic facts ledger.S5b: reviews, triage, findings queue, rulings
weaver review --chapter N [--run]: continuity, style and critic packets. Continuity gets compact context, and every finding must quote its paragraph verbatim.weaver findings: one triaged queue across style rules, voice and judgment. Definite findings plus at most 2 critic items are queued, capped at 6 per chapter; everything else becomes notes.weaver rule <id> --decision fix|allow|intended: decide once. A ruling lapses when the passage changes, allowing a blocking finding is audited, and each ruling is its own commit.S7: studio (
weaver studio, 127.0.0.1:4187)X-Weaver-Studioheader and a local Host; routes are allow-listed; restrictive CSP. Port 4187 is allocated in the ops port registry.Verification so far
npm run preflight: 63/63 with a fake host.ANTHROPIC_API_KEY, so it succeeding proves the key is stripped. It stopped on system memory pressure and is resumable.continuity/rulings.json, and the count updated. POST without the header returns 403, a forged Host 403, and path traversal 404.Still to do before this leaves draft
review --runon a chapter throughfindingsandrule.🤖 Generated with Claude Code
https://claude.ai/code/session_011T6ux9Zwjx6YYPyHmFa375