# kloudtaxi/shiny-waffle architecture

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

- Interactive diagram: https://gitdiagram.com/kloudtaxi/shiny-waffle
- Repository: https://github.com/kloudtaxi/shiny-waffle
- Video tour (about a minute): https://gitdiagram.com/kloudtaxi/shiny-waffle/video

## Overview

Northstar OWM Lab is a seeded synthetic enterprise laboratory: it builds deliberately messy evidence from clean organizational truth, then supports experiments that test whether an OWM can reason over that evidence. The principal workflow is truth/scenarios → generated corpus → OWM-facing decision or reader → evaluated answer. The repo also contains a substantial experimental kernel for evidence screening, governed procedures, document registration, and engine replay. README documents the generation workflow; several lab links below are supported by the source index, while unsampled subsystem internals are represented at their known paths.

Main entry points: [`src/northstar/build.py`](https://github.com/kloudtaxi/shiny-waffle/blob/main/src/northstar/build.py) (Corpus Builder), [`lab/owm_kernel/kernel.py`](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_kernel/kernel.py) (Decision Kernel), [`lab/decision_engine/engine.py`](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/decision_engine/engine.py) (Decision Engine Port), [`runs/2026-10-03-adversarial/hybrid_v3.py`](https://github.com/kloudtaxi/shiny-waffle/blob/main/runs/2026-10-03-adversarial/hybrid_v3.py) (Hybrid Experiment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Truth And Corpus"]
  node_truth["Typed Truth<br/>[entities.py]"]
  node_scenario["Scenario Truth<br/>[scenarios.py]"]
  node_factories["Background Factories"]
  node_generators["Evidence Generators"]
  node_build["Corpus Builder<br/>[build.py]"]
  node_exports["Answer Exports<br/>[yaml.py]"]
  node_oracle["Reference Oracle<br/>[oracle.py]"]
end

subgraph group_decision["Decision Experiments"]
  node_discount["Discount Decisions<br/>[discount.py]"]
  node_credit["Credit Decisions<br/>[credit.py]"]
  node_sla["SLA Decisions<br/>[sla.py]"]
end

subgraph group_governance["Governance Kernel"]
  node_kernel["Decision Kernel<br/>[kernel.py]"]
  node_flow["Spec Runner<br/>[flow.py]"]
  node_governed["Governed Procedures<br/>[governed.py]"]
  node_registrar["Document Registrar<br/>[registrar.py]"]
  node_spec_admit["Spec Admission<br/>[admit.py]"]
end

subgraph group_evaluation["Evaluation And Readers"]
  node_measure_score["Probe Scoring<br/>[score.py]"]
  node_hybrid["Hybrid Experiment<br/>[hybrid_v3.py]"]
  node_bakeoff["Foundation Bakeoff<br/>[adapters.py]"]
end

subgraph group_integration["Engine Integration"]
  node_engine["Decision Engine Port<br/>[engine.py]"]
  node_utopia["Utopia Reader<br/>[utopia.py]"]
  node_blind["Blind Reader<br/>[blind_reader.py]"]
  node_standin["Stand-in Server<br/>[server.py]"]
end

node_user(("Experimenter"))

node_user -->|"builds corpus"| node_build
node_truth -->|"supplies truth"| node_build
node_scenario -->|"defines cases"| node_build
node_factories -->|"adds background"| node_build
node_generators -->|"generates evidence"| node_build
node_build -->|"writes answer key"| node_exports
node_truth -->|"grounds answers"| node_oracle
node_scenario -->|"selects case"| node_oracle
node_oracle -->|"produces expected results"| node_exports
node_user -->|"loads corpus"| node_utopia
node_utopia -->|"supports reading"| node_blind
node_engine -.->|"calls remote model"| node_user
node_hybrid -->|"uses decision port"| node_engine
node_hybrid -.->|"compares kernel"| node_kernel
node_credit -->|"uses kernel"| node_kernel
node_flow -->|"uses kernel types"| node_kernel
node_governed -->|"runs approved spec"| node_flow
node_governed -->|"uses register"| node_registrar
node_spec_admit -->|"checks kernel"| node_kernel
node_discount -.->|"specializes kernel"| node_kernel
node_sla -.->|"specializes kernel"| node_kernel
node_measure_score -->|"scores probe"| node_hybrid
node_bakeoff -->|"registers adapter"| node_engine
node_standin -.->|"serves wire format"| node_engine

click node_truth "https://github.com/kloudtaxi/shiny-waffle/blob/main/src/northstar/model/entities.py"
click node_scenario "https://github.com/kloudtaxi/shiny-waffle/blob/main/src/northstar/model/scenarios.py"
click node_factories "https://github.com/kloudtaxi/shiny-waffle/tree/main/src/northstar/factories"
click node_generators "https://github.com/kloudtaxi/shiny-waffle/tree/main/src/northstar/generators"
click node_build "https://github.com/kloudtaxi/shiny-waffle/blob/main/src/northstar/build.py"
click node_exports "https://github.com/kloudtaxi/shiny-waffle/blob/main/src/northstar/export/yaml.py"
click node_oracle "https://github.com/kloudtaxi/shiny-waffle/blob/main/src/northstar/oracle.py"
click node_engine "https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/decision_engine/engine.py"
click node_utopia "https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/utopia/utopia.py"
click node_blind "https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/utopia/blind_reader.py"
click node_kernel "https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_kernel/kernel.py"
click node_flow "https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_kernel/flow.py"
click node_governed "https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_kernel/governed.py"
click node_registrar "https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_register/registrar.py"
click node_discount "https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_kernel/discount.py"
click node_credit "https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_kernel/credit.py"
click node_sla "https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_kernel/sla.py"
click node_spec_admit "https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/spec_admission/admit.py"
click node_measure_score "https://github.com/kloudtaxi/shiny-waffle/blob/main/runs/2026-10-02-jev-probe/j3/score.py"
click node_hybrid "https://github.com/kloudtaxi/shiny-waffle/blob/main/runs/2026-10-03-adversarial/hybrid_v3.py"
click node_bakeoff "https://github.com/kloudtaxi/shiny-waffle/blob/main/runs/2026-10-09-kf-bakeoff/adapters.py"
click node_standin "https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_standin/server.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_truth,node_scenario,node_factories,node_generators,node_build,node_exports,node_oracle toneBlue
class node_discount,node_credit,node_sla toneAmber
class node_kernel,node_flow,node_governed,node_registrar,node_spec_admit toneMint
class node_measure_score,node_hybrid,node_bakeoff toneRose
class node_engine,node_utopia,node_blind,node_standin,node_user toneIndigo
```

## Components

### Truth And Corpus

- [Typed Truth](https://github.com/kloudtaxi/shiny-waffle/blob/main/src/northstar/model/entities.py): `src/northstar/model/entities.py`
- [Scenario Truth](https://github.com/kloudtaxi/shiny-waffle/blob/main/src/northstar/model/scenarios.py): `src/northstar/model/scenarios.py`
- [Background Factories](https://github.com/kloudtaxi/shiny-waffle/tree/main/src/northstar/factories): `src/northstar/factories`
- [Evidence Generators](https://github.com/kloudtaxi/shiny-waffle/tree/main/src/northstar/generators): `src/northstar/generators`
- [Corpus Builder](https://github.com/kloudtaxi/shiny-waffle/blob/main/src/northstar/build.py): `src/northstar/build.py`
- [Answer Exports](https://github.com/kloudtaxi/shiny-waffle/blob/main/src/northstar/export/yaml.py): `src/northstar/export/yaml.py`
- [Reference Oracle](https://github.com/kloudtaxi/shiny-waffle/blob/main/src/northstar/oracle.py): `src/northstar/oracle.py`

### Decision Experiments

- [Discount Decisions](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_kernel/discount.py): `lab/owm_kernel/discount.py`
- [Credit Decisions](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_kernel/credit.py): `lab/owm_kernel/credit.py`
- [SLA Decisions](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_kernel/sla.py): `lab/owm_kernel/sla.py`

### Governance Kernel

- [Decision Kernel](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_kernel/kernel.py): `lab/owm_kernel/kernel.py`
- [Spec Runner](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_kernel/flow.py): `lab/owm_kernel/flow.py`
- [Governed Procedures](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_kernel/governed.py): `lab/owm_kernel/governed.py`
- [Document Registrar](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_register/registrar.py): `lab/owm_register/registrar.py`
- [Spec Admission](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/spec_admission/admit.py): `lab/spec_admission/admit.py`

### Evaluation And Readers

- [Probe Scoring](https://github.com/kloudtaxi/shiny-waffle/blob/main/runs/2026-10-02-jev-probe/j3/score.py): `runs/2026-10-02-jev-probe/j3/score.py`
- [Hybrid Experiment](https://github.com/kloudtaxi/shiny-waffle/blob/main/runs/2026-10-03-adversarial/hybrid_v3.py): `runs/2026-10-03-adversarial/hybrid_v3.py`
- [Foundation Bakeoff](https://github.com/kloudtaxi/shiny-waffle/blob/main/runs/2026-10-09-kf-bakeoff/adapters.py): `runs/2026-10-09-kf-bakeoff/adapters.py`

### Engine Integration

- [Decision Engine Port](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/decision_engine/engine.py): `lab/decision_engine/engine.py`
- [Utopia Reader](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/utopia/utopia.py): `lab/utopia/utopia.py`
- [Blind Reader](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/utopia/blind_reader.py): `lab/utopia/blind_reader.py`
- [Stand-in Server](https://github.com/kloudtaxi/shiny-waffle/blob/main/lab/owm_standin/server.py): `lab/owm_standin/server.py`

### Other components

- **Experimenter**

## Connections

- Experimenter → Corpus Builder: builds corpus
- Typed Truth → Corpus Builder: supplies truth
- Scenario Truth → Corpus Builder: defines cases
- Background Factories → Corpus Builder: adds background
- Evidence Generators → Corpus Builder: generates evidence
- Corpus Builder → Answer Exports: writes answer key
- Typed Truth → Reference Oracle: grounds answers (evidence: `src/northstar/oracle.py`)
- Scenario Truth → Reference Oracle: selects case (evidence: `src/northstar/oracle.py`)
- Reference Oracle → Answer Exports: produces expected results
- Experimenter → Utopia Reader: loads corpus
- Utopia Reader → Blind Reader: supports reading (evidence: `lab/utopia/blind_reader.py`)
- Decision Engine Port → Experimenter: calls remote model (evidence: `lab/decision_engine/engine.py`)
- Hybrid Experiment → Decision Engine Port: uses decision port (evidence: `runs/2026-10-03-adversarial/hybrid_v3.py`)
- Hybrid Experiment → Decision Kernel: compares kernel
- Credit Decisions → Decision Kernel: uses kernel (evidence: `lab/owm_kernel/credit.py`)
- Spec Runner → Decision Kernel: uses kernel types (evidence: `lab/owm_kernel/flow.py`)
- Governed Procedures → Spec Runner: runs approved spec (evidence: `lab/owm_kernel/governed.py`)
- Governed Procedures → Document Registrar: uses register (evidence: `lab/owm_kernel/governed.py`)
- Spec Admission → Decision Kernel: checks kernel (evidence: `lab/spec_admission/admit.py`)
- Discount Decisions → Decision Kernel: specializes kernel
- SLA Decisions → Decision Kernel: specializes kernel
- Probe Scoring → Hybrid Experiment: scores probe (evidence: `runs/2026-10-03-adversarial/hybrid_v3.py`)
- Foundation Bakeoff → Decision Engine Port: registers adapter (evidence: `runs/2026-10-09-kf-bakeoff/adapters.py`)
- Stand-in Server → Decision Engine Port: serves wire format
