Skip to main content

English 简体中文

Novel Weaver

License: AGPL v3+ Python CI PyPI

Core Engine for productized long-form novel production

Novel Weaver turns chapter production into a repeatable, controllable, recoverable, repairable, and traceable engineering pipeline. It is not a chat writing tool, novel editor, community platform, or multi-agent prompt chain.

Plan → Context Pack → Provider.generate → Candidate
  → Validate / Semantic Review → Commit Guard
  → Canonical Story → Checkpoint / Resume / Audit

Success is not “can generate one pretty chapter”. Success is whether long runs stay stable, upstream edits only invalidate real dependents, and swapping providers does not erase the official story.

Features

  • Truth boundary: Evidence → Proposal → Canonical promotion with Commit Guard
  • Strict Draft / Candidate / Canonical layering (PENDING ≠ FALSE ≠ TRUE)
  • Single-chapter production loop with dual-layer quality + optional LLM semantic review
  • Continuous production with checkpoint/resume and no double-commit on retry
  • Incremental repair: dependency graph, impact analysis, minimal invalidation
  • External-edit reconcile before further commits
  • Book-level consistency pass, snapshots, releases, timeline projection
  • Swappable providers: fake, template, OpenAI-compatible HTTP, failover
  • SQLite Canonical storage (stdlib); zero mandatory third-party runtime deps
  • CLI for demo, production, bench, export, and diagnostics

Requirements

  • Python 3.12+

Install

git clone https://github.com/zcbacxc/novel-weaver.git
cd novel-weaver
python -m pip install -e ".[dev]"

From PyPI

pip install novel-weaver

Core runtime has no mandatory third-party dependencies. Real LLM calls are optional via any OpenAI-compatible HTTP endpoint.

Quick start

# Offline tests (no paid LLM)
python -m pytest tests -v

# Demo workspace: truth boundary + short engine loop
novel-weaver demo --workspace .workspaces/demo

# Single-chapter engine production
novel-weaver engine --provider template --workspace .workspaces/engine
# novel-weaver engine --provider openai --workspace .workspaces/llm

# Continuous multi-chapter production
novel-weaver produce --workspace .workspaces/prod

# Full-book consistency check
novel-weaver book-check --workspace .workspaces/demo

# Long-run benchmark (default 30 chapters)
novel-weaver bench --chapters 30 --workspace .workspaces/bench-30

More paths (config, snapshots, timeline) are in docs/QUICKSTART.md and docs/ARCHITECTURE.md.

LLM configuration (optional)

Copy .env.example to project .env or ~/.novel-weaver/.env:

NOVEL_WEAVER_LLM_BASE_URL=https://api.openai.com/v1
NOVEL_WEAVER_LLM_API_KEY=sk-...
NOVEL_WEAVER_LLM_MODEL=gpt-4o-mini

See docs/LLM_PROVIDERS.md. Without LLM keys, fake / template still run the full engine loop.

Package layout

src/novel_weaver/
  config.py         # config + workspace bootstrap
  domain/           # Canonical entities and versions
  truth/            # Evidence / Proposal / Commit Guard / Audit
  storage/          # SQLite repositories + Snapshot / Release / Artifact
  production/       # orchestration, invalidation, repair, review
  ai/               # providers (fake / template / openai-compat / failover)
  runtime/          # Checkpoint / Resume / Cost / Diagnostics
  benchmarks/       # long-run production benchmark
  cli/              # novel-weaver entrypoint
tests/
docs/               # public bilingual docs (EN primary)

Design constraints

  • Canonical Story is the only official truth; projections must be rebuildable.
  • Draft / Candidate / Canonical are strictly layered; no evidence, no Canon.
  • Runtime failures never pollute Canon; commits must pass Commit Guard.
  • Upstream edits invalidate only real dependents (minimal re-production).
  • Providers and models are swappable; agents are an implementation detail, not a system boundary.

Documentation

Topic English 简体中文
Docs index docs/index.md —
Quickstart QUICKSTART 快速开始
Architecture ARCHITECTURE 架构
Contributing CONTRIBUTING 贡献指南
LLM providers LLM_PROVIDERS Provider 配置
ADR ADR 架构决策
Packaging PACKAGING 打包
Release checklist RELEASE_CHECKLIST 发布清单
Roadmap ROADMAP 路线图
AI guide AI_GUIDE AI 导航

Release

License

GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). See LICENSE. Network service use triggers AGPL §13 source offer obligations.

Metadata

Release files for novel-weaver 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for novel-weaver 0.4.0
File Size Uploaded Provenance Actions
novel_weaver-0.4.0.tar.gz 165.1 kB With provenance Details for novel_weaver-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for novel-weaver 0.4.0
File Interpreter ABI Platform Actions
novel_weaver-0.4.0-py3-none-any.whl Python 3 none any Details for novel_weaver-0.4.0-py3-none-any.whl

Total release size: 327.9 kB

Release files / novel_weaver-0.4.0.tar.gz

Download URL novel_weaver-0.4.0.tar.gz
Size 165.1 kB
Tags Source
SHA-256 checksum
How to use checksums
346ca4a1f627e043fab68b9371ef06fb291d988de352748a50ea29f6cb56a4ff
BLAKE2b-256 checksum
How to use checksums
28f73606e35633f718130c57610e4434c6e9b771cb15a6aa4286a2b677a13986
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / novel_weaver-0.4.0-py3-none-any.whl

Download URL novel_weaver-0.4.0-py3-none-any.whl
Size 162.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff6b6b9c30cda90ea908a09d07c4d089d6c54774b7654c310e50598e71a77319
BLAKE2b-256 checksum
How to use checksums
7a1b7ba6fa1f26d27d98a4fe71e04657ddfa1e73de079088e2dde4d2d4357d17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Security for novel-weaver 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for novel_weaver-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page