$npx -y skills add WILLOSCAR/research-units-pipeline-skills --skill citation-anchoringRegression-check citation anchoring (citations stay in the same subsection) to prevent “polish drift” that breaks claim→evidence alignment. Trigger: citation anchoring, citation drift, regression, cite stability, 引用锚定, 引用漂移. Use when: after editing/polishing, you want to
| 1 | # Citation Anchoring (regression) |
| 2 | |
| 3 | Purpose: prevent a common failure mode: polishing rewrites text and accidentally moves citation markers into a different `###` subsection, breaking claim→evidence alignment. |
| 4 | |
| 5 | ## Inputs |
| 6 | |
| 7 | - `output/DRAFT.md` |
| 8 | - `output/citation_anchors.prepolish.jsonl` (baseline; created by `draft-polisher` on first run) |
| 9 | |
| 10 | ## Outputs |
| 11 | |
| 12 | - `output/CITATION_ANCHORING_REPORT.md` (PASS/FAIL + drift examples) |
| 13 | |
| 14 | ## Baseline policy |
| 15 | |
| 16 | - `draft-polisher` captures a baseline once per run: `output/citation_anchors.prepolish.jsonl`. |
| 17 | - Subsequent polish runs should keep per-H3 citation sets stable. |
| 18 | |
| 19 | ## Workflow (analysis-only) |
| 20 | |
| 21 | Role: |
| 22 | - **Auditor**: only checks and reports; does not edit. |
| 23 | |
| 24 | Steps: |
| 25 | |
| 26 | 1) Load the baseline anchors. |
| 27 | 2) Parse the current `output/DRAFT.md` into `###` subsections and extract citation keys per subsection. |
| 28 | 3) Compare current sets to baseline sets: |
| 29 | - keys added/removed within a subsection |
| 30 | - keys that migrated across subsections |
| 31 | 4) Write `output/CITATION_ANCHORING_REPORT.md`: |
| 32 | - `- Status: PASS` only if no drift is detected |
| 33 | - otherwise, `- Status: FAIL` with a short diff table + examples |
| 34 | |
| 35 | ## Notes |
| 36 | |
| 37 | If you intentionally restructure across subsections: |
| 38 | - delete `output/citation_anchors.prepolish.jsonl` and regenerate a new baseline (then treat that as the new regression anchor). |
| 39 | |
| 40 | ## Troubleshooting |
| 41 | |
| 42 | ### Issue: baseline anchor file is missing |
| 43 | |
| 44 | Fix: |
| 45 | - Run `draft-polisher` once to generate `output/citation_anchors.prepolish.jsonl`, then rerun the anchoring check. |
| 46 | |
| 47 | ### Issue: citations intentionally moved across subsections |
| 48 | |
| 49 | Fix: |
| 50 | - Delete `output/citation_anchors.prepolish.jsonl` and regenerate a new baseline (then treat that as the new regression anchor). |