opencode-bioresearcher 1.9.0 → 1.11.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/agents/bioresearcher-dr-worker.md +31 -22
- package/connector-meta.json +1 -1
- package/package.json +1 -1
- package/skills/bioresearcher-deep-research/SKILL.md +190 -220
- package/skills/bioresearcher-deep-research/references/analysis-methods.md +40 -2
- package/skills/bioresearcher-deep-research/references/best-practices.md +5 -5
- package/skills/bioresearcher-deep-research/references/citations.md +40 -24
- package/skills/bioresearcher-deep-research/references/clinical-trials.md +1 -1
- package/skills/bioresearcher-deep-research/references/ensembl-pdb.md +2 -0
- package/skills/bioresearcher-deep-research/references/report-template.md +16 -14
- package/skills/bioresearcher-deep-research/references/tool-selection.md +2 -0
- package/skills/bioresearcher-deep-research/references/worker-protocol.md +130 -42
- package/skills/bioresearcher-deep-research/scripts/evidence-ledger.py +799 -34
- package/skills/bioresearcher-deep-research/scripts/vet-references.py +362 -28
|
@@ -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/PDB for datasets (`geo:`, `sra:`, `gb:`, `pdb:`),
|
|
27
|
+
`url:`/`title:` for 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
|
|
|
@@ -34,9 +50,9 @@ Example:
|
|
|
34
50
|
|
|
35
51
|
When PMID is unavailable, use DOI: `DOI: 10.xxxx/xxxxx`. Both may be given.
|
|
36
52
|
Online ahead of print records legitimately carry no Volume(Issue):Pages - not
|
|
37
|
-
even NCBI has them until assigned; render
|
|
53
|
+
even NCBI has them until assigned; they render locator-less
|
|
38
54
|
(`Journal. Year. DOI: .... PMID: ....`). Locator fields are backfilled once
|
|
39
|
-
NCBI assigns them (Step 5a `evidence-ledger.py verify`; the Step
|
|
55
|
+
NCBI assigns them (Step 5a `evidence-ledger.py verify`; the Step 5c
|
|
40
56
|
`vet-references.py` run is the final safety net).
|
|
41
57
|
|
|
42
58
|
### Clinical trials (from trial_search / trial_get)
|
|
@@ -120,9 +136,10 @@ Example:
|
|
|
120
136
|
[7] Cutaneous melanoma. MONDO:0002025. https://monarchinitiative.org/MONDO:0002025
|
|
121
137
|
```
|
|
122
138
|
|
|
123
|
-
### Datasets / sequences (geo_get / sra_get / genbank_get)
|
|
139
|
+
### Datasets / structures / sequences (pdb / geo_get / sra_get / genbank_get)
|
|
124
140
|
|
|
125
141
|
```
|
|
142
|
+
[N] PDB structure [PDB_ID]: [title]. [[method]] Resolution: [res]. https://www.rcsb.org/structure/[PDB_ID]
|
|
126
143
|
[N] GEO series GSEXXXXXX: [title]. [organism]. https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSEXXXXXX
|
|
127
144
|
[N] SRA run SRRXXXXXXX: [experiment description]. https://trace.ncbi.nlm.nih.gov/Traces/?run=SRRXXXXXXX
|
|
128
145
|
[N] GenBank accession XXXXXXXX.X: [definition]. https://www.ncbi.nlm.nih.gov/nuccore/XXXXXXXX.X
|
|
@@ -139,7 +156,7 @@ Example:
|
|
|
139
156
|
| Source type | Cite? |
|
|
140
157
|
|-------------|-------|
|
|
141
158
|
| Tool-returned articles, trials, patents, annotations | Yes |
|
|
142
|
-
| Statistical/quantitative claims | Yes - always |
|
|
159
|
+
| Statistical/quantitative claims | Yes - always (keyed at capture time) |
|
|
143
160
|
| Direct quotes | Yes |
|
|
144
161
|
| General textbook knowledge ("DNA has 4 bases") | No |
|
|
145
162
|
|
|
@@ -149,13 +166,12 @@ Example:
|
|
|
149
166
|
NCT ID, or accession.
|
|
150
167
|
2. Cite primary sources over reviews when both are available.
|
|
151
168
|
3. Quote accurately; do not overstate findings beyond what the source says.
|
|
152
|
-
4.
|
|
153
|
-
|
|
169
|
+
4. Cite-key markers must resolve to ledger records; the worker-side
|
|
170
|
+
`check --markers` gate catches unresolvable markers before the aspect is
|
|
171
|
+
reported complete, and `render` fails loudly on any key that still
|
|
172
|
+
does not.
|
|
154
173
|
5. Access dates only for web sources (tools log their own query date).
|
|
155
|
-
6.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
entry may contain any field absent from the ledger - if a field is
|
|
160
|
-
missing, render the ledger's `[MISSING field: ...]` marker rather than
|
|
161
|
-
composing one from memory.
|
|
174
|
+
6. References are generated by `render` from the merged ledger - never
|
|
175
|
+
hand-composed, hand-numbered, or copy-pasted. If a ledger field is
|
|
176
|
+
missing, enrich the record (or let `verify` backfill it) rather than
|
|
177
|
+
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 |
|
|
@@ -132,3 +132,5 @@ Structure workflow:
|
|
|
132
132
|
the workspace matters.
|
|
133
133
|
- Chain ensembl_lookup -> gene_get for human annotation; ensembl_region ->
|
|
134
134
|
variant_get for variant detail; pdb citation sections -> article_get.
|
|
135
|
+
Never copy `summary.title` (structure title) or `summary.authors` (depositors)
|
|
136
|
+
into `article` records; deposition titles and authors belong to the coordinate entry.
|
|
@@ -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,15 +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
|
-
- [ ] References generated from evidence/sources.jsonl (ledger-first: every
|
|
110
|
-
entry copied from a ledger record - worker-protocol rule 8, Step 5a)
|
|
111
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)
|
|
112
114
|
|
|
113
115
|
## Common mistakes
|
|
114
116
|
|
|
@@ -68,6 +68,8 @@ QUESTION TYPE
|
|
|
68
68
|
├─ Orthologues / consequences / regions / structures
|
|
69
69
|
│ → ensembl_lookup / ensembl_homology / ensembl_consequence / ensembl_region
|
|
70
70
|
│ → pdb (query | pdb_id | pdb_id+download)
|
|
71
|
+
│ - Cite structure: dataset [@pdb:XXXX]
|
|
72
|
+
│ - Cite paper: chain summary.pmid -> article_get(pmid) -> article [@pmid:XXXX]
|
|
71
73
|
│ → details: references/ensembl-pdb.md
|
|
72
74
|
│
|
|
73
75
|
├─ Ambiguous / multi-entity free text ("BRAF V600E melanoma")
|
|
@@ -17,35 +17,46 @@ 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
|
|
21
|
+
EXECUTION RULE: Do NOT read or inspect evidence-ledger.py or other skill scripts; all schemas and commands are fully specified here.
|
|
20
22
|
```
|
|
21
23
|
|
|
22
|
-
- ABSTRACT: <200 words describing the exact focus
|
|
23
|
-
|
|
24
|
+
- ABSTRACT: <200 words describing the exact focus, a list of detailed
|
|
25
|
+
research items to investigate, and the aspect's inclusion definition +
|
|
26
|
+
binding exclusion criteria (negative examples welcome). Numeric caps
|
|
27
|
+
inside it (source limits, call budgets) are binding on the worker.
|
|
24
28
|
- Tier B (generic subagent): the orchestrator should ALSO inline into the
|
|
25
29
|
prompt the Worker Rules below, the per-domain tool cheatsheet from
|
|
26
|
-
`references/tool-selection.md`,
|
|
27
|
-
`references/citations.md
|
|
28
|
-
|
|
30
|
+
`references/tool-selection.md`, the cite-key marker summary from
|
|
31
|
+
`references/citations.md`, and the evidence-verification discipline from
|
|
32
|
+
`references/analysis-methods.md` - generic subagents may not have access
|
|
33
|
+
to this skill's files. The template's `SKILL_DIR` line carries the
|
|
34
|
+
resolved absolute script path.
|
|
29
35
|
- 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.
|
|
36
|
+
reads this file plus `references/tool-selection.md`,
|
|
37
|
+
`references/citations.md`, and `references/analysis-methods.md` itself at
|
|
38
|
+
startup (via `${CLAUDE_PLUGIN_ROOT}`); the orchestrator sends ONLY the
|
|
39
|
+
filled-in template below.
|
|
34
40
|
|
|
35
41
|
## File protocol
|
|
36
42
|
|
|
37
|
-
- Output files (exactly TWO
|
|
43
|
+
- Output files (exactly TWO - together they are the self-contained
|
|
44
|
+
deliverable for the aspect):
|
|
38
45
|
- `reports/<TOPIC>/<YOUR-FOCUS>.md` — the aspect report, where `<YOUR-FOCUS>`
|
|
39
46
|
is the underscore-separated aspect name (e.g. `clinical_landscape.md`).
|
|
40
47
|
- `reports/<TOPIC>/evidence/<YOUR-FOCUS>.jsonl` — the evidence ledger, one
|
|
41
|
-
JSON record per potentially-citable source (see Worker rule 8).
|
|
48
|
+
JSON record per potentially-citable source (see Worker rule 8). The
|
|
49
|
+
ledger supplies every bibliography entry later; the pair
|
|
50
|
+
(report + ledger) must be understandable without any other context.
|
|
42
51
|
- The write tool auto-creates parent directories - never use bash mkdir.
|
|
43
|
-
- The report file must be self-contained: a reader should understand the
|
|
44
|
-
findings, the tools/queries used, and the sources cited without any other
|
|
45
|
-
context.
|
|
46
52
|
- Report file structure: title, one-paragraph scope summary, findings with
|
|
47
|
-
|
|
48
|
-
values), and
|
|
53
|
+
cite-key markers, tool/query log (which biomcp tools + key argument
|
|
54
|
+
values), and explicit evidence gaps. No bibliography section - the
|
|
55
|
+
orchestrator's `render` step generates numbering and References from the
|
|
56
|
+
ledger.
|
|
57
|
+
- The ABSTRACT the orchestrator sends you defines the aspect's inclusion
|
|
58
|
+
definition and binding exclusion criteria; apply them per
|
|
59
|
+
`references/analysis-methods.md` (criterion vs keyword).
|
|
49
60
|
|
|
50
61
|
## Worker rules
|
|
51
62
|
|
|
@@ -60,9 +71,11 @@ DESCRIPTION: <ABSTRACT>
|
|
|
60
71
|
and GEO supplementary downloads, which are unthrottled - space those out.
|
|
61
72
|
4. No internal knowledge: use only biomcp tool results or official sources.
|
|
62
73
|
If evidence is missing after retries, say so explicitly in the report.
|
|
63
|
-
5. Citations: every claim gets
|
|
64
|
-
`
|
|
65
|
-
|
|
74
|
+
5. Citations: every claim gets a semantic cite-key marker - `[@pmid:21639808]`,
|
|
75
|
+
groups `[@pmid:a; @nct:NCT00000000]` - using the keys the ledger actually
|
|
76
|
+
derived (the `add` banner echoes them). Capture identifiers as you go:
|
|
77
|
+
PMIDs, PMCIDs, DOIs, NCT IDs, patent IDs, GEO/SRA accessions, database IDs.
|
|
78
|
+
Never hand-number citations and never write a bibliography.
|
|
66
79
|
6. Retry logic: if a query fails, wait a few seconds, retry with a simpler
|
|
67
80
|
query; at most 3 attempts per query before recording the gap and moving on.
|
|
68
81
|
7. Writing: succinct, accurate, professional - academic standard.
|
|
@@ -89,9 +102,10 @@ DESCRIPTION: <ABSTRACT>
|
|
|
89
102
|
{"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":[...]}
|
|
90
103
|
{"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":[...]}
|
|
91
104
|
{"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":[...]}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
105
|
+
{"schema":"bioresearcher-evidence/1","type":"disease","ids":{"mondo":"MONDO:0002025"},"title":"Cutaneous melanoma","url":"https://monarchinitiative.org/MONDO:0002025","provenance":[...]}
|
|
106
|
+
{"schema":"bioresearcher-evidence/1","type":"dataset","ids":{"geo":"GSE12345"},"title":"Series title","provenance":[...]}
|
|
107
|
+
{"schema":"bioresearcher-evidence/1","type":"dataset","ids":{"pdb":"6N65"},"title":"KRAS G-quadruplex G16T mutant","meta":{"method":"X-RAY DIFFRACTION","resolution":"1.6 Å"},"url":"https://www.rcsb.org/structure/6N65","provenance":[...]}
|
|
108
|
+
{"schema":"bioresearcher-evidence/1","type":"web","ids":{"url":"https://..."},"title":"Page Title","meta":{"organization":"FDA","accessed":"2026-09-10"},"provenance":[...]}
|
|
95
109
|
{"schema":"bioresearcher-evidence/1","type":"other","ids":{"url":"https://..."},"title":"Any other citable source (FDA page, guideline, ...)","provenance":[...]}
|
|
96
110
|
```
|
|
97
111
|
|
|
@@ -103,19 +117,89 @@ DESCRIPTION: <ABSTRACT>
|
|
|
103
117
|
take the standard retry ladder (rule 6), then leave the record in the
|
|
104
118
|
ledger with a gap note in the aspect file - the orchestrator's verify
|
|
105
119
|
step backfills what it can.
|
|
106
|
-
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
-
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
- PDB dual-entity discipline: when querying `pdb`, distinguish between
|
|
121
|
+
citing the macromolecular structure and citing the associated publication:
|
|
122
|
+
- To cite the published paper: set `type: "article"` with `ids.pmid` (or
|
|
123
|
+
`ids.doi`). NEVER copy `summary.title` (structure title) or
|
|
124
|
+
`summary.authors` (deposition list) from the PDB result into the
|
|
125
|
+
article record. Enrich via `article_get(pmid)` for canonical article
|
|
126
|
+
metadata, or leave title/authors null for orchestrator verification.
|
|
127
|
+
- To cite the 3D structure itself: set `type: "dataset"` with `ids.pdb:
|
|
128
|
+
"<PDB_ID>"` and `title: summary.title`. Canonical key derived:
|
|
129
|
+
`pdb:<PDB_ID>`. Marker: `[@pdb:<PDB_ID>]`.
|
|
130
|
+
- With Bash available (the orchestrator provides `SKILL_DIR` in the
|
|
131
|
+
prompt): append with
|
|
132
|
+
`python3 <SKILL_DIR>/scripts/evidence-ledger.py add <file> --stdin`,
|
|
133
|
+
substituting the SKILL_DIR value from your prompt LITERALLY - it is a
|
|
134
|
+
path string, NOT an environment variable (`$SKILL_DIR` in a shell
|
|
135
|
+
resolves to nothing and breaks the call). Pass records via a shell heredoc
|
|
136
|
+
or with an array/JSONL file (`add <file> @<batch.json>`):
|
|
137
|
+
```bash
|
|
138
|
+
python3 <SKILL_DIR>/scripts/evidence-ledger.py add reports/<TOPIC>/evidence/<YOUR-FOCUS>.jsonl --stdin << 'EOF'
|
|
139
|
+
[
|
|
140
|
+
{"schema":"bioresearcher-evidence/1","type":"article","ids":{"pmid":"..."},"title":"...","provenance":[{"aspect":"<YOUR-FOCUS>","tool":"article_search","args":{},"retrieved_at":"<ISO>"}]}
|
|
141
|
+
]
|
|
142
|
+
EOF
|
|
143
|
+
```
|
|
144
|
+
(A JSON array `[...]`, a single JSON object `{...}`, or newline-delimited JSONL lines are all accepted by `--stdin` or `@<file>`).
|
|
145
|
+
Both validate, normalize, and accept every record in one call, and the banner echoes
|
|
146
|
+
the derived canonical keys - cite those keys. Re-adding the same key
|
|
147
|
+
MERGES fill-only (never overwrites a non-null value): later adds for
|
|
148
|
+
the same source are safe and expected (e.g. enriching a record after a
|
|
149
|
+
`_get` call), and a key that lives only in another aspect's ledger is
|
|
150
|
+
remedied by re-adding the record to your OWN ledger. Do NOT issue one
|
|
151
|
+
`add` per record and do NOT write per-record scratch files first -
|
|
152
|
+
every append is a tool call (an LLM turn), so batch per search result.
|
|
153
|
+
`retrieved_at` carries the real UTC time of the call (e.g.
|
|
154
|
+
`date -u +%Y-%m-%dT%H:%M:%SZ`) - never a rounded or placeholder
|
|
155
|
+
timestamp. Fields the tool did not return stay null; values inferred
|
|
156
|
+
from your own query parameters (e.g. a phase filter) may enter `meta`
|
|
157
|
+
ONLY with the filter captured in `provenance.args` and the inference
|
|
158
|
+
disclosed in the report. When querying ClinicalTrials.gov
|
|
159
|
+
(`trial_search` / `biomcp_trial_search`), use exact uppercase underscore
|
|
160
|
+
enum values for `status`: `RECRUITING`, `ACTIVE_NOT_RECRUITING`,
|
|
161
|
+
`COMPLETED`, `TERMINATED` (commas or spaces in status trigger HTTP 400
|
|
162
|
+
Bad Request from ClinicalTrials.gov). Without Bash ONLY (e.g. the Claude
|
|
163
|
+
plugin worker): write raw JSONL lines with the Write tool and re-read the
|
|
164
|
+
ledger to match markers; the orchestrator validates via `check` upon return.
|
|
165
|
+
- BEFORE reporting completion, run
|
|
166
|
+
`python3 <SKILL_DIR>/scripts/evidence-ledger.py check <file> --markers <YOUR-FOCUS>.md` -
|
|
167
|
+
it must exit 0: no quarantined lines, and every `[@key]` marker in
|
|
168
|
+
your aspect file resolves to a ledger record (markers are ONLY for
|
|
169
|
+
resolvable cited sources - a mention-by-id in prose stays plain text,
|
|
170
|
+
e.g. "the pivotal trial, NCT02435849, was not found"). Without Bash,
|
|
171
|
+
re-read the ledger and match the markers manually.
|
|
172
|
+
9. Evidence quality: apply the evidence-verification discipline
|
|
173
|
+
(`references/analysis-methods.md`) to every claim - direction of
|
|
174
|
+
causality, quantitative fidelity, criterion vs keyword, axis discipline,
|
|
175
|
+
primary vs downstream.
|
|
176
|
+
|
|
177
|
+
## Restart / gap top-up (orchestrator-dispatched)
|
|
178
|
+
|
|
179
|
+
Aspect-file ownership is SERIALIZED, never concurrent: a top-up worker
|
|
180
|
+
adopts the original worker's contract only after that worker has terminated.
|
|
181
|
+
The orchestrator dispatches it when `evidence-ledger.py check` fails or for evidence gaps:
|
|
182
|
+
|
|
183
|
+
- Target scope: touch ONLY `reports/<TOPIC>/<ASPECT>.md` and
|
|
184
|
+
`reports/<TOPIC>/evidence/<ASPECT>.jsonl`. Never edit other aspects or the
|
|
185
|
+
synthesis draft.
|
|
186
|
+
- For unresolved markers: fetch canonical metadata via biomcp (`article_get`,
|
|
187
|
+
`trial_get`) and append via `add`. If no valid source exists, remove or
|
|
188
|
+
qualify the claim in `<ASPECT>.md` and document the gap under `## Evidence Gaps`.
|
|
189
|
+
Never invent or guess cite-keys.
|
|
190
|
+
- For quarantined lines: fix the JSON formatting in the ledger.
|
|
191
|
+
- End with `check <file> --markers <aspect>.md` (exit 0) before reporting.
|
|
192
|
+
|
|
193
|
+
### Remediation worker prompt template
|
|
194
|
+
|
|
195
|
+
```md
|
|
196
|
+
TOPIC: <TOPIC>
|
|
197
|
+
YOUR RESEARCH FOCUS: <RESEARCH-ASPECT> (REMEDIATION)
|
|
198
|
+
DIAGNOSTIC OUTPUT:
|
|
199
|
+
<stdout and stderr from: evidence-ledger.py check reports/<TOPIC>/evidence/<ASPECT>.jsonl --markers reports/<TOPIC>/<ASPECT>.md>
|
|
200
|
+
TASK: Resolve quarantined lines in reports/<TOPIC>/evidence/<ASPECT>.jsonl and fetch canonical metadata for unresolved markers via biomcp. Touch no other aspects or synthesis files. End with `evidence-ledger.py check` (must exit 0).
|
|
201
|
+
SKILL_DIR: <absolute path to this skill's directory>
|
|
202
|
+
```
|
|
119
203
|
|
|
120
204
|
## Retry ladder (per query)
|
|
121
205
|
|
|
@@ -135,8 +219,8 @@ attempt 3: alternate tool/source (see references/tool-selection.md routing)
|
|
|
135
219
|
inlined cheatsheet (Tier B). Do not mix tiers within one topic.
|
|
136
220
|
- Launch workers in parallel in batches of up to 5.
|
|
137
221
|
- Track each aspect in the todo list; mark complete when its output file
|
|
138
|
-
exists
|
|
139
|
-
|
|
222
|
+
exists with cite-key markers throughout AND its evidence ledger file
|
|
223
|
+
exists, passes `check --markers` (exit 0), and covers every cited key.
|
|
140
224
|
- If a worker fails or stalls, restart it (same prompt), max 3 restarts.
|
|
141
225
|
- Tell the user up front: "If subagents are stuck without progress for too
|
|
142
226
|
long, interrupt and ask me to resume work."
|
|
@@ -147,8 +231,8 @@ If the harness has no subagent/Task tool, the SAME protocol runs inline in the
|
|
|
147
231
|
main conversation, one aspect at a time:
|
|
148
232
|
|
|
149
233
|
1. Announce the aspect being worked on.
|
|
150
|
-
2. Apply Worker rules 2-
|
|
151
|
-
discipline, evidence ledger, file protocol).
|
|
234
|
+
2. Apply Worker rules 2-9 exactly (same tool selection, retries, citation
|
|
235
|
+
discipline, evidence ledger, evidence quality, file protocol).
|
|
152
236
|
3. Write `reports/<TOPIC>/<ASPECT>.md` and
|
|
153
237
|
`reports/<TOPIC>/evidence/<ASPECT>.jsonl` before moving to the next aspect.
|
|
154
238
|
4. After the last aspect, proceed to synthesis (SKILL.md Step 5).
|
|
@@ -160,10 +244,14 @@ Sequential mode trades latency for context - keep per-aspect tool calls lean
|
|
|
160
244
|
|
|
161
245
|
- [ ] Output file exists at `reports/<TOPIC>/<ASPECT>.md`
|
|
162
246
|
- [ ] Evidence ledger exists at `reports/<TOPIC>/evidence/<ASPECT>.jsonl`
|
|
163
|
-
|
|
247
|
+
and passes `evidence-ledger.py check <file> --markers <ASPECT>.md`
|
|
248
|
+
with exit 0 (Tier A without Bash: re-read the ledger and match the
|
|
249
|
+
markers manually)
|
|
250
|
+
- [ ] Every cite-key marker `[@...]` used in the aspect file resolves to a
|
|
251
|
+
ledger record (no invented keys)
|
|
164
252
|
- [ ] Every claim has a citation, source note, or method note
|
|
165
|
-
- [ ]
|
|
166
|
-
|
|
253
|
+
- [ ] Findings obey the aspect's inclusion/exclusion boundaries and the
|
|
254
|
+
evidence-verification discipline
|
|
167
255
|
- [ ] Identifiers included (PMIDs / DOIs / NCT IDs / patent IDs / accessions)
|
|
168
256
|
- [ ] Tool/query log included
|
|
169
257
|
- [ ] Evidence gaps (if any) explicitly listed
|