# chadowsaln/fresh-flux architecture

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

- Interactive diagram: https://gitdiagram.com/chadowsaln/fresh-flux
- Repository: https://github.com/chadowsaln/fresh-flux

## Overview

This repository packages a chess-engine competition: an entrant plays a generated gauntlet through an HTTP environment, and a scorer evaluates the resulting games. The starter demonstrates the entrant-to-result loop. Separate agent SDKs expose trial configuration, deterministic randomness, store/supplier APIs, and model clients for the broader makefun agent interface. The sampled files establish the main runtime behavior; several ancillary capabilities are visible only from paths or SDK documentation, so their wiring is not inferred.

Main entry points: [`program/env/server.mjs`](https://github.com/chadowsaln/fresh-flux/blob/master/program/env/server.mjs) (Game HTTP environment), [`sdk/makefun-agent.ts`](https://github.com/chadowsaln/fresh-flux/blob/master/sdk/makefun-agent.ts) (TypeScript agent SDK), [`sdk/makefun_agent.py`](https://github.com/chadowsaln/fresh-flux/blob/master/sdk/makefun_agent.py) (Python agent SDK), [`program/generator/draw.mjs`](https://github.com/chadowsaln/fresh-flux/blob/master/program/generator/draw.mjs) (Gauntlet generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_competition["Competition runtime"]
  node_environment["Game HTTP environment<br/>[server.mjs]"]
  node_generator["Gauntlet generator<br/>[draw.mjs]"]
  node_scorer["Result scorer<br/>[score.mjs]"]
end

subgraph group_agent["Entrant and SDK"]
  node_entrant["Starter chess agent<br/>[main.py]"]
  node_sdk_ts["TypeScript agent SDK<br/>[makefun-agent.ts]"]
  node_sdk_py["Python agent SDK<br/>[makefun_agent.py]"]
end

subgraph group_integrations["Agent integrations"]
  node_store_supplier["Shop and supplier APIs"]
  node_model_gateway["Model gateway<br/>[gateway.mjs]"]
end

subgraph group_artifacts["Trial artifacts"]
  node_gauntlet["Gauntlet inputs"]
  node_references["Scoring references"]
  node_calls_log[("Environment call log<br/>[server.mjs]")]
end

node_entrant_actor(("Entrant"))

node_entrant_actor -->|"runs"| node_entrant
node_entrant -->|"requests games"| node_environment
node_generator -->|"writes instances"| node_gauntlet
node_environment -->|"loads gauntlet"| node_gauntlet
node_scorer -->|"reads reference"| node_references
node_environment -->|"records calls"| node_calls_log
node_generator -.->|"supplies inputs"| node_environment
node_environment -.->|"provides game results"| node_scorer
node_entrant_actor -->|"uses"| node_sdk_ts
node_entrant_actor -->|"uses"| node_sdk_py
node_sdk_ts -->|"calls APIs"| node_store_supplier
node_sdk_py -->|"calls APIs"| node_store_supplier
node_sdk_ts -.->|"sends model calls"| node_model_gateway
node_sdk_py -.->|"sends model calls"| node_model_gateway

click node_entrant "https://github.com/chadowsaln/fresh-flux/blob/master/starter/main.py"
click node_environment "https://github.com/chadowsaln/fresh-flux/blob/master/program/env/server.mjs"
click node_generator "https://github.com/chadowsaln/fresh-flux/blob/master/program/generator/draw.mjs"
click node_scorer "https://github.com/chadowsaln/fresh-flux/blob/master/program/scorer/score.mjs"
click node_gauntlet "https://github.com/chadowsaln/fresh-flux/tree/master/practice"
click node_references "https://github.com/chadowsaln/fresh-flux/tree/master/practice"
click node_sdk_ts "https://github.com/chadowsaln/fresh-flux/blob/master/sdk/makefun-agent.ts"
click node_sdk_py "https://github.com/chadowsaln/fresh-flux/blob/master/sdk/makefun_agent.py"
click node_model_gateway "https://github.com/chadowsaln/fresh-flux/blob/master/gateway/gateway.mjs"
click node_calls_log "https://github.com/chadowsaln/fresh-flux/blob/master/program/env/server.mjs"

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_environment,node_generator,node_scorer toneBlue
class node_entrant,node_sdk_ts,node_sdk_py toneAmber
class node_store_supplier,node_model_gateway toneMint
class node_gauntlet,node_references,node_calls_log toneRose
class node_entrant_actor toneIndigo
```

## Components

### Competition runtime

- [Game HTTP environment](https://github.com/chadowsaln/fresh-flux/blob/master/program/env/server.mjs): `program/env/server.mjs`
- [Gauntlet generator](https://github.com/chadowsaln/fresh-flux/blob/master/program/generator/draw.mjs): `program/generator/draw.mjs`
- [Result scorer](https://github.com/chadowsaln/fresh-flux/blob/master/program/scorer/score.mjs): `program/scorer/score.mjs`

### Entrant and SDK

- [Starter chess agent](https://github.com/chadowsaln/fresh-flux/blob/master/starter/main.py): `starter/main.py`
- [TypeScript agent SDK](https://github.com/chadowsaln/fresh-flux/blob/master/sdk/makefun-agent.ts): `sdk/makefun-agent.ts`
- [Python agent SDK](https://github.com/chadowsaln/fresh-flux/blob/master/sdk/makefun_agent.py): `sdk/makefun_agent.py`

### Agent integrations

- **Shop and supplier APIs**
- [Model gateway](https://github.com/chadowsaln/fresh-flux/blob/master/gateway/gateway.mjs): `gateway/gateway.mjs`

### Trial artifacts

- [Gauntlet inputs](https://github.com/chadowsaln/fresh-flux/tree/master/practice): `practice`
- [Scoring references](https://github.com/chadowsaln/fresh-flux/tree/master/practice): `practice`
- [Environment call log](https://github.com/chadowsaln/fresh-flux/blob/master/program/env/server.mjs): `program/env/server.mjs`

### Other components

- **Entrant**

## Connections

- Entrant → Starter chess agent: runs (evidence: `starter/main.py`)
- Starter chess agent → Game HTTP environment: requests games (evidence: `starter/main.py`)
- Gauntlet generator → Gauntlet inputs: writes instances (evidence: `program/generator/draw.mjs`)
- Game HTTP environment → Gauntlet inputs: loads gauntlet (evidence: `program/env/server.mjs`)
- Result scorer → Scoring references: reads reference (evidence: `program/scorer/score.mjs`)
- Game HTTP environment → Environment call log: records calls (evidence: `program/env/server.mjs`)
- Gauntlet generator → Game HTTP environment: supplies inputs
- Game HTTP environment → Result scorer: provides game results
- Entrant → TypeScript agent SDK: uses (evidence: `sdk/makefun-agent.ts`)
- Entrant → Python agent SDK: uses (evidence: `sdk/makefun_agent.py`)
- TypeScript agent SDK → Shop and supplier APIs: calls APIs (evidence: `sdk/makefun-agent.ts`)
- Python agent SDK → Shop and supplier APIs: calls APIs (evidence: `sdk/makefun_agent.py`)
- TypeScript agent SDK → Model gateway: sends model calls
- Python agent SDK → Model gateway: sends model calls
