# Current architecture

Status: Milestone 2 vNext promoted; Milestone 3 local product implemented

Chartsmith is a deterministic state machine around bounded Codex stages. The
runner, rather than a model, owns stage order, concurrency, retry limits, artifact
checks, and routing. Each model stage receives explicit inputs and must emit
contracted artifacts.

The active runner reconstructs the image, retrieves local design references,
proposes exactly three concepts, selects one, renders it deterministically,
generatively, or as a hybrid, and independently reviews full and embedded
outputs. It releases only after production, epistemic, communication, authorship,
and provenance gates pass.

The active sources are:

- `config/experiments/build_week_vnext/workflow.yaml`
- `config/experiments/build_week_vnext/prompts/`
- `config/experiments/build_week_vnext/schemas/`
- `scripts/chartsmith_vnext.py`
- `scripts/model_invocation.py`

The v2.6 configs, generated runner, evaluator, and NodeBench remain the rollback
and historical optimization baseline. They are no longer the default product
path.

All new execution output goes to `runs/build_week/`. The large run lake outside
that directory is pre-build-week evidence indexed by `runs/manifest.jsonl`.

## Milestone 3 product boundary

The judge-facing application is implemented locally. Its approved direction is
`milestone_3_product_brief.md`, its executed plan is `milestone_3_plan.md`, and
its evidence is `milestone_3_results.md`.

Milestone 3 adds a vinext product UI, durable local job controller, and artifact
projection layer around the promoted workflow. It does not create a second
redesign pipeline. User-facing progress is derived from validated workflow
artifacts and presented as polished reconstruction, concept, rendering, review,
and repair results rather than raw JSON or technical logs.

The application supports immediate curated journeys and genuine local uploads.
Public deployment architecture and authority remain unresolved and must not be
inferred from the implemented local surface.

## Active vNext

The product direction in `product_doctrine.md` is newer than this implementation.
The persuasion-first `build_week_vnext` workflow is:

- `config/experiments/build_week_vnext/workflow.yaml` — deterministic execution
  bounds, stages, schemas, prompts, and artifacts;
- `scripts/model_invocation.py` — Codex CLI, hosted Responses API, and GPT Image
  invocation boundaries;
- `scripts/chartsmith_vnext.py` — image-only state machine, validation,
  rendering, review/repair, final evaluation, and evidence packaging.

The runner performs perceptual reconstruction, local-reference retrieval, three
materially different concepts with autonomous selection, deterministic,
generative, or hybrid rendering, full/embedded visual review, no more than six
repairs and one pivot, then independent final comparison. Hybrid rendering gives
GPT Image the visual base while deterministic code owns all exact typography and
data-bearing geometry.

Stage-specific context keeps the complete reconstruction as an artifact while
avoiding redundant payloads. Identical generation prompts reuse content-addressed
assets, and interrupted image-generation or repair runs can resume from their
latest artifacts. The active bound is six repairs and one pivot, learned from the
already-strong challenge case. See `milestone_2_results.md`.
