# herbertkokholm/attest architecture

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

- Interactive diagram: https://gitdiagram.com/herbertkokholm/attest
- Repository: https://github.com/herbertkokholm/attest

## Overview

attest is a dependency-light kernel for LLM-assisted systematic-review screening and self-validation, not a complete review-management product. A caller supplies records; the CLI or library validates them, runs vendor raters, aggregates retained ordinal votes, routes human work through separate planes, and reports statistically valid recall and agreement with provenance. The graph preserves the documented confidence, tau, prefilter, ablation, and drift-monitoring capabilities. Some subsystem links rely on SOURCE INDEX references or README descriptions because their source was not excerpted.

Main entry points: [`src/attest/cli.py`](https://github.com/herbertkokholm/attest/blob/main/src/attest/cli.py) (CLI workflows), [`src/attest/vendors/base.py`](https://github.com/herbertkokholm/attest/blob/main/src/attest/vendors/base.py) (Vendor raters), [`src/attest/ensemble/votes.py`](https://github.com/herbertkokholm/attest/blob/main/src/attest/ensemble/votes.py) (Vote vectors), [`src/attest/io/store.py`](https://github.com/herbertkokholm/attest/blob/main/src/attest/io/store.py) (JSON run store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Inputs and controls"]
  node_input_contract["Record contract<br/>[input.py]"]
  node_prefilter["Prefilter framework<br/>[framework.py]"]
  node_config["Ensemble config<br/>[config.py]"]
end

subgraph group_screening["Screening ensemble"]
  node_vendors["Vendor raters<br/>[base.py]"]
  node_batch["Batch execution<br/>[batch.py]"]
  node_providers["Vendor providers"]
  node_votes["Vote vectors<br/>[votes.py]"]
  node_aggregate["Decision aggregation<br/>[aggregate.py]"]
  node_tau["Tau analysis<br/>[tau.py]"]
  node_confidence["Vote confidence<br/>[confidence.py]"]
end

subgraph group_review["Human review planes"]
  node_adjudication["Disagreement adjudication<br/>[adjudication.py]"]
  node_active["Active learning<br/>[active_learning.py]"]
  node_recall_audit["Recall audit<br/>[recall_audit.py]"]
  node_inclusion_audit["Inclusion audit<br/>[inclusion_audit.py]"]
end

subgraph group_validation["Validation and provenance"]
  node_stats["Recall statistics<br/>[recall.py]"]
  node_agreement["Agreement statistics<br/>[agreement.py]"]
  node_validation_record["Validation contract"]
  node_provenance["Run provenance"]
  node_sentinel["Drift sentinel<br/>[sentinel.py]"]
  node_ablation["Ablation analysis<br/>[xsweep.py]"]
end

subgraph group_runtime["Runtime interface"]
  node_cli["CLI workflows<br/>[cli.py]"]
  node_store[("JSON run store<br/>[store.py]")]
end

node_shell(("Product shell"))

node_shell -->|"invokes"| node_cli
node_cli -->|"validates records"| node_input_contract
node_cli -->|"loads config"| node_config
node_cli -->|"runs prefilter"| node_prefilter
node_cli -->|"runs ensemble"| node_vendors
node_cli -->|"submits batches"| node_batch
node_cli -->|"aggregates votes"| node_aggregate
node_cli -->|"validates tau"| node_tau
node_cli -->|"uses confidence"| node_confidence
node_cli -->|"routes review"| node_adjudication
node_cli -->|"selects review"| node_active
node_cli -->|"draws audit"| node_recall_audit
node_cli -->|"draws audit"| node_inclusion_audit
node_cli -->|"persists run"| node_store
node_cli -->|"builds report"| node_validation_record
node_cli -->|"tracks epochs"| node_provenance
node_cli -->|"checks drift"| node_sentinel
node_cli -->|"runs ablation"| node_ablation
node_vendors -->|"builds vectors"| node_votes
node_batch -->|"shares rater protocol"| node_vendors
node_providers -->|"implements raters"| node_vendors
node_aggregate -->|"reads vectors"| node_votes
node_confidence -->|"scores vote metadata"| node_votes
node_tau -->|"analyzes threshold"| node_aggregate
node_active -->|"uses confidence"| node_confidence
node_recall_audit -->|"supplies sample counts"| node_stats
node_inclusion_audit -->|"estimates audited TP"| node_stats
node_agreement -->|"analyzes agreement"| node_votes
node_store -->|"reads normalized input"| node_input_contract
node_store -->|"assembles report"| node_validation_record
node_sentinel -->|"evaluates raters"| node_vendors

click node_cli "https://github.com/herbertkokholm/attest/blob/main/src/attest/cli.py"
click node_input_contract "https://github.com/herbertkokholm/attest/blob/main/src/attest/contracts/input.py"
click node_prefilter "https://github.com/herbertkokholm/attest/blob/main/src/attest/prefilter/framework.py"
click node_config "https://github.com/herbertkokholm/attest/blob/main/src/attest/provenance/config.py"
click node_vendors "https://github.com/herbertkokholm/attest/blob/main/src/attest/vendors/base.py"
click node_batch "https://github.com/herbertkokholm/attest/blob/main/src/attest/vendors/batch.py"
click node_providers "https://github.com/herbertkokholm/attest/tree/main/src/attest/vendors/providers"
click node_votes "https://github.com/herbertkokholm/attest/blob/main/src/attest/ensemble/votes.py"
click node_aggregate "https://github.com/herbertkokholm/attest/blob/main/src/attest/ensemble/aggregate.py"
click node_tau "https://github.com/herbertkokholm/attest/blob/main/src/attest/ensemble/tau.py"
click node_confidence "https://github.com/herbertkokholm/attest/blob/main/src/attest/ensemble/confidence.py"
click node_adjudication "https://github.com/herbertkokholm/attest/blob/main/src/attest/planes/adjudication.py"
click node_active "https://github.com/herbertkokholm/attest/blob/main/src/attest/planes/active_learning.py"
click node_recall_audit "https://github.com/herbertkokholm/attest/blob/main/src/attest/planes/recall_audit.py"
click node_inclusion_audit "https://github.com/herbertkokholm/attest/blob/main/src/attest/planes/inclusion_audit.py"
click node_stats "https://github.com/herbertkokholm/attest/blob/main/src/attest/stats/recall.py"
click node_agreement "https://github.com/herbertkokholm/attest/blob/main/src/attest/stats/agreement.py"
click node_validation_record "https://github.com/herbertkokholm/attest/blob/main/src/attest/contracts/validation_record.py"
click node_provenance "https://github.com/herbertkokholm/attest/tree/main/src/attest/provenance"
click node_sentinel "https://github.com/herbertkokholm/attest/blob/main/src/attest/provenance/sentinel.py"
click node_ablation "https://github.com/herbertkokholm/attest/blob/main/src/attest/ablation/xsweep.py"
click node_store "https://github.com/herbertkokholm/attest/blob/main/src/attest/io/store.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_input_contract,node_prefilter,node_config toneBlue
class node_vendors,node_batch,node_providers,node_votes,node_aggregate,node_tau,node_confidence toneAmber
class node_adjudication,node_active,node_recall_audit,node_inclusion_audit toneMint
class node_stats,node_agreement,node_validation_record,node_provenance,node_sentinel,node_ablation toneRose
class node_cli,node_store,node_shell toneIndigo
```

## Components

### Inputs and controls

- [Record contract](https://github.com/herbertkokholm/attest/blob/main/src/attest/contracts/input.py): `src/attest/contracts/input.py`
- [Prefilter framework](https://github.com/herbertkokholm/attest/blob/main/src/attest/prefilter/framework.py): `src/attest/prefilter/framework.py`
- [Ensemble config](https://github.com/herbertkokholm/attest/blob/main/src/attest/provenance/config.py): `src/attest/provenance/config.py`

### Screening ensemble

- [Vendor raters](https://github.com/herbertkokholm/attest/blob/main/src/attest/vendors/base.py): `src/attest/vendors/base.py`
- [Batch execution](https://github.com/herbertkokholm/attest/blob/main/src/attest/vendors/batch.py): `src/attest/vendors/batch.py`
- [Vendor providers](https://github.com/herbertkokholm/attest/tree/main/src/attest/vendors/providers): `src/attest/vendors/providers`
- [Vote vectors](https://github.com/herbertkokholm/attest/blob/main/src/attest/ensemble/votes.py): `src/attest/ensemble/votes.py`
- [Decision aggregation](https://github.com/herbertkokholm/attest/blob/main/src/attest/ensemble/aggregate.py): `src/attest/ensemble/aggregate.py`
- [Tau analysis](https://github.com/herbertkokholm/attest/blob/main/src/attest/ensemble/tau.py): `src/attest/ensemble/tau.py`
- [Vote confidence](https://github.com/herbertkokholm/attest/blob/main/src/attest/ensemble/confidence.py): `src/attest/ensemble/confidence.py`

### Human review planes

- [Disagreement adjudication](https://github.com/herbertkokholm/attest/blob/main/src/attest/planes/adjudication.py): `src/attest/planes/adjudication.py`
- [Active learning](https://github.com/herbertkokholm/attest/blob/main/src/attest/planes/active_learning.py): `src/attest/planes/active_learning.py`
- [Recall audit](https://github.com/herbertkokholm/attest/blob/main/src/attest/planes/recall_audit.py): `src/attest/planes/recall_audit.py`
- [Inclusion audit](https://github.com/herbertkokholm/attest/blob/main/src/attest/planes/inclusion_audit.py): `src/attest/planes/inclusion_audit.py`

### Validation and provenance

- [Recall statistics](https://github.com/herbertkokholm/attest/blob/main/src/attest/stats/recall.py): `src/attest/stats/recall.py`
- [Agreement statistics](https://github.com/herbertkokholm/attest/blob/main/src/attest/stats/agreement.py): `src/attest/stats/agreement.py`
- [Validation contract](https://github.com/herbertkokholm/attest/blob/main/src/attest/contracts/validation_record.py): `src/attest/contracts/validation_record.py`
- [Run provenance](https://github.com/herbertkokholm/attest/tree/main/src/attest/provenance): `src/attest/provenance`
- [Drift sentinel](https://github.com/herbertkokholm/attest/blob/main/src/attest/provenance/sentinel.py): `src/attest/provenance/sentinel.py`
- [Ablation analysis](https://github.com/herbertkokholm/attest/blob/main/src/attest/ablation/xsweep.py): `src/attest/ablation/xsweep.py`

### Runtime interface

- [CLI workflows](https://github.com/herbertkokholm/attest/blob/main/src/attest/cli.py): `src/attest/cli.py`
- [JSON run store](https://github.com/herbertkokholm/attest/blob/main/src/attest/io/store.py): `src/attest/io/store.py`

### Other components

- **Product shell**

## Connections

- Product shell → CLI workflows: invokes
- CLI workflows → Record contract: validates records (evidence: `src/attest/cli.py`)
- CLI workflows → Ensemble config: loads config (evidence: `src/attest/cli.py`)
- CLI workflows → Prefilter framework: runs prefilter (evidence: `src/attest/cli.py`)
- CLI workflows → Vendor raters: runs ensemble (evidence: `src/attest/cli.py`)
- CLI workflows → Batch execution: submits batches (evidence: `src/attest/cli.py`)
- CLI workflows → Decision aggregation: aggregates votes (evidence: `src/attest/cli.py`)
- CLI workflows → Tau analysis: validates tau (evidence: `src/attest/cli.py`)
- CLI workflows → Vote confidence: uses confidence (evidence: `src/attest/cli.py`)
- CLI workflows → Disagreement adjudication: routes review (evidence: `src/attest/cli.py`)
- CLI workflows → Active learning: selects review (evidence: `src/attest/cli.py`)
- CLI workflows → Recall audit: draws audit (evidence: `src/attest/cli.py`)
- CLI workflows → Inclusion audit: draws audit (evidence: `src/attest/cli.py`)
- CLI workflows → JSON run store: persists run (evidence: `src/attest/cli.py`)
- CLI workflows → Validation contract: builds report (evidence: `src/attest/cli.py`)
- CLI workflows → Run provenance: tracks epochs (evidence: `src/attest/cli.py`)
- CLI workflows → Drift sentinel: checks drift (evidence: `src/attest/cli.py`)
- CLI workflows → Ablation analysis: runs ablation (evidence: `src/attest/cli.py`)
- Vendor raters → Vote vectors: builds vectors (evidence: `src/attest/vendors/base.py`)
- Batch execution → Vendor raters: shares rater protocol (evidence: `src/attest/vendors/batch.py`)
- Vendor providers → Vendor raters: implements raters (evidence: `src/attest/vendors/registry.py`)
- Decision aggregation → Vote vectors: reads vectors (evidence: `src/attest/ensemble/aggregate.py`)
- Vote confidence → Vote vectors: scores vote metadata (evidence: `src/attest/ensemble/confidence.py`)
- Tau analysis → Decision aggregation: analyzes threshold (evidence: `src/attest/ensemble/tau.py`)
- Active learning → Vote confidence: uses confidence (evidence: `src/attest/planes/active_learning.py`)
- Recall audit → Recall statistics: supplies sample counts (evidence: `src/attest/planes/recall_audit.py`)
- Inclusion audit → Recall statistics: estimates audited TP (evidence: `src/attest/planes/inclusion_audit.py`)
- Agreement statistics → Vote vectors: analyzes agreement (evidence: `src/attest/stats/agreement.py`)
- JSON run store → Record contract: reads normalized input (evidence: `src/attest/io/store.py`)
- JSON run store → Validation contract: assembles report (evidence: `src/attest/io/store.py`)
- Drift sentinel → Vendor raters: evaluates raters (evidence: `src/attest/provenance/sentinel.py`)
