# rick-clinton-jpg/dogwhistle architecture

> Architecture diagram of the GitHub repository rick-clinton-jpg/dogwhistle, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rick-clinton-jpg/dogwhistle
- Repository: https://github.com/rick-clinton-jpg/dogwhistle

## Overview

DogWhistle is an auditable research experiment, not a deployed detector. Its central workflow prepares a synthetic allocation task and planted handoff references, runs a successor model, then audits and scores its response. Separate study modules test held-out transmission, coalition-seeking and honest listeners, and the label-free repeated-replay sensitivity contrast. Allocation, handoff validation, and statistical routines form shared internal layers; independent evaluation re-scores published evidence. Edges reflect README statements or indexed source references; unsampled implementation details and historical prior-work internals are not expanded.

Main entry points: [`dogwhistle/study.py`](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/study.py) (Base study), [`dogwhistle/visibility.py`](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/visibility.py) (Visibility study), [`dogwhistle/heldout.py`](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/heldout.py) (Held-out study), [`dogwhistle/stats.py`](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/stats.py) (Study statistics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experiment["Experiment orchestration"]
  node_study["Base study<br/>[study.py]"]
  node_heldout["Held-out study<br/>[heldout.py]"]
  node_visibility["Visibility study<br/>[visibility.py]"]
  node_honest["Honest study<br/>[honest.py]"]
  node_listener["Listener audit<br/>[listener.py]"]
end

subgraph group_runtime["Task and model runtime"]
  node_task["Allocation task<br/>[allocation.py]"]
  node_handoff["Handoff gate<br/>[gate.py]"]
  node_adapter["Codex adapter<br/>[codex_adapter.py]"]
end

subgraph group_audit["Study audits"]
  node_stats["Study statistics<br/>[stats.py]"]
end

subgraph group_evaluation["Statistical evaluation"]
  node_independent["Independent scoring<br/>[evalstats.py]"]
  node_pr6eval["PR6 re-analysis<br/>[pr6_eval.py]"]
  node_serieseval["Series re-analysis<br/>[series_eval.py]"]
end

node_researcher(("Researcher"))
node_model(("Successor model"))

node_researcher -->|"runs study"| node_study
node_study -->|"generates tasks"| node_task
node_study -->|"uses handoff"| node_handoff
node_study -->|"uses statistics"| node_stats
node_study -.->|"invokes adapter"| node_adapter
node_adapter -.->|"calls model"| node_model
node_researcher -->|"runs study"| node_heldout
node_heldout -->|"validates tasks"| node_task
node_heldout -->|"uses statistics"| node_stats
node_researcher -->|"runs study"| node_visibility
node_visibility -->|"generates and scores"| node_task
node_visibility -->|"builds handoff"| node_handoff
node_visibility -->|"uses decoding"| node_heldout
node_visibility -->|"uses statistics"| node_stats
node_researcher -->|"runs study"| node_honest
node_honest -->|"uses allocation"| node_task
node_honest -->|"uses shared study logic"| node_heldout
node_honest -->|"uses statistics"| node_stats
node_researcher -->|"runs audit"| node_listener
node_listener -.->|"receives model outputs"| node_model
node_listener -->|"uses statistics"| node_stats
node_researcher -->|"runs re-analysis"| node_independent
node_pr6eval -->|"uses methods"| node_independent
node_serieseval -->|"uses methods"| node_independent

click node_study "https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/study.py"
click node_heldout "https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/heldout.py"
click node_visibility "https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/visibility.py"
click node_honest "https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/honest.py"
click node_listener "https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/listener.py"
click node_task "https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/allocation.py"
click node_handoff "https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/gate.py"
click node_adapter "https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/codex_adapter.py"
click node_stats "https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/stats.py"
click node_independent "https://github.com/rick-clinton-jpg/dogwhistle/blob/main/analysis/independent_eval/evalstats.py"
click node_pr6eval "https://github.com/rick-clinton-jpg/dogwhistle/blob/main/analysis/independent_eval/pr6_eval.py"
click node_serieseval "https://github.com/rick-clinton-jpg/dogwhistle/blob/main/analysis/independent_eval/series_eval.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_study,node_heldout,node_visibility,node_honest,node_listener toneBlue
class node_task,node_handoff,node_adapter toneAmber
class node_stats toneMint
class node_independent,node_pr6eval,node_serieseval toneRose
class node_researcher,node_model toneIndigo
```

## Components

### Experiment orchestration

- [Base study](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/study.py): `dogwhistle/study.py`
- [Held-out study](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/heldout.py): `dogwhistle/heldout.py`
- [Visibility study](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/visibility.py): `dogwhistle/visibility.py`
- [Honest study](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/honest.py): `dogwhistle/honest.py`
- [Listener audit](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/listener.py): `dogwhistle/listener.py`

### Task and model runtime

- [Allocation task](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/allocation.py): `dogwhistle/allocation.py`
- [Handoff gate](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/gate.py): `dogwhistle/gate.py`
- [Codex adapter](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/codex_adapter.py): `dogwhistle/codex_adapter.py`

### Study audits

- [Study statistics](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/dogwhistle/stats.py): `dogwhistle/stats.py`

### Statistical evaluation

- [Independent scoring](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/analysis/independent_eval/evalstats.py): `analysis/independent_eval/evalstats.py`
- [PR6 re-analysis](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/analysis/independent_eval/pr6_eval.py): `analysis/independent_eval/pr6_eval.py`
- [Series re-analysis](https://github.com/rick-clinton-jpg/dogwhistle/blob/main/analysis/independent_eval/series_eval.py): `analysis/independent_eval/series_eval.py`

### Other components

- **Researcher**
- **Successor model**

## Connections

- Researcher → Base study: runs study (evidence: `README.md`)
- Base study → Allocation task: generates tasks (evidence: `dogwhistle/study.py`)
- Base study → Handoff gate: uses handoff (evidence: `dogwhistle/study.py`)
- Base study → Study statistics: uses statistics (evidence: `dogwhistle/study.py`)
- Base study → Codex adapter: invokes adapter
- Codex adapter → Successor model: calls model
- Researcher → Held-out study: runs study (evidence: `README.md`)
- Held-out study → Allocation task: validates tasks (evidence: `dogwhistle/heldout.py`)
- Held-out study → Study statistics: uses statistics (evidence: `dogwhistle/heldout.py`)
- Researcher → Visibility study: runs study (evidence: `README.md`)
- Visibility study → Allocation task: generates and scores (evidence: `dogwhistle/visibility.py`)
- Visibility study → Handoff gate: builds handoff (evidence: `dogwhistle/visibility.py`)
- Visibility study → Held-out study: uses decoding (evidence: `dogwhistle/visibility.py`)
- Visibility study → Study statistics: uses statistics (evidence: `dogwhistle/visibility.py`)
- Researcher → Honest study: runs study (evidence: `README.md`)
- Honest study → Allocation task: uses allocation (evidence: `dogwhistle/honest.py`)
- Honest study → Held-out study: uses shared study logic (evidence: `dogwhistle/honest.py`)
- Honest study → Study statistics: uses statistics (evidence: `dogwhistle/honest.py`)
- Researcher → Listener audit: runs audit (evidence: `README.md`)
- Listener audit → Successor model: receives model outputs
- Listener audit → Study statistics: uses statistics (evidence: `dogwhistle/listener.py`)
- Researcher → Independent scoring: runs re-analysis (evidence: `README.md`)
- PR6 re-analysis → Independent scoring: uses methods (evidence: `analysis/independent_eval/pr6_eval.py`)
- Series re-analysis → Independent scoring: uses methods (evidence: `analysis/independent_eval/series_eval.py`)
