Citation Anchoring (regression)
Purpose: prevent a common failure mode: polishing rewrites text and accidentally moves citation markers into a different ### subsection, breaking claim→evidence alignment.
Inputs
- - INLINECODE1
- INLINECODE2 (baseline; created by
draft-polisher on first run)
Outputs
- -
output/CITATION_ANCHORING_REPORT.md (PASS/FAIL + drift examples)
Baseline policy
- -
draft-polisher captures a baseline once per run: output/citation_anchors.prepolish.jsonl. - Subsequent polish runs should keep per-H3 citation sets stable.
Workflow (analysis-only)
Role:
- - Auditor: only checks and reports; does not edit.
Steps:
1) Load the baseline anchors.
2) Parse the current output/DRAFT.md into ### subsections and extract citation keys per subsection.
3) Compare current sets to baseline sets:
- - keys added/removed within a subsection
- keys that migrated across subsections
4) Write
output/CITATION_ANCHORING_REPORT.md:
- -
- Status: PASS only if no drift is detected - otherwise,
- Status: FAIL with a short diff table + examples
Notes
If you intentionally restructure across subsections:
- - delete
output/citation_anchors.prepolish.jsonl and regenerate a new baseline (then treat that as the new regression anchor).
Troubleshooting
Issue: baseline anchor file is missing
Fix:
- - Run
draft-polisher once to generate output/citation_anchors.prepolish.jsonl, then rerun the anchoring check.
Issue: citations intentionally moved across subsections
Fix:
- - Delete
output/citation_anchors.prepolish.jsonl and regenerate a new baseline (then treat that as the new regression anchor).
引用锚定(回归测试)
目的:防止一种常见故障模式:润色改写文本时意外将引用标记移动到不同的###子节中,破坏主张与证据的对齐。
输入
- - output/DRAFT.md
- output/citation_anchors.prepolish.jsonl(基线文件;由draft-polisher在首次运行时创建)
输出
- - output/CITATIONANCHORINGREPORT.md(通过/失败 + 漂移示例)
基线策略
- - draft-polisher每次运行捕获一次基线:output/citation_anchors.prepolish.jsonl
- 后续润色运行应保持每个H3子节的引用集稳定
工作流程(仅分析)
角色:
步骤:
1) 加载基线锚定文件
2) 将当前output/DRAFT.md解析为###子节,并提取每个子节的引用键
3) 将当前引用集与基线引用集进行比较:
4) 写入output/CITATION
ANCHORINGREPORT.md:
- - - Status: PASS 仅当未检测到漂移时
- 否则,- Status: FAIL 并附上简短差异表格 + 示例
备注
如果故意跨子节重组内容:
- - 删除output/citation_anchors.prepolish.jsonl并重新生成新基线(然后将该基线视为新的回归锚定)
故障排除
问题:基线锚定文件缺失
解决方法:
- - 运行一次draft-polisher生成output/citation_anchors.prepolish.jsonl,然后重新运行锚定检查
问题:引用被有意跨子节移动
解决方法:
- - 删除output/citation_anchors.prepolish.jsonl并重新生成新基线(然后将该基线视为新的回归锚定)