Codex/phase4 export tasks 1 4 - #4
Merged
Merged
Conversation
added 9 commits
August 3, 2026 15:02
There was a problem hiding this comment.
Pull request overview
该 PR 实现 Phase 4「番茄小说人工投稿包」导出能力:从 accepted 事实链、审校报告、来源台账、平台规则快照与投稿元数据生成仅供作者人工上传的离线包,并提供可复验 manifest 与相应的单元/集成测试、文档和 Skill 合同更新。
Changes:
- 新增 Fanqie 导出核心:章节清理、来源审计、内部重复检测、规则/元数据校验、manifest 生成与导出打包。
- CLI 增加
export fanqie子命令与 Phase4/E2E 测试脚本,补齐端到端验证夹具。 - 增补规则快照/元数据/来源台账 JSON Schema、Fanqie 规则快照样例、文档与
novel-exportSkill 合同。
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/submission-metadata.test.ts | 投稿元数据 Schema + 平台规则约束单测 |
| tests/unit/provenance.test.ts | 来源台账 Schema + 来源审计单测 |
| tests/unit/platform-rules.test.ts | 平台规则快照 Schema、加载与时效单测 |
| tests/unit/duplication.test.ts | 内部重复检测与审计输出单测 |
| tests/unit/clean-chapter.test.ts | 导出章节清理规则与残留 blocker 单测 |
| tests/integration/skills-contract.test.ts | Skill 合同覆盖新增 novel-export 与路由命令 |
| tests/integration/phase4-export.test.ts | Phase 4 ready/blocked 情景集成测试 |
| tests/integration/end-to-end.test.ts | 从 accepted 到投稿包的端到端测试 |
| tests/integration/build-package.test.ts | 投稿包构建集成测试(排序、manifest、阻断条件) |
| tests/fixtures/export/chapter-with-internals.md | 章节清理夹具(frontmatter/投影/内链等) |
| tests/fixtures/export/approved-book/README.md | Phase 4 临时夹具说明 |
| tests/fixtures/export/approved-book/factory.ts | 端到端/集成测试临时 Vault+runtime 夹具工厂 |
| src/review/prose-lint.ts | 占位符规则字符串归一化以支持变体配置 |
| src/export/rules.ts | 平台规则快照加载与时效判断 |
| src/export/provenance.ts | 来源台账校验与正文来源审计 |
| src/export/metadata.ts | 投稿元数据 Schema 校验 + 平台规则校验 |
| src/export/manifest.ts | 投稿包 manifest 生成与复验 |
| src/export/duplication.ts | 8-gram 内部重复检测与审计输出 |
| src/export/cover-brief.ts | 封面简报渲染(含人工复核项) |
| src/export/clean-chapter.ts | Markdown 章节清理为纯正文 + residual 扫描 |
| src/export/build-package.ts | 导出编排:门禁、写包、manifest、ready/blocked 落盘 |
| src/core/checksum.ts | 新增 bytes checksum 支持 manifest |
| src/cli.ts | 新增 export fanqie CLI 路由与参数解析 |
| schemas/submission-metadata.schema.json | 投稿元数据 JSON Schema |
| schemas/source-ledger.schema.json | 来源台账 JSON Schema |
| schemas/platform-rules.schema.json | 平台规则快照 JSON Schema |
| README.md | Phase 4 完成说明、命令与产物结构文档化 |
| policies/fanqie/rules-2026-07-17.json | Fanqie 官方公开规则快照样例 |
| policies/fanqie/README.md | 规则快照保存与刷新原则说明 |
| policies/common/prose.yaml | 占位符模式配置更新(配合归一化) |
| package.json | 新增 phase4/e2e 测试脚本 |
| docs/release/0.1.0-checklist.md | 0.1.0 发布审计清单(含 Phase4 验证命令) |
| docs/release/0.1.0-architecture.md | 0.1.0 架构与数据流/安全边界说明 |
| .agents/skills/novel/SKILL.md | novel 路由新增 novel-export/export fanqie |
| .agents/skills/novel-export/SKILL.md | 新增番茄人工投稿包导出 Skill 合同 |
| .agents/skills/novel-export/references/manual-upload-checklist.md | 人工上传步骤清单引用 |
| .agents/skills/novel-export/references/fanqie-rule-refresh.md | 官方规则刷新协议引用 |
| .agents/skills/novel-export/agents/openai.yaml | novel-export agent 元数据 |
Suppressed comments (1)
src/export/clean-chapter.ts:135
scanResiduals用line.includes('---')判定 frontmatter 分隔符会产生误报:正文里出现“---”(如场景分隔线、符号组合)也会被当作 blocker。建议只在整行(trim 后)等于---时才视为 frontmatter 分隔符残留。
const locator = `line:${index + 1}`;
if (line.includes('---')) issues.push(issue('frontmatter-delimiter', locator, '清理后仍残留 frontmatter 分隔符。', line));
if (line.includes('[[') || line.includes(']]')) issues.push(issue('obsidian-link', locator, '清理后仍残留 Obsidian 内链。', line));
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+105
to
+109
| if (skipSection && line === '') { | ||
| skipSection = false; | ||
| continue; | ||
| } | ||
| if (skipSection) continue; |
Comment on lines
+173
to
+176
| issues.push(...latestPassedReview(runtimeRoot, commit.chapter_id, commit.chapter_checksum)); | ||
| const cleaned = cleanChapterForExport(source.source); | ||
| issues.push(...cleaned.issues); | ||
| exportChapters.push({ |
Comment on lines
+42
to
+45
| "checksum": { | ||
| "type": "string", | ||
| "pattern": "^[0-9a-fA-F]{64}$" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.