PaperSpine 语义确认门(Semantic Confirmation):写作前锁定贡献契约与动机主线的关键技术指南
PaperSpine 语义确认门(Semantic Confirmation):写作前锁定贡献契约与动机主线的关键技术指南
本篇技术指南围绕 PaperSpine 的「写作前语义确认门」展开:它把研究成果先转化为一份用户批准的双段语义契约(已确认贡献 + 已确认动机),再允许任何实质性写作继续。读完本文,你将掌握该门的输入产物、候选契约表格式、guided / delegated_local_test 两种决策授权路径、两条门禁 CLI 命令,以及 contribution_check.py 与 progress_check.py 的底层校验逻辑,能够在自己(或 Agent)驱动的论文写作流水线中正确执行与排障。
语义确认门是什么:写作之前必须先定契约
在 PaperSpine 的流水线中,semantic_confirmation 被定义为 canonical writing-before-writing gate(写作前规范门)。它的职责是把研究阶段的产出转化为一份用户批准的语义契约,契约由两个有序部分组成(见 semantic-confirmation.md):
- Confirmed contribution(已确认贡献)—— 治理性契约:论文为领域新增了什么、哪个空缺与挑战使其成为必要、什么证据使其成立、适用什么声明边界(claim boundary)。
- Confirmed motivation(已确认动机)—— 支撑性论证:该贡献为什么对领域和目标期刊/会议重要。动机可以锐化框架(sharpen the framing),但不得替代或悄悄扩大贡献本身。
两者地位明确:动机支撑贡献,贡献治理动机。之后所有依赖性的写作选择(section 蓝图、写作理由矩阵、正文本身)都必须复用这份已确认的贡献与动机;只有当某个决策真正缺失或发生变化时,才通过当前公开任务(current public task)解决,而不需要两个历史文件或遗留检查器来检查、规划、评审或安全继续论文。
从流水线位置看,orchestrator-branch-map.md 将「Semantic confirmation」列为第 4 步,紧随研究(Research)与引文库(Citation)之后,其必需产物为 confirmed_contribution.md 与 confirmed_motivation.md,门禁名即 semantic_confirmation;而 progress_check.py 中的阶段定义与此一一对应:
StageDef("semantic_confirmation", "Semantic Confirmation (Contribution + Motivation)", [
"confirmed_contribution.md",
"confirmed_motivation.md",
]),
输入与前置产物:研究阶段必须交付什么
语义确认门不是凭空开始的,它消费研究阶段(Research stage)产出的以下输入(见 semantic-confirmation.md):
sota_gap_map.md—— SOTA 与空缺映射;research_dossier.md—— 研究档案;exemplar_learning_dossier.md—— 范例论文学习档案;contribution_options_after_research.md—— 研究后的贡献候选;motivation_options_after_research.md—— 研究后的动机候选;- 用户在研究阶段索引过的证据(user evidence)。
这些文件同样被 progress_check.py 的 research 阶段定义所要求(含 source_map.md、reference_materials/source_index.md、style_profile.md 等),构成进入语义确认门之前的完整上游。如果 semantic_confirmation 阶段缺少 confirmed_contribution.md / confirmed_motivation.md,但存在 contribution_options_after_research.md 或 motivation_options_after_research.md,progress_check.py 会把该阶段标记为 BLOCKED(而不是 PENDING),表示"选项已就绪、等待用户确认",这与 resume 流程中"不得仅为绕过门禁而重写选项"的规则是一致的。
研究生成的候选契约:3–5 个真正不同的选项
contribution_options_after_research.md 必须给出 3–5 个真正不同的贡献契约,而不是同一句话的措辞变体(cosmetic phrasings)。每个选项需要按以下列组织为表格(列结构来自 semantic-confirmation.md):
| Option | Main Contribution | Contribution Type | Specific Gap and Challenge | Evidence Required | Evidence Available | Evidence Missing | Claim Boundary | Reviewer Payoff | Main Risk |
|---|---|---|---|---|---|---|---|---|---|
| A | 该论文的核心贡献句 | new method / new dataset / new theory / new empirical finding / new system / new analysis-or-benchmark / new application | 精确的空缺与使之难以闭合的挑战 | 审稿人会要求什么证据 | 你实际拥有的证据 | 要求与已有之间的缺口 | 允许的强声明与需弱化/回避的声明 | 审稿人只记住一句的价值 | 最可能的反驳风险 |
同时,每个动机选项必须指名它支撑的是哪个贡献选项(Each motivation option must name the contribution option it supports)。如果一个选项需要用户并不拥有的证据,那么它要么弱化其声明,要么明确列出待补的工作(state the missing work explicitly)——这是防止"选项看上去很美、实则站不住"的硬性约束。
决策授权门:guided 与 delegated_local_test 两条路径
确认动作发生在「决策授权门」(Decision Authority Gate),按 interaction-policy.md 的授权模型,存在两种模式:
guided(默认模式):停下来问用户
在 guided 模式下,Agent 必须停下并请用户选择、修改、合并或替换提出的契约。确认是有序的:
- 先锁定贡献及其证据/声明边界;
- 再锁定一个解释该确切贡献必要性与重要性的动机。
用户可以在一次回复中同时确认两者,但 PaperSpine 必须将其记录为两份独立产物,以便后续检查能够区分"什么已经确立"(what is established)与"它为何重要"(why it matters)。
delegated_local_test(本地委派模式):仅在精确授权内替用户决策
delegated_local_test 允许当前宿主 Agent 在不再次询问用户的情况下选择一个有证据支撑的贡献与动机,但前提是:确切的任务/材料/本地范围授权(grant)同时包含 contribution_selection 与 motivation_selection 两个决策类。约束还包括:
- 选择必须停留在证据/声明边界之内;
- 每个选择都必须产生各自的、哈希绑定的
delegated-decision.收据(receipt); - delegated-decision 主体取代作者身份执行本次操作,但绝不虚构作者事实(never invent author facts);
- 任何缺失/过期/漂移的授权(missing/expired/drifted grant)都会回退到 guided 类型化问题,且发生在修订变更之前。
interaction-policy.md 进一步规定授权必须绑定:确切的 task_id 与材料 snapshot_sha256、requested_scope=manuscript|local_delivery(绝不接受 submission_package)、有限有效期与确切的授权决策类、reversible=true 且 external_action_authorized=false,以及宿主/用户行为者身份与三个 SHA-256 字段(user_confirmation_sha256、authority_attestation_sha256、grant_sha256)。注意:仅凭生产者设置的 explicit_user_grant=true 布尔值不构成授权。
每个行使的委派选择都会产生 paperspine5.delegated-decision-receipt。对应的 JSON Schema 位于 delegated-decision-receipt.schema.json,其中可见 decision_class 枚举只允许六类(contribution_selection、motivation_selection、non_author_local_target_adaptation、figure_keep_or_transform、figure_omit、figure_supplement),且强制 "reversible": {"const": true} 与 "external_action_authorized": {"const": false},choice_sha256、grant_sha256、receipt_sha256 均为 64 位十六进制哈希——这就是"哈希绑定"的落地实现。
另外,interaction-policy.md 列出了永久人工门:任何本地委派都无权猜测或决定作者姓名、单位、ORCID、基金、数据可用性事实、许可、费用、投稿范围或任何外部动作;上传、投稿、发布、转账、购买、接受条款、授权第三方披露均不在委派范围内。
确认产物:confirmed_contribution.md 与 confirmed_motivation.md
在有效的 guided 确认或有效的委派收据之后,按 semantic-confirmation.md 的要求:
- 依据 contribution.md 创建
confirmed_contribution.md; - 依据 motivation-thread-writing.md 创建
confirmed_motivation.md; - 确保每个优先化的动机声明都落在贡献的
Strong claims allowed之内,每个回避的声明都与贡献的声明边界一致。
confirmed_contribution.md:四段式贡献契约
contribution.md 规定 confirmed_contribution.md 由四个 ## 小节构成,每一行都强迫做一次具体决策;任何单元格留空或写成 TODO、TBD、... 或模板占位符都会被 contribution_check.py 判定为失败。完整模板如下:
# Confirmed Contribution
## Core Contribution
| Field | Content |
|---|---|
| Main contribution statement | The single sentence the whole paper defends. One claim, specific, falsifiable. |
| Contribution type | new method / new dataset / new theory / new empirical finding / new system / new analysis-or-benchmark / new application. Pick the dominant one. |
| One-sentence reviewer payoff | If the reviewer remembers one thing, it is this. Phrase as the value to the field, not the activity performed. |
## Why This Contribution Is Needed
| Field | Content |
|---|---|
| Field problem | The broad problem the field cares about. Why the area exists. |
| Specific gap | The precise missing capability/knowledge this paper fills. Not "X is understudied" — name the exact hole. |
| Concrete challenge | What makes the gap hard to close (the technical/empirical obstacle that explains why it is still open). |
| Why prior work leaves it unresolved | Name the closest prior approaches and the specific reason each one does not already solve the gap. |
## How This Paper Responds
| Field | Content |
|---|---|
| Design response | The core idea/mechanism that addresses the gap. The "how", tied directly to the challenge above. |
| Evidence required | What evidence a skeptical reviewer would demand to believe the Core contribution. List it before checking what you have. |
| Evidence available | The evidence you actually have (experiments, proofs, datasets, ablations) that meets the "required" list. |
| Evidence missing | The gap between required and available. If non-empty, the Core contribution must be softened or more work is needed. Honest entry here prevents over-claiming. |
## Claim Boundary
| Field | Content |
|---|---|
| Strong claims allowed | Claims fully backed by Evidence available. State them at full strength. |
| Claims to soften or avoid | Claims the evidence cannot carry. Hedge ("suggests", "in this setting") or cut. |
| Novelty risk | The most likely "this was already done by X" objection, and your honest answer. |
| Significance risk | The most likely "so what / too narrow" objection, and your honest answer. |
四段顺序是刻意的:一个贡献只有满足"被需要(第 2 节)、被证据回答(第 3 节)、被边界约束而不夸大(第 4 节)"才是真实的。第 1 节是承诺,第 2–4 节是让承诺在评审中存活的东西。Evidence missing 与 Claim boundary 正是作者最容易跳过、审稿人最常惩罚的部分,PaperSpine 使其成为强制项。
confirmed_motivation.md:支撑性动机契约
motivation-thread-writing.md 提供的 confirmed_motivation.md 模板包含:Source(user-provided / selected option / edited option)、Governing contribution(来自 confirmed_contribution.md 的确切核心贡献句或 Claim ID)、Confirmed motivation statement、One-sentence red thread、Field problem、Specific gap、Design response、Main evidence available、Target-venue fit、Prioritized claims、Claims to avoid、Secondary motivations or boundaries、Surface language priorities,以及按 Section 展开的 Section Consequences 表(Abstract / Introduction / Methods / Results / Discussion 各自"必须做什么 / 应避免什么")。
confirmed_motivation.md 不仅要说明贡献为何重要,还要说明论文不应论证什么;其优先化声明必须落在 confirmed_contribution.md 的声明边界内,防止后续小节漂移为笼统或膨胀的声明。该文档同时强调:Field problem -> specific gap -> design response -> evidence -> interpretation -> limitation/future 这条问题-解决弧线是内部规划记号,绝不能以字面箭头链的形式出现在读者看到的正文里(例如把 传统客服痛点 → 大模型机遇 → ... 写进句子)。
门禁执行:CLI 命令与检查器底层原理
semantic-confirmation.md 给出的门禁命令为:
python scripts/contribution_check.py paper_rewriting_output --markdown --write
python scripts/progress_check.py paper_rewriting_output --gate semantic_confirmation
第二条命令中,motivation_confirmation 仍作为兼容别名(compatibility alias)存在,但新的文档与自动化必须统一使用 semantic_confirmation。
contribution_check.py:贡献契约的结构化校验
contribution_check.py 专门校验 paper_rewriting_output/confirmed_contribution.md,其模块头注释点明了硬规则:没有 confirmed_contribution.md,就没有实质性写作。核心实现细节:
- 占位符模式(contribution_check.py):空行、
todo、tbd、fixme、xxx、n/a、---、...、<...>、[...]、中文的待填、待定、无都被视为"决策从未做出"; - 最小内容长度(contribution_check.py):普通字段内容须 ≥ 12 个真实字符(
MIN_CELL_CHARS = 12);contribution type这类合法短分类标签仅须 ≥ 4 字符(SHORT_OK_MIN_CHARS = 4),并且先剥离 Markdown 强调/反引号再测量; - 四个必需小节(contribution_check.py):
Core Contribution、Why This Contribution Is Needed、How This Paper Responds、Claim Boundary,每节带字段行与可接受别名;缺行、缺节、占位符均产出 findings 并使进程以退出码 1 失败; - 输出:
--write会把contribution_check.md写入输出目录,报告中含Status: PASS/FAIL。
对应测试见 test_contribution_check.py:test_filled_fixture_passes(完整填写通过并出现 Status: PASS)、test_missing_file_fails(文件不存在退出码 1)、test_missing_section_fails(删除整节失败)、test_placeholder_field_fails(把 Design response 换成 TODO 失败)、test_empty_cell_fails。测试中的 VALID_CONTRIBUTION fixture 也是一个可直接参照的合法样例。
progress_check.py:阶段状态机与门禁编排
progress_check.py 负责把语义确认纳入整条流水线:
- 别名解析(progress_check.py):
motivation_confirmation→semantic_confirmation; - 门禁检查(progress_check.py):当
stage_key in {"semantic_confirmation", "planning"}时,gate_check会先运行contribution_check.py <output_dir> --markdown --write,退出码非 0 即判为GATE FAILED,提示"返回语义确认并修复贡献契约"; - BLOCKED 判定(progress_check.py):已存在
contribution_options_after_research.md或motivation_options_after_research.md但确认产物缺失时,阶段状态为BLOCKED,即"用户确认前置"; - 续跑指引(progress_check.py):
_next_action_for_stage对semantic_confirmation阶段固定指向references/semantic-confirmation.md说明文档。
resume.md 给出了对应的人工续跑规则:当 next_stage 为 semantic_confirmation 且状态为 BLOCKED 时,读取 references/semantic-confirmation.md,然后把已有的 contribution_options_after_research.md 与 motivation_options_after_research.md 原样呈现给用户,等待用户明确确认后才写 confirmed_contribution.md 与 confirmed_motivation.md;不得仅为绕过门禁而重写选项。
失败处理:真实缺口必须解决,安全并行允许继续
semantic-confirmation.md 明确了门禁失败后的行为边界:
- 如果检查暴露了真实的声明、证据或用户选择缺口,必须在做出依赖该缺口的断言之前解决它;
- 与此同时,可以在同一任务中继续独立、安全的工作——仅因缺少历史产物或某条命令失败,并不禁止所有的规划与写作。
这与整个 PaperSpine 的"权威链"哲学一致:检查器校验的是已命名形式(legacy checker validates its named form),而不是科学新颖性或用户权威(见 contribution.md)。也就是说,一条命令失败本身不会冻结全部工作,真正需要回退的是那些依赖未决语义契约的写作决策。
在流水线层面,orchestrator-branch-map.md 将"弱或未确认的贡献/动机"路由回语义确认阶段;确认完成后再进入 planning / drafting。
关联参考文档速查
- 语义确认门权威说明:src/skill/references/semantic-confirmation.md
- 贡献契约书写规范(四段模板与各节检查清单):src/skill/references/contribution.md
- 动机主线书写规范(红线程、选项模板、surface map):src/skill/references/motivation-thread-writing.md
- 授权模型与委派收据:src/skill/references/interaction-policy.md、paperspine5/core/03_联合开发/contracts/delegated-decision-receipt.schema.json
- 阶段编排与续跑规则:src/skill/references/orchestrator-branch-map.md、src/skill/references/resume.md
- 门禁实现与测试:src/scripts/contribution_check.py、src/scripts/progress_check.py、tests/test_contribution_check.py