Skip to main content

discovery-engine

The Discovery Engine discovery cycle

The investigation/study framework + the derive-first discovery cycle for the Vivarium ecosystem. It owns the investigation/study data model, its lifecycle (canonicalize, contracts, scaffold, seed, migrate, audit), report/card generation — and the discovery cycle itself: it turns an investigation (an investigation.yaml plus its member study.yaml files) into a structured, reproducible view of what is known, what is unresolved, what is most valuable to do next, whether a study is materially ready to run, and how to cycle it forward — and now also drives that cycle: reconcile evidence, plan, design discriminating studies, acquire models, evaluate and promote claims, compose a transition model, and grow the investigation by seeding and refining studies — all without performing the science itself.

It is a standalone library, consumed by:

Two layers

The engine has two cooperating layers over the same inputs. See docs/architecture.md for the full reference.

Layer 1 — the pure projection (assess + gate-readiness + execute + persist):

run_cycle        → knowledge / argument / narrative / gates / validators / suggestions
frontier/closure → the prioritized unresolved work + the machine-checkable closure test
opportunities    → value-ranked frontier (info·impact·enable·closure − cost)
run_readiness    → is a study materially ready to produce an evaluable, rendered result?
execute_action   → carry out the next move, gated by consequence
advance_cycle    → build-if-needed and run the open questions
persist_cycle    → the slim regenerable cycle_state + persist-time narrative renewal

It is pure (no disk I/O) and derive-first: every view is computed from the studies, then merged over any authored override — authored wins, an empty authored value never clobbers a derived one. Same inputs always yield the same bundle.

Layer 2 — the phased discovery cycle (the generative, evidence-integrity half). Each phase produces a typed contract and is driven by one CLI verb:

Phase What it decides CLI verb Module
A reconcile classify each finding's evidence: verified / provisional / contradicted / unsupported reconcile-evidence evidence_integrity
B plan one ranked, dependency-ordered portfolio: REPAIR · RESOLVE · EXTEND plan candidate_action
C design a discriminating study: contrast, controls, registered predictions, committed decision rule design experiment_design
D build capability-driven model acquisition (reuse / wrap / build); immutable ModelVersion build-model model_architect
E execute run the designed studies, consequence- and autonomy-gated advance / execute (Layer 1)
F evaluate promote or reject claims (support × evidence integrity); emit a DiscoveryDelta evaluate / delta evaluation

Growth ops close the loop — propose → seed → run → promote → refine — gated by a human_in_the_loop (default) vs autonomous policy:

Op What it does CLI verb Module
suggest propose new studies (followups, narrative gaps, gated decisions) suggest discover
seed author a complete, run-ready study.yaml from a parent + proposal/finding seed-study study_seeding
refine deepen an existing study — add seeds, sweep variants, raise model fidelity refine-study study_refinement

Install

Use it as a git dependency (not published to a package index). In the Vivarium ecosystem it's wired as a git source in the consumer's pyproject.toml, e.g. in viva-superpowers / vivarium-workbench:

dependencies = ["discovery-engine", ...]

[tool.uv.sources]
discovery-engine = { git = "https://github.com/vivarium-collective/discovery-engine.git", branch = "main" }

Then uv lock / uv sync resolves it. To work on this repo directly, clone it and run uv sync.

Depends on viva-emitters (reads run results) and viva-workspace (resolves a workspace's layout); plus process-bigraph, bigraph-schema, numpy, polars, ruamel.yaml, pyyaml, click.

Use — library

import discovery_engine as de

inv = {"studies": ["s1"], "acceptance_criteria": [{"study": "s1", "behavior": "b"}]}
studies = {"s1": {"name": "s1", "behavior_tests": [{"name": "b"}], "runs": []}}

bundle = de.run_cycle(inv, studies)          # pure projection
front  = de.frontier(bundle, inv)            # prioritized unresolved items
clo    = de.closure(bundle, inv)             # {closed, open_items, ...}
opps   = de.opportunities(bundle, inv)       # value-ranked

Use — CLI

Drive a workspace on disk with discover <verb> <investigation>.

# Assess
discover status <inv>                 # project one cycle, print the summary
discover crank <inv>                   # frontier + next action + closure
discover complete <inv>                # the completion map (+ publishable axis)
discover diagnose <inv>                # classify the crank's productivity bottlenecks
discover hypotheses <inv>              # the competing-hypothesis support rollup
discover opportunities <inv>           # value-ranked frontier
discover suggest <inv>                 # new studies to run next

# Cycle N+1 — the phased discovery cycle
discover reconcile-evidence <inv>      # A: evidence integrity per finding
discover plan <inv>                    # B: the CandidateAction portfolio
discover design <inv> <study>          # C: a discriminating study design
discover build-model <inv> --mechanism …   # D: reuse/wrap/build model acquisition
discover evaluate <inv>                # F: claim verdicts (support × integrity)
discover delta <inv>                   # F: the per-cycle DiscoveryDelta

# Cycle N+2

# Grow — propose · seed · refine (autonomy-gated)
discover seed-study <inv> <parent> --slug … [--autonomy …] [--write]
discover refine-study <inv> <study> [--composite …] [--autonomy …] [--write]

# Advance / author
discover advance <inv> [--autonomous]
discover execute <inv> [--execute] [--autonomous] [--ai-decide]
discover set-verdict <study> <verdict> [--rationale …]
discover relate <downstream> <upstream> [--relation …]
discover connect <inv> [--relation …]
discover resolve <inv> <kind> <target> --rationale …

# Maintenance
discover cycle <inv>                   # the full cycle bundle (JSON)
discover snapshot-validations <inv>

Every subcommand is self-describing via discover <verb> -h.

Design invariants

  • Progress ⊥ verdict — a failed execution is not a refuted hypothesis.
  • Closure ⊥ frontier — a settled argument can still carry non-blocking work.
  • Publishable ⊥ closure — presentation-completeness is its own axis.
  • Evidence integrity ⊥ support — whether a claim is backed is distinct from whether its evidence is a registered run; a provisional-backed claim is provisionally-supported, never promoted.
  • Specify before run — a discriminating study's predictions and decision rule are committed before any run.
  • Declaration ⇒ materialization — a run is gated unless its composite imports, observables are emittable, measures resolve and viz is rendered.
  • Epistemic separation — a validator's execution status never implies its scientific judgment.

Architecture & roadmap

  • docs/architecture.md — the full discovery-cycle reference: the two layers, the Phase A–F + N+2 model, the typed contracts (Hypothesis, Prediction, Evidence, ExperimentDesign, ModelVersion, DiscoveryDelta, CandidateAction), and the propose→seed→run→promote→refine loop.
  • docs/roadmap.md — what has shipped and the remaining backlog (EIG over calibrated distributions, figure critique, Bayesian belief updates, autonomy budgets + per-decision logs, scientific quality metrics).

Metadata

Release files for viva-discovery-engine 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for viva-discovery-engine 0.4.0
File Size Uploaded Provenance Actions
viva_discovery_engine-0.4.0.tar.gz 3.3 MB With provenance Details for viva_discovery_engine-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for viva-discovery-engine 0.4.0
File Interpreter ABI Platform Actions
viva_discovery_engine-0.4.0-py3-none-any.whl Python 3 none any Details for viva_discovery_engine-0.4.0-py3-none-any.whl

Total release size: 3.9 MB

Release files / viva_discovery_engine-0.4.0.tar.gz

Download URL viva_discovery_engine-0.4.0.tar.gz
Size 3.3 MB
Tags Source
SHA-256 checksum
How to use checksums
8b16cfdd1860c69cd9b83d607e092c233e6fc0ebf99f9975bc80902a2a80e3b4
BLAKE2b-256 checksum
How to use checksums
8962b11969e8124d920d8764e09c0b1b929039aac3bec1bf4023095113361cee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / viva_discovery_engine-0.4.0-py3-none-any.whl

Download URL viva_discovery_engine-0.4.0-py3-none-any.whl
Size 538.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a3df2b0063c103c9eb682f086b66adc5417cb3bc1cd96c953178feeedac1b38
BLAKE2b-256 checksum
How to use checksums
e0d6711270033b9fb51c4ad2e845745b4236e8352cc25c1f9ef97fdd91a45cac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for viva-discovery-engine 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for viva_discovery_engine-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page