Some API providers (e.g. openclaudecode.cn) require a specific
User-Agent header for external clients. Without it requests get 403.
Adds INKOS_LLM_HEADERS (JSON object) which is injected as
defaultHeaders into the OpenAI SDK client. No effect when unset.
Also adds an optional `headers` field to LLMConfigSchema.
Adds StateManager.rollbackToChapter(bookId, targetChapter) which:
- Restores the snapshot at targetChapter
- Deletes chapter files, snapshots, and runtime artifacts beyond it
- Updates the chapter index to remove discarded entries
review reject now calls rollbackToChapter(chapterNum - 1) by default,
undoing the rejected chapter's state mutations and any subsequent chapters
that depended on them. --keep-subsequent preserves legacy behavior.
review approve now re-snapshots the approved chapter to ensure a clean
rollback target exists.
This prevents bad drafts from permanently polluting truth files — the
core "audit-then-commit" invariant that was missing.
Three changes:
1. FanficCanonImporter now extracts a writing_style section from source
material — narration voice, sentence rhythm, dialogue markers, imagery
preferences, emotional expression patterns, with source-text citations.
2. initFanficBook calls generateStyleGuide after canon import so fanfic
books start with both style_profile.json and style_guide.md.
3. importCanon reads up to 5 parent chapters and generates a style guide
for the target book. importChapters does the same on first run.
These ensure continuation and fanfic books have style reference data
available to the writer from the first chapter onward.
Implements buildMoodDirective — detects when 3+ recent chapters share
high-tension mood keywords (紧张/冷硬/压抑/tense/grim/etc.) and emits
a structured directive forcing the writer to downshift to a quieter scene.
Completes the moodDirective slot that was declared but left as undefined
in the previous structured-directives commit.
Dialogue paragraphs (starting with quotes/brackets) are naturally short
and should not count toward the "consecutive short paragraphs" warning.
This was the #1 cause of audit failures in all Chinese books (14-25%
pass rate), inflating issue counts with false positives.
Discovered via autoresearch: 3/5 books had paragraph fragmentation as
their top audit issue category, all driven by dialogue-heavy scenes.
Add Studio release announcement near the top of all three READMEs
(zh/en/ja). Add inkos studio to command reference tables. Mark
Studio as shipped in roadmap, add interactive fiction as next item.
Update SKILL.md to v2.2.0 with Studio workflow section.
Settler may reference hook IDs that were cleared by a previous
settlement or not yet created. Gracefully skip instead of crashing
the pipeline.
Discovered via autoresearch: 旧城暗号 failed at ch16 with
"unknown hook: H012".