opencode-bioresearcher 1.8.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/agents/bioresearcher-dr-worker.md +38 -17
- package/connector-meta.json +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
- package/skills/bioresearcher-deep-research/SKILL.md +149 -49
- package/skills/bioresearcher-deep-research/references/analysis-methods.md +40 -2
- package/skills/bioresearcher-deep-research/references/article-literature.md +24 -0
- package/skills/bioresearcher-deep-research/references/best-practices.md +18 -2
- package/skills/bioresearcher-deep-research/references/citations.md +44 -17
- package/skills/bioresearcher-deep-research/references/clinical-trials.md +1 -1
- package/skills/bioresearcher-deep-research/references/report-template.md +16 -12
- package/skills/bioresearcher-deep-research/references/tool-selection.md +1 -1
- package/skills/bioresearcher-deep-research/references/utility-config.md +1 -1
- package/skills/bioresearcher-deep-research/references/worker-protocol.md +135 -26
- package/skills/bioresearcher-deep-research/scripts/evidence-ledger.py +1974 -0
- package/skills/bioresearcher-deep-research/scripts/ncbi_esummary.py +86 -0
- package/skills/bioresearcher-deep-research/scripts/vet-references.py +181 -79
|
@@ -1,24 +1,40 @@
|
|
|
1
1
|
# Citation Formats
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Semantic cite-key markers in authored text; numbered citations and the
|
|
4
|
+
bibliography are GENERATED by `evidence-ledger.py render`, never hand-written.
|
|
4
5
|
|
|
5
6
|
## Overview
|
|
6
7
|
|
|
7
|
-
All
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
All authored text (aspect reports, `final_report.draft.md`) cites sources with
|
|
9
|
+
semantic cite-key markers that resolve against the evidence ledger. `render`
|
|
10
|
+
assigns numbers by order of first appearance, rewrites the markers into
|
|
11
|
+
numbered form, and generates the References section from the merged ledger -
|
|
12
|
+
so citation numbers and bibliography entries are never transcribed by hand.
|
|
11
13
|
|
|
12
|
-
##
|
|
14
|
+
## Cite-key marker grammar
|
|
13
15
|
|
|
14
16
|
```markdown
|
|
15
|
-
Single: BRAF V600E occurs in ~50% of cutaneous melanomas [
|
|
16
|
-
Multiple: Several studies confirm the association [
|
|
17
|
-
Range: Extensively documented [1-5].
|
|
18
|
-
Timeline: Approved in 2011 [1] and became standard of care [2, 3].
|
|
17
|
+
Single: BRAF V600E occurs in ~50% of cutaneous melanomas [@pmid:21639808].
|
|
18
|
+
Multiple: Several studies confirm the association [@pmid:21639808; @nct:NCT04280705].
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
- Marker: `[@ns:value]`; group members separated by `;` (leading `@` per
|
|
22
|
+
token optional). `render` rewrites groups as `[1]`, `[2, 3]`, `[1-5]`.
|
|
23
|
+
- Keys are the ledger's derived canonical keys (the `add` banner echoes
|
|
24
|
+
them): `pmid:` > `doi:` > `pmcid:` for articles, `nct:` for trials,
|
|
25
|
+
`patent:`, `gene:`, `clinvar:`, `chembl:`/`chebi:`/`unii:` for drugs,
|
|
26
|
+
ontology ids for diseases, accessions for datasets, `url:`/`title:` for
|
|
27
|
+
web/other. A `doi:`/`pmcid:` marker whose record was promoted to a `pmid:`
|
|
28
|
+
key by merge still resolves.
|
|
29
|
+
- A bracket whose tokens are not namespace+shape-valid cite-keys (prose like
|
|
30
|
+
`[@home]`, pandoc-style `[@Chapman2011]`) is left verbatim.
|
|
31
|
+
- Unresolved keys fail `render` (exit 1, no output written) with did-you-mean
|
|
32
|
+
suggestions - fix the draft or ledger, never hand-number.
|
|
33
|
+
|
|
34
|
+
## Bibliography formats (renderer output)
|
|
35
|
+
|
|
36
|
+
The formats below document what `render` (and `bib`) emits per source type;
|
|
37
|
+
`final_report.md`'s References section is generated, not composed.
|
|
22
38
|
|
|
23
39
|
### Journal articles (from article_search / article_get)
|
|
24
40
|
|
|
@@ -33,9 +49,11 @@ Example:
|
|
|
33
49
|
```
|
|
34
50
|
|
|
35
51
|
When PMID is unavailable, use DOI: `DOI: 10.xxxx/xxxxx`. Both may be given.
|
|
36
|
-
Online ahead of print records
|
|
37
|
-
|
|
38
|
-
|
|
52
|
+
Online ahead of print records legitimately carry no Volume(Issue):Pages - not
|
|
53
|
+
even NCBI has them until assigned; they render locator-less
|
|
54
|
+
(`Journal. Year. DOI: .... PMID: ....`). Locator fields are backfilled once
|
|
55
|
+
NCBI assigns them (Step 5a `evidence-ledger.py verify`; the Step 5c
|
|
56
|
+
`vet-references.py` run is the final safety net).
|
|
39
57
|
|
|
40
58
|
### Clinical trials (from trial_search / trial_get)
|
|
41
59
|
|
|
@@ -49,6 +67,9 @@ Example:
|
|
|
49
67
|
[2] NCT04280705: A Study of Encorafenib Plus Cetuximab With or Without Nivolumab in Metastatic Colorectal Cancer. Phase 2. Sponsor: Pfizer. Status: Completed. https://clinicaltrials.gov/study/NCT04280705
|
|
50
68
|
```
|
|
51
69
|
|
|
70
|
+
Ledger records for trials carry `phase`/`sponsor`/`status` in the `meta`
|
|
71
|
+
object (worker-written top-level fields are folded there automatically).
|
|
72
|
+
|
|
52
73
|
### Patents (from patent_search / patent_get)
|
|
53
74
|
|
|
54
75
|
```
|
|
@@ -134,7 +155,7 @@ Example:
|
|
|
134
155
|
| Source type | Cite? |
|
|
135
156
|
|-------------|-------|
|
|
136
157
|
| Tool-returned articles, trials, patents, annotations | Yes |
|
|
137
|
-
| Statistical/quantitative claims | Yes - always |
|
|
158
|
+
| Statistical/quantitative claims | Yes - always (keyed at capture time) |
|
|
138
159
|
| Direct quotes | Yes |
|
|
139
160
|
| General textbook knowledge ("DNA has 4 bases") | No |
|
|
140
161
|
|
|
@@ -144,6 +165,12 @@ Example:
|
|
|
144
165
|
NCT ID, or accession.
|
|
145
166
|
2. Cite primary sources over reviews when both are available.
|
|
146
167
|
3. Quote accurately; do not overstate findings beyond what the source says.
|
|
147
|
-
4.
|
|
148
|
-
|
|
168
|
+
4. Cite-key markers must resolve to ledger records; the worker-side
|
|
169
|
+
`check --markers` gate catches unresolvable markers before the aspect is
|
|
170
|
+
reported complete, and `render` fails loudly on any key that still
|
|
171
|
+
does not.
|
|
149
172
|
5. Access dates only for web sources (tools log their own query date).
|
|
173
|
+
6. References are generated by `render` from the merged ledger - never
|
|
174
|
+
hand-composed, hand-numbered, or copy-pasted. If a ledger field is
|
|
175
|
+
missing, enrich the record (or let `verify` backfill it) rather than
|
|
176
|
+
editing rendered output.
|
|
@@ -15,7 +15,7 @@ intervention, or keyword with status/phase filters and CURSOR pagination.
|
|
|
15
15
|
| Parameter | Type | Notes |
|
|
16
16
|
|-----------|------|-------|
|
|
17
17
|
| query | string (required) | Condition, intervention, or keyword |
|
|
18
|
-
| status | string, optional |
|
|
18
|
+
| status | string, optional | single CT.gov v2 enum value, any letter case (uppercased upstream): `Recruiting`, `Active_not_recruiting`, `Not_yet_recruiting`, `Enrolling_by_invitation`, `Completed`, `Suspended`, `Terminated`, `Withdrawn`, `Withheld`, `Unknown`. Commas AND spaces FAIL with HTTP 400 (`"Active, not recruiting"` is rejected) - use the underscore spelling; on 400, drop the filter and triage locally by the returned `status` field |
|
|
19
19
|
| phase | string, optional | e.g. "Phase 1", "Phase 2" |
|
|
20
20
|
| intervention_type | string, optional | e.g. "Drug", "Device" |
|
|
21
21
|
| limit | int 1-50, default 10 | Maximum results per page |
|
|
@@ -45,7 +45,8 @@ Key findings:
|
|
|
45
45
|
[Generalizability: where findings apply and where they may not]
|
|
46
46
|
|
|
47
47
|
## References
|
|
48
|
-
[
|
|
48
|
+
[GENERATED by render from the merged ledger - numbered by first appearance;
|
|
49
|
+
authored drafts end before this section]
|
|
49
50
|
```
|
|
50
51
|
|
|
51
52
|
## Per-aspect file structure (lighter)
|
|
@@ -56,25 +57,25 @@ Key findings:
|
|
|
56
57
|
Scope: [1 paragraph from the worker ABSTRACT]
|
|
57
58
|
|
|
58
59
|
## Findings
|
|
59
|
-
[Findings with
|
|
60
|
+
[Findings with cite-key markers [@pmid:...]; no bibliography - the ledger is
|
|
61
|
+
the source of truth for citations]
|
|
60
62
|
|
|
61
63
|
## Tool / Query Log
|
|
62
64
|
[tool + key arguments, e.g. article_search(query="...", dateRange="2021-01-01/", limit=15)]
|
|
63
65
|
|
|
64
66
|
## Evidence Gaps
|
|
65
67
|
[queries that failed after retries, with reasons]
|
|
66
|
-
|
|
67
|
-
## References
|
|
68
|
-
[numbered bibliography]
|
|
69
68
|
```
|
|
70
69
|
|
|
71
70
|
## Citation placement rules
|
|
72
71
|
|
|
73
|
-
-
|
|
74
|
-
|
|
72
|
+
- Authored text uses semantic cite-key markers `[@pmid:...]`, groups
|
|
73
|
+
`[@a; @b]`; `render` (SKILL.md Step 5b) numbers them by ORDER OF
|
|
74
|
+
APPEARANCE across the document and range-compresses groups.
|
|
75
75
|
- The Executive Summary cites only the most critical sources.
|
|
76
|
-
- Every table row with a number has a Source column.
|
|
77
|
-
-
|
|
76
|
+
- Every table row with a number has a Source column (cite-key markers).
|
|
77
|
+
- The References section is generated by `render` from the merged ledger and
|
|
78
|
+
ordered by number, not alphabetized.
|
|
78
79
|
|
|
79
80
|
## Provenance standard
|
|
80
81
|
|
|
@@ -100,13 +101,16 @@ combination [4]."
|
|
|
100
101
|
|
|
101
102
|
- [ ] All six sections present, in order
|
|
102
103
|
- [ ] Every claim has provenance (citation / source / method)
|
|
103
|
-
- [ ]
|
|
104
|
+
- [ ] Draft authored with cite-key markers; `render` exited 0 (all keys
|
|
105
|
+
resolved, no [MISSING ...] entries)
|
|
106
|
+
- [ ] `vet-references.py` structural audit PASS (contiguous [1]..[N], N ==
|
|
107
|
+
bibliography count, no placeholders)
|
|
104
108
|
- [ ] Identifiers included in references (PMIDs, DOIs, NCT IDs, patent IDs, accessions)
|
|
105
109
|
- [ ] Access dates for web/official-site sources
|
|
106
110
|
- [ ] Limitations honest about gaps and auth-gated tools not used
|
|
107
|
-
- [ ] Findings re-numbered into one bibliography in final_report.md
|
|
108
|
-
- [ ] References vetted against NCBI via vet-references.py (volume, issue, pages backfilled)
|
|
109
111
|
- [ ] Conflicting findings surfaced, not silently dropped
|
|
112
|
+
- [ ] Findings obey the plan's inclusion/exclusion boundaries and the
|
|
113
|
+
evidence-verification discipline (analysis-methods.md)
|
|
110
114
|
|
|
111
115
|
## Common mistakes
|
|
112
116
|
|
|
@@ -5,7 +5,7 @@ Route a research question to the correct biomcp tool, then shape the call with
|
|
|
5
5
|
|
|
6
6
|
## Overview
|
|
7
7
|
|
|
8
|
-
biomcp (npm `biomcp`, pinned `biomcp@1.
|
|
8
|
+
biomcp (npm `biomcp`, pinned `biomcp@1.4`) exposes 56 tools: 41 core plus 15
|
|
9
9
|
environment-gated optional tools (3 database, 4 R analysis, 8 biowasm). This
|
|
10
10
|
file routes question types to tools; per-domain parameter detail lives in the
|
|
11
11
|
domain reference files.
|
|
@@ -110,7 +110,7 @@ Check a feature's parameters in detail:
|
|
|
110
110
|
|
|
111
111
|
- Smoke-test sequence for a fresh setup: `biomcp_configure` with `{}` ->
|
|
112
112
|
confirm expected features `running_now` -> one cheap domain call.
|
|
113
|
-
- `doctor` CLI complements this: `npx -y biomcp@1.
|
|
113
|
+
- `doctor` CLI complements this: `npx -y biomcp@1.4 doctor` (exit 0 = clear);
|
|
114
114
|
`--client opencode` emits a paste-ready client entry.
|
|
115
115
|
- Multi-entity literature pulls (e.g. 10 PMIDs from article_search) belong in
|
|
116
116
|
ONE `batch_get` call, not 10 article_get calls.
|
|
@@ -6,8 +6,8 @@ subagents and the sequential fallback in the main conversation.
|
|
|
6
6
|
## Overview
|
|
7
7
|
|
|
8
8
|
Each worker owns exactly ONE research aspect of a TOPIC. It queries biomcp
|
|
9
|
-
tools, collects identifiers, and writes one markdown
|
|
10
|
-
`reports/<TOPIC>/`. Workers never re-delegate, never fabricate, and never fall
|
|
9
|
+
tools, collects identifiers, and writes one markdown report plus its evidence
|
|
10
|
+
ledger under `reports/<TOPIC>/`. Workers never re-delegate, never fabricate, and never fall
|
|
11
11
|
back to internal knowledge for facts. Workers also never interview the user -
|
|
12
12
|
clarification and plan review are exclusively the orchestrator's domain (SKILL.md).
|
|
13
13
|
|
|
@@ -17,31 +17,45 @@ clarification and plan review are exclusively the orchestrator's domain (SKILL.m
|
|
|
17
17
|
TOPIC: <TOPIC>
|
|
18
18
|
YOUR RESEARCH FOCUS: <RESEARCH-ASPECT>
|
|
19
19
|
DESCRIPTION: <ABSTRACT>
|
|
20
|
+
SKILL_DIR: <absolute skill dir> # Tier B only; resolve before dispatch
|
|
20
21
|
```
|
|
21
22
|
|
|
22
|
-
- ABSTRACT: <200 words describing the exact focus
|
|
23
|
-
|
|
23
|
+
- ABSTRACT: <200 words describing the exact focus, a list of detailed
|
|
24
|
+
research items to investigate, and the aspect's inclusion definition +
|
|
25
|
+
binding exclusion criteria (negative examples welcome). Numeric caps
|
|
26
|
+
inside it (source limits, call budgets) are binding on the worker.
|
|
24
27
|
- Tier B (generic subagent): the orchestrator should ALSO inline into the
|
|
25
28
|
prompt the Worker Rules below, the per-domain tool cheatsheet from
|
|
26
|
-
`references/tool-selection.md`,
|
|
27
|
-
`references/citations.md
|
|
28
|
-
|
|
29
|
+
`references/tool-selection.md`, the cite-key marker summary from
|
|
30
|
+
`references/citations.md`, and the evidence-verification discipline from
|
|
31
|
+
`references/analysis-methods.md` - generic subagents may not have access
|
|
32
|
+
to this skill's files. The template's `SKILL_DIR` line carries the
|
|
33
|
+
resolved absolute script path.
|
|
29
34
|
- Tier A (dedicated `bioresearcher-dr-worker` plugin subagent): the worker
|
|
30
|
-
reads this file plus `references/tool-selection.md
|
|
31
|
-
`references/citations.md` itself at
|
|
32
|
-
`${CLAUDE_PLUGIN_ROOT}`); the orchestrator sends ONLY the
|
|
33
|
-
template below.
|
|
35
|
+
reads this file plus `references/tool-selection.md`,
|
|
36
|
+
`references/citations.md`, and `references/analysis-methods.md` itself at
|
|
37
|
+
startup (via `${CLAUDE_PLUGIN_ROOT}`); the orchestrator sends ONLY the
|
|
38
|
+
filled-in template below.
|
|
34
39
|
|
|
35
40
|
## File protocol
|
|
36
41
|
|
|
37
|
-
- Output
|
|
38
|
-
|
|
42
|
+
- Output files (exactly TWO - together they are the self-contained
|
|
43
|
+
deliverable for the aspect):
|
|
44
|
+
- `reports/<TOPIC>/<YOUR-FOCUS>.md` — the aspect report, where `<YOUR-FOCUS>`
|
|
45
|
+
is the underscore-separated aspect name (e.g. `clinical_landscape.md`).
|
|
46
|
+
- `reports/<TOPIC>/evidence/<YOUR-FOCUS>.jsonl` — the evidence ledger, one
|
|
47
|
+
JSON record per potentially-citable source (see Worker rule 8). The
|
|
48
|
+
ledger supplies every bibliography entry later; the pair
|
|
49
|
+
(report + ledger) must be understandable without any other context.
|
|
39
50
|
- The write tool auto-creates parent directories - never use bash mkdir.
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
- Report file structure: title, one-paragraph scope summary, findings with
|
|
52
|
+
cite-key markers, tool/query log (which biomcp tools + key argument
|
|
53
|
+
values), and explicit evidence gaps. No bibliography section - the
|
|
54
|
+
orchestrator's `render` step generates numbering and References from the
|
|
55
|
+
ledger.
|
|
56
|
+
- The ABSTRACT the orchestrator sends you defines the aspect's inclusion
|
|
57
|
+
definition and binding exclusion criteria; apply them per
|
|
58
|
+
`references/analysis-methods.md` (criterion vs keyword).
|
|
45
59
|
|
|
46
60
|
## Worker rules
|
|
47
61
|
|
|
@@ -56,12 +70,98 @@ DESCRIPTION: <ABSTRACT>
|
|
|
56
70
|
and GEO supplementary downloads, which are unthrottled - space those out.
|
|
57
71
|
4. No internal knowledge: use only biomcp tool results or official sources.
|
|
58
72
|
If evidence is missing after retries, say so explicitly in the report.
|
|
59
|
-
5. Citations: every claim gets
|
|
60
|
-
`
|
|
61
|
-
|
|
73
|
+
5. Citations: every claim gets a semantic cite-key marker - `[@pmid:21639808]`,
|
|
74
|
+
groups `[@pmid:a; @nct:NCT00000000]` - using the keys the ledger actually
|
|
75
|
+
derived (the `add` banner echoes them). Capture identifiers as you go:
|
|
76
|
+
PMIDs, PMCIDs, DOIs, NCT IDs, patent IDs, GEO/SRA accessions, database IDs.
|
|
77
|
+
Never hand-number citations and never write a bibliography.
|
|
62
78
|
6. Retry logic: if a query fails, wait a few seconds, retry with a simpler
|
|
63
79
|
query; at most 3 attempts per query before recording the gap and moving on.
|
|
64
80
|
7. Writing: succinct, accurate, professional - academic standard.
|
|
81
|
+
8. Evidence ledger (mandatory): maintain
|
|
82
|
+
`reports/<TOPIC>/evidence/<YOUR-FOCUS>.jsonl` as you search.
|
|
83
|
+
- AFTER EACH biomcp search/get call, append one record per source you
|
|
84
|
+
might cite, copying fields VERBATIM from the tool result object -
|
|
85
|
+
batched: ALL records from one tool result go into ONE `add` call
|
|
86
|
+
(see below). Fields the tool did not provide are `null` - NEVER invent
|
|
87
|
+
values. Records without titles (e.g. LitSense hint results) are
|
|
88
|
+
acceptable as-is. Never hold more than one tool result's worth of
|
|
89
|
+
un-appended records, and never stage records in per-record scratch
|
|
90
|
+
files - compose the batch array directly in the append call.
|
|
91
|
+
- Canonical record shapes - one JSON line per source; copy the line for
|
|
92
|
+
your source type and fill fields verbatim (omit optionals you lack).
|
|
93
|
+
biomcp-native field spellings (`ids.nct_id`, top-level `phase`/
|
|
94
|
+
`status`/`sponsor`, ...) are also accepted and normalized
|
|
95
|
+
automatically, but prefer the canonical forms below:
|
|
96
|
+
|
|
97
|
+
```jsonl
|
|
98
|
+
{"schema":"bioresearcher-evidence/1","type":"article","ids":{"pmid":"21639808","pmcid":"PMC3549296","doi":"10.1056/nejmoa1103782"},"title":"...","authors":["Chapman Paul B"],"journal":"N Engl J Med","year":"2011","volume":"364","issue":"26","pages":"2507-16","url":"https://pubmed.ncbi.nlm.nih.gov/21639808/","provenance":[{"aspect":"<YOUR-FOCUS>","tool":"article_search","args":{},"retrieved_at":"<ISO>"}]}
|
|
99
|
+
{"schema":"bioresearcher-evidence/1","type":"trial","ids":{"nct":"NCT04280705"},"title":"Official Title","meta":{"phase":"Phase 2","sponsor":"Pfizer","status":"Completed"},"url":"https://clinicaltrials.gov/study/NCT04280705","provenance":[...]}
|
|
100
|
+
{"schema":"bioresearcher-evidence/1","type":"patent","ids":{"patent":"US11027025B2"},"title":"Title of invention","meta":{"assignee":"ModernaTx, Inc.","status":"granted"},"url":"https://patents.google.com/patent/US11027025B2","provenance":[...]}
|
|
101
|
+
{"schema":"bioresearcher-evidence/1","type":"gene","ids":{"ncbi_gene":"673","hgnc":"HGNC:1097"},"title":"B-Raf proto-oncogene, serine/threonine kinase","meta":{"symbol":"BRAF"},"url":"https://www.ncbi.nlm.nih.gov/gene/673","provenance":[...]}
|
|
102
|
+
{"schema":"bioresearcher-evidence/1","type":"variant","ids":{"clinvar":"13961","rs":"rs113488022"},"title":"NM_004333.6(BRAF):c.1799T>A","meta":{"gene":"BRAF","protein_change":"V600E","significance":"Pathogenic"},"provenance":[...]}
|
|
103
|
+
{"schema":"bioresearcher-evidence/1","type":"drug","ids":{"chembl":"CHEMBL1229517"},"title":"vemurafenib","meta":{"indication":"BRAF V600E-mutant melanoma","source_section":"FDA label (drug_get safety section)"},"provenance":[...]}
|
|
104
|
+
{"schema":"bioresearcher-evidence/1","type":"disease","ids":{"mondo":"MONDO:0002025"},"title":"Cutaneous melanoma","url":"https://monarchinitiative.org/MONDO:0002025","provenance":[...]}
|
|
105
|
+
{"schema":"bioresearcher-evidence/1","type":"dataset","ids":{"geo":"GSE12345"},"title":"Series title","provenance":[...]}
|
|
106
|
+
{"schema":"bioresearcher-evidence/1","type":"web","ids":{"url":"https://..."},"title":"Page Title","meta":{"organization":"FDA","accessed":"2026-09-10"},"provenance":[...]}
|
|
107
|
+
{"schema":"bioresearcher-evidence/1","type":"other","ids":{"url":"https://..."},"title":"Any other citable source (FDA page, guideline, ...)","provenance":[...]}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Omit `key` - the ledger derives it from the ids (`pmid:` > `doi:` >
|
|
111
|
+
`pmcid:` for articles, `nct:` for trials, ...).
|
|
112
|
+
- Title-less records (typical: LitSense hits return only
|
|
113
|
+
`pmid`/`pmcid`/`score`) MUST be enriched via `article_get(pmid)` - one
|
|
114
|
+
sequential, server-paced call - BEFORE they may be cited; on failure
|
|
115
|
+
take the standard retry ladder (rule 6), then leave the record in the
|
|
116
|
+
ledger with a gap note in the aspect file - the orchestrator's verify
|
|
117
|
+
step backfills what it can.
|
|
118
|
+
- With Bash available (the orchestrator provides `SKILL_DIR` in the
|
|
119
|
+
prompt): append with
|
|
120
|
+
`python3 <SKILL_DIR>/scripts/evidence-ledger.py add <file> --stdin`,
|
|
121
|
+
substituting the SKILL_DIR value from your prompt LITERALLY - it is a
|
|
122
|
+
path string, NOT an environment variable (`$SKILL_DIR` in a shell
|
|
123
|
+
resolves to nothing and breaks the call). Pass a JSON ARRAY of the
|
|
124
|
+
batch's records (a heredoc works well), or equivalently
|
|
125
|
+
`add <file> @<batch.json>` with an array file. Both validate,
|
|
126
|
+
normalize, and accept every record in one call, and the banner echoes
|
|
127
|
+
the derived canonical keys - cite those keys. Re-adding the same key
|
|
128
|
+
MERGES fill-only (never overwrites a non-null value): later adds for
|
|
129
|
+
the same source are safe and expected (e.g. enriching a record after a
|
|
130
|
+
`_get` call), and a key that lives only in another aspect's ledger is
|
|
131
|
+
remedied by re-adding the record to your OWN ledger. Do NOT issue one
|
|
132
|
+
`add` per record and do NOT write per-record scratch files first -
|
|
133
|
+
every append is a tool call (an LLM turn), so batch per search result.
|
|
134
|
+
`retrieved_at` carries the real UTC time of the call (e.g.
|
|
135
|
+
`date -u +%Y-%m-%dT%H:%M:%SZ`) - never a rounded or placeholder
|
|
136
|
+
timestamp. Fields the tool did not return stay null; values inferred
|
|
137
|
+
from your own query parameters (e.g. a phase filter) may enter `meta`
|
|
138
|
+
ONLY with the filter captured in `provenance.args` and the inference
|
|
139
|
+
disclosed in the report. Without Bash ONLY (e.g. the Claude plugin
|
|
140
|
+
worker): write raw JSONL lines with the Write tool; the orchestrator's
|
|
141
|
+
merge validates them.
|
|
142
|
+
- BEFORE reporting completion, run
|
|
143
|
+
`python3 <SKILL_DIR>/scripts/evidence-ledger.py check <file> --markers <YOUR-FOCUS>.md` -
|
|
144
|
+
it must exit 0: no quarantined lines, and every `[@key]` marker in
|
|
145
|
+
your aspect file resolves to a ledger record (markers are ONLY for
|
|
146
|
+
resolvable cited sources - a mention-by-id in prose stays plain text,
|
|
147
|
+
e.g. "the pivotal trial, NCT02435849, was not found"). Without Bash,
|
|
148
|
+
re-read the ledger and match the markers manually.
|
|
149
|
+
9. Evidence quality: apply the evidence-verification discipline
|
|
150
|
+
(`references/analysis-methods.md`) to every claim - direction of
|
|
151
|
+
causality, quantitative fidelity, criterion vs keyword, axis discipline,
|
|
152
|
+
primary vs downstream.
|
|
153
|
+
|
|
154
|
+
## Restart / gap top-up (orchestrator-dispatched)
|
|
155
|
+
|
|
156
|
+
Aspect-file ownership is SERIALIZED, never concurrent: a top-up worker
|
|
157
|
+
adopts the original worker's contract only after that worker has terminated.
|
|
158
|
+
The orchestrator dispatches it with the prior worker's evidence-gaps list:
|
|
159
|
+
|
|
160
|
+
- Append to the SAME per-aspect ledger via `add` (upsert merge is safe).
|
|
161
|
+
- Update the SAME aspect .md via read-then-targeted edits confined to the
|
|
162
|
+
gap sections - never rewrite unrelated content, other aspects, or the
|
|
163
|
+
orchestrator's draft.
|
|
164
|
+
- End with `check <file> --markers <aspect>.md` (exit 0) before reporting.
|
|
65
165
|
|
|
66
166
|
## Retry ladder (per query)
|
|
67
167
|
|
|
@@ -81,7 +181,8 @@ attempt 3: alternate tool/source (see references/tool-selection.md routing)
|
|
|
81
181
|
inlined cheatsheet (Tier B). Do not mix tiers within one topic.
|
|
82
182
|
- Launch workers in parallel in batches of up to 5.
|
|
83
183
|
- Track each aspect in the todo list; mark complete when its output file
|
|
84
|
-
exists
|
|
184
|
+
exists with cite-key markers throughout AND its evidence ledger file
|
|
185
|
+
exists, passes `check --markers` (exit 0), and covers every cited key.
|
|
85
186
|
- If a worker fails or stalls, restart it (same prompt), max 3 restarts.
|
|
86
187
|
- Tell the user up front: "If subagents are stuck without progress for too
|
|
87
188
|
long, interrupt and ask me to resume work."
|
|
@@ -92,9 +193,10 @@ If the harness has no subagent/Task tool, the SAME protocol runs inline in the
|
|
|
92
193
|
main conversation, one aspect at a time:
|
|
93
194
|
|
|
94
195
|
1. Announce the aspect being worked on.
|
|
95
|
-
2. Apply Worker rules 2-
|
|
96
|
-
discipline, file protocol).
|
|
97
|
-
3. Write `reports/<TOPIC>/<ASPECT>.md`
|
|
196
|
+
2. Apply Worker rules 2-9 exactly (same tool selection, retries, citation
|
|
197
|
+
discipline, evidence ledger, evidence quality, file protocol).
|
|
198
|
+
3. Write `reports/<TOPIC>/<ASPECT>.md` and
|
|
199
|
+
`reports/<TOPIC>/evidence/<ASPECT>.jsonl` before moving to the next aspect.
|
|
98
200
|
4. After the last aspect, proceed to synthesis (SKILL.md Step 5).
|
|
99
201
|
|
|
100
202
|
Sequential mode trades latency for context - keep per-aspect tool calls lean
|
|
@@ -103,8 +205,15 @@ Sequential mode trades latency for context - keep per-aspect tool calls lean
|
|
|
103
205
|
## Aspect completion checklist
|
|
104
206
|
|
|
105
207
|
- [ ] Output file exists at `reports/<TOPIC>/<ASPECT>.md`
|
|
208
|
+
- [ ] Evidence ledger exists at `reports/<TOPIC>/evidence/<ASPECT>.jsonl`
|
|
209
|
+
and passes `evidence-ledger.py check <file> --markers <ASPECT>.md`
|
|
210
|
+
with exit 0 (Tier A without Bash: re-read the ledger and match the
|
|
211
|
+
markers manually)
|
|
212
|
+
- [ ] Every cite-key marker `[@...]` used in the aspect file resolves to a
|
|
213
|
+
ledger record (no invented keys)
|
|
106
214
|
- [ ] Every claim has a citation, source note, or method note
|
|
107
|
-
- [ ]
|
|
215
|
+
- [ ] Findings obey the aspect's inclusion/exclusion boundaries and the
|
|
216
|
+
evidence-verification discipline
|
|
108
217
|
- [ ] Identifiers included (PMIDs / DOIs / NCT IDs / patent IDs / accessions)
|
|
109
218
|
- [ ] Tool/query log included
|
|
110
219
|
- [ ] Evidence gaps (if any) explicitly listed
|