Skip to main content

discovery-engine

The Discovery Engine discovery cycle

▶ Explore the interactive cycle map  ·  PDF  ·  map spec

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

  • Interactive cycle map — a clickable map of the whole cycle: every stage's functions, the skills that drive it, its inputs/outputs, and what it writes to investigations, studies and models. Also as a PDF and a map specification.
  • 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.7.1

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.7.1
File Size Uploaded Provenance Actions
viva_discovery_engine-0.7.1.tar.gz 4.0 MB With provenance Details for viva_discovery_engine-0.7.1.tar.gz

Built distribution (wheel)

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

Total release size: 4.7 MB

Release files / viva_discovery_engine-0.7.1.tar.gz

Download URL viva_discovery_engine-0.7.1.tar.gz
Size 4.0 MB
Tags Source
SHA-256 checksum
How to use checksums
8113f65984ef0b3af63f47bb0579e26a72c72982a06378952d5dff43ed90698c
BLAKE2b-256 checksum
How to use checksums
fc127fcaad4e1872d5a492d40e5881d1a7e8bfb45e83003255e56e694a06406f
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 20, 2026.

Transparency log

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

Download URL viva_discovery_engine-0.7.1-py3-none-any.whl
Size 646.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8d7cfefb5b716f6e80516fdee5e742b192fa2aae0b8212ae216ae7b7ab04bfc
BLAKE2b-256 checksum
How to use checksums
422f76780f9cebebaa47ad5958b485e26b651ea0142bd0268104bd0647e41dcf
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 20, 2026.

Transparency log

Security for viva-discovery-engine 0.7.1

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.7.1.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 20, 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