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.1.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.1.0
File Size Uploaded Provenance Actions
viva_discovery_engine-0.1.0.tar.gz 3.3 MB With provenance Details for viva_discovery_engine-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 3.8 MB

Release files / viva_discovery_engine-0.1.0.tar.gz

Download URL viva_discovery_engine-0.1.0.tar.gz
Size 3.3 MB
Tags Source
SHA-256 checksum
How to use checksums
1584b78de990b930f584b5a526466d00bd72e48d424e7c02a0c558f147d4d86f
BLAKE2b-256 checksum
How to use checksums
8246123fb96912b553e8265b0afd43d1233a8c2da6c65435e16dfb9c22b7e08f
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 2, 2026.

Transparency log

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

Download URL viva_discovery_engine-0.1.0-py3-none-any.whl
Size 479.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4d114d7243de21cdd5a143693678632e91692c766142ce54dd56455a0255ea6
BLAKE2b-256 checksum
How to use checksums
352e830107c72614384bf56497fa8e26c50b13408d961a2b49738ad1f27db2c9
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 2, 2026.

Transparency log

Security for viva-discovery-engine 0.1.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for viva_discovery_engine-0.1.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 2, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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