opencode-bioresearcher 1.9.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.
@@ -45,7 +45,8 @@ Key findings:
45
45
  [Generalizability: where findings apply and where they may not]
46
46
 
47
47
  ## References
48
- [Numbered bibliography in references/citations.md format, ordered by first appearance]
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 in-text citations [1], [2, 3]]
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
- - In-text: [1] single; [2, 3] list; [1-5] range - numbered by ORDER OF
74
- APPEARANCE across the document.
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
- - Bibliography is ordered by number, not alphabetized.
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
- - [ ] All in-text [N] present in References; no orphan references
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
 
@@ -17,35 +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 of the aspect and a list of
23
- detailed research items to investigate.
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`, and the citation format summary from
27
- `references/citations.md` - generic subagents may not have access to this
28
- skill's files.
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` and
31
- `references/citations.md` itself at startup (via
32
- `${CLAUDE_PLUGIN_ROOT}`); the orchestrator sends ONLY the filled-in
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 files (exactly TWO):
42
+ - Output files (exactly TWO - together they are the self-contained
43
+ deliverable for the aspect):
38
44
  - `reports/<TOPIC>/<YOUR-FOCUS>.md` — the aspect report, where `<YOUR-FOCUS>`
39
45
  is the underscore-separated aspect name (e.g. `clinical_landscape.md`).
40
46
  - `reports/<TOPIC>/evidence/<YOUR-FOCUS>.jsonl` — the evidence ledger, one
41
- JSON record per potentially-citable source (see Worker rule 8).
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.
42
50
  - 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
51
  - Report file structure: title, one-paragraph scope summary, findings with
47
- in-text citations, tool/query log (which biomcp tools + key argument
48
- values), and a full bibliography.
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).
49
59
 
50
60
  ## Worker rules
51
61
 
@@ -60,9 +70,11 @@ DESCRIPTION: <ABSTRACT>
60
70
  and GEO supplementary downloads, which are unthrottled - space those out.
61
71
  4. No internal knowledge: use only biomcp tool results or official sources.
62
72
  If evidence is missing after retries, say so explicitly in the report.
63
- 5. Citations: every claim gets [N] references; keep a numbered bibliography in
64
- `references/citations.md` format. Capture identifiers as you go: PMIDs,
65
- PMCIDs, DOIs, NCT IDs, patent IDs, GEO/SRA accessions, database IDs.
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.
66
78
  6. Retry logic: if a query fails, wait a few seconds, retry with a simpler
67
79
  query; at most 3 attempts per query before recording the gap and moving on.
68
80
  7. Writing: succinct, accurate, professional - academic standard.
@@ -103,19 +115,53 @@ DESCRIPTION: <ABSTRACT>
103
115
  take the standard retry ladder (rule 6), then leave the record in the
104
116
  ledger with a gap note in the aspect file - the orchestrator's verify
105
117
  step backfills what it can.
106
- - With Bash available: append with
107
- `python3 <skill_dir>/scripts/evidence-ledger.py add <file> --stdin`,
108
- passing a JSON ARRAY of the batch's records (a heredoc works well), or
109
- equivalently `add <file> @<batch.json>` with an array file. Both
110
- validate, normalize, and accept every record in one call. A single
111
- inline `'<record JSON>'` argument remains fine for one-off records.
112
- Do NOT issue one `add` per record and do NOT write per-record scratch
113
- files first - every append is a tool call (an LLM turn), so batch per
114
- search result. Without Bash: write raw JSONL lines with the Write
115
- tool; the orchestrator's merge validates them.
116
- - BEFORE writing the bibliography, RE-READ your ledger file; compose
117
- every References entry by COPYING ledger fields. A bibliography entry
118
- must not contain any field absent from the ledger.
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.
119
165
 
120
166
  ## Retry ladder (per query)
121
167
 
@@ -135,8 +181,8 @@ attempt 3: alternate tool/source (see references/tool-selection.md routing)
135
181
  inlined cheatsheet (Tier B). Do not mix tiers within one topic.
136
182
  - Launch workers in parallel in batches of up to 5.
137
183
  - Track each aspect in the todo list; mark complete when its output file
138
- exists, ends with a bibliography, AND its evidence ledger file exists with
139
- at least one record per cited source.
184
+ exists with cite-key markers throughout AND its evidence ledger file
185
+ exists, passes `check --markers` (exit 0), and covers every cited key.
140
186
  - If a worker fails or stalls, restart it (same prompt), max 3 restarts.
141
187
  - Tell the user up front: "If subagents are stuck without progress for too
142
188
  long, interrupt and ask me to resume work."
@@ -147,8 +193,8 @@ If the harness has no subagent/Task tool, the SAME protocol runs inline in the
147
193
  main conversation, one aspect at a time:
148
194
 
149
195
  1. Announce the aspect being worked on.
150
- 2. Apply Worker rules 2-8 exactly (same tool selection, retries, citation
151
- discipline, evidence ledger, file protocol).
196
+ 2. Apply Worker rules 2-9 exactly (same tool selection, retries, citation
197
+ discipline, evidence ledger, evidence quality, file protocol).
152
198
  3. Write `reports/<TOPIC>/<ASPECT>.md` and
153
199
  `reports/<TOPIC>/evidence/<ASPECT>.jsonl` before moving to the next aspect.
154
200
  4. After the last aspect, proceed to synthesis (SKILL.md Step 5).
@@ -160,10 +206,14 @@ Sequential mode trades latency for context - keep per-aspect tool calls lean
160
206
 
161
207
  - [ ] Output file exists at `reports/<TOPIC>/<ASPECT>.md`
162
208
  - [ ] Evidence ledger exists at `reports/<TOPIC>/evidence/<ASPECT>.jsonl`
163
- with at least one record per cited source (rule 8)
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)
164
214
  - [ ] Every claim has a citation, source note, or method note
165
- - [ ] Bibliography present, numbered by order of appearance, every entry
166
- copied from ledger fields (no field absent from the ledger)
215
+ - [ ] Findings obey the aspect's inclusion/exclusion boundaries and the
216
+ evidence-verification discipline
167
217
  - [ ] Identifiers included (PMIDs / DOIs / NCT IDs / patent IDs / accessions)
168
218
  - [ ] Tool/query log included
169
219
  - [ ] Evidence gaps (if any) explicitly listed