Commit Graph

406 Commits

Author SHA1 Message Date
Ma 2a5ab2cbc0 refactor(pipeline): extract persisted governed plan loader 2026-04-01 17:27:20 +08:00
Ma 06070ca4be refactor(state): share story markdown parsers 2026-04-01 17:22:11 +08:00
Ma eb288b31f8 refactor(prompt): share compact governed process briefs 2026-04-01 17:12:15 +08:00
Ma 4248e1db56 refactor(prompt): compact governed writer control surface 2026-04-01 16:40:15 +08:00
Ma 616f807d6f refactor(pipeline): extract chapter state recovery 2026-04-01 16:21:45 +08:00
Ma ef7d4ebb6a refactor(pipeline): extract hook agenda from memory retrieval 2026-04-01 16:14:32 +08:00
Ma f3044007d4 feat(pipeline): auto-repair collapsed chapter titles 2026-04-01 16:05:41 +08:00
Ma b80056eac5 refactor(prompt): naturalize hook debt briefs 2026-04-01 15:44:26 +08:00
Ma 71a860e7d5 refactor(pipeline): centralize cadence pressure policy 2026-04-01 15:39:06 +08:00
Ma 822708e3ca refactor(prompt): soften governed creative guidance 2026-04-01 15:33:33 +08:00
Ma 82c28425a3 refactor(pipeline): align hook activity thresholds 2026-04-01 13:41:21 +08:00
Ma 2b911816c6 refactor(pipeline): centralize hook policy constants 2026-04-01 13:38:40 +08:00
Ma ba7f7c5f08 refactor(pipeline): unify legacy context windows 2026-04-01 13:24:55 +08:00
Ma 3f8528798f feat(pipeline): make hook retrieval lifecycle-aware 2026-04-01 13:15:38 +08:00
Ma 198cc94859 feat(pipeline): make hook agenda pressure-aware 2026-04-01 13:08:42 +08:00
Ma f0110e8d7b feat(pipeline): align hook audit with lifecycle semantics 2026-04-01 12:56:44 +08:00
Ma 2638f22927 fix(pipeline): isolate audit drift guidance from state 2026-04-01 12:43:38 +08:00
Ma c608cd3237 feat(pipeline): unify chapter cadence pressure analysis 2026-04-01 12:38:01 +08:00
Ma 6b12293dd5 feat(pipeline): add structured hook pressure map 2026-04-01 12:15:34 +08:00
Ma d6855e4e60 feat(pipeline): add semantic hook lifecycle guidance 2026-04-01 11:52:26 +08:00
Ma aeb64b658c feat(llm): support custom HTTP headers via INKOS_LLM_HEADERS env var
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.
2026-04-01 10:11:18 +08:00
Ma e689a8391f feat(cli): expose degraded-state recovery flow 2026-04-01 09:52:01 +08:00
Ma 2e2264f255 fix(pipeline): recover from state validation failures 2026-04-01 09:50:59 +08:00
Ma f9faefc27b fix(style): degrade gracefully when fingerprint extraction fails 2026-03-31 21:28:51 +08:00
Ma 48ea3e353d fix(review): preserve committed snapshots on approval 2026-03-31 21:28:09 +08:00
Ma 5f187f957c feat(review): reject rolls back state and discards downstream chapters
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.
2026-03-31 20:36:50 +08:00
Ma 7316ed7027 feat(style): extract writing style in fanfic/continuation/import flows
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.
2026-03-31 19:58:58 +08:00
Ma 1fa53d3131 feat(planner): emit mood directive when consecutive chapters are high-tension
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.
2026-03-31 19:58:43 +08:00
Ma c5af09f897 fix(titles): regenerate duplicates before suffix fallback 2026-03-31 16:00:18 +08:00
Ma db55742fce fix(hooks): promote stale debt and explicit hook agenda in writer 2026-03-31 15:50:19 +08:00
Ma 8a05275d32 feat(governed): inject explicit history and canon evidence into writer 2026-03-31 15:41:50 +08:00
Ma 6be56cf08c feat(planner): emit structured writing directives 2026-03-31 15:31:56 +08:00
Ma b9c05e1ad1 fix(planner): demote stale current focus below outline anchors 2026-03-31 15:22:11 +08:00
Ma 2061c7ef30 fix(planner): harden exact and range outline matching 2026-03-31 15:05:06 +08:00
Ma c442a9a805 fix(planner): support chapter range outline anchors 2026-03-31 14:37:20 +08:00
Ma 59b1f191a3 fix: exclude dialogue lines from paragraph fragmentation detection
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.
2026-03-31 12:23:57 +08:00
Ma 2037147cdf fix(release): publish studio package in automated releases v1.0.1 2026-03-31 01:10:29 +08:00
Ma 128cd79d10 fix(cli): ship studio runtime with published package 2026-03-31 00:57:58 +08:00
Ma 65852fe6ea chore: bump version to 1.0.0, update CHANGELOG
Studio integration, stability fixes, and documentation updates.
v1.0.0
2026-03-30 20:15:29 +08:00
Ma a7dbc31a52 chore: gitignore .playwright-cli/, .superpowers/, _*.md 2026-03-30 20:12:37 +08:00
Ma 79f6782874 chore: untrack .playwright-cli/ and .superpowers/ from studio merge 2026-03-30 20:12:25 +08:00
Ma 1b3312d6ac chore: remove promotional files brought in by studio merge 2026-03-30 20:12:09 +08:00
Ma 6a60f2fc5b chore: untrack docs/ — already in .gitignore 2026-03-30 20:07:43 +08:00
Ma 6b4194d6df chore: untrack autoresearch/ and add to .gitignore 2026-03-30 20:06:35 +08:00
Ma e16b2c145f docs: announce Studio launch and update roadmap across all READMEs
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.
2026-03-30 20:06:10 +08:00
Ma 2f9d5f7d69 chore: add autoresearch/ to .gitignore 2026-03-30 20:05:34 +08:00
Ma 1bfcba7a2d test(core): align unknown-hook reducer expectations 2026-03-30 18:13:18 +08:00
Ma 904006baf9 fix(studio): surface async book creation failures 2026-03-30 18:09:53 +08:00
Ma 6aa5c83080 fix(studio): wait for created books before routing 2026-03-30 18:09:53 +08:00
Ma 88a341a6da fix: skip unknown hooks in resolve/defer instead of throwing
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".
2026-03-30 17:46:32 +08:00