Browse Source

docs: update bilingual README with v0.3 new features

majx_mac 8 tháng trước cách đây
mục cha
commit
ddacad44d6
2 tập tin đã thay đổi với 124 bổ sung và 42 xóa
  1. 62 21
      README.en.md
  2. 62 21
      README.md

+ 62 - 21
README.en.md

@@ -23,9 +23,41 @@
 
 Open-source multi-agent system that autonomously writes, audits, and revises novels — with human review gates that keep you in control.
 
-## v0.3 Update (2026-03-13)
+## v0.3 Update
 
-Three-layer rule separation: core guardrails → genre-specific rules → per-book custom rules.
+Three-layer rule separation + cross-chapter memory + AIGC detection + Webhook.
+
+### Cross-Chapter Memory & Writing Quality
+
+The Writer auto-generates chapter summaries, updates subplot/emotion/character matrices — all appended to truth files. Subsequent chapters load full context, so long-term foreshadowing never gets lost.
+
+| Truth File | Purpose |
+|------------|---------|
+| `chapter_summaries.md` | Per-chapter summaries: characters, key events, state changes, hook dynamics |
+| `subplot_board.md` | Subplot progress board: A/B/C line status tracking |
+| `emotional_arcs.md` | Emotional arcs: per-character emotion, triggers, arc direction |
+| `character_matrix.md` | Character interaction matrix: encounter records, information boundaries |
+
+### AIGC Detection
+
+| Feature | Description |
+|---------|-------------|
+| AI-Tell Audit | Pure rule-based detection (no LLM): paragraph uniformity, hedge word density, formulaic transitions, list-like structure — auto-merged into audit results |
+| AIGC Detection API | External API integration (GPTZero / Originality / custom endpoints), `inkos detect` command |
+| Style Fingerprint | Extract StyleProfile from reference text (sentence length, TTR, rhetorical features), inject into Writer prompt |
+| Anti-Detect Rewrite | ReviserAgent `anti-detect` mode, detect → rewrite → re-detect loop |
+| Detection Feedback Loop | `detection_history.json` records each detection/rewrite result, `inkos detect --stats` for statistics |
+
+```bash
+inkos style analyze reference.txt           # Analyze reference text style
+inkos style import reference.txt my-book    # Import style into book
+inkos detect my-book --all                  # Detect all chapters
+inkos detect --stats                        # Detection statistics
+```
+
+### Webhook + Smart Scheduler
+
+Pipeline events POST JSON to configured URLs (HMAC-SHA256 signed), with event filtering (`chapter-complete`, `audit-failed`, `pipeline-error`, etc.). Daemon mode adds quality gates: auto-retry on audit failure (with temperature ramp), pause book after consecutive failures.
 
 ### Genre Customization
 
@@ -83,13 +115,13 @@ fatigueWordsOverride: ["pupils constricted", "disbelief"]   # Override genre def
 
 Protagonist personality lock, numerical caps, custom prohibitions, fatigue word overrides — each book's rules are independent, without affecting the genre template.
 
-### 19-Dimension Audit
+### 26-Dimension Audit
 
-Auditing is broken down into 19 dimensions, with genre-appropriate subsets auto-enabled:
+Auditing is broken down into 26 dimensions, with genre-appropriate subsets auto-enabled:
 
-OOC check, timeline, setting conflicts, foreshadowing, pacing, writing style, information leaking, vocabulary fatigue, broken interest chains, side character intelligence drops, side character tool-ification, hollow payoffs, dialogue authenticity, padding detection, knowledge base contamination, POV consistency, power scaling collapse, numerical verification, era research
+OOC check, timeline, setting conflicts, foreshadowing, pacing, writing style, information leaking, vocabulary fatigue, broken interest chains, side character intelligence drops, side character tool-ification, hollow payoffs, dialogue authenticity, padding detection, knowledge base contamination, POV consistency, power scaling collapse, numerical verification, era research, paragraph uniformity, hedge word density, formulaic transitions, list-like structure, subplot stagnation, flat emotional arc, monotonous pacing
 
-Xuanhuan/Xianxia: all 19 dimensions. Urban: 17 dimensions (including era research). Horror: 15 dimensions.
+Xuanhuan/Xianxia: all 26 dimensions. Urban: 24 dimensions (including era research). Horror: 22 dimensions. Dims 20-23 (AI-tell detection) use a pure rule engine — no LLM calls consumed.
 
 ### De-AI-ification
 
@@ -101,12 +133,12 @@ Xuanhuan/Xianxia: all 19 dimensions. Urban: 17 dimensions (including era researc
 - Same imagery rendered no more than twice
 - Methodology jargon stays out of prose
 
-Vocabulary fatigue audit simultaneously checks marker word density — exceeding threshold triggers a warning.
+Vocabulary fatigue audit + AI-tell audit (dims 20-23) provide dual detection. Style fingerprint injection further reduces AI text characteristics.
 
 ### Other
 
 - Supports OpenAI + Anthropic native + all OpenAI-compatible endpoints
-- Reviser supports polish / rewrite / rework modes
+- Reviser supports polish / rewrite / rework / anti-detect modes
 - Genres without numerical systems skip resource ledger generation
 - All commands support `--json` structured output for OpenClaw / external agent integration
 - Auto-detect book-id when project has only one book
@@ -145,15 +177,19 @@ If the audit fails, the pipeline automatically enters a revise → re-audit loop
 
 ### Canonical Truth Files
 
-Every book maintains three files as the single source of truth:
+Every book maintains 7 truth files as the single source of truth:
 
 | File | Purpose |
 |------|---------|
 | `current_state.md` | World state: character locations, relationships, knowledge, emotional arcs |
 | `particle_ledger.md` | Resource accounting: items, money, supplies with quantities and decay tracking |
 | `pending_hooks.md` | Open plot threads: foreshadowing planted, promises to readers, unresolved conflicts |
+| `chapter_summaries.md` | Per-chapter summaries: characters, key events, state changes, hook dynamics |
+| `subplot_board.md` | Subplot progress board: A/B/C line status tracking |
+| `emotional_arcs.md` | Emotional arcs: per-character emotion tracking and growth |
+| `character_matrix.md` | Character interaction matrix: encounter records, information boundaries |
 
-The Continuity Auditor checks every draft against these files. If a character "remembers" something they never witnessed, or pulls a weapon they lost two chapters ago, the auditor catches it.
+The Continuity Auditor checks every draft against these files. If a character "remembers" something they never witnessed, or pulls a weapon they lost two chapters ago, the auditor catches it. Legacy books without new truth files are automatically compatible.
 
 <p align="center">
   <img src="assets/screenshot-state.png" width="800" alt="Truth files snapshot">
@@ -280,6 +316,9 @@ inkos up                          # Daemon mode
 | `inkos config show-global` | Show global config |
 | `inkos config set/show` | View/update project config |
 | `inkos doctor` | Diagnose setup issues (includes API connectivity test) |
+| `inkos detect [id] [n]` | AIGC detection (`--all` for all chapters, `--stats` for statistics) |
+| `inkos style analyze <file>` | Analyze reference text to extract style fingerprint |
+| `inkos style import <file> [id]` | Import style fingerprint into a book |
 | `inkos update` | Update to latest version |
 | `inkos up / down` | Start/stop daemon |
 
@@ -309,7 +348,7 @@ Radar data sources are pluggable via the `RadarSource` interface. Built-in sourc
 
 ### Notifications
 
-Telegram, Feishu, and WeCom. In daemon mode, get notified on your phone when a chapter is done or an audit fails.
+Telegram, Feishu, WeCom, and Webhook. In daemon mode, get notified on your phone when a chapter is done or an audit fails. Webhook supports HMAC-SHA256 signing and event filtering.
 
 ### External Agent Integration
 
@@ -321,14 +360,14 @@ Atomic commands + `--json` output make InkOS callable by OpenClaw and other AI a
 inkos/
 ├── packages/
 │   ├── core/              # Agent runtime, pipeline, state management
-│   │   ├── agents/        # architect, writer, continuity, reviser, radar
-│   │   ├── pipeline/      # runner (atomic ops + full pipeline), agent (tool-use), scheduler
-│   │   ├── state/         # File-based state manager
+│   │   ├── agents/        # architect, writer, continuity, reviser, radar, ai-tells, detector, style-analyzer
+│   │   ├── pipeline/      # runner, agent (tool-use), scheduler, detection-runner
+│   │   ├── state/         # File-based state manager (7 truth files + snapshots)
 │   │   ├── llm/           # OpenAI + Anthropic dual SDK (streaming)
-│   │   ├── notify/        # Telegram, Feishu, WeCom
+│   │   ├── notify/        # Telegram, Feishu, WeCom, Webhook
 │   │   └── models/        # Zod schema validation
-│   └── cli/               # Commander.js CLI (16 commands)
-│       └── commands/      # init, book, write, draft, audit, revise, agent, review, status, export...
+│   └── cli/               # Commander.js CLI (18 commands)
+│       └── commands/      # init, book, write, draft, audit, revise, agent, review, detect, style...
 └── (planned) studio/      # Web UI for review and editing
 ```
 
@@ -339,7 +378,7 @@ TypeScript monorepo managed with pnpm workspaces.
 - [x] Full pipeline (radar → architect → writer → auditor → reviser)
 - [x] Canonical truth files + continuity audit
 - [x] Built-in writing rule system
-- [x] Full CLI (16 commands)
+- [x] Full CLI (18 commands)
 - [x] State snapshots + chapter rewrite
 - [x] Daemon mode
 - [x] Notifications (Telegram / Feishu / WeCom)
@@ -348,10 +387,12 @@ TypeScript monorepo managed with pnpm workspaces.
 - [x] Pluggable radar (RadarSource interface)
 - [x] External agent integration (OpenClaw, etc.)
 - [x] Genre customization + per-book rules (genre CLI + book_rules.md)
-- [x] 19-dimension continuity audit
-- [x] De-AI-ification rules
+- [x] 26-dimension continuity audit (including AI-tell detection)
+- [x] De-AI-ification rules + style fingerprint injection
 - [x] Multi-LLM provider (OpenAI + Anthropic + compatible endpoints)
-- [ ] AI detection review (AIGC detection + auto-rewrite to reduce detection rate)
+- [x] AIGC detection + anti-detect rewrite pipeline
+- [x] Webhook notifications + smart scheduler (quality gates)
+- [x] Cross-chapter coherence (chapter summaries + subplot/emotion/character matrices)
 - [ ] `packages/studio` Web UI for review and editing
 - [ ] Multi-model routing (different models for different agents)
 - [ ] Custom agent plugin system

+ 62 - 21
README.md

@@ -23,9 +23,41 @@
 
 Agent 写小说。写、审、改,全程接管。
 
-## v0.3 更新 (2026-03-13)
+## v0.3 更新
 
-创作规则三层分离:基础护栏 → 题材特性 → 用户自定义规则。
+创作规则三层分离 + 跨章记忆 + AIGC 检测 + Webhook。
+
+### 跨章记忆与写作质量
+
+Writer 每章自动生成摘要、更新支线/情感/角色矩阵,全部追加到真相文件。后续章节加载全量上下文,长线伏笔不再丢失。
+
+| 真相文件 | 用途 |
+|----------|------|
+| `chapter_summaries.md` | 各章摘要:出场人物、关键事件、状态变化、伏笔动态 |
+| `subplot_board.md` | 支线进度板:A/B/C 线状态追踪 |
+| `emotional_arcs.md` | 情感弧线:按角色追踪情绪、触发事件、弧线方向 |
+| `character_matrix.md` | 角色交互矩阵:相遇记录、信息边界 |
+
+### AIGC 检测
+
+| 功能 | 说明 |
+|------|------|
+| AI 痕迹审计 | 纯规则检测(不走 LLM):段落等长、套话密度、公式化转折、列表式结构,自动合并到审计结果 |
+| AIGC 检测 API | 外部 API 集成(GPTZero / Originality / 自定义端点),`inkos detect` 命令 |
+| 文风指纹学习 | 从参考文本提取 StyleProfile(句长、TTR、修辞特征),注入 Writer prompt |
+| 反检测改写 | ReviserAgent `anti-detect` 模式,检测→改写→重检测循环 |
+| 检测反馈闭环 | `detection_history.json` 记录每次检测/改写结果,`inkos detect --stats` 查看统计 |
+
+```bash
+inkos style analyze reference.txt         # 分析参考文本文风
+inkos style import reference.txt 吞天魔帝  # 导入文风到书
+inkos detect 吞天魔帝 --all               # 全书 AIGC 检测
+inkos detect --stats                      # 检测统计
+```
+
+### Webhook + 智能调度
+
+管线事件 POST JSON 到配置 URL(HMAC-SHA256 签名),支持事件过滤(`chapter-complete`、`audit-failed`、`pipeline-error` 等)。守护进程增加质量门控:审计失败自动重试(调高 temperature)、连续失败暂停书籍。
 
 ### 题材自定义
 
@@ -83,13 +115,13 @@ fatigueWordsOverride: ["瞳孔骤缩", "不可置信"]   # 覆盖题材默认
 
 主角人设锁定、数值上限、自定义禁令、疲劳词覆盖——每本书的规则独立调整,不影响题材模板。
 
-### 19 维度审计
+### 26 维度审计
 
-审计细化为 19 个维度,按题材自动启用对应的子集:
+审计细化为 26 个维度,按题材自动启用对应的子集:
 
-OOC检查、时间线、设定冲突、伏笔、节奏、文风、信息越界、词汇疲劳、利益链断裂、配角降智、配角工具人化、爽点虚化、台词失真、流水账、知识库污染、视角一致性、战力崩坏、数值检查、年代考据
+OOC检查、时间线、设定冲突、伏笔、节奏、文风、信息越界、词汇疲劳、利益链断裂、配角降智、配角工具人化、爽点虚化、台词失真、流水账、知识库污染、视角一致性、战力崩坏、数值检查、年代考据、段落等长、套话密度、公式化转折、列表式结构、支线停滞、弧线平坦、节奏单调
 
-玄幻/仙侠全 19 维度,都市 17 维度(含年代考据),恐怖 15 维度。
+玄幻/仙侠全 26 维度,都市 24 维度(含年代考据),恐怖 22 维度。其中 dim 20-23(AI 痕迹)由纯规则引擎检测,不消耗 LLM 调用。
 
 ### 去 AI 味
 
@@ -101,12 +133,12 @@ OOC检查、时间线、设定冲突、伏笔、节奏、文风、信息越界
 - 同一意象渲染不超过两轮
 - 方法论术语不入正文
 
-词汇疲劳审计同时检测标记词密度,超标即 warning。
+词汇疲劳审计 + AI 痕迹审计(dim 20-23)双重检测。文风指纹注入进一步降低 AI 文本特征。
 
 ### 其他
 
 - 支持 OpenAI + Anthropic 原生 + 所有 OpenAI 兼容接口
-- 修订者支持 polish / rewrite / rework 三种模式
+- 修订者支持 polish / rewrite / rework / anti-detect 四种模式
 - 无数值系统的题材不生成资源账本
 - 所有命令支持 `--json` 结构化输出,OpenClaw / 外部 Agent 可直接解析
 - book-id 自动检测:项目只有一本书时省略 book-id
@@ -145,15 +177,19 @@ OOC检查、时间线、设定冲突、伏笔、节奏、文风、信息越界
 
 ### 长期记忆
 
-每本书维护三个文件作为唯一事实来源:
+每本书维护 7 个真相文件作为唯一事实来源:
 
 | 文件 | 用途 |
 |------|------|
 | `current_state.md` | 世界状态:角色位置、关系网络、已知信息、情感弧线 |
 | `particle_ledger.md` | 资源账本:物品、金钱、物资数量及衰减追踪 |
 | `pending_hooks.md` | 未闭合伏笔:铺垫、对读者的承诺、未解决冲突 |
+| `chapter_summaries.md` | 各章摘要:出场人物、关键事件、状态变化、伏笔动态 |
+| `subplot_board.md` | 支线进度板:A/B/C 线状态、停滞检测 |
+| `emotional_arcs.md` | 情感弧线:按角色追踪情绪变化和成长 |
+| `character_matrix.md` | 角色交互矩阵:相遇记录、信息边界 |
 
-连续性审计员对照这三个文件检查每一章草稿。如果角色"记起"了从未亲眼见过的事,或者拿出了两章前已经丢失的武器,审计员会捕捉到。
+连续性审计员对照这些文件检查每一章草稿。如果角色"记起"了从未亲眼见过的事,或者拿出了两章前已经丢失的武器,审计员会捕捉到。旧书无新真相文件时自动兼容。
 
 <p align="center">
   <img src="assets/screenshot-state.png" width="800" alt="长期记忆快照">
@@ -280,6 +316,9 @@ inkos up                       # 守护进程模式
 | `inkos config show-global` | 查看全局配置 |
 | `inkos config set/show` | 查看/更新项目配置 |
 | `inkos doctor` | 诊断配置问题(含 API 连通性测试) |
+| `inkos detect [id] [n]` | AIGC 检测(`--all` 全部章节,`--stats` 统计) |
+| `inkos style analyze <file>` | 分析参考文本提取文风指纹 |
+| `inkos style import <file> [id]` | 导入文风指纹到指定书 |
 | `inkos update` | 更新到最新版本 |
 | `inkos up / down` | 启动/停止守护进程 |
 
@@ -327,7 +366,7 @@ inkos up                       # 守护进程模式
 
 ### 通知推送
 
-支持 Telegram、飞书、企业微信。守护进程模式下,写完一章或审计不通过都会推通知到手机。
+支持 Telegram、飞书、企业微信、Webhook。守护进程模式下,写完一章或审计不通过都会推通知到手机。Webhook 支持 HMAC-SHA256 签名和事件过滤。
 
 ### 外部 Agent 集成
 
@@ -339,14 +378,14 @@ inkos up                       # 守护进程模式
 inkos/
 ├── packages/
 │   ├── core/              # Agent 运行时、管线、状态管理
-│   │   ├── agents/        # architect, writer, continuity, reviser, radar
-│   │   ├── pipeline/      # runner (原子操作 + 完整管线), agent (tool-use 编排), scheduler
-│   │   ├── state/         # 基于文件的状态管理器
+│   │   ├── agents/        # architect, writer, continuity, reviser, radar, ai-tells, detector, style-analyzer
+│   │   ├── pipeline/      # runner, agent (tool-use), scheduler, detection-runner
+│   │   ├── state/         # 基于文件的状态管理器(7 真相文件 + 快照)
 │   │   ├── llm/           # OpenAI + Anthropic 双 SDK 接口 (流式)
-│   │   ├── notify/        # Telegram, 飞书, 企业微信
+│   │   ├── notify/        # Telegram, 飞书, 企业微信, Webhook
 │   │   └── models/        # Zod schema 校验
-│   └── cli/               # Commander.js 命令行 (16 条命令)
-│       └── commands/      # init, book, write, draft, audit, revise, agent, review, status, export...
+│   └── cli/               # Commander.js 命令行 (18 条命令)
+│       └── commands/      # init, book, write, draft, audit, revise, agent, review, detect, style...
 └── (规划中) studio/        # 网页审阅编辑界面
 ```
 
@@ -357,7 +396,7 @@ TypeScript 单仓库,pnpm workspaces 管理。
 - [x] 完整管线(雷达 → 建筑师 → 写手 → 审计 → 修订)
 - [x] 长期记忆 + 连续性审计
 - [x] 内置创作规则体系
-- [x] CLI 全套命令(15 条)
+- [x] CLI 全套命令(18 条)
 - [x] 状态快照 + 章节重写
 - [x] 守护进程模式
 - [x] 通知推送(Telegram / 飞书 / 企微)
@@ -366,10 +405,12 @@ TypeScript 单仓库,pnpm workspaces 管理。
 - [x] 可插拔雷达(RadarSource 接口)
 - [x] 外部 Agent 集成(OpenClaw 等)
 - [x] 题材自定义 + 单本书规则(genre CLI + book_rules.md)
-- [x] 19 维度连续性审计
-- [x] 去 AI 味铁律
+- [x] 26 维度连续性审计(含 AI 痕迹检测)
+- [x] 去 AI 味铁律 + 文风指纹注入
 - [x] 多 LLM provider(OpenAI + Anthropic + 兼容接口)
-- [ ] AI 检测复核(AIGC 检测 + 自动改写降率)
+- [x] AIGC 检测 + 反检测改写管线
+- [x] Webhook 通知 + 智能调度(质量门控)
+- [x] 跨章节连贯性(章节摘要 + 支线/情感/角色矩阵)
 - [ ] `packages/studio` Web UI 审阅编辑界面
 - [ ] 多模型路由(不同 agent 用不同模型)
 - [ ] 自定义 agent 插件系统