# yuitokyouni/sieve architecture

> Architecture diagram of the GitHub repository yuitokyouni/sieve, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yuitokyouni/sieve
- Repository: https://github.com/yuitokyouni/sieve

## Overview

Sieve is a local simulation-validation workbench. Its principal workflow normalizes simulation runs, computes exploratory metrics and figures, then emits an offline report and integrity-sealed evidence bundle; separate confirmatory testing and model comparison workflows use reference suites and inference. The graph preserves those documented branches. Several links are supported by the SOURCE INDEX rather than full excerpts, so unsampled implementation details are not expanded.

Main entry points: [`src/sieve/cli/app.py`](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/cli/app.py) (CLI commands), [`src/sieve/evaluation/inspect.py`](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/evaluation/inspect.py) (Exploratory inspection), [`src/sieve/evaluation/runner.py`](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/evaluation/runner.py) (Confirmatory testing), [`src/sieve/provenance/bundle.py`](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/provenance/bundle.py) (Bundle sealing and verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and schemas"]
  node_python_api["Python API<br/>[api.py]"]
  node_csv_adapter["CSV adapter<br/>[csv.py]"]
  node_dataset_adapter["Dataset adapter<br/>[dataset.py]"]
  node_dataset["Standardized runs<br/>[dataset.py]"]
  node_schemas["Evidence schemas<br/>[models.py]"]
end

subgraph group_explore["Exploratory inspection"]
  node_inspect["Exploratory inspection<br/>[inspect.py]"]
  node_metrics["Stylized-fact metrics<br/>[registry.py]"]
  node_figures["Diagnostic figures<br/>[plots.py]"]
  node_figure_registry["Figure registry<br/>[registry.py]"]
  node_svg["SVG rendering<br/>[svg.py]"]
end

subgraph group_confirm["Confirmatory analysis"]
  node_suite[("Versioned suites<br/>[loader.py]")]
  node_test_runner["Confirmatory testing<br/>[runner.py]"]
  node_inference["Statistical inference<br/>[permutation.py]"]
  node_multiplicity["Multiplicity adjustment<br/>[multiplicity.py]"]
  node_compare["Model comparison<br/>[compare.py]"]
end

subgraph group_evidence["Evidence and reporting"]
  node_bundle["Bundle sealing and verification<br/>[bundle.py]"]
  node_report["Offline HTML report<br/>[html.py]"]
  node_artifacts["Reports and bundles"]
end

node_researcher(("Researcher"))
node_simulation["Simulation outputs"]
node_cli["CLI commands<br/>[app.py]"]

node_researcher -->|"runs commands"| node_cli
node_simulation -->|"supplies data"| node_cli
node_cli -->|"loads inspect data"| node_dataset_adapter
node_cli -->|"loads test data"| node_csv_adapter
node_python_api -->|"builds datasets"| node_dataset_adapter
node_dataset_adapter -->|"assembles runs"| node_dataset
node_csv_adapter -->|"validates manifests"| node_dataset_adapter
node_cli -->|"dispatches inspect"| node_inspect
node_inspect -->|"loads input"| node_dataset_adapter
node_inspect -->|"loads suite"| node_suite
node_inspect -->|"computes diagnostics"| node_metrics
node_metrics -->|"evaluates run values"| node_dataset
node_inspect -->|"requests figures"| node_figure_registry
node_figure_registry -->|"dispatches plots"| node_figures
node_figures -->|"renders SVG"| node_svg
node_figures -->|"computes plot statistics"| node_metrics
node_cli -->|"dispatches test"| node_test_runner
node_test_runner -->|"loads reference suite"| node_suite
node_test_runner -->|"resolves metrics"| node_metrics
node_test_runner -->|"runs tests"| node_inference
node_test_runner -->|"adjusts results"| node_multiplicity
node_cli -->|"dispatches compare"| node_compare
node_compare -.->|"uses reference gate"| node_suite
node_compare -->|"compares distributions"| node_inference
node_compare -->|"adjusts comparisons"| node_multiplicity
node_inspect -->|"seals evidence"| node_bundle
node_test_runner -->|"writes evidence"| node_bundle
node_bundle -->|"serializes bundles"| node_schemas
node_inspect -->|"renders report"| node_report
node_test_runner -->|"renders report"| node_report
node_compare -->|"renders report"| node_report
node_report -->|"checks sealed artifacts"| node_bundle
node_cli -->|"verifies bundles"| node_bundle
node_bundle -->|"writes sealed outputs"| node_artifacts
node_report -->|"writes HTML"| node_artifacts

click node_cli "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/cli/app.py"
click node_python_api "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/api.py"
click node_csv_adapter "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/adapters/csv.py"
click node_dataset_adapter "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/adapters/dataset.py"
click node_dataset "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/core/dataset.py"
click node_schemas "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/core/models.py"
click node_suite "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/suites/loader.py"
click node_inspect "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/evaluation/inspect.py"
click node_metrics "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/metrics/registry.py"
click node_figures "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/figures/plots.py"
click node_figure_registry "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/figures/registry.py"
click node_svg "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/figures/svg.py"
click node_test_runner "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/evaluation/runner.py"
click node_inference "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/inference/permutation.py"
click node_multiplicity "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/inference/multiplicity.py"
click node_compare "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/evaluation/compare.py"
click node_bundle "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/provenance/bundle.py"
click node_report "https://github.com/yuitokyouni/sieve/blob/main/src/sieve/reporting/html.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_python_api,node_csv_adapter,node_dataset_adapter,node_dataset,node_schemas toneBlue
class node_inspect,node_metrics,node_figures,node_figure_registry,node_svg toneAmber
class node_suite,node_test_runner,node_inference,node_multiplicity,node_compare toneMint
class node_bundle,node_report,node_artifacts toneRose
class node_researcher,node_simulation toneIndigo
class node_cli toneTeal
```

## Components

### Inputs and schemas

- [Python API](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/api.py): `src/sieve/api.py`
- [CSV adapter](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/adapters/csv.py): `src/sieve/adapters/csv.py`
- [Dataset adapter](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/adapters/dataset.py): `src/sieve/adapters/dataset.py`
- [Standardized runs](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/core/dataset.py): `src/sieve/core/dataset.py`
- [Evidence schemas](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/core/models.py): `src/sieve/core/models.py`

### Exploratory inspection

- [Exploratory inspection](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/evaluation/inspect.py): `src/sieve/evaluation/inspect.py`
- [Stylized-fact metrics](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/metrics/registry.py): `src/sieve/metrics/registry.py`
- [Diagnostic figures](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/figures/plots.py): `src/sieve/figures/plots.py`
- [Figure registry](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/figures/registry.py): `src/sieve/figures/registry.py`
- [SVG rendering](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/figures/svg.py): `src/sieve/figures/svg.py`

### Confirmatory analysis

- [Versioned suites](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/suites/loader.py): `src/sieve/suites/loader.py`
- [Confirmatory testing](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/evaluation/runner.py): `src/sieve/evaluation/runner.py`
- [Statistical inference](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/inference/permutation.py): `src/sieve/inference/permutation.py`
- [Multiplicity adjustment](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/inference/multiplicity.py): `src/sieve/inference/multiplicity.py`
- [Model comparison](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/evaluation/compare.py): `src/sieve/evaluation/compare.py`

### Evidence and reporting

- [Bundle sealing and verification](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/provenance/bundle.py): `src/sieve/provenance/bundle.py`
- [Offline HTML report](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/reporting/html.py): `src/sieve/reporting/html.py`
- **Reports and bundles**

### Other components

- **Researcher**
- **Simulation outputs**
- [CLI commands](https://github.com/yuitokyouni/sieve/blob/main/src/sieve/cli/app.py): `src/sieve/cli/app.py`

## Connections

- Researcher → CLI commands: runs commands (evidence: `src/sieve/cli/app.py`)
- Simulation outputs → CLI commands: supplies data (evidence: `README.md`)
- CLI commands → Dataset adapter: loads inspect data (evidence: `src/sieve/cli/app.py`)
- CLI commands → CSV adapter: loads test data (evidence: `src/sieve/cli/app.py`)
- Python API → Dataset adapter: builds datasets (evidence: `src/sieve/api.py`)
- Dataset adapter → Standardized runs: assembles runs (evidence: `src/sieve/adapters/dataset.py`)
- CSV adapter → Dataset adapter: validates manifests (evidence: `src/sieve/adapters/csv.py`)
- CLI commands → Exploratory inspection: dispatches inspect (evidence: `src/sieve/cli/app.py`)
- Exploratory inspection → Dataset adapter: loads input (evidence: `src/sieve/evaluation/inspect.py`)
- Exploratory inspection → Versioned suites: loads suite (evidence: `src/sieve/evaluation/inspect.py`)
- Exploratory inspection → Stylized-fact metrics: computes diagnostics (evidence: `src/sieve/evaluation/inspect.py`)
- Stylized-fact metrics → Standardized runs: evaluates run values (evidence: `src/sieve/metrics/registry.py`)
- Exploratory inspection → Figure registry: requests figures (evidence: `src/sieve/evaluation/inspect.py`)
- Figure registry → Diagnostic figures: dispatches plots (evidence: `src/sieve/figures/registry.py`)
- Diagnostic figures → SVG rendering: renders SVG (evidence: `src/sieve/figures/plots.py`)
- Diagnostic figures → Stylized-fact metrics: computes plot statistics (evidence: `src/sieve/figures/plots.py`)
- CLI commands → Confirmatory testing: dispatches test (evidence: `src/sieve/cli/app.py`)
- Confirmatory testing → Versioned suites: loads reference suite (evidence: `src/sieve/evaluation/runner.py`)
- Confirmatory testing → Stylized-fact metrics: resolves metrics (evidence: `src/sieve/evaluation/runner.py`)
- Confirmatory testing → Statistical inference: runs tests (evidence: `src/sieve/evaluation/runner.py`)
- Confirmatory testing → Multiplicity adjustment: adjusts results (evidence: `src/sieve/evaluation/runner.py`)
- CLI commands → Model comparison: dispatches compare (evidence: `src/sieve/cli/app.py`)
- Model comparison → Versioned suites: uses reference gate (evidence: `README.md`)
- Model comparison → Statistical inference: compares distributions (evidence: `src/sieve/evaluation/compare.py`)
- Model comparison → Multiplicity adjustment: adjusts comparisons (evidence: `src/sieve/evaluation/compare.py`)
- Exploratory inspection → Bundle sealing and verification: seals evidence (evidence: `src/sieve/evaluation/inspect.py`)
- Confirmatory testing → Bundle sealing and verification: writes evidence (evidence: `src/sieve/evaluation/runner.py`)
- Bundle sealing and verification → Evidence schemas: serializes bundles (evidence: `src/sieve/provenance/bundle.py`)
- Exploratory inspection → Offline HTML report: renders report (evidence: `src/sieve/evaluation/inspect.py`)
- Confirmatory testing → Offline HTML report: renders report (evidence: `src/sieve/evaluation/runner.py`)
- Model comparison → Offline HTML report: renders report (evidence: `src/sieve/evaluation/compare.py`)
- Offline HTML report → Bundle sealing and verification: checks sealed artifacts (evidence: `src/sieve/reporting/html.py`)
- CLI commands → Bundle sealing and verification: verifies bundles (evidence: `src/sieve/cli/app.py`)
- Bundle sealing and verification → Reports and bundles: writes sealed outputs (evidence: `src/sieve/provenance/bundle.py`)
- Offline HTML report → Reports and bundles: writes HTML (evidence: `src/sieve/reporting/html.py`)
