$npx -y skills add WILLOSCAR/research-units-pipeline-skills --skill evidence-selfloopEvidence self-loop for surveys: read evidence bindings + evidence packs, then write an actionable upstream TODO plan (which stage/skill to fix) before writing more prose. Trigger: evidence self-loop, evidence loop, evidence gaps, binding gaps, blocking_missing, 证据自循环, 证据缺口回路.
| 1 | # Evidence Self-loop (C3/C4 fix → rebind → redraft) |
| 2 | |
| 3 | Purpose: make the evidence-first pipeline converge **without writing filler prose**. |
| 4 | |
| 5 | This skill reads the *intermediate evidence artifacts* (briefs/bindings/packs) and produces an actionable TODO list that answers: |
| 6 | |
| 7 | - Which subsections are under-supported? |
| 8 | - Is the problem mapping/coverage (C2) or evidence extraction (C3) or binding/planning (C4)? |
| 9 | - Which skill(s) should be rerun, in what order, to unblock high-quality writing? |
| 10 | |
| 11 | ## Inputs |
| 12 | |
| 13 | - `outline/subsection_briefs.jsonl` |
| 14 | - `outline/evidence_bindings.jsonl` (expects `binding_gaps` / `binding_rationale` if available) |
| 15 | - `outline/evidence_drafts.jsonl` (expects `blocking_missing`, comparisons, eval protocol, limitations) |
| 16 | - Optional (improves routing): |
| 17 | - `outline/evidence_binding_report.md` |
| 18 | - `outline/anchor_sheet.jsonl` |
| 19 | - `papers/paper_notes.jsonl` |
| 20 | - `papers/fulltext_index.jsonl` |
| 21 | - `queries.md` |
| 22 | |
| 23 | ## Outputs |
| 24 | |
| 25 | - `output/EVIDENCE_SELFLOOP_TODO.md` (report-class; always written) |
| 26 | |
| 27 | ## Self-loop contract (what “fixing evidence” means) |
| 28 | |
| 29 | - Prefer fixing **upstream evidence**, not writing around gaps. |
| 30 | - If an evidence pack has `blocking_missing`, treat it as a STOP signal: strengthen notes/fulltext/mapping, then regenerate packs. |
| 31 | - If bindings show `binding_gaps`, treat it as a ROUTING signal: either enrich the evidence bank for the mapped papers, expand mapping coverage, or adjust `required_evidence_fields` if unrealistic. |
| 32 | |
| 33 | Recommended rerun chain (minimal): |
| 34 | |
| 35 | - If C3 evidence is thin: `pdf-text-extractor` → `paper-notes` → `evidence-binder` → `evidence-draft` → `anchor-sheet` → `writer-context-pack` |
| 36 | - If C2 coverage is weak: `section-mapper` → `outline-refiner` → (then rerun C3/C4 evidence skills) |
| 37 | |
| 38 | ## Workflow (analysis-only) |
| 39 | |
| 40 | 1) Read `queries.md` (if present) |
| 41 | - Use it only as a soft config hint (evidence_mode / draft_profile); do not override the artifact contract. |
| 42 | |
| 43 | 2) Read `outline/subsection_briefs.jsonl` |
| 44 | - For each `sub_id`, capture `axes` + `required_evidence_fields` (what evidence types this subsection expects). |
| 45 | |
| 46 | 3) Read `outline/evidence_bindings.jsonl` |
| 47 | - For each `sub_id`, surface `binding_rationale` and `binding_gaps` (what the binder could/could not cover from the evidence bank). |
| 48 | |
| 49 | 4) (Optional) Read `outline/evidence_binding_report.md` |
| 50 | - Use it as a human-readable summary; treat it as a view of `outline/evidence_bindings.jsonl`, not a separate truth source. |
| 51 | |
| 52 | 5) Read `outline/evidence_drafts.jsonl` |
| 53 | - Surface `blocking_missing` (STOP signals), and check for missing comparisons / eval protocol / limitations that would force hollow writing. |
| 54 | |
| 55 | 6) (Optional) Read `outline/anchor_sheet.jsonl` |
| 56 | - Check whether each subsection has at least a few citation-backed anchors (numbers / evaluation / limitations). |
| 57 | |
| 58 | 7) (Optional) Read `papers/paper_notes.jsonl` and `papers/fulltext_index.jsonl` |
| 59 | - Use these to route fixes: if evidence is abstract-only and missing eval tokens, prefer enriching notes/fulltext before drafting prose. |
| 60 | |
| 61 | ## What the report contains |
| 62 | |
| 63 | - Summary counts: subsections with `blocking_missing`, with `binding_gaps`, and common failure reasons. |
| 64 | - Per-subsection TODO: the smallest upstream fix path (skills + artifacts) to make the subsection writeable. |
| 65 | |
| 66 | ## Status semantics (unblock rules) |
| 67 | |
| 68 | This skill is the *prewrite router* for evidence quality. Treat its `Status:` line as the unblock contract: |
| 69 | |
| 70 | - `PASS`: no `blocking_missing` and no `binding_gaps` -> proceed to C5 writing (but still scan non-blocking writability smells: low comparisons/eval/anchors often predict hollow prose). |
| 71 | - `OK`: no `blocking_missing`, but some `binding_gaps` -> you may draft, but expect weaker specificity; prefer fixing gaps first. |
| 72 | - `FAIL`: missing inputs OR any `blocking_missing` -> do not write filler prose; fix upstream and rerun C3/C4. |
| 73 | |
| 74 | ## Routing matrix (symptom -> root cause -> upstream fix) |
| 75 | |
| 76 | Use this as a *semantic routing table* (not a script checklist). The goal is to fix the earliest broken intermediate artifact. |
| 77 | |
| 78 | | Symptom (where you see it) | Likely root cause | Inspect first | Smallest upstream fix chain | |
| 79 | |---|---|---|---| |
| 80 | | `evidence_drafts.blocking_missing: no usable citation keys` | mapped papers lack `bibkey` / bibkeys not in `citations/ref.bib` | `papers/paper_notes.jsonl` (bibkey fields), `citations/ref.bib` | C3 `paper-notes` (ensure bibkeys) -> C4 `citation-verifier` -> rerun `evidence-binder` -> rerun `evidence-draft` | |
| 81 | | `blocking_missing: title-only evidence` | retrieval/metadata lacks abstracts (or aggressive filtering) | `papers/papers_raw.jsonl` abstracts, `papers/paper_notes.jsonl` evidence_level | C1 `literature-engineer` (enrich metadata) OR C3 `pdf-text-extractor` ( |