Changelog¶
Unreleased¶
1.0.0¶
- The local SearXNG in
examples/searxng/is now pinned by image digest instead oflatest: the build it was tested with by hand on 2026-11-21 (the container went healthy, the adapter searched against it, and a default instance gave the expected 403 withoutjson). It no longer updates itself; the docs say how to move the digest. A test keeps it pinned. - A documentation audit against the code (A10) found and fixed claims that had gone stale: the README and
llms.txtsaid the writing was still placeholder text and the MCP server was in-memory only,CONFIGURATION.mdandARCHITECTURE.mdsaid no run could be started through the API, SDK or MCP and that snapshots, budget guards and more MCP tools were not built,NOVELS.mdsaid a novel stops after the draft,RELEASING.mdsaid no image was published, andTROUBLESHOOTING.mddescribed a table race and an import path that no longer exist.INTERACTIONS.mdnow listsei serve mcp,ei run grantanddeny,ei doctor,ei acpand thegrant_runanddeny_runtools,TESTING.mdlists the toolchain, canary and nightly-evaluation gates, and the README links the docs it had left out, including the threat model. - A test now fails when the documents drift from the code: every
EI_*variable the code reads must have a row in the new index indocs/CONFIGURATION.md(and the index may name nothing unused), and every command in the frozen CLI tree and every MCP tool must appear indocs/INTERACTIONS.md. It found two commands that were documented only on their own pages,ei skills importandei plugins import, which are now in the reference too. Two more tests pin criteria A4 and A5: a book run killed after each of its stages, for both a non-fiction book and a novel, must resume to the same chapters, the same model calls and the same spend as an uninterrupted run, and a property test shows no order of reserving, settling, overrunning and releasing can take a run's spend past its cap. ADR 0003's A8 now says what CI enforces: one global 100% threshold, not one per layer. - The front-door documents are rewritten to one pattern, described in the new
docs/STYLE.md: the bottom line up front, a short scene in which Professor Feynman (a fictional teacher) teaches his student Daniel the one idea the page turns on, then the exact reference.README.mdnow opens with the one install command and the one command that writes a book, and its quickstart isei book create, not the placeholder pipeline.docs/GETTING_STARTED.mdgoes install, check, author profile, first book, then the optional stack. The newdocs/AGENTS_DRIVING.mdgives the exact instructions for an agent with a shell, the Claude Code skill, and the MCP path with its real prerequisites and limits;llms.txtis rebuilt to index every document and the newllms-full.txtis those instructions in one file for a model. Tests now fail a teaching page that lacks its bottom line or its scene, a relative link or heading anchor that goes nowhere in any tracked Markdown file (this found and fixed two broken links), an install command that differs between pages, and an index that omits a document. The remaining pages are listed in the test as still to be rewritten. - Thirteen reference and model pages now follow the documentation pattern (bottom line, a scene, the reference): INTERACTIONS, CONFIGURATION, ARCHITECTURE, COMPATIBILITY, EVALUATION, LOCAL_MODEL, MODEL_CALLS, MODEL_CATALOG, MODEL_PROFILES, LIVE_SMOKE_TEST, NOVELS, PROMPTS and RESEARCH. An independent audit of the new text against the code corrected several statements that were too strong, among them that the research stage's "cite only what you read" rule is an instruction and not a check, that the evaluation bar is on each dimension's mean and the judge is only named separately, and that a model's price is looked up once when the process starts. The reference gained what it lacked: the brief's fields, the REST error codes for runs and budgets, every
ei booksubcommand's flags, the exit codes ofei run create,runs,grantandserve, the rubric's dimensions, the author profile's limits, and a table of all nineteen prompt templates (the page said seventeen). Tests now hold the brief table to the contract, every flag of every command to the interfaces page, the template table to the folder, and the rubric's dimensions to the evaluation page.CONFIGURATION.mdhad two headings named "Limits to know"; the first is renamed so each has its own anchor. - The "Status: alpha, and honest about it" notice is removed from the top of the README, and the matching alpha and never-run-against-a-live-model sentences are removed from
llms.txtandllms-full.txt. The README's Limitations section and the per-feature status paragraphs on the technical pages are unchanged. - The documentation site's navigation is reworked. The top bar had seven groups, and its menus were transparent, so the text of the page showed through their items. It now has five groups (Start, Writing books, Reference, Operating and Project; the separate Quality group is part of Operating). Each menu has a solid background in the colours of the current theme, and a long menu scrolls. The "Edit on GitHub" link is removed: it pointed at
docs/<name>.md, which is not where the pages come from. Checked in a browser at desktop width in both themes, and pinned by tests. - The documentation site's tables are fixed. The Vibey stylesheet keeps every table cell on one line and leaves the text colour of the odd rows unset, and the site's own stylesheet broke code at any character, so a table such as "What you get" showed black text on a dark background in alternate rows and a first column one letter wide. Every row now takes the table's own text colour, cells wrap their prose, and a wide table scrolls inside itself. Checked in a browser on all 44 pages: no dark cell and no horizontal page overflow. A test pins the rules so a stylesheet edit cannot bring it back.
- The documentation is now also built as a website from the same Markdown, so there is one copy to keep true.
scripts/build_docs_site.pyassembles the pages (a clean address for each, links rewritten so a link to another page works between pages and a link to anything else points at that file on GitHub, a page listing the decision records,llms.txtandllms-full.txtand arobots.txtat the root), ProperDocs builds them with warnings as errors so a link or heading that goes nowhere fails the build, andscripts/inject_docs_meta.py, adapted from Vibey's, adds each page's description, canonical address and Open Graph and Twitter tags and the home page'sSoftwareApplicationdescription. The Vibey stylesheet comes from the lockedvibey-enginepackage at build time. A newdocs.ymlworkflow builds on every pull request that touches the documents and, ondevelop, publishes to GitHub Pages only when the repository variablePUBLISH_DOCSistrueand Pages is switched to GitHub Actions; there is no analytics. Vibey's ownrelease-surfacesworkflow was not adopted whole because it also pushes the wheel to GHCR on every release run, which would bypass the gating on image publishing. Nothing has been published and the workflow has not yet run on GitHub: the build and the metadata step were run locally and the pages were looked at in a browser. See DOCUMENTATION_SITE.md. - The last eight teaching pages now follow the documentation pattern (bottom line, a scene, the reference): TOOL_LOCK, SKILLS, PLUGINS, WORKER_IMAGE, TESTING, RELEASING, TROUBLESHOOTING and CONTRIBUTING. The tool lock, skills and plugins pages each gain an at-a-glance table, as they had no table at all. TROUBLESHOOTING gains the symptoms a first book run meets: an
--outthat is not empty, a failedbuildstage naming a TeX tool, a missing author profile, a run that stopped for budget, and each failureei doctor --readyreports. Every teaching page now follows the pattern, so the list of pages still to be rewritten in the test is empty. An audit of these pages against the code corrected several statements before they shipped, and one of them was advice in pages already merged: a run that ends in failure (exit 1) is final, soei book create --resumereturns it as it is and does not retry it, which the getting-started page, the agent instructions, the Claude Code skill,llms-full.txtand the README had implied it would. The pages now say what a failed run leaves (every chapter, exported to--out) and what to do instead. Also corrected:ei plugins showprints each skill's text cut to 100 characters and no reference sections, a skill file may be 256 KiB, not 64, the worker image is run withbook build, a merge tomaincreates the tag and GitHub release before any upload variable applies, and the troubleshooting rows now quote the exact messages the CLI prints. ei doctor --localchecks the free local model (M6.6): that something answers atEI_LOCAL_URL, that the model is pulled (namingollama pullif not), one tiny real completion (free, on this machine; an empty reply fails, because a reasoning model can spend its whole cap before it writes), and that the context length Ollama loaded the model with is at least the 32,768 a prompt is assembled to fit (namingOLLAMA_CONTEXT_LENGTHif not). A server that is not Ollama passes on its answer alone. Exit 0, 1 or 2 as for the other checks, and it runs on its own, not with--modelsor--search. It was run once against a real Ollama; the rest is tested against local fakes.- The process runner's memory meter no longer depends on
PATHto findps. It lookedpsup on thePATHof the process being run, so a tool started with a restrictedPATHcrashed the runner withFileNotFoundError: 'ps'the first time it lasted past the half-second sampling interval, and apsplanted on thatPATHwould have been run in its place. It now runspsfrom/binor/usr/bin, and falls back toPATHonly when neither has it. This surfaced as three intermittent failures in the visual-QA rasterizer tests, which give a fakepdftoppmaPATHof its own and failed whenever the machine was busy enough for the fake to outlast one interval. - Three bugs found by the documentation audit are fixed. An unknown pipeline stage is now refused where every interface validates the request:
POST /v1/pipelinesanswers 422 naming the real stages (the audit read it as a 500 before), andei pipeline start --stagerejects it as a usage error instead of printing a traceback; a blank--slugor--titleis likewise one line and exit 2.ei book createnow checks that--outis a new or empty folder before any stage runs, where it used to find out only when writing the book at the very end; when resuming into a folder that already holds an earlier export it says how to continue into a new folder with--state-dir.ei doctor --readyruns each of its parts on its own, so a part that cannot start (a missing extra, an unusable setting) is one failed line and no longer hides the others, and it skips the local model, saying so, whenEI_STAGE_EXECUTORis notlocal. - Saving the tool lock no longer writes through whatever is at its temporary name. It used to write to
.NAME.tmpbeside the lock, so a link left or planted there could redirect the write to another file. It now removes a stale file or link first and creates the temporary file new, refusing to follow a link, as the skill and plugin locks already did. The lock is still replaced whole or not at all. - The default is now free (M6.6): with
EI_STAGE_EXECUTORunset, a run's stages are written bygpt-oss:20b(Apache 2.0) on your own machine through Ollama, with a SearXNG athttp://127.0.0.1:8888for research, no key and no cost. It was chosen by running the installed candidates on one 24 GB laptop over three book-copy tasks, which is a small test; seedocs/LOCAL_MODEL.md.EI_LOCAL_MODELandEI_LOCAL_URLpoint at another model or server;EI_STAGE_EXECUTOR=modelstill means a model of your own with a profile and a price, anddeterministicthe offline placeholder, which the example compose stack now sets because a container cannot reach the host. A profile may setreasoning_effort(low,medium,high) for an openai_compatible server, so a model that reasons does not spend a stage's whole token cap before it writes. Building the executor contacts nothing, andei doctordoes not yet check the local server, the model or its context size. - One command now installs what a book needs:
install.sh, run ascurl -fsSL https://raw.githubusercontent.com/adammatthewsteinberger/engineering-influence/main/install.sh | sh. It installsuvif missing andeiwith the extras a book needs, Ollama and the free local model, the TeX tools the build stage calls, a local SearXNG when Docker is present, and a starter author profile it never writes over, then runs the newei doctor --ready. It supports macOS with Homebrew and Linux with apt-get, takes--dry-run,--skip-model,--skip-tex,--skip-search,--with-claude-skilland--version REF, and has been run for real only as a dry run on macOS; the Linux path is tested against stand-in tools.ei doctor --readyanswers whether this machine can make a book now: it checks the extras, each build tool, the author profile (--author-profile, elseEI_AUTHOR_PROFILE), the local model and the search, and prints every check in one run.ei doctor --searchnow checks the SearXNG at its default address when nothing is configured and the free local model is in use, because that is the search such a run falls back to. A starter profile (examples/author-profile.example.toml) and a Claude Code skill (examples/claude-code/engineering-influence/SKILL.md) are included, andei serve mcpwith a missing module now names themcpandruntimeextras. - There is now a way to try the whole non-fiction pipeline against a real model, with a spending limit you set in advance.
tests/paid/test_live_smoke.pyis apaidtest (it never runs by default and refuses to start withoutEI_ALLOW_PAID=1) that drives all eleven stages in one process with in-memory adapters, so it needs no database, queue or worker. It requiresEI_SMOKE_BUDGET_MICRO_USD, which has no default, uses a made-up author, and writes every artifact and asmoke-report.json(per-stage outcome, attempts, cost and time) to a folder even when the run fails. The same driver runs in the normal suite against a scripted local server, as a free rehearsal of the chain, the retry loop and the budget stop. Seedocs/LIVE_SMOKE_TEST.md. Nothing here has yet been run against a live model; that is for you to do with your own key. - The worker image now includes
procps, which providesps. The slim image did not, so the process runner's memory meter failed there withFileNotFoundErroron the first tool that ran past one sampling interval, and a TeX or EPUB build could stop mid-run. Built and checked in the slim image: the meter now reads a process group's memory. A missingpsis now a clear build error that names the package to install, rather than a crash. The troubleshooting page has a table of the error codes a person is likely to meet, each with its message as the code prints it and what to do, and the remaining codes are named as internal in a test that fails when a new code is added without a decision. A test pins the packages the Dockerfile installs to the packages the worker image page describes, and the CI toolchain's package list to the same set. - The package is now a strict onion, and the rules are enforced by the build. Layers, from the inside:
errors,models,contracts,interfaces,services, thencontrollers,repositoriesandinfrastructure, theninteractions, thenruntime, the only layer that builds concrete classes (docs/adr/0006-onion-layers-and-interfaces.md,docs/ARCHITECTURE.md). Every folder has aninterfaces/folder, there is one class per file, and every class implements an interface;lint-importsand nine zero-tolerance architecture tests check it, and tests pass fakes instead of patching production code. This summarises them1-r*entries below, which carry the detail.
Breaking, for code that imports internals: domain is now models, interaction is interactions, every *Port is a *Interface, and engineering_influence.publishing is gone, its classes redistributed across the layers (scripts/refactor/move_map.toml maps every old module to its new one). Cover plugins import from engineering_influence.covers. The ei command, the REST API, the MCP tool, the SDK and the entry-point group engineering_influence.covers are unchanged, and the generated OpenAPI document, the MCP tool list, every CLI help page and the fixture book's typeset pages and EPUB members are identical to before the restructure.
- Added ADR 0006 (onion layers, interfaces and one class per file), the move map for restructuring every class (scripts/refactor/move_map.toml), a class inventory script, and architecture ratchets that hold each unmet structural rule at its current violation count so it can only improve. No code moved and no behaviour changed.
- Renamed the domain package to models, the interaction package to interactions, and the 20 *Port interfaces to *Interface (modules *_port.py become *_interface.py). Code that imports engineering_influence.domain, engineering_influence.interaction or a *Port class must switch to the new names. The ei command, the REST API, the MCP tool, the SDK and the cover-plugin API are unchanged, and no behaviour changed: the OpenAPI document, the MCP tool list, every CLI help page and the wheel contents match the previous build apart from these paths.
- Gave the remaining classes their interfaces, so every class in the package now has one: 44 new …Interface modules for the adapters in infrastructure/ (33, including the cover painter toolkit), the transports in interactions/ (6) and the composition code in runtime/ (5), built under the same rules as before (methods only, __slots__ = (), type-only imports). A class that already implements a port or another class's interface, such as ConstantTimeApiKeyVerifier, the Traced* services and the RabbitMQ adapter, keeps that one and gets no second interface.
The SDK package follows the same rules: EngineeringInfluenceClient and AsyncEngineeringInfluenceClient inherit EngineeringInfluenceClientInterface and AsyncEngineeringInfluenceClientInterface (in engineering_influence_sdk.interfaces), with identical constructors, methods and signatures, and the same __all__. The built SDK wheel ships the new package and still installs and imports on its own. A new architecture test holds the SDK to the interface rules and checks that each client's signatures match its interface.
Tidied two things from the previous step. SqlModelLedger and SqlModelOutbox had been given a redundant second interface on top of the port they already implemented; those two generated modules are gone, and the tables they create are unchanged, statement for statement. LedgerRepositoryInterface is a port that extends LedgerInterface, so it moved to engineering_influence.interfaces.ledger_repository_interface; as with the earlier internal moves there is no alias. The generated REST schema, the MCP tool list and every ei help page are byte-identical.
The architecture ratchets for classes without an interface, layer crossings, interface-rule breaks, unpaired interfaces, effectful imports and model purity are all at zero.
- Breaking: removed the engineering_influence.publishing package. Its sixteen cover modules (engineering_influence.publishing.covers.{box, box_blur, compositing, cover_builder, cover_layout, cover_painter, cover_plugin, cover_plugin_loader, cover_style, film_grain, ink, painter_registry, quiet_zone, soft_rect, starfield, value_noise}) and engineering_influence.publishing.project_layout were compatibility shims that warned and re-exported the real classes; they are gone, with no deprecation period. Import the same names from engineering_influence.covers (CoverPainter, CoverPlugin and ProjectLayout are there too). They are the same classes, so a private cover plugin only needs its import lines changed; one that loaded 16 lines across three files from the old paths loads again, with all its styles, once they point at engineering_influence.covers.
Every architecture rule in tests/architecture/ now holds with no exceptions, so the tolerance file that allowed a fixed number of violations (ratchet.json) and its update switch are removed. test_rules.py asserts that each of the nine rules has zero violations everywhere, and that none has been dropped from the metrics: a class without an interface, an import that crosses layers, a file outside the layers or an interface that breaks the declaration rules fails the build. The generated REST schema, the MCP tool list and every ei help page are byte-identical.
- Tests now pass fakes into the classes that take their collaborators instead of patching production classes, wherever the code already allowed it: the controller and ei book tests inject fake LaTeX, EPUB, cover, verifier and renderer collaborators, the publish-step tests inject a fake EPUB verifier, the MCP test overrides build in a subclass, and the cover-plugin loader tests pass an entry-point lookup. That took the monkeypatch.setattr calls from 33 to 21; what remained were standard-library or test-local patches and nine production targets that the class under test built itself, which the next step injects. A new architecture test fails the build on any new patch of production code.
Three small seams make that possible, all optional and defaulting to the previous behaviour: CliRuntime(publishing=...) takes the factory that wires the ei book commands, CoverPluginLoader(discover=...) takes the entry-point lookup (CoverPluginLoader() is unchanged for existing callers, including the public cover API), and PublishPipelineProvider takes the EPUB verifiers from PublishingControllerFactory rather than building them. The generated REST schema, the MCP tool list, every ei help page and the wheel's file list are unchanged.
- Removed the last nine test patches of production code by passing the collaborators in through constructors, so no test patches a production class any more; the only patches left are standard-library calls at the system boundary and one class a test defines itself. PublishingController and PublishSteps now receive a BookBuilderInterface and a PdfVerifierInterface instead of building BookBuilder and PdfVerifier themselves, and the controller no longer takes the LaTeX compiler, build workspace and package assets that only existed to build the book builder. PublishingControllerFactory builds each once and gives the same instance to the controller and to PublishPipelineProvider. CoverBuilder takes optional image, ebook and print-PDF verifiers, and EbookCoverVerifier, PrintPdfVerifier and CoverRenderer take KDP's size and text limits as constructor arguments that default to KdpCoverSpec, so a test passes a tiny limit instead of editing the spec. ApiRuntime takes an optional queue, and ServeStarter takes optional runtime factories for its default runners; its imports stay lazy.
Every default is the previous behaviour, and none of these classes is part of the public API. The generated REST schema, the MCP tool list, every ei help page and the wheel's file list are unchanged. Not every pure helper is injected yet: the controller still builds the audit classes and EpubVerifier still builds its own checks, because no test has to replace them. The architecture test now lists only the system boundary, and its two tests are renamed to match (test_tests_patch_only_the_system_boundary and test_the_boundary_list_has_no_stale_entries).
- Moved object composition out of the interactions and into runtime/. ApiApplication(controller, guard, observability) and McpApplication(controller) now take a project controller instead of a ledger and queue, CliApplication and ServeCli receive their collaborators, and VibeyPhaseHandler takes a RunPhaseInterface. The ei entry point is now engineering_influence.runtime.main:main, the CLI application class moved to interactions.cli.cli_application, and webhook delivery and signing moved from interactions.webhooks to infrastructure.webhooks (a new WebhookSignerInterface lets the inbound verifier stay in the interactions). lint-imports now enforces a strict layers contract. The ei command, the REST API, the MCP tool and the SDK are unchanged.
- Moved the 35 audit, check and report classes at the top of engineering_influence.publishing into the layers: models, services and one adapter now live under models/publishing/, services/publishing/ and infrastructure/publishing/ (for example ProjectConfig, ProjectLayout, BookAuditor, PdfVerifier). The publishing ReadinessReport is now ReleaseReadinessReport, so it no longer shares a name with the health-check ReadinessReport. engineering_influence.publishing.project_layout is removed; import ProjectLayout from engineering_influence.covers or engineering_influence.models.publishing.project_layout. The ei command and its output are unchanged.
- Seven publishing services no longer read files or PDFs themselves. A new ManuscriptSourceInterface (existence, text and Markdown listing) and a new PdfInspectorInterface (a PdfDocument of plain page facts, and a page count) sit between them and the file system, pypdf and pdfplumber; FilesystemManuscriptSource and PypdfPdfInspector are the adapters. BookAuditor, ReleaseAuditor, PdfVerifier, PublishingController, PublishPipeline, PublishSteps and BookCli now take those two collaborators as constructor arguments, and the PDF checks work on PdfDocument and PdfPage instead of library objects. The ei commands and their output are unchanged.
- Moved the 21 typesetting classes out of engineering_influence.publishing.typesetting into the layers: errors/typesetting (BookBuildError, ManuscriptError), models/typesetting, services/typesetting (the Markdown-to-LaTeX converters and BookBuilder), repositories/typesetting (BookLoader, ChapterLoader) and infrastructure/typesetting (LatexCompiler, ToolEnvironment). PathRelativizer and RunningHead, which the loaders share, are now models. BookBuilder takes its loader, compiler, workspace and assets as BookLoaderInterface, LatexCompilerInterface, BuildWorkspaceInterface and PackageAssetsInterface arguments, and PublishingController takes them too; a new PublishingControllerFactory in runtime/ builds them for ei book, so no layer below runtime imports an adapter. PackageAssets(override) can serve a directory of your own. The ei commands and their output are unchanged.
- Moved the 28 EPUB classes out of engineering_influence.publishing.epub into the layers: models/epub (EpubContents, XhtmlPatterns, and a new CoverDeclaration for the cover's file name, id and size floor), services/epub (the document builders, the checks, EpubBuilder, EpubVerifier and EpubRepacker) and infrastructure/epub (EpubArchive, CoverImage, EpubcheckRunner, Tex4ebookCompiler, plus the new EpubCoverInspector and ZipEpubPackage). The services no longer open archives or images themselves: they use new EpubCompilerInterface, EpubArchiveReaderInterface, EpubcheckInterface, EpubCoverInspectorInterface, EpubPackageInterface and EbookCoverInterface ports, and BuildWorkspaceInterface gained prepare_ebook and ensure_directory. EpubBuilder, EpubVerifier and EpubRepacker take their collaborators as arguments, PublishingController takes a finished EpubBuilder and EpubVerifier instead of building them, and PublishingControllerFactory wires the real ones, so the controller no longer imports an adapter. CoverImage.NAME, ID and MIN_PX are now on CoverDeclaration. The EPUBs ei book epub and ei book publish write, and the ei commands and their output, are unchanged.
- Moved the 35 cover classes out of engineering_influence.publishing.covers into the layers: models/covers (Box, CoverLayout, CoverStyle, KdpCoverSpec, and the layout and style rules LayoutFactory, LayoutCheck, BuiltinCoverStyle, TextRecorder), infrastructure/covers (the painter toolkit, typesetters, renderer, files, verifiers, PainterRegistry, CoverPluginLoader and CoverBuilder) and interfaces (the plugin contracts, now CoverPainterInterface and CoverPluginInterface). New BookSlug and CoverBuilderInterface keep the controller and the services from importing the cover adapters. PublishingController now asks a CoverBuilderProvider (built in runtime/) for its builder when covers are first needed, so cover plugins still load lazily.
Removed (breaking): the sixteen modules a private project imported from, engineering_influence.publishing.covers.{box, box_blur, compositing, cover_builder, cover_layout, cover_painter, cover_plugin, cover_plugin_loader, cover_style, film_grain, ink, painter_registry, quiet_zone, soft_rect, starfield, value_noise}, and engineering_influence.publishing.project_layout no longer exist, and neither does the engineering_influence.publishing package. Import the same names from engineering_influence.covers instead (CoverPainter and CoverPlugin keep their names there, and ProjectLayout is there too). They are the same classes, so an existing plugin and its isinstance checks work once its imports are changed. The other nineteen modules in that package were internal. The covers ei book covers and ei book publish write, and the ei commands and their output, are unchanged.
- Moved the last 19 classes of engineering_influence.publishing into the layers: page QA into models/qa (PageRecord, RenderReport, PageFileNumber) and infrastructure/qa (RenderQa, PageRasterizer, BlankPageDetector, ContactSheetBuilder), and release evidence into services/release (PublishPipeline, PublishSteps, FormatPolicy, ReleaseSummary, PageLimitCheck), repositories/release (ArtifactInventory, FileDigest, JsonReport, StepRecorder) and infrastructure/release (GitState, ToolVersions, EpubZipCheck). The bundled LaTeX classes, stylesheets and fonts moved to infrastructure/publishing/assets/ beside PackageAssets, which finds them; a wheel still ships all 17 files.
PublishPipeline and PublishSteps no longer read the clock, run git, open archives or build their own helpers: they take ClockInterface, RenderQaInterface, ArtifactInventoryInterface, JsonReportInterface, StepRecorderInterface, GitStateInterface, ToolVersionsInterface, EpubZipCheckInterface and EpubVerifierInterface arguments, and read PDF page counts through PdfInspectorInterface. PublishingController takes a RenderQaInterface and a PublishPipelineProviderInterface; a new PublishPipelineProvider in runtime/ builds the pipeline when publish starts, so cover plugins still load at that moment, even for --audit-only. With that the controller imports nothing from the old publishing/ package, and the temporary import-linter exceptions for it are gone: all three contracts pass with no ignored imports. BuildWorkspaceInterface gained ensure_tree.
One visible detail: when ei book runs without the publishing extra, the error still says how to install it and names the first missing library, but which library that is can now differ (for example markdown_it instead of PIL), because the controller no longer imports Pillow first. The ei commands, their output and the reports they write are otherwise unchanged.
- Gave every class in errors/, models/ and contracts/ an interface: 45 new …Interface modules, each beside its class in the layer's interfaces/ folder, and each class now inherits its own. The interfaces declare methods only (never fields, so dataclasses, pydantic models and exceptions behave exactly as before), set __slots__ = (), and import models and contracts only for type checking. The four enums (GateKind, JobOutcome, PhaseState, PipelineStage) get runtime_checkable Protocols instead, because an enum cannot inherit an ABC, and a new architecture test checks every member against its Protocol. The generated REST schema, the MCP tool list and every ei help page are byte-identical.
The 27 existing interface modules now follow the same rules: each declares __slots__ = (), and the 11 that imported a model or contract at runtime import it for type checking only. That removes the last six layer-crossing imports, so the layer-crossing ratchet and the interface-rule ratchet are both at zero.
Renamed the gate-evaluation port GateInterface to GateEvaluatorInterface (module engineering_influence.interfaces.gate_evaluator_interface), so that GateInterface can be the interface of the Gate model. Code that subclasses or imports the port by its old name must use the new one; like the earlier *Port renames, there is no alias.
- Gave every service, controller and repository an interface and made each inherit it: 70 new …Interface modules, each beside its class in the layer's interfaces/ folder (services/<group>/interfaces/, repositories/interfaces/, controllers/interfaces/). They follow the rules set in the previous step: methods only, __slots__ = (), and models, contracts and type aliases imported for type checking only, with annotations and defaults copied verbatim. The two SQLModel ledger and outbox tables inherit theirs too; the tables create_all() builds are unchanged, statement for statement. The generated REST schema, the MCP tool list and every ei help page are byte-identical.
The interfaces that already existed for ProjectController, DispatchOutbox, ProcessJob, ReadinessProbe, RunPhase and StartPipeline are untouched. Services still construct their own pure helper services (for example EpubVerifier builds its checks); passing those in as interfaces is a separate, later change. The 44 classes left without an interface are all in infrastructure/, interactions/ and runtime/.
- Added the first versioned contracts. contracts/brief/v1 holds BookBriefV1, the document that starts a book run: a kind (nonfiction or novel), an idea and a required spending cap in micro-dollars, with an optional title hint, audience, target length, trim size and language; unknown fields, a second schema version and a missing budget are refused. contracts/book_config/v1 formalises what BookLoader reads from books/<slug>.toml (source, front, parts, back, not_in_book, each entry a bare file name or a table with a style), keeps every other key as metadata, and is tested to order a book exactly as the publisher does. Broker messages now carry schema_version: 1; a message without it is read as version 1 so messages already queued when a worker upgrades still parse, and any other version is refused. Planned for a later pre-1.0 release, and not part of this change: the public project request will stop taking PipelineStage names once ei book create replaces them, which will change the REST schema, the SDK and the MCP tool.
- Added the first pure models for the 1.0 book pipeline (M2): BookKind (nonfiction or novel), QualityIssue and GateVerdict (what a gate found, with a failed verdict required to say why and a passing one barred from carrying a blocker), Budget (a spend cap in integer micro-dollars where a call reserves its worst-case cost first, so spent plus reserved can never pass the cap) and DegradeLadder (an ordered list of cheaper fallbacks a run steps down, never back up). They live in engineering_influence.models, each with its interface, and nothing uses them yet; the pipeline, the API and the CLI behave as before. A Hypothesis property test checks that no interleaving of reserves, settlements and failed calls can overspend a budget.
- Added the pure models a book run is built from: BookBrief (an idea, a kind of book and a required spending cap, with optional title hint, audience, target length, trim size and language), StagePlan, BookRun with its RunStatus (pending, running, parked for credit, completed, failed, cancelled), SourceRecord and StoryBible, each with its interface and move-map entry. A run is an immutable value: every change returns a new one, so a repository can store each step and a resumed run picks up where the last stored one stopped. Nothing consumes them yet.
- Added AdvanceRun, the service that moves a book run one stage at a time and is safe under redelivery, retries and crashes. A delivery names a run, a stage and an attempt: the current stage executes through the new StageExecutorInterface port, the run is saved, and the next stage is queued as a run.advance job. A message for a stage the run has already passed is skipped, a message for the stage just before the current one means a worker saved the advance and died before queueing the next stage, so the current stage is queued again, and a message for a later stage is refused. Failures are sorted by the new FailureClassifier into retry (TransientStageError, timeouts and dropped connections, up to a limit, then the run fails with a blocking retries-exhausted issue), park (CapacityExhaustedError parks the run on the same stage until it is resumed) or stop (anything else fails the run and records the error type and message, cut to 200 characters). The budget's spent is recomputed from the run journal after every attempt, so a crash cannot lose the cost of a call that happened and a replayed call is never counted twice. BookRun gains start(), and the new AdvanceOutcome and StageReport models describe a delivery's result and what a stage reports. Two deliveries of one stage can overlap, so every change to the run goes through a new swap on RunRepositoryInterface, which stores a replacement only if the stored run is still exactly what the delivery read (the SQL version is a single conditional UPDATE on the stored document, so it needs no new column or migration); the delivery that loses reports SKIPPED and neither overwrites the winner nor queues anything, so duplicates cannot compound. If the journal ever records more than the cap, the run fails with a blocking budget-exceeded issue instead of raising and being redelivered forever, and Budget now raises BudgetExceededError for that case too. A crash-injection test drops a save or an enqueue at every point and checks that the run still finishes with every artifact and the exact spend. Nothing runs it yet: wiring it into the worker comes with the model-backed stages.
- The database schema is now owned by Alembic instead of create_all(). The migrations ship in the wheel, and a new command, ei db upgrade, applies them to EI_DATABASE_URL (it needs the runtime extra, prints the revision it reached and never prints the connection string). The baseline creates the ledger, outbox, run, journal and artifact tables, and creates only the ones that are missing, so a database made by the earlier create_all() is adopted with its rows intact. The API and the worker no longer create tables: they check the revision at start-up and exit with the database schema is not at the latest revision; runei db upgrade`, which removes the race where both created the schema on first start. **Breaking:** the SQL repositories no longer create their tables or default to an in-memory database, so anything that embeds them must run the migrations first, and an existing deployment must runei db upgradebefore starting a new release. The compose file gains a one-shotmigrateservice that the API and the worker wait for. A test builds the schema from the migrations and fails if it differs from the SQLModel models, so a model change without a migration fails the build. ADR 0006 exemptsinfrastructure/migrations/from the one-class-per-file rules, because an Alembic script is a module of functions by contract.
- Added the artifact store. A new port,ArtifactStoreInterface(put, get, names), keeps the files a run produces underrun id / name, and has three implementations: in memory, on a local directory, and in the database for workers that do not share a disk. Artifacts are write-once: storing the same bytes again is accepted and returns the same SHA-256, while different bytes under a used name raise the newArtifactConflictError, so a stage that is not deterministic is caught instead of silently replaced. The directory store writes to a.partfile and renames it, so a crash never leaves a half-written artifact under its real name, and it resolves symlinks through the path guard so a planted link cannot lead a write outside the store's root.ArtifactAddressrefuses names that are absolute, climb with.., or use backslashes. Nothing uses the store yet.
- Added the first M3 building blocks, all pure and not yet consumed:BudgetExceededError,FailureKind(transient, capacity, unrecoverable, which decides between retrying, parking a run for credit and stopping), and the journal'sJournalKeyandJournalEntry. A key is the model snapshot, parameter hash, prompt version and context hash of a request, and its SHA-256 digest is stable and separator-safe, so a resumed run can find the answer a repeated request already got instead of paying for it again.Budgetnow raisesBudgetExceededErrorwhen a reservation does not fit or a call cost more than it reserved; it is aValueError, so existing handlers keep working.
- Added integration tests that run against a real PostgreSQL and RabbitMQ, a newintegrationCI job, and a state-machine property test.tests/integration/stack.sh up|env|downstarts both services in Docker with random credentials (eval "$(sh tests/integration/stack.sh up)", thenuv run pytest -m integration tests/integration); theintegrationmarker is deselected by default, the tests skip when the stack is not running, and the CI job setsEI_REQUIRE_INTEGRATION=1so a missing stack fails instead of passing with nothing tested. They check that the migrations build exactly what the models describe on PostgreSQL, that threads racing to change a run, record a journal entry or store an artifact leave exactly one winner, that large binary artifacts round-trip, that jobs are consumed, dead-lettered and redelivered through the broker, and that a book run finishes through both services with every artifact byte-identical, spend exactly equal to the journal and nothing dead-lettered, whether a worker dies before storing a change, before queueing the next stage or before acknowledging, and that a run parked for credit resumes through the real broker. A Hypothesis state machine drives random deliveries, duplicate deliveries, failures, resumes and cancels in memory and checks after every step that a finished run never changes, a run never moves backwards, spend equals the journal, artifacts are never rewritten and a run that can still move always has a job queued for its stage. **Fixed:** the baseline migration created timezone-naive timestamp columns on PostgreSQL while the models useTIMESTAMP WITH TIME ZONE, which stores an aware UTC value shifted into the session's own zone; SQLite ignores the difference, so only the PostgreSQL test could see it. No release contained migrations, so the baseline was corrected in place: a development database created byei db upgradebefore this change should be recreated.
- Added a read API for book runs.GET /v1/runs/{run_id}returns aRunSummaryV1(status, current stage, the stage plan, the budget as cap, spent, reserved and remaining micro-dollars, the recorded issues and the names of the artifacts stored so far; the brief's idea is left out) andGET /v1/runs/{run_id}/artifacts/{name}returns one artifact byte for byte asapplication/octet-streamwithX-Content-Type-Options: nosniffandCache-Control: no-store. Both sit behind the same API-key guard as the rest of/v1, an unknown run isRUN_NOT_FOUNDand a missing artifact isARTIFACT_NOT_FOUND, and a name that could never be stored (absolute,.., a backslash) gets the same answer as one that was never written, so nothing about the store's layout leaks.ei run status RUN_IDprints the same summary as one line of JSON and needs onlyEI_DATABASE_URL. The summary and its budget and issue parts are the new versioned contractsRunSummaryV1,RunBudgetV1andRunIssueV1; the routes are read-only, the API opens its run and artifact stores beside the ledger and closes them with it, and the SDK and MCP server have no run methods yet (M8). The documentation also corrects two stale notes: migrations exist now, but the baseline adopts an old outbox table as it is, so a database created before thedead_atcolumn must still be recreated.
- AddedResumeRunandCancelRun, and anei runcommand group to call them (ei run resume RUN_ID,ei run cancel RUN_ID) against the stack's database. Resuming a parked run moves it to running with a compare-and-swap and only then queues its current stage, because a message that arrives while the run is still parked is skipped; resuming a run that is already running just queues the stage again, so a resume that died between the two steps is repaired by running it once more, and a completed, failed or cancelled run is refused withRUN_FINISHED. Cancelling is idempotent, refuses a completed or failed run, and reads the run and swaps again a few times if a worker advances it in the meantime (thenRUN_CHANGED, marked retryable); a stage already executing is not interrupted, but the worker's own swap then loses to the cancel, so the run stays cancelled and nothing further is queued. The commands print one line, exit 0 on success, 1 when the run cannot do what was asked (unknown, finished or changing) and 2 on setup trouble such as a missing setting, an unreachable broker or a database that was never migrated, never print a traceback, and need theruntimeextra.CliRuntimetakes an optional queue so the commands can be driven in tests without a broker.
- Added the run repository and the run journal. Two new ports,RunRepositoryInterface(save, get, list ids) andJournalInterface(record, find, entries), each have an in-memory implementation for local use and tests and a SQLModel implementation for SQLite and PostgreSQL. A saved run is stored as JSON with its status and stage in their own columns, and loading it rebuilds every model so the models re-check their own rules. The journal keeps the first answer recorded for a run, stage and request and returns it on a repeat, and the database enforces that with a unique constraint, so two workers racing on the same request converge on one answer. Nothing uses them yet; the next slices add the artifact stores, migrations and theAdvanceRunservice.
- The worker now handlesrun.advancejobs. A newJobRoutersends each job to the service for the prefix of its kind,pipeline.to the existing pipeline service andrun.to the newProcessRunJob, which checks the payload (run_id,stageand anattemptof at least 1; extra keys such as a correlation id are ignored) and callsAdvanceRun. A kind nobody handles is still refused withUNKNOWN_JOB_KINDand dead-lettered.JobOutcomegains arun_member for everyAdvanceOutcome(run_advanced,run_completed,run_retrying,run_parked,run_failed,run_skipped,run_repaired), so the worker'sjobs.outcome.counters distinguish them, and a test fails if an outcome is added without one. The worker opens the run, journal and artifact stores on the same database as the ledger and closes them with it. Until the model adapters arrive, stages run throughDeterministicStageExecutor, a placeholder that journals a zero-cost entry and storesfrom the brief's idea, in the same wayDeterministicRunnerstands in for pipelines. Nothing creates a run yet, so norun.advancejob is queued in the compose stack; an end-to-end test runs one through the real handler, router, run advancer and SQL stores.
- A book's config can now saykind = "novel"(the default isnonfiction), and the kind picks the text rules. A novel may use em dashes, in the manuscript and in the checks of the finished PDF and EPUB, where non-fiction still refuses them; en dashes are refused for both. A---line inside a novel's chapter prints a scene break instead of nothing: a centred* * in the PDF and the hardcover, a classed paragraph in the EPUB, with the paragraph after it not indented; a rule that opens or ends a passage, sits beside another rule or is inside a quote or list prints nothing, and a rule right after a callout or illustration is kept. The wordDraftis still refused in a novel's narration but may appear inside curly quotation marks, so a character can say it; a quoted span is capped at 500 characters so an unclosed quote cannot hide a strayDraft. An unknown kind stops the build with a message namingnonfictionandnovel. The rules live in a smallTextPolicymodel that the loader, both document builders and both verifiers share, andBookConfigV1gains an optionalkind. Non-fiction output is unchanged except that every EPUB's stylesheet gains two rules for scene breaks. A synthetic novel (tests/fixtures/fixture_novel/) joins the non-fiction fixture in the toolchain test, which now builds both with the real toolchain and states what the novel must show.
- Added the KDP listing checks to the release audit. A description now has a maximum of 4,000 characters (description-too-long, lowered per book withrelease.maximum_description_characters), and a newCategoryCheckvalidatesrelease.categories: up to three Amazon browse paths such asBooks > Literature & Fiction > Mystery, unique, with at least two levels, refusing a fourth (too-many-categories), anything that is not a path (category-not-a-path), a duplicate however it is spaced or cased (duplicate-category) and a BISAC subject code, which is a different scheme (category-is-bisac); errors in a strict release, warnings otherwise. A book with no categories gets the warningcategories-not-declared, never an error, so existing books keep passing a strict release. The check cannot know Amazon's browse tree, which has no API, so the names are confirmed at upload, and the limits are KDP's published ones as understood today. The back cover now fails fast and clearly when the description cannot fit above the barcode area: the typesetter raisesBackCoverTextTooLongError, aBookBuildError, carrying the description's length, how many characters fit at this trim size (measured with the same layout code, not guessed) and the overflow in inches, instead of drawing text into the barcode area and failing after rendering with a count of stray pixels. With the default style about 3,000 characters fit at 6x9 and 5.5x8.5 and about 2,200 at 5x8, below KDP's 4,000-character listing limit, so a description can pass the audit and still be too long for the cover. New tests prove that text at the limit never touches the barcode area at any trim size, for the paperback and the hardcover, and that ink placed there is always caught.
- A book's config can now settrim_size(6x9, the default,5.5x8.5or5x8) andpaper(white, the default, orcream); a config that sets neither builds exactly the same files as before, which a before-and-after build of the non-fiction fixture confirmed byte for byte. The trim size sets the interior's page size, the cover layouts and the ebook cover's proportions, and the PDF check now expects the book's own page size instead of a fixed 432 x 648 pt; the paper sets the spine width of the paperback and hardcover wraps (0.002252 in a page for white, 0.0025 for cream). They are two small models,TrimSizeandPaperStock, that replace the constants that were hard-coded in the cover spec and the PDF geometry (KdpCoverSpec.TRIM_W,TRIM_HandPAPER_WHITE, andKdpGeometry.TRIM, are gone). The TeX class takes its size from\finetrimwidthand\finetrimheight, which the generated document sets before the class loads and only for a size other than 6x9. KDP does not print a hardcover at 5x8, so a 5x8 book is paperback and ebook only: it gets no hardcover interior, no hardcover wrap and no hardcover artifact in the inventory, aformats.hardcoverorrelease.formats.kdp_hardcoveris refused, and its pricing no longer needs a hardcover price (one that is given is still checked). The hardcover column follows KDP's published sizes as understood today and should be confirmed against KDP's current list.BookConfigV1gains the two settings and the brief'strim_sizeis now one of the three sizes instead of free text. The toolchain test builds three books, adding a 5x8 pocket book and moving the novel to 5.5x8.5 on cream paper, and checks the page sizes and the wrap widths from the real outputs.
- AddedAnthropicModel, the first model adapter. It calls the Anthropic Messages API over plainhttpx(ADR 0007), sends the system prompt as a cached block, counts input tokens before a call, and sorts every failure into the three outcomes a run acts on: a rate limit, server error or dropped connection is transient; spent credit or a refused key is a capacity failure that parks the run; anything else stops it. Theruntimeextra now includeshttpx. Nothing calls the adapter yet.
- Every external build tool now has a deadline, and a tool that passes it is stopped together with everything it started.latexmkandtex4ebookget 30 minutes,epubcheckand the page renderer 10; the build then fails with aBookBuildErrorthat names the tool and shows its last output, instead of holding a worker for ever. The four tools run through a newProcessRunner(an interface and an implementation, injected like any other collaborator), which starts each tool in its own process group and kills the group, becausesubprocess.run(timeout=...)stops only the direct child andlatexmkandtex4ebookrun their work in grandchildren that keep the output pipe open. Ctrl-C now stops the tool and reaps it, too. The deadlines are constructor arguments with these defaults, not settings. Stopping a whole tree needs process groups, so it works on Linux and macOS and not on Windows. A new toolchain test hangs reallatexmkand realtex4ebookwith a document that loops forever and checks that nothing is left running, and the fixture books build byte-identically through the new runner (final PDFs, EPUBs, covers and reports; only build timestamps in scratch files differ).
- Model exchanges can now be recorded once and replayed in tests.CassetteReplayTransportanswers an adapter from a cassette in order and refuses any request whose method, path or body differs from the recorded one, so a prompt that changed fails the test instead of replaying a stale answer.CassetteRecordingTransportkeeps the real exchanges with no headers and every key masked, andJsonCassetteStorerefuses to save or load a cassette that still looks like it holds a secret. Apaidtest marker is deselected by default and also needsEI_ALLOW_PAID=1. No cassette has been recorded yet.
- AddedContextAssembler, which fits one drafting call's context into an input-token budget. The style and the story bible (or outline) go in the system text, where the adapter can cache them; the beats, the instruction, the newest prior-chapter summaries and the end of the previous chapter go in the prompt. The fixed parts are never cut. Summaries are kept newest first, then the previous chapter's tail takes the room left, cut from its start to a paragraph boundary. It finds the fit by binary search over the model's owncount_tokens, so a draft needs a few dozen counting calls however long the book is, and it raisesCONTEXT_TOO_LARGEwhen the fixed parts alone do not fit. Nothing calls it yet.
- Addei doctor --modelsand model profiles: a profile names an adapter, a server and the environment variable holding its key (blank for a local OpenAI-compatible server), and the doctor checks, with nothing sent anywhere by default, that each profile is priced in the catalog today, that its key is set, and that a key would not travel over plain http to another machine.--probeis opt-in and adds one model-list request per profile; no check can bill.
- AddedOpenAICompatibleModel, a model adapter for OpenAI and for any server that speaks the Chat Completions shape (Ollama, vLLM, llama.cpp, LM Studio), over plainhttpx. A blank API key sends noAuthorizationheader, so a local server needs no key, andoutput_cap_fieldselectsmax_tokensor OpenAI'smax_completion_tokens. The shape has no token-counting endpoint, socount_tokensreturns an upper bound (the UTF-8 byte length plus a per-message allowance) that over-reserves and is corrected from the server's reported usage. Cached prompt tokens are priced at the cache-read rate. Spent quota (insufficient_quotaor 402) and refused keys park the run; 408, 429 and 5xx are transient. Nothing calls the adapter yet.
- Added the model catalog:ModelCatalogpicks the price in force on a date for a provider and model, andTomlModelCatalogLoaderreads it from a TOML file the deployment owns (docs/MODEL_CATALOG.md). Prices are integer micro-dollars per million tokens, each with an effective date, so old calls keep their old price and a price change is a new entry. A model with no price in force is refused (MODEL_UNPRICED) rather than guessed, and the package ships no vendor prices.ProviderDescriptornow prices a long-context tier (a prompt over a threshold is billed at a higher percentage of the input and output rates), in both the final cost and the pre-call reservation.
- Added the prompt library. A prompt is now aPromptTemplate: named text parts with{{blanks}}, a whole-number version, and a list of blanks that take text from outside. Rendering is strict (every blank given, nothing extra, values never re-expanded), and text from outside is always wrapped in anblock with any copy of that tag inside it defused; a template may not put such a blank in itssystempart, and must have asystempart that says how to treat it.TomlPromptLibraryloadstemplates/from the package behind aPromptLibraryInterfaceport, and refuses unknown keys. The context assembler now takes its section labels from the shippedcontext_packtemplate, and recordscontext_pack@1as the prompt version (the prompt text itself is unchanged). A lock test pins each template's version to a fingerprint of its text, so a prompt cannot be edited without a version bump (the version is part of the journal key, so an edit under an old version would replay answers written for the old text). The templates ship in the wheel and load in a bare install. Seedocs/PROMPTS.md.
- AddedAskModel, the policy a stage uses when a model's answer is not complete, andModelAnswer(the text, whether it is complete, the issues, the cost and the number of calls). An answer cut off at its output cap is asked again with the cap doubled, up to the model's own limit; a refusal is asked again, identical and never reworded, up to a bounded number of times (default one retry); when the attempts run out (default four calls) the best text found comes back with a blockingTRUNCATEDand/orREFUSEDquality issue and the stage carries on. Before any live call it replays a complete answer at any output cap it could have reached, so a resumed run does not pay again for the attempts that led to an answer it already has, and every call is journaled under its own attempt number so no cost is lost. Running out of money and provider failures pass through to the run unchanged.CallModelgainedreplay, which looks up a complete answer for nothing. Seedocs/MODEL_CALLS.md.
- AddedCallModel, the one way a stage reaches a model, andSpendGuard, the lock-protected budget it spends against. A request already answered in the run and stage is replayed from the journal for nothing. Otherwise the worst-case cost is reserved before anything is sent, so concurrent calls can never pass the cap, the call is made, and the answer is journaled with its true cost before the reservation is settled. A failed call releases its reservation and journals nothing. A truncated or refused answer is journaled too, so its cost counts toward spend, but under a key that includes the outcome and the attempt, so it is never replayed as a good answer. A call that costs more than it reserved is journaled and then refused withBudgetExceededError. Nothing calls it yet.
- Closed several ways for untrusted text to reach TeX live, and addeddocs/THREAT_MODEL.md. A bare URL or link target containing`, { or } could close \url{ and leave the rest as TeX; a fenced code block containing \end{verbatim} could end its environment early; the title, subtitle, author and edition went raw into the PDF info dictionary; and website and email went raw into \url and \href. URLs are now turned into valid URIs (every character outside the ordinary URL set is percent-encoded, so a space, quote or accented letter in a printed URL appears as %20, %22 or %C3%A9), a code block with \end{verbatim} is refused with a message, a website must be an http or https address or a bare host name (any other scheme, and host:port, is refused; write a port with its scheme), and the PDF info strings drop the characters TeX or PDF would act on (an ordinary title is unchanged, and the page text and EPUB contents of the fixture books are byte-identical before and after). A new tripwire test fills every field with a payload and fails if a live macro reaches the generated TeX, and a new toolchain test builds a hostile book with the real tools and checks that nothing in it runs.
- The build tools are now limited in memory and disk as well as time. A ToolLimits model holds the three ceilings, and ProcessRunner checks them every half second: resident memory summed over the tool and everything it started (8 GiB for latexmk and tex4ebook, 4 GiB for epubcheck, 2 GiB for the page renderer; read with ps, so a JVM's reserved address space does not count), and the size of the directory it writes into (4 GiB; epubcheck writes nothing, so none is measured). A tool over a limit is killed with its whole process tree and the build fails with a BookBuildError naming the tool, the limit and its last output. The limits are constructor arguments, not settings, and they are sampled, so a tool can pass one by what it can allocate or write in half a second. The fixture books build byte-identically through the limiting runner (final PDFs, EPUBs, covers and reports), and peak at about 400 MiB. New toolchain tests make real lualatex allocate and write past its limits.
- A non-fiction run now ends with an assemble stage that turns the drafted chapters into a manuscript the publishing pipeline can read: manuscript/src/chapter_NN.md and manuscript/books/<slug>.toml in the run's artifacts, with a list in assemble.md. It calls no model. Each chapter is headed with the outline's title; em and en dashes, which the typesetter refuses in non-fiction, are rewritten (a dash between digits becomes a hyphen, any other a comma), and an unfinished marker such as [TODO] or the word Draft stops the stage with the chapter and line. The config has the kind, title, trim size when set and the chapters, and not the author, publisher, edition, year or bio, which the author supplies, so the book loads but does not yet build. Recorded in ADR 0010.
- A non-fiction run now ends with an audit stage that runs the publishing pipeline's own audit-only gates (the manuscript audit and the release readiness check) on the assembled book, with no model call and no TeX toolchain. The reports are stored under audit/ with a summary in audit.md. Errors stop the run with AUDIT_FAILED, after the reports are stored so a failed book can be read; warnings, such as a missing price, do not. The book is laid out in a private temporary folder that is removed afterwards. An assembled book passes the real audit (with an author profile the only findings are the prices the author has yet to set). The PDF and EPUB build and the cover are not part of it yet. Recorded in ADR 0010.
- The prompt that drafts a chapter now keeps everything from outside out of the system part. The context assembler (not yet used by any stage) put the style and the grounding in the high-trust system part and left the summaries, the tail and the beats unwrapped, which suited a story bible the product wrote but not a non-fiction book whose grounding holds web research and whose summaries are model output. The context_pack template (now version 2) holds fixed system text, and the voice, the book and its sources, the earlier chapters' summaries, the tail of the previous chapter and this chapter's beats are each an untrusted blank, rendered as their own <untrusted> block in the prompt with any copy of the tag defused. Only the caller's instruction is plain text, and it must hold nothing from a model or the web. Fitting to a token budget is unchanged. See docs/PROMPTS.md.
- A non-fiction run now has a draft stage after outline. It writes every chapter in order (chapter_01.md, chapter_02.md, …), each from the brief, the positioning, the outline and research, the summaries of the chapters before it and the end of the last one, and keeps a short summary of each (summary_01.md, …) and an index (draft.md). A stage that fails or is delivered twice goes back over the chapters and does only the work that is not done, so a redelivery costs nothing for what was already written. Chapter length comes from the brief's target words (2,500 words a chapter when there is none), within the model's output limit and window; a window that cannot hold a chapter stops the stage before any call. Skills can be enabled for draft like any other stage. Recorded in ADR 0010; nothing here has run against a live model yet.
- Remote MCP servers over HTTP (ADR 0008, slice 4d). ei tools add --url URL NAME contacts a server once and locks its address, the name and version it reported and a hash of its tools; a lock entry has either a command or a url, and [server.files] is only for a command. A remote server is reached over Streamable HTTP, https only and only to a public address (the URL policy fetch_url uses, asked before every request), with no redirects, no cookies, no compression, replies bounded to 4 MiB, 128 messages and 30 seconds, and a four-hour session. A token is the variable named by --bearer-env, sent as a bearer header to the locked address and never written into the lock or an error; a lock refuses a user, query string or fragment in the address. A remote server is a weaker pin than a local one, because its code is not ours to hash: only its address and what it advertises are locked. A server on this machine or network cannot be reached over HTTP; use stdio. The name is resolved twice (the policy, then the connection), the same gap as fetch_url. See docs/TOOL_LOCK.md.
- Marketplace indexes (ADR 0008, slice 6b). A marketplace is only an index: a TOML file listing plugin files, each with an address and the SHA-256 the file must have, with no other key. ei plugins search INDEX [TEXT] lists its plugins, and ei plugins fetch INDEX NAME [--output DIR] downloads one, checks its hash against the index's before reading it as anything, checks that it is the plugin and version listed, and saves it as NAME.toml without overwriting anything. Fetching installs nothing: it prints the ei plugins show and ei plugins add commands to run next, so installing stays an offline step on a file a person has read. INDEX is a file on disk or an https:// address. A download goes through the same pinned-address URL policy as fetch_url and the remote tool transport (https, a public address checked each time, the connection made to the address that was checked, no redirects, no cookies, no compression, 512 KiB and 30 seconds); an address in an index has no user, password, query string or fragment. A run never contacts a marketplace, and only search and fetch can use a network. The downloader needs the runtime extra and is built on first use, so the core install still runs every other command and a local index file. Indexes and plugin files are not signed: the hash proves only that the bytes are the ones the index described. See docs/PLUGINS.md.
- A non-fiction run now has a metadata stage after outline. It writes the store listing (title, subtitle, a description of at least 80 words, seven keywords and one to three Amazon categories) in a fixed format that is read strictly, so an unreadable or out-of-contract listing stops the run where it is written (METADATA_INVALID). The assemble stage puts it in the book's config, with the release contract's keywords and categories, and a listing made this way passes the release metadata and category checks. The author's own details (author, publisher, edition, bio, and optionally year, website, email, ISBNs, dedication, copyright notes and earlier titles) come from a TOML file named by EI_AUTHOR_PROFILE, are written into the config, and are never sent to a model; see CONFIGURATION.md. With a profile, an assembled book has what the build needs. Recorded in ADR 0010.
- The outline is now a contract (ADR 0010, the first step of drafting chapters). The stage_outline template (now version 3) tells the model to write each chapter as ## Chapter N: Title with Purpose:, Beats:, Claims to source: and Leads to:, and a new OutlineParser reads that strictly into an Outline of ChapterOutlines (at most 50 chapters, numbered 1, 2, 3 with no gaps, one-line bounded texts; a model's preamble and a closing paragraph after a blank line are ignored, and hidden and control characters are removed). A check run when the outline stage finishes refuses an answer it cannot read with OUTLINE_INVALID, before it is stored, so a malformed outline stops the run at the outline and not after drafting has been paid for. ADR 0010 records the decision to draft chapters in order inside one draft stage, and to drop the plan's parallel fan-out and join counter for 1.0, because a rolling summary needs the chapters in order. The drafting stage itself is not built yet. See docs/PROMPTS.md and docs/adr/0010-chapters-are-drafted-in-order-in-one-stage.md.
- Plugins (ADR 0008, slice 6a). A plugin is one TOML file that bundles skills and tool server definitions, so a person can review and pin them together. ei plugins show FILE says what installing it would do; ei plugins add FILE locks its skills (each enabled for no stage), keeps a copy of the bundle in plugins/ and records its SHA-256 in ei-plugins.lock.toml; list, verify and remove check and undo it. Installing starts nothing, contacts nothing, grants nothing and enables nothing: the ei tools add command for each server is printed, shell-quoted, for a person to review and run, because that command is what starts a server. A bundle has no key for a grant or a stage, and any unknown key is refused; a server it describes is held to the rules the tool lock uses (an absolute command that is not a launcher, an https address with no secret in it); its skills are read by the same strict parser as a skill file. A plugin that is installed, or whose skills are already locked, is refused before anything is written, and a failure part-way undoes the install; remove deletes only skills that are still exactly what it installed. A run never reads the plugin lock. Marketplace indexes and fetching are not built (6b). See docs/PLUGINS.md.
- The research stage and the model's web tools are built (ADR 0008, slice 3). A model-backed non-fiction run is now brief, positioning, research and outline. The research stage is the first stage with tools: web_search (titles and links only) and fetch_url (public https pages, returned with their address, title and a SHA-256 of the text). Search uses SearXNG first, through EI_SEARXNG_URL, with Brave Search as the backup when BRAVE_SEARCH_API_KEY is also set; a run with neither stops at start. examples/searxng/ runs a free local SearXNG on 127.0.0.1 with the JSON format switched on. fetch_url only reads an address the model was shown (in the prompt, a link line of an earlier search, or the address header of an earlier fetch; never an error message or page text), so a hostile page cannot steer it to an address that carries the brief out. A search query can still carry text to the search service, and a page can offer a menu of addresses to pick among, which leaks only a few bits. Everything a tool returns, and the text of a tool's error, is now wrapped in an <untrusted> block that it cannot close early, before it is stored or shown to the model. The outline prompt is now version 2 and reads the research notes. Nothing has been run against a live model, SearXNG, Brave or the internet, and the SearXNG container has not been started by the project's tests.
- A non-fiction run now edits the draft in three passes before the book is assembled: revise_structure, revise_lines and copy_edit. Each makes one call with no tools for each chapter, in order, from its own prompt, and each reads what the pass before wrote (structure_NN.md, lines_NN.md, copy_NN.md); the book is now assembled from copy_NN.md. Structure sees the outline, a line on every other chapter and the chapter's plan, lines sees the voice, and copy sees only the chapter. An edit that is blank, or more than a fifth (structure), a tenth (lines) or a twentieth (copy) longer or shorter than the chapter, is not kept and the chapter passes through unchanged, reported as a tolerated revision-unchanged issue; an answer that did not finish stops the stage. A chapter that would not fit the model's window stops the stage before the call. The editing passes mean about five model calls per chapter in all, each counted against the run's budget. Skills can be enabled for each pass. Recorded in ADR 0010; nothing here has run against a live model.
- ei run export RUN_ID DIRECTORY writes what a run produced to a new or empty folder: the book as a project at the top (books/<slug>.toml and src/chapter_NN.md, ready for the book commands) and every other artifact, such as the stage outputs and the audit reports, under run/. It only reads the run. Nothing is overwritten, a folder that already holds anything is refused, and either every file is written or none is (the tree is built beside the target and moved into place). Until now a run's manuscript could only be read one artifact at a time through the API.
- Research sources can now be found and read. BraveSearchProvider runs a web search and keeps only each result's link and title. HttpSourceFetcher reads a page as evidence: the outbound URL policy is asked before the first request and before every redirect, only HTML and plain text are accepted, a body over the size cap is refused (compressed bodies are not accepted, so a small download cannot expand in memory), and no cookies or credentials are sent. HtmlTextExtractor keeps what a reader would see and drops scripts, comments, hidden elements and invisible characters, so a page cannot hide instructions from the reader. Nothing uses them yet, and neither the search adapter nor the fetcher has been run against the live internet.
- Skills (ADR 0008, slice 5). A skill is a TOML file of text, with a part for each stage it speaks to, that a person installs to steer a stage's prompt: it adds no tool, no command and no address, and cannot widen what a stage may call. ei skills add FILE checks it strictly, records the SHA-256 of its bytes in ei-skills.lock.toml and keeps a copy in skills/ beside the lock; it enables nothing. ei skills enable NAME STAGE (at most four per stage), disable, remove, list and verify do the rest. A run reads a skill lock only when EI_SKILL_LOCK names it, checks every enabled skill against its hash before any tool server is started or any call is made (SKILL_LOCK_MISMATCH, SKILL_LOCK_MISSING), and adds each stage's skills to the end of its user prompt inside a fixed frame (the new skill_guidance template), never the system part. The skills' identity goes into the prompt version, so a resumed run replays an answer only for the same text; a stage with no skill sends exactly what it always did. Text a reviewer cannot see (zero-width and bidirectional marks, control characters, private-use code points) is refused, a part is capped at 8,000 characters and a file at 64 KiB, and a copy of the block's tags inside a skill is defused. A skill is trusted as installed: one that was hostile when locked is followed, which is why it is read before it is enabled. See docs/SKILLS.md.
- A run's stages can now be done by a model. ModelStageExecutor reads the stage's recipe, puts the brief and every earlier answer into the prompt as untrusted text, asks through AskModel, and keeps the answer once. An answer that is refused, cut off or empty stops the run and stores nothing, so no later stage is built on it. Non-fiction runs have three stages so far (brief, positioning, outline). The worker still uses the offline placeholder unless EI_STAGE_EXECUTOR=model is set with EI_STAGE_MODEL_PROFILE, EI_MODEL_PROFILES and EI_MODEL_CATALOG; with anything missing it refuses to start. Nothing has been run against a live provider.
- The tool lock and the MCP client are built (ADR 0008, slice 4a). A lock file (version = 1, TOML) records each approved MCP server: its command, the SHA-256 of its executable and of every script in its arguments, the name and version it reported, the names it is given as environment variables, and a hash of every tool it advertised, so a changed file or a reworded tool description is noticed. Package launchers such as npx, uvx and docker are refused because their code cannot be hashed. McpClient speaks initialize, tools/list and tools/call, offers a server nothing (it refuses every request a server sends except ping), and treats everything a server sends as untrusted and bounded. ToolLockVerifier compares a lock with the files on disk and with what a running server reports. Not wired in yet: nothing starts a server, reads a lock in a run, or offers a server's tools to a stage, there is no ei tools command, and the client has only been tested against a fake transport. See docs/TOOL_LOCK.md.
- The tool loop (ADR 0008, slice 2) is built. RunToolLoop runs every model-backed stage: it asks, runs the tools the model calls through ToolRunner, and asks again, within limits on turns (8), tool calls (16), result size (20,000 characters) and seconds per call (60). A stage gets only the tools its recipe names; a call to any other name, or with arguments that do not fit the tool's schema, runs nothing and is answered with an error the model can read. Every tool call is journaled by tool and arguments, and CallModel now journals a tool turn whole (text and calls, keyed by the tools offered and the conversation so far), so a run that stopped in the middle of a conversation replays what it had finished for nothing and goes on from the first unfinished turn. A request with no tools is keyed and stored exactly as before. A model that calls a tool nobody offered is billed, journaled and refused. No tool is registered yet, so the model still has none; web_search and fetch_url come next. Not run against a live provider.
- The stdio transport and the ei tools commands are built (ADR 0008, slice 4b). ei tools add NAME -- COMMAND runs an MCP server once and records it in the tool lock (the SHA-256 of its executable and scripts, the name and version it reported, a hash of every tool it advertised); ei tools list shows the lock without starting anything; ei tools verify runs each locked server and compares it, and never starts one whose files have changed. A server runs as a child process in its own process group with a bare environment (no API key unless the lock names it), a throwaway home directory, and time, memory and disk limits, and is stopped by killing the whole group. Launchers such as npx, uvx and docker, and scripts given by relative path, are refused before anything runs. This is not a sandbox: a server can still read any file the user can and use the network. The client has been run against a small server written for the tests, not third-party servers, and nothing in a run reads the lock yet. See docs/TOOL_LOCK.md.
- The model port can now carry tools. A ModelRequest can offer tool definitions and a transcript of earlier tool turns, and a ModelResponse can return the tool calls the model asked for with the new tool_use stop reason. Both adapters speak their provider's format (content blocks for Anthropic, tool_calls and tool messages for OpenAI-compatible servers, including local servers that report stop alongside a tool call). Adapters never run a tool, and CallModel refuses a request with tools until the tool loop and journal exist, so nothing offers tools yet. Not run against a live provider.
- Locked MCP servers are wired into model-backed runs (ADR 0008, slice 4c). A run given EI_TOOL_LOCK starts each locked server, refuses to start (TOOL_LOCK_MISMATCH) if its files, name, version or tools differ from the lock, and stops every server already started; a changed file's server is never run. Each tool is registered as <server>__<tool>, but a stage is offered only the tools the lock grants it, so a registered tool that was not granted is refused even if the model asks. Grants live in a new optional [server.grants] table in the lock (no wildcards), edited with ei tools grant and ei tools revoke; ei tools list shows them. A locked tool goes through the same runner as the built-in tools (schema check, size cap, untrusted wrapping, journal), and its journal key includes the hash of the server's tools, so an updated server is asked again instead of replaying old answers. A lock in the working directory is not read unless named. A server is still not sandboxed, nothing has run against a third-party server or a live model, and HTTP servers are not built yet. See docs/TOOL_LOCK.md.
- ei plugins search can now read a Claude Code marketplace.json (a path or an https:// address ending in .json) and lists each plugin with its description, version and where its source says it lives. It reads only name, description, version and source from each entry and ignores every other key; a source is classified (path, github, url, other) and printed, never followed. For a marketplace on disk, a path source also prints the ei plugins import command for that folder. Nothing is fetched, cloned or installed, and plugins fetch is unchanged. Entries that cannot be read are counted, not hidden.
- A locked MCP server that declares the resources capability now offers two tools the client adds itself, list_resources and read_resource, with fixed descriptions and schemas (not the server's). They are pinned by the tools hash, granted to a stage only by name (ei tools grant NAME STAGE list_resources read_resource) and offered to no stage by default; their results are untrusted tool output. read_resource takes a one-line uri of at most 2,000 characters and returns text only (binary content is noted as left out); list_resources shows at most 200 entries. Nothing is subscribed to. A server that declares resources and was locked before this change no longer matches its lock, because its tool list has two more tools: re-lock it with ei tools add --replace. A server with its own tool of either name keeps it and gets neither of ours. Run against a small server written for the tests only, not a third-party server.
- ei plugins import FOLDER turns a Claude Code plugin folder into a plugin bundle to review, then install with ei plugins show and add. It reads .claude-plugin/plugin.json, .mcp.json and skills/*/SKILL.md: each skill becomes a reference skill (enabled for no stage), and a server is kept only if the tool lock would accept it (an absolute, non-launcher command, or an https address). Placeholders are not expanded; environment values and headers are not copied, only variable names and a Bearer ${NAME} token as bearer_env. Commands, agents, hooks and the like are named and set aside, never read or run, and every skipped server or skill is printed with its reason. The file is written new, named for the plugin, and parsed again before it is written. Nothing has run against a real Claude Code plugin from the wild beyond the shape of the files.
- A skill can now carry reference sections that the model reads on request instead of having them in every prompt. A skill file may have a [reference] table of "Section title" = "text"; a stage the skill is enabled for gets an index of the sections (a line each, with its length) and the built-in read-only read_skill tool, and the model names a skill and a section to get its text, returned as untrusted tool output. read_skill refuses any skill or section the calling stage's own prompt does not list, so a skill enabled for one stage cannot be read from another. A section may be up to 20,000 characters, a skill 64 sections and 200,000 characters; a skill file may now be up to 256 KiB. ei skills import --reference keeps the sections of a SKILL.md for this (no --stage), so a long methodology reference imports whole. The drafting and editing passes are offered the tool too. The skill guidance template is now version 2, so prompt versions of stages with skills change. Nothing here has run against a live model.
- ei doctor --search runs one real search through each configured provider (SearXNG, then Brave when its key is set), one at a time so a down SearXNG is not hidden by Brave behind it, and prints a line each: how many links came back and the host of the first (never a title or address from the web, and a host with a control or unusual character is replaced by a placeholder). It takes --query (the default is the harmless sentence open source book publishing; the query leaves the machine) and runs on its own, not with --models. Exit 0 all answered, 1 one did not or nothing is configured, 2 the setting is unusable. New docs/RESEARCH.md covers search setup, installing your own methodology skills for the research stage (ei skills import --reference, ei plugins import), and what is not built. The live smoke test's setup now points at the check. The check itself has only been run against local servers written for the tests, not a live SearXNG instance or Brave.
- A book brief can now carry inputs: up to eight blocks of plain text (notes, an excerpt, reference material), each named, at most 50,000 characters and 200,000 in all, stored with the run. Brief version 1 gains an optional inputs list, so every existing brief reads the same, and a run stored before this loads with none. Text with a control, format, private-use or invisible character is refused, never cleaned. A FileRunInputReader reads a .txt, .md or .markdown file of UTF-8 text up to 256 KiB through no link. Inputs are untrusted data and grant nothing (ADR 0011). Nothing uses them yet: no command starts a run before ei book create, and the stage prompts do not carry inputs until the next change.
- The brief, research and outline stages now show the author's inputs to the model, as one <untrusted name="inputs"> block listing each input under a heading with its name, origin and short SHA-256, or not given when there are none. The templates are stage_brief@2, stage_research@2 and stage_outline@4, so a run in progress does not replay answers written for the old prompts. The research prompt says the material is not a source: a fact still needs a page the model read. Inputs change neither a stage's system prompt nor the tools it may call. The context window is not checked before these three stages, so very large inputs can overrun a small model. Still nothing supplies inputs: that waits for ei book create.
- ei skills import SOURCE --stage STAGE [--section TITLE ...] turns a SKILL.md (the Vibey and Claude skill format: a --- frontmatter block and markdown) into an ordinary skill file to review and lock with ei skills add. You choose the sections and the stages; nothing is cut to fit, so when the chosen text is longer than a part holds (8,000 characters) the error lists every section with its length. Frontmatter keys other than name and description (allowed-tools, domains, and the like) are read, set aside and named, never used, because a skill grants nothing. It writes a new file and never replaces one, reads only the SKILL.md, follows no link, and locks and enables nothing. Tests include a real shaped file imported, locked, enabled and read by the research stage's prompt guidance. This is the first step of M6.5 (the model's reach); serving large references on demand comes next. See docs/SKILLS.md.
- The novel work is documented as it stands (M7.5): docs/NOVELS.md covers the five stages, the content levels, the continuity check and what is not built, and says how to read the prompts without a model. docs/LIVE_SMOKE_TEST.md states that the paid smoke test drives only the non-fiction plan, so there is no paid novel check yet, and why. No paid test was added: a novel run stops at the draft, so one would fail for a reason that teaches nothing.
- A novel's brief may set violence (none, mild, moderate, graphic) and heat (none, sweet, steamy, explicit); only a novel may, and a brief that sets neither reads exactly as before (M7.2). A model catalog entry may record max_violence and max_heat, what you have read that provider allow; the project asserts nothing about any provider. The new ContentPolicy service refuses a brief whose levels exceed the recorded ceiling (CONTENT_LEVEL_NOT_ALLOWED, naming the setting to change), and holds a model with no ceiling recorded to mild and sweet. Nothing calls it yet; the novel stages in M7.3 do before their first paid call.
- StoryBible is now a structured story bible (M7.1): characters with aliases and an age, places, dated events and a span in years, each short text one printable line and each list bounded. A new ContinuityChecker reads a novel's chapters against it, with no model call, and reports three kinds of finding: a capitalised name or place one letter from a known one (Katharine for Katherine), an age stated in one of three shapes that falls outside what the bible allows, and a dated event first mentioned after a later one. A finding is a question, not a verdict: a flashback is a good reason for a timeline finding to be wrong, a new character named like an old one for a spelling finding, and names under four letters are never compared. Nothing calls the checker yet; the novel stages that will are the next slices of M7.
- A novel run now drafts (M7.4): its plan ends with draft, the same chapter-by-chapter loop non-fiction uses, driven by a new DraftRecipe that says what a kind of book reads (the brief, the story bible, the beats and the outline), how the prompt labels it, and the one instruction, which now also carries the brief's violence and heat levels. Two new prompts, novel_context_pack and novel_summary; the non-fiction prompts are byte-for-byte what they were. When every chapter is written, NovelDraftChecks reads the whole draft against the story bible with the continuity checker and records each finding as a non-blocking quality issue (CONTINUITY_NAME, _PLACE, _AGE, _TIMELINE) and in continuity.md; the run keeps going, because a finding is a question and not a verdict. The novel draft is also gated by the content-level check before any call. Revision, copy editing, assembly and the audit for a novel are not built, nothing repairs a flagged chapter, and nothing has run against a real model. See docs/NOVELS.md.
- A novel run now has its first four stages (M7.3): brief, story_bible, beats and outline, each one versioned prompt with no tools (novel_brief, novel_story_bible, novel_beats, novel_outline). The story bible is one JSON object that the new StoryBibleParser reads strictly (the first object in the answer; every text collapsed to one line and stripped of control characters; the timeline sorted) and a bad one stops the run where it was written (STORY_BIBLE_INVALID); the outline uses the same chapter format non-fiction does, so one parser reads both. The runtime now dispatches by the brief's kind, so non-fiction is unchanged, and every novel stage first asks ContentPolicy whether the model is recorded as allowing the brief's violence and heat level, before any call. The levels are also in the prompts. Drafting and everything after it for a novel is not built, so a novel run ends at the outline, and nothing has run against a real model. See docs/NOVELS.md.
- ei acp now implements session/load: a client that reconnects can load a session it started, and see where its run stands. Sessions are stored in the database, so this works from a new ei acp process. This needs migration 0002; run ei db upgrade first. See INTERACTIONS.md.
- ei acp now follows the run of each session and sends a session/update notice whenever its status or stage changes, once per change, until the run finishes. The client sees the run move through its stages without polling ei run status. Notices are written between replies, never inside one. See INTERACTIONS.md.
- ei acp serves the Agent Client Protocol (stable, version 1) over stdin and stdout, so an editor or agent client can start a book run in a session. initialize, session/new, session/prompt and session/cancel are implemented; a prompt is read as the same TOML brief that ei run create reads, and it starts the same run. Sessions live in the process, and a run outlives its session. Permission requests, session/load, MCP servers and progress streaming are not yet implemented. See INTERACTIONS.md.
- ei book create makes a whole book from an idea, with nobody in the loop: ei book create --kind nonfiction|novel "<idea>" --budget-usd 5 --out DIR --profile author.toml. It runs every stage of the plan in one process (no database server, queue or worker), with the models and search the environment names, and writes the book project, the finished PDF, EPUB, covers, listing and manifest, the readiness reports and quality-report.json to DIR. The run is kept in a SQLite file beside it (DIR.state/), so a process that dies loses nothing that was paid for: --resume continues it and a model call already made is replayed, not paid for again; a run that asks for more budget stops and writes nothing until --resume --approve-spend. The budget has no default, and the author profile is required; both are checked before anything is spent, as is a strict release's need for pricing. The author profile may now carry a [pricing] table (verified_on, source_url, ebook, paperback, optional hardcover) that goes into the book's [release.pricing], so a run's book passes --strict-release with epubcheck required (--strict-release on ei book create, or EI_BUILD_STRICT_RELEASE); a hardcover price also declares the book a KDP hardcover. That is proven with the real toolchain, for a book and a novel, in tests/toolchain/test_run_builds_book.py. A failed run is final, as on a worker, but what it made is still written out. Retries wait 2, 10 then 30 seconds between attempts.
- A run now plans its money. The editing passes degrade instead of stopping the run: when a revision pass would pass the cap, that chapter and the rest of the pass keep the text they had (stored unchanged, so the next pass and the assembly read them as usual), the pass's list says so, and one tolerated issue, revision-skipped-budget, goes into the quality report; nothing more is paid for. Where the pass stopped is kept in <stage>_skipped.md, so a redelivery reports the same list. The planning stages and the draft are still essential and still stop to ask for more budget. A first-pass cost estimator (CostEstimator) prices every stage of a plan from the brief (words become chapters, chapters become the tokens each stage reads and writes) with the model's own rates, and a BudgetPlanner grades a cap against it: short, tight, lean or ample. ei book create prints the estimate before it spends anything, refuses a short budget with the budget that would do (--ignore-estimate starts anyway), and warns on tight and lean. quality-report.json gains a spend block with the cap, what was spent, the estimate made from the brief and their ratio, which is how the estimator's constants are to be calibrated on real runs: nothing here claims the estimate is within any bound of the truth, and A5's accuracy target is not yet evidenced. A test shrinks a finished draft's cap to what it spent and shows the run still completes with every chapter assembled from the draft.
- Granting and denying a run's request for budget are on the API (POST /v1/runs/{run_id}/grant and /deny), in MCP (grant_run, deny_run) and in the SDK (grant_run, deny_run, sync and async), as well as on the command line. Each refuses exactly what the service refuses. See INTERACTIONS.md.
- Every public contract is now frozen by a snapshot test. tests/contracts/ compares the brief, book-config, run-summary and job-message schemas, the REST OpenAPI document the stack really serves (and the shape of its errors), the whole ei command tree (every command, option, choice and default, without help text), the SDK's public methods and signatures, the MCP tools and their arguments, the error codes and issue codes found in the source, and the webhook envelope, catalogue, headers and signature with committed copies in tests/contracts/snapshots/; a contract that moves fails a test, and EI_UPDATE_CONTRACTS=1 uv run pytest tests/contracts rewrites the snapshot when the move is intended. Prose (docstrings, help text, names generated from handler functions) is left out, so rewording is not a change. The new docs/COMPATIBILITY.md says what is promised, what counts as compatible and what as breaking, how to change a contract on purpose, and what is not promised (ACP, the experimental pipeline stages, the files a run writes, Python imports). Two contracts changed to make them freezable: a book config now carries schema_version (version 1; a config without it is read as version 1, so no existing book changes), and a webhook delivery is now a versioned envelope, {"schema_version": 1, "id", "type", "data"}, with a new WebhookEventV1 contract whose catalogue (pipeline.started, phase.completed, gate.awaiting, pipeline.completed, each with its payload keys) is tested against what the services really record. Nothing delivers webhooks yet; the envelope is frozen so a receiver written now keeps working. CliApplication gains a parser() method so the tree can be read.
- ei evaluate is the A5 and A6 evaluation harness. It makes every book of a fixed set (evaluation/set.toml: three non-fiction ideas and two novels) with the stack's own pipeline, has a separately configured judge model score each finished book on a reviewed rubric (evaluation/rubric.toml), and checks the release against the bar: every book finished, every dimension's mean at least 3.5, none fallen by more than 0.2 from the previous report, and the cost estimate within 30% of what was spent. It writes a stable evaluation.json that is the next release's baseline, and exits 0, 1 or 2. It spends real money, so it refuses to start without EI_ALLOW_PAID=1, takes a budget for each book and one for the judge, and the judge reserves every call from its own budget before it is made. Tested only against scripted models: no real model has been run against the bar. A nightly workflow exists and is off until RUN_NIGHTLY_EVAL is true. See EVALUATION.md.
- A novel run now ends in a built book too. Its plan is brief, story bible, beats, outline, metadata, draft, assemble, audit and build. The new metadata stage (prompt novel_metadata, checked with MetadataParser) writes the store listing right after the outline. Assemble builds the manuscript project from the draft's own chapters with kind = "novel" and the brief's trim size, and keeps the em and en dashes a novel's prose has (a new VerbatimDashes; only non-fiction refuses them). Audit and build are the same stages non-fiction uses. There are no editing passes for a novel yet, so the book is built from the draft as written. A scripted novel run, built with the real toolchain, is tests/toolchain/test_run_builds_book.py. That test found a real defect: the cover text check refused a back-cover blurb whose first letter overhung the safe area by 0.04 in, so a legitimate book could fail its build over a few pixels; the tolerance is now 0.06 in, still far inside KDP's margin. The rehearsal driver (tests/smoke_run.py) now runs the plan of the brief's kind.
- ei book package SLUG writes the KDP release bundle to build/SLUG/release/kdp (M8.2): listing.md (the listing to paste, with the file table and hashes), MANIFEST.json, and a copy of each finished file the release requires. It refuses, writing nothing, when the release check fails, when a required file is missing, or when the listing is outside the release limits. The packaging is a service behind a publisher port, so the controller only coordinates it, and the directory adapter refuses symbolic links and names that are not plain filenames. Nothing is uploaded; KDP has no publishing API.
- A release now publishes the two container images (A9). After the GitHub release, an images job in release.yml builds the runtime and worker-tex targets of the Dockerfile from the released commit, checks that each reports the released version, pushes them to ghcr.io/<owner>/<repo> as <version> and <version>-tex (a stable release also moves latest and tex), and attests the build provenance of each by digest. It never writes over a tag that was built from another commit, and it stops on any registry answer other than a clear "no such manifest". It runs from its own ghcr environment and stays off until the repository variable PUBLISH_IMAGES is true. Never run: the workflow is tested against a stand-in docker, not a registry. See RELEASING.md.
- A non-fiction run now ends in a built book. A new final stage, build, takes the run's own manuscript through the same publish pipeline as ei book publish (audit, interior PDF, covers, EPUB with epubcheck, release-readiness) in a scratch folder, packages the KDP bundle, and stores the result in the run: book/<slug>.pdf, .epub, the covers, listing.md and MANIFEST.json; build/ with the readiness reports and tool logs; a deterministic quality-report.json (status, errors, warnings, steps, and a size and sha256 for every file); and build.md. A failed build stores what it produced before it fails the run (BUILD_FAILED). The stage needs the TeX worker image; examples/docker-compose.tex.yml switches the compose stack's worker to it, and docs/WORKER_IMAGE.md says how. A strict release needs the author's pricing inputs, which a run cannot invent, so it is off by default: set EI_BUILD_STRICT_RELEASE=1 to fail a run on any readiness warning. Proven with the real toolchain: tests/toolchain/test_run_builds_book.py runs the scripted rehearsal of the whole plan and checks the PDF, the EPUB, the report and its checksums. Building the book from a run also exposed a bug in KDP packaging: it expected a hardcover file for every book, whether or not the book had a hardcover, and refused with "missing artifact"; it now reads the book's own format settings.
- ei run create BRIEF.TOML starts a book run from a brief file, and ei run runs lists the saved runs (M8.1). The brief is read as TOML and checked against the brief contract, so a file that is not a brief is refused on one line with nothing saved; a kind this build cannot start is refused the same way. The run is saved pending with the brief's cap as its budget, and its first stage is queued on the broker, exactly as resume queues one, so the worker does the stages. Nothing here runs a stage in-process, and no API, MCP or SDK method starts a run yet.
- Book runs can be listed, resumed and cancelled over the API, MCP and the SDK (M8.4): GET /v1/runs, POST /v1/runs/{run_id}/resume and POST /v1/runs/{run_id}/cancel, the list_runs, resume_run and cancel_run MCP tools, and the matching SDK methods (sync and async). They go through one RunManagement service that composes the list, resume and cancel services the command line uses, so every surface refuses what the command line refuses: an unknown run is 404, a finished run cannot be resumed (409). A parity test checks each surface against the services, including the refusals and the missing-key case.
- A run's status and its files can now be read from the SDK and over MCP, not only from the REST API and the command line. The SDK (sync and async) gains get_run(run_id), a run's summary with the names of its artifacts, and get_artifact(run_id, name), the bytes of one stored file such as book/my-book.pdf. The MCP server, when built with a run reader, gains get_run and read_artifact: a file is returned as text when it is UTF-8 and as base64 when it is not, and one over 1 MiB is refused with ARTIFACT_TOO_LARGE and the address that downloads any size. Every surface agrees with the service: tests/parity/test_run_read_parity.py checks the REST API, MCP and both SDK clients against it, including binary files and nested names, and a run or file that is not there.
- Book runs can be started from a brief over the API, MCP and the SDK (M8.3): POST /v1/runs takes the brief contract v1 and answers 201 with the new run, create_run is the MCP tool and the SDK method (sync and async). All of them use the same CreateRun service as ei run create, and a parity test checks each returns the same run for the same brief. Creating a run now has its plan mapping in one place (CreateRun builds it by default), not one per wiring. The command line prints a line of text rather than the run, so it is not in the JSON parity comparison. Nothing here lists, resumes or cancels a run over the API, MCP or SDK yet.
- ei serve mcp runs the stack's MCP server over stdio, so an MCP host (Claude Desktop, an agent runtime) can start it as a child process and drive runs: start_pipeline, create_run, list_runs, get_run, read_artifact, resume_run and cancel_run, over the same database and queue as the API. It needs EI_DATABASE_URL and EI_RABBITMQ_URL and a migrated database, takes no API key (the host that starts it already holds the stack's credentials), and keeps standard output for the protocol, with JSON logs on standard error. It does not offer grant_run or deny_run unless the operator sets EI_MCP_ALLOW_SPEND=1: an agent can start, watch and read a run, but cannot raise its own run's cap, and a run it starts is held to EI_MCP_MAX_RUN_BUDGET_MICRO_USD (default five dollars), so it cannot open one with a cap of its own choosing (a limit on how many runs it starts is not built yet); a run that needs more budget shows as awaiting_consent and the person answers it with ei run grant. McpApplication takes the same switch as allow_spend, which now defaults to off, and max_run_budget_micro_usd. A test starts ei serve mcp as a real subprocess and talks to it over stdio (initialize, list the tools, call get_run on a seeded run).
- The operator can now put ceilings on spend that hold however a run is started or topped up. EI_MAX_RUN_BUDGET_MICRO_USD is the most any one run may be given, at its start and after every grant; EI_MAX_OUTSTANDING_BUDGET_MICRO_USD is the most unspent budget all runs may hold together (each unfinished run's cap less what it has spent), so a client that starts many runs, or is granted more again and again, runs out of room instead of out of money. Neither is set by default. A brief or a grant that would break one is refused before anything is saved or queued, with BUDGET_ABOVE_LIMIT or OUTSTANDING_BUDGET_EXCEEDED (HTTP 422), the same way over the REST API, ei run create and ei run grant, MCP and ACP; a denial is never held back. The check lives in a new SpendCeiling service used by CreateRun and ResolveSpendConsent. A property test (tests/unit/services/test_spend_ceiling_property.py) runs random sequences of starts, requests for more, grants, spending and finishing and shows that no ceiling is ever exceeded. A check and the save that follows it are one locked step, so many requests at once to one API or MCP process cannot each pass against the same total; across separate processes (the API and a command line) each holds its own lock, so there it is a check with a window of a few milliseconds. ei book create (your own machine, one run) is not held to it.
- A run that would spend past its cap now waits for a decision instead of failing. Its next model call is refused before it spends, and the run stops as awaiting_consent with the amount the call needs. An open ei acp session is asked with a permission request to grant that exact amount or deny it; from the command line, ei run grant RUN_ID and ei run deny RUN_ID decide any waiting run. A denied run parks and can be continued later with ei run grant RUN_ID --micro-usd N. See INTERACTIONS.md.
- The run summary (ei run status, the run API) now says how much a run waiting for consent asks for, in consent_requested_micro_usd; it is null at any other time. The field is additive: existing readers are unaffected.
- The Dockerfile has a worker-tex target (M8.5): a worker image with the TeX toolchain a book build calls (LuaLaTeX, latexmk, tex4ebook, pdftoppm, epubcheck, a Java runtime, zip and tidy). The default target is still the slim image the compose stack runs; it now also installs the publishing extra, so it is about 170 MB larger. In the TeX image, a book builds to PDF and EPUB and the EPUB passes epubcheck, with the container's filesystem read-only and every capability dropped. The TeX cache has to point at /tmp, which the image sets; docs/WORKER_IMAGE.md records what was verified and what was not, including a full book and the CI job for this target.
- Outbound connections for fetch_url and remote MCP servers are pinned to the address that was checked, closing the DNS-rebinding gap. The new PublicHttpsUrlPinner resolves a name once, has the URL policy judge every address it returned, and hands the caller the vetted address together with the name for the Host header and for TLS, so the certificate is still checked against the name and not the address. A name that resolves public and then inward is sent to the public address only. Only one address is tried, a request to a name that fails to resolve or fails IDNA encoding is refused, and fetch_url sends Connection: close so a connection verified for one name is never reused for another that shares its address. Proven over real TLS with a self-signed certificate. Signed webhook delivery still asks the policy and lets the client resolve again, and is unchanged.
- Publishing now follows the branch. A merge to develop uploads a development build (<version>.dev<run number>) to TestPyPI, and a merge to main is a release: the guard checks the version and changelog, a GitHub release and the tag v<version> are created, and the packages are uploaded to PyPI. The core and the SDK are uploaded by separate jobs from separate environments (testpypi and testpypi-sdk, pypi and pypi-sdk), because PyPI tells pending trusted publishers apart by their environment. Each index is off until its repository variable (PUBLISH_TO_TESTPYPI, PUBLISH_TO_PYPI) is true, and each environment's reviewers approve every upload. A tag push no longer starts a release. None of the four upload jobs has run. See ADR 0009.
- The structure and lines editing passes now tell the model how long the chapter is and what range to stay in, and a rejected answer is asked for once more. On the first real book, gpt-oss:20b shrank every chapter to 21-46% of its length in the structure pass and 57-80% in the lines pass, so all but one answer fell outside the bounds and the book was kept as drafted. Asking for "about as long, no fewer than N words and no more than M, keeping every section, table, checklist and example" brought six of the seven chapters to 90-100% of their length, with every heading and table kept and no new quotations; the seventh, at 62%, is the case the retry below is for. If an answer is still outside the bounds, the executor asks once more with the rejected answer's length and the range in the prompt, which makes it a different request and so not a replay from the journal; if that one does not finish, the first answer's rejection stands, and if it runs out of budget the chapter is skipped like any other. The three editing templates are now version 2 (each has a new retry part; the structure and lines prompts have the three length blanks), so an old run's calls are not replayed. A rejected chapter now costs a second call, which the cost estimator does not count.
- An edit that a revision pass rejects is now reported as a tolerated revision-rejected issue, with the answer's word count and the length bounds it missed, and the chapter it was asked about is listed as kept as it was. Before, a rejected edit was reported as revision-unchanged, which read as the model having changed nothing. The rejection is recorded per chapter in <stage>_rejected_NN.md, so a redelivery reports the same. Nothing is kept or paid for differently; the run's status is unaffected.
0.1.0a2¶
- Release flow and CI: ADR 0005 records how releases really work (the version is set by hand in the release commit) and replaces direct edits of this file with
changelog.d/fragments, folded byscripts/fold_changelog.pyand enforced by the release guard. CI now runs every gate on Python 3.12, 3.13 and 3.14, the SDK and core declare 3.14, and a dailyCanaryworkflow installs the declared bounds from the package index without the lock file and runs the suite.CONTRIBUTING.mdstates what may live in the public repository (where model prompts, fixtures and cassettes go). - The
toolchainCI job caches the downloaded TeX packages and downloads them in short, retried attempts, because the runner's mirror sometimes throttled a connection until the job hit its time limit. - Added a
toolchainCI job that builds a synthetic fixture book with real LuaLaTeX, tex4ebook and epubcheck under a strict release contract and compares it with a checked-in structural snapshot. Before this, no test built a real PDF or EPUB. Seedocs/TESTING.md. - Hardened the TeX toolchain before any model-written text reaches it:
latexmkruns with-no-shell-escape, and bothlatexmkandtex4ebookget an allow-listed environment (PATH,HOME, locale,TEXMF*and similar) instead of a copy of the parent's, so API keys and tokens never reach a build tool. - A strict release (
--strict-release, orrelease.required = truein the book config) now fails whenepubcheckis not installed. Before, a missing validator read as a pass. - CI works again.
vibey-engine4.5.0 was removed from PyPI (the index lists 0.3.0 and 0.4.0), which failed the provenance job, the distribution build anduv lock. The runtime extra now asks forvibey-engine>=0.4,<0.5; the provenance job installs fromuv.lockinstead of the index;tests/unit/test_vibey_import_contract.pynames every vibey symbol the package uses. - CI now also runs
ruff format --checkand installs withuv sync --locked, which fails whenuv.lockandpyproject.tomldisagree. - Replaced the unused
cliextra (typer) withwebhooks(httpx, which webhook delivery imports). - The commit-msg and pre-push hooks are regenerated by the pinned
vibey-gh; the new template readsself_sourcefrom local git config instead of a tracked file. uvresolves only Python 3.12 to 3.14, so a lock no longer tries to resolve Python 3.15.- Added ADR 0003 (the definition of 1.0: an idea becomes a KDP-ready EPUB and print PDF with nobody in the loop) and ADR 0004 (versioning, compatibility and deprecation).
- Corrected documentation that claimed more than the code does: categories are not checked, jobs are not retried, no
pdf_safetymodule exists, no clock port exists, delivery is at least once, and the API readiness probe does not include the toolchain check. The MCP server no longer says it can inspect pipelines. - Provenance headers now cover the SDK package, and
CONTRIBUTING.mdlists every gate command. - Documentation now states the purpose everywhere: fully autonomous writing of fiction and non-fiction books, packaged ready to self-publish on Amazon KDP. Added
docs/BOOKS_AND_KDP.md(what a KDP-ready package contains, what is built, what is not); package descriptions updated. - Restored a green
developafter the Dependabot major bumps: the MCP server usesmcp.server.mcpserver.MCPServer(mcp2.x renamedFastMCP) and the bounds now requiremcp>=2,<3; the compose file mounts/var/lib/postgresqlfor PostgreSQL 18; coverage measures child processes itself (patch = ["subprocess"]) now that pytest-cov 7 does not. - Pull requests opened by Dependabot are exempt from the
Made-With:provenance check (it cannot add the trailer); Conventional Commit checking still applies. - Rewrote the examples to behave like real use:
requestsandcurlagainst a running API, a real MCP stdio client and server, and a stdlib webhook receiver with a sender, plusexamples/up.shanddown.shto run the stack. The example tests run them against real sockets. - Documentation overhaul: README, getting started, interfaces reference, architecture, troubleshooting, testing, contributing, agent guidance and
llms.txt. - The release workflow can be started by hand for an existing tag (
workflow_dispatch), and the guard now verifies the commit of the tag being released instead of the commit that started the run. - CI can be started by hand.
0.1.0a1¶
- Established the orphan FOSS package and initial domain boundaries.
- Recorded the vibey integration boundary and fallback adapter decision.
- Added fail-closed security adapters: API key authentication, per-address and per-key rate limiting, timestamped webhook signatures with replay defence, an outbound URL policy that blocks SSRF, path confinement, and upload inspection. The REST API now requires a guard.
ApplicationErrorstays immutable but no longer blocks__traceback__, which crashed it when raised on a worker thread.- Added observability: JSON logs with secret masking, a correlation id carried from request to queue to worker to webhook, request counters,
/health/live,/health/readyand an authenticated Prometheus/metrics, service latency tracing, crash alert hooks and a worker heartbeat with a silence watchdog. - Webhook dispatch now isolates failures per event, counts attempts, and dead-letters with an alert after repeated failure. Previously one rejected or unreachable destination blocked every event behind it. The outbox table gained
dead_at. - Added
ei serve apiandei serve worker, a Dockerfile, andexamples/docker-compose.yml(Postgres, RabbitMQ, API, worker) with a smoke test. All settings fail closed and the compose file has no default credentials. - Added a worker that consumes jobs from RabbitMQ, runs each stage, records it in the ledger and enqueues the next, with malformed and failing jobs dead-lettered.
StartPipelinenow tells a job which stages follow it. - Fixed the RabbitMQ publisher silently dropping messages when the queue had not been declared yet.
- Added release automation: a tag-triggered workflow that guards the tag, builds and installs the real artifacts, attests build provenance, creates the GitHub release with checksums and an SBOM, and publishes to PyPI behind an approval gate. See
docs/RELEASING.md. - The version is now defined once, in
__version__, and read bypyproject.toml,ei --versionand the API. Builds are reproducible. - The wheel now ships
py.typed, and the source distribution no longer includes local tool caches, git hooks or agent configuration. Added project URLs, classifiers and an SDK README. ei servewithout theapiandruntimeextras now says which extras to install instead of failing with a traceback.- Pinned every GitHub Action to a commit SHA, restricted job permissions, and added
actionlintandzizmorchecks.