Skip to content

Add causal-edge mode to deep-research-community (Edison, one community) - #225

Merged
realmarcin merged 1 commit into
mainfrom
feat/causal-edge-research-mode
Jul 20, 2026
Merged

Add causal-edge mode to deep-research-community (Edison, one community)#225
realmarcin merged 1 commit into
mainfrom
feat/causal-edge-research-mode

Conversation

@realmarcin

Copy link
Copy Markdown
Contributor

What

Extends the Edison deep-research-community skill with a causal-edge mode:
for a single community, it asks Edison (PaperQA3) to build a source-backed causal
interaction graph
— interaction nodes (type, scope, source→target taxa,
metabolites/processes, +/− sign) and directed causal edges ("A enables/drives/
suppresses B").

Maps straight onto the schema:

  • nodes → ecological_interactions[] (interaction_type, scope, source_taxon
    target_taxon, metabolites, biological_processes)
  • edges → EcologicalInteraction.downstream[] (InteractionDownstream: target +
    causal-link description)

Changes

  • templates/community_causal_graph_research.md — new causal template. Reuses
    the same placeholders as the mechanism template, so the existing
    render_query / template_vars machinery is unchanged. Requires a verbatim
    snippet + CURIEs per node and per edge; asks for a node table, an edge table,
    and a DOT/adjacency sketch; flags hypothesized vs demonstrated edges.
  • scripts/research_community_edison.py — add --label to suffix output
    filenames, so a causal run (--label causal) does not overwrite the default
    mechanism run for the same community+job. Label is recorded in the meta yaml.
  • justfilejust research-community-causal <target> (causal template +
    --label causal), same Edison plumbing/provenance as research-community-edison.
  • skill.md — documents the mode: when to use it, output naming, schema mapping,
    and the unchanged curator hand-off (never mutate kb/communities/).

Verified

  • Causal template renders against a real community (10360 chars, all placeholders
    resolve).
  • just research-community-causal <stem> --dry-run writes
    <stem>-edison-literature-causal(-meta).*doesn't touch the mechanism run,
    spends no credits.
  • Reuses the vendored _edison_capture provenance bundle; scoped to one
    community at a time
    (as requested).

Scope note: research/report only — like the base skill, it does not write to
kb/communities/; a curator applies the reviewed ecological_interactions block.

🤖 Generated with Claude Code

Extend the Edison deep-research skill with a causal-graph mode that, for a single
community, extracts a source-backed causal interaction graph: interaction nodes
(type, scope, source->target taxa, metabolites/processes, sign) + directed causal
edges. Maps onto the schema: nodes -> ecological_interactions[], edges ->
EcologicalInteraction.downstream[] (InteractionDownstream).

- templates/community_causal_graph_research.md: new causal template (same
  placeholders as the mechanism template, so the existing render/template_vars
  machinery is reused unchanged). Demands verbatim snippets + CURIEs per node and
  per edge; asks for a node table, edge table, and a DOT/adjacency sketch.
- scripts/research_community_edison.py: add --label to suffix output filenames so
  a causal run (label=causal) does NOT overwrite the default mechanism run for the
  same community+job; label recorded in the meta yaml.
- justfile: `just research-community-causal <target>` (causal template + --label
  causal), same Edison plumbing/provenance as research-community-edison.
- skill.md: document the causal-edge mode (when to use, output naming, schema
  mapping, curator hand-off).

Verified: causal template renders against a real community (10360 chars, all
placeholders resolve); `just research-community-causal <stem> --dry-run` writes
`<stem>-edison-literature-causal(-meta).*` without touching the mechanism run and
spends no credits. Reuses the vendored _edison_capture provenance bundle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 20, 2026 19:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@realmarcin
realmarcin merged commit c8977dd into main Jul 20, 2026
2 checks passed
@realmarcin
realmarcin deleted the feat/causal-edge-research-mode branch July 20, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants