# beastrog/aethens architecture

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

- Interactive diagram: https://gitdiagram.com/beastrog/aethens
- Repository: https://github.com/beastrog/aethens

## Overview

Aethens is a Python CLI for auditing task verifiers. Its main workflow loads task directories, runs verifier checks using an isolated runner, and emits findings with evidence and reproduction commands. Separate CLI capabilities generate probe overlays, scaffold task directories, and convert Terminal-Bench 2 tasks. The graph follows documented workflow statements and source-index references; unsampled implementation details and unverified links are omitted.

Main entry points: [`src/aethens/audit.py`](https://github.com/beastrog/aethens/blob/main/src/aethens/audit.py) (Audit orchestration), [`src/aethens/cli/main.py`](https://github.com/beastrog/aethens/blob/main/src/aethens/cli/main.py) (CLI commands), [`src/aethens/checks/base.py`](https://github.com/beastrog/aethens/blob/main/src/aethens/checks/base.py) (Check framework), [`src/aethens/checks/c004_mutation.py`](https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c004_mutation.py) (Mutation testing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and task input"]
  node_cli["CLI commands<br/>[main.py]"]
  node_loader["Task loader<br/>[task_loader.py]"]
  node_models["Task and report models<br/>[models.py]"]
end

subgraph group_audit["Verifier auditing"]
  node_audit_core["Audit orchestration<br/>[audit.py]"]
  node_check_base["Check framework<br/>[base.py]"]
  node_c001["Gold sanity"]
  node_c002["Flakiness<br/>[c002_flakiness.py]"]
  node_c003["Labeled candidates"]
  node_c004["Mutation testing<br/>[c004_mutation.py]"]
  node_mutations["AST mutations<br/>[mutation.py]"]
  node_equivalence["Equivalence checks<br/>[equivalence.py]"]
  node_c005["Order and isolation<br/>[c005_order.py]"]
  node_c006["Overspecification<br/>[c006_overspec.py]"]
  node_rewrites["Behavior rewrites<br/>[rewrites.py]"]
  node_c007["Reward-hack probes"]
end

subgraph group_execution["Task execution"]
  node_runner["Runner interface<br/>[base.py]"]
  node_docker["Docker sandbox<br/>[docker.py]"]
  node_local["Unsafe local runner<br/>[local.py]"]
  node_workdir["Disposable workdir<br/>[workdir.py]"]
end

subgraph group_utilities["Audit utilities"]
  node_report["Report output<br/>[report.py]"]
  node_probes["Probe overlays<br/>[probes.py]"]
  node_scaffold["Task scaffolding<br/>[scaffold.py]"]
  node_converter["TB2 converter<br/>[tb2convert.py]"]
end

node_user(("Task author"))

node_user -->|"runs audit"| node_cli
node_cli -->|"loads tasks"| node_loader
node_cli -->|"starts audit"| node_audit_core
node_audit_core -->|"uses checks"| node_check_base
node_check_base -->|"uses models"| node_models
node_check_base -->|"runs verifier"| node_runner
node_audit_core -->|"uses models"| node_models
node_audit_core -->|"dispatches checks"| node_c001
node_audit_core -->|"dispatches checks"| node_c002
node_audit_core -->|"dispatches checks"| node_c003
node_audit_core -->|"dispatches checks"| node_c004
node_audit_core -->|"dispatches checks"| node_c005
node_audit_core -->|"dispatches checks"| node_c006
node_audit_core -->|"dispatches checks"| node_c007
node_c004 -->|"generates mutants"| node_mutations
node_c004 -->|"checks equivalence"| node_equivalence
node_c006 -->|"generates rewrites"| node_rewrites
node_runner -->|"implements"| node_docker
node_runner -->|"implements"| node_local
node_docker -->|"builds workdir"| node_workdir
node_cli -->|"selects runner"| node_docker
node_cli -->|"selects runner"| node_local
node_cli -->|"writes report"| node_report
node_report -->|"serializes models"| node_models
node_cli -->|"creates overlays"| node_probes
node_cli -->|"creates task"| node_scaffold
node_cli -->|"converts tasks"| node_converter

click node_cli "https://github.com/beastrog/aethens/blob/main/src/aethens/cli/main.py"
click node_loader "https://github.com/beastrog/aethens/blob/main/src/aethens/adapters/task_loader.py"
click node_models "https://github.com/beastrog/aethens/blob/main/src/aethens/models.py"
click node_audit_core "https://github.com/beastrog/aethens/blob/main/src/aethens/audit.py"
click node_check_base "https://github.com/beastrog/aethens/blob/main/src/aethens/checks/base.py"
click node_c001 "https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c001_gold_sanity.py"
click node_c002 "https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c002_flakiness.py"
click node_c003 "https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c003_labeled_candidates.py"
click node_c004 "https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c004_mutation.py"
click node_mutations "https://github.com/beastrog/aethens/blob/main/src/aethens/checks/mutation.py"
click node_equivalence "https://github.com/beastrog/aethens/blob/main/src/aethens/checks/equivalence.py"
click node_c005 "https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c005_order.py"
click node_c006 "https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c006_overspec.py"
click node_rewrites "https://github.com/beastrog/aethens/blob/main/src/aethens/checks/rewrites.py"
click node_c007 "https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c007_reward_hack.py"
click node_runner "https://github.com/beastrog/aethens/blob/main/src/aethens/runner/base.py"
click node_docker "https://github.com/beastrog/aethens/blob/main/src/aethens/runner/docker.py"
click node_local "https://github.com/beastrog/aethens/blob/main/src/aethens/runner/local.py"
click node_workdir "https://github.com/beastrog/aethens/blob/main/src/aethens/runner/workdir.py"
click node_report "https://github.com/beastrog/aethens/blob/main/src/aethens/report.py"
click node_probes "https://github.com/beastrog/aethens/blob/main/src/aethens/probes.py"
click node_scaffold "https://github.com/beastrog/aethens/blob/main/src/aethens/scaffold.py"
click node_converter "https://github.com/beastrog/aethens/blob/main/src/aethens/tb2convert.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_cli,node_loader,node_models toneBlue
class node_audit_core,node_check_base,node_c001,node_c002,node_c003,node_c004,node_mutations,node_equivalence,node_c005,node_c006,node_rewrites,node_c007 toneAmber
class node_runner,node_docker,node_local,node_workdir toneMint
class node_report,node_probes,node_scaffold,node_converter,node_user toneRose
```

## Components

### CLI and task input

- [CLI commands](https://github.com/beastrog/aethens/blob/main/src/aethens/cli/main.py): `src/aethens/cli/main.py`
- [Task loader](https://github.com/beastrog/aethens/blob/main/src/aethens/adapters/task_loader.py): `src/aethens/adapters/task_loader.py`
- [Task and report models](https://github.com/beastrog/aethens/blob/main/src/aethens/models.py): `src/aethens/models.py`

### Verifier auditing

- [Audit orchestration](https://github.com/beastrog/aethens/blob/main/src/aethens/audit.py): `src/aethens/audit.py`
- [Check framework](https://github.com/beastrog/aethens/blob/main/src/aethens/checks/base.py): `src/aethens/checks/base.py`
- [Gold sanity](https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c001_gold_sanity.py): `src/aethens/checks/c001_gold_sanity.py`
- [Flakiness](https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c002_flakiness.py): `src/aethens/checks/c002_flakiness.py`
- [Labeled candidates](https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c003_labeled_candidates.py): `src/aethens/checks/c003_labeled_candidates.py`
- [Mutation testing](https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c004_mutation.py): `src/aethens/checks/c004_mutation.py`
- [AST mutations](https://github.com/beastrog/aethens/blob/main/src/aethens/checks/mutation.py): `src/aethens/checks/mutation.py`
- [Equivalence checks](https://github.com/beastrog/aethens/blob/main/src/aethens/checks/equivalence.py): `src/aethens/checks/equivalence.py`
- [Order and isolation](https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c005_order.py): `src/aethens/checks/c005_order.py`
- [Overspecification](https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c006_overspec.py): `src/aethens/checks/c006_overspec.py`
- [Behavior rewrites](https://github.com/beastrog/aethens/blob/main/src/aethens/checks/rewrites.py): `src/aethens/checks/rewrites.py`
- [Reward-hack probes](https://github.com/beastrog/aethens/blob/main/src/aethens/checks/c007_reward_hack.py): `src/aethens/checks/c007_reward_hack.py`

### Task execution

- [Runner interface](https://github.com/beastrog/aethens/blob/main/src/aethens/runner/base.py): `src/aethens/runner/base.py`
- [Docker sandbox](https://github.com/beastrog/aethens/blob/main/src/aethens/runner/docker.py): `src/aethens/runner/docker.py`
- [Unsafe local runner](https://github.com/beastrog/aethens/blob/main/src/aethens/runner/local.py): `src/aethens/runner/local.py`
- [Disposable workdir](https://github.com/beastrog/aethens/blob/main/src/aethens/runner/workdir.py): `src/aethens/runner/workdir.py`

### Audit utilities

- [Report output](https://github.com/beastrog/aethens/blob/main/src/aethens/report.py): `src/aethens/report.py`
- [Probe overlays](https://github.com/beastrog/aethens/blob/main/src/aethens/probes.py): `src/aethens/probes.py`
- [Task scaffolding](https://github.com/beastrog/aethens/blob/main/src/aethens/scaffold.py): `src/aethens/scaffold.py`
- [TB2 converter](https://github.com/beastrog/aethens/blob/main/src/aethens/tb2convert.py): `src/aethens/tb2convert.py`

### Other components

- **Task author**

## Connections

- Task author → CLI commands: runs audit (evidence: `README.md`)
- CLI commands → Task loader: loads tasks (evidence: `src/aethens/cli/main.py`)
- CLI commands → Audit orchestration: starts audit (evidence: `src/aethens/cli/main.py`)
- Audit orchestration → Check framework: uses checks (evidence: `src/aethens/audit.py`)
- Check framework → Task and report models: uses models (evidence: `src/aethens/checks/base.py`)
- Check framework → Runner interface: runs verifier (evidence: `src/aethens/checks/base.py`)
- Audit orchestration → Task and report models: uses models (evidence: `src/aethens/audit.py`)
- Audit orchestration → Gold sanity: dispatches checks
- Audit orchestration → Flakiness: dispatches checks
- Audit orchestration → Labeled candidates: dispatches checks
- Audit orchestration → Mutation testing: dispatches checks
- Audit orchestration → Order and isolation: dispatches checks
- Audit orchestration → Overspecification: dispatches checks
- Audit orchestration → Reward-hack probes: dispatches checks
- Mutation testing → AST mutations: generates mutants (evidence: `src/aethens/checks/c004_mutation.py`)
- Mutation testing → Equivalence checks: checks equivalence (evidence: `src/aethens/checks/c004_mutation.py`)
- Overspecification → Behavior rewrites: generates rewrites (evidence: `src/aethens/checks/c006_overspec.py`)
- Runner interface → Docker sandbox: implements (evidence: `src/aethens/runner/__init__.py`)
- Runner interface → Unsafe local runner: implements (evidence: `src/aethens/runner/__init__.py`)
- Docker sandbox → Disposable workdir: builds workdir (evidence: `src/aethens/runner/docker.py`)
- CLI commands → Docker sandbox: selects runner (evidence: `src/aethens/cli/main.py`)
- CLI commands → Unsafe local runner: selects runner (evidence: `src/aethens/cli/main.py`)
- CLI commands → Report output: writes report (evidence: `src/aethens/cli/main.py`)
- Report output → Task and report models: serializes models (evidence: `src/aethens/report.py`)
- CLI commands → Probe overlays: creates overlays (evidence: `src/aethens/cli/main.py`)
- CLI commands → Task scaffolding: creates task (evidence: `src/aethens/cli/main.py`)
- CLI commands → TB2 converter: converts tasks (evidence: `src/aethens/cli/main.py`)
