Software Factory Build Plan · Decisions Locked

Atelier

A workshop where agents propose & deterministic code disposes

Atelier marries the determinism of the Super-Simple Software Factory (ADW engine) with the operator-console cockpit of FounderOS. Agents propose inside bounded phases; deterministic Python decides sequencing and acceptance; and every event streams to a UI you can watch, launch, and steer.

The whole plan rests on one lucky coincidence I found reading both repos: both systems already treat SQLite as the single source of truth. That shared seam is what makes this a marriage, not a rewrite.

01 What we take from each

The Engine - from SSSF Python

Determinism spine

"Agent proposes, code disposes." Non-deterministic agents live as bounded nodes inside a deterministic Python graph.

  • Typed envelopes - every agent emits a Pydantic-validated JSON contract, not prose
  • Deterministic gates - code verifies the envelope's claims against disk & git before proceeding
  • kind = engineer · agent · code - known commands (tests, git) are code, never an agent
  • Bounded loops - MAX_FIX_LOOPS=3, MAX_REVISION=2 as constants, not agent judgment
  • Write-boundary enforcement - before/after repo diff, rollback anything outside an agent's allowlist
  • Model stack - a different model per phase (Opus 5 / Fable 5 planner, GPT-5.6 Sol builder)

The Cockpit - from FounderOS Next.js

Operator console

A terminal-grade command center: "Monolith Signal" aesthetic - bare black, JetBrains Mono, color only ever means status.

  • App shell - sidebar nav (single source of truth) + ⌘K palette + screen-aware AI dock
  • Process Map - horizontal phase pipeline, per-step human/agent/tool owner + status
  • Activity feed - newest-first live run log with OK/FAIL + timestamps
  • Cost/observability tables - per-agent runs, success rate, tokens, $, latency
  • Kanban + Skills library - cards that agents advance; capability grid read live from disk
  • Design system - terminal.tsx primitives + tokens, liftable wholesale

This very document is rendered in FounderOS's own Monolith Signal tokens - so it doubles as a preview of Atelier's target look.

02 Architecture - two processes, one database

The cockpit and the engine never call each other directly at runtime. They meet at one SQLite file. The engine writes the live trace; the cockpit polls it on a rowid cursor (exactly the contract SSSF's tracer already ships, and exactly the way FounderOS's repo layer already reads). The only net-new plumbing is a control channel - a run_queue table - so the cockpit can launch runs, not just observe them.

Operatoryou
launch / cancel
CockpitNext.js + FounderOS UI
enqueue intent
run_queuecontrol table · net-new
worker drains
EnginePython · ADW orchestrator
kind=agent propose  ·  kind=code dispose
Coding agentAgent SDK / Pi
Deterministic blockstests · git · gates
stream events live
sssf.dbSQLite · the seam
↑  Cockpit reads sssf.db back on a poll (rowid cursor) - the loop that makes the UI live

sssf.db is the seam both sides already speak; run_queue and the cockpit's launch path are the only net-new pieces.

The seam · sssf.db

Both sides already speak it. SSSF's tracer writes 7 tables in WAL mode (readers never block the writer); FounderOS reads SQLite through a Zod-validated repo layer. Point that layer at SSSF's schema and observation is nearly free.

Net-new · run_queue

SSSF is CLI-launched. To launch from the UI we add one table + a tiny worker (or thin FastAPI). Cancel reuses the processes table - pids are already tracked.

The one risk to design around

Python (engine) and TypeScript (cockpit) must agree on the schema forever. Mitigation: generate the TS row types from the Pydantic/SQLite definitions so they can't drift.

03 Concept map - engine ↔ cockpit ↔ unified

Nearly every ADW primitive already has a FounderOS view waiting for it. The unified column is what we actually build.

Engine concept (SSSF)Cockpit view (FounderOS)Unified in Atelier
adw_id sessionActivity feed rowRun - one line in the run log, click to open
Phases (engineer/agent/code)WorkflowMap process mapProcess Map - live phase pipeline w/ owner lanes
sssf.config.yaml rosterReal Agents runtime pageAgents - roster cards, tier, model, tools, last-run
Deterministic gates- (none yet)Gate panel - pass/fail w/ per-check evidence
tracer.py · 7 tablesAgentCostAnalysis tableObservability - tokens, $, latency, success rate
UsageBreakdownCost tiles + sparkCost - per-run & per-model spend, "thousandth run"
cookbooks / recipesSkills capability librarySkills - card grid read live from the factory
- (CLI launch only)Tasks Kanban + ConductorQueue - enqueue/steer runs, NL launch via Conductor

04 The determinism the UI must never bypass

The cockpit is a window and a launch button - it observes and enqueues. It must never reach in and mutate a run's acceptance. SSSF wraps every non-deterministic agent call in five deterministic checkpoints inside agents.execute(); we keep all five and simply render them.

01

Schema parse

Envelope must parse as its declared Pydantic type. 2 same-session JSON-fix retries.

02

Claim gates

Verify the envelope's assertions against disk & git. Violations feed back into the live session.

03

Write boundary

Before/after repo diff; roll back anything outside the agent's writes allowlist.

04

Status check

Envelope status == "success" or the phase raises.

05

Phase manager

Defaults to fail. Success must be earned; one run.finish() reconciles db + banner + exit code.

05 The three views that make it real

Mocked below in the target design system. These are the v1 / Phase-1 deliverables - everything else is elaboration on top of them.

Runs
RUNlogin-formbuilding00:12
OKcsv-exportaccepted02:41
FAILstripe-hookgate ✗04:03
OKdark-modeaccepted09:55

Run log - from events + sessions. Live, newest-first.

Process Map · login-form
agent
planner
✓ 0:31
code
commit plan
agent
builder
running…
code
test
-
agent
reviewer
-

Process map - FounderOS WorkflowMap re-skinned to ADW phase lanes.

Run detail
Tokens
48.2k
Cost
$0.19
Gates
6 ✓
Retries
1
gate_pass · artifacts_exist · "plan.md exists, 2.1KB"
gate_pass · verdict_consistent · "approved, 0 blocking"

Run detail - phase timeline + envelope + gate evidence + cost.

06 Build roadmap

Per your call, v1 = Phases 0-1 (observe-first): prove the seam over real, CLI-launched runs before building the control plane.

Phase 0v1Foundations & the seamscaffold · no features yet
  • Stand up the monorepo: /engine (SSSF install) + /cockpit (Next.js w/ FounderOS design system)
  • Lift the design system wholesale: terminal.tsx primitives, tokens, shell, nav.ts, ⌘K palette
  • Freeze the SQLite schema as the contract; generate a TS mirror of the tracer/Pydantic types
  • Run a trivial ADW; confirm both processes point at one sssf.db

Ships

Empty cockpit renders; engine runs; shared db proven.

Phase 1v1Observe - read-only cockpit over real runsthe core deliverable
  • Point the cockpit repo layer at sssf.db via the rowid polling contract
  • Build the three views on real data: Runs log · Process Map · Run detail (phases + envelope + gates)
  • Re-skin WorkflowMap to ADW engineer/agent/code lanes with live per-phase status

Ships

Kick an ADW from the CLI, watch it end-to-end in the cockpit. ← v1 done

Phase 2Control plane - launch from the UIthe run_queue
  • Add run_queue table + a small worker (or thin FastAPI) that the engine drains
  • Conductor dock becomes the NL launcher - "plan + build X" picks an ADW + roster
  • Cancel/kill wired to the existing processes pid tracking

Ships

Start & stop runs entirely from the cockpit.

Phase 3Observability & costdesign for the 1000th run
  • Cost/usage tables (UsageBreakdown → AgentCostAnalysis): per-run token/$/latency, summed across retries
  • Gate panel with evidence + retry visualization; model-stack view (which model per phase, cost per tier)

Ships

Full observability - you can measure, therefore improve.

Phase 4Authoring & reusesystems that build systems
  • Roster editor - edit sssf.config.yaml (agents, models, prompts, writes/tools), validated, from the UI
  • ADW builder - wrap make_adw.py to compose phase chains visually
  • Skills / cookbook library reading the factory's own recipes

Ships

Create/modify agents & workflows without leaving the cockpit.

Phase 5Real-time & scaleclose the one FounderOS gap
  • Replace polling with SSE/WebSocket for streaming logs + phase status (FounderOS's one missing piece)
  • Sandbox / cloud runs - "push 80% of junk work to sandboxes"
  • Multi-run dashboard; Tasks Kanban becomes the queue lanes

Ships

Live streaming, parallel runs, real queue management.

07 Decisions - locked

#DecisionLocked
D1Coding-agent backendBoth - Pi + Claude Code behind the coding_agent abstraction; CC driven by the Agent SDK (see below)
D2The seamHybrid - cockpit reads sssf.db directly; control via a run_queue table + small worker
D3Repo layoutMonorepo - /engine + /cockpit sharing generated schema types
D4v1 scopeObserve-first - Phases 0-1, over real CLI-launched runs
D5NameAtelier

D1 deep-dive - driving Claude Code: Agent SDK, not Herdr

You asked whether to drive CC through Herdr or the Agent SDK. For the engine backend, the Claude Agent SDK (claude-agent-sdk, Python) is the right tool. Herdr is a terminal multiplexer for driving/observing interactive agent panes - a great operator UX, but the wrong seam for a deterministic engine that needs typed, parseable, resumable output. The SDK is purpose-built for exactly SSSF's contract and maps 1:1 onto machinery the engine already has:

SSSF mechanism (exists today)Agent SDK primitive
tracer events (agent_start · tool_call · agent_end)typed async message stream - SystemMessage · AssistantMessage · ToolResultMessage · ResultMessage
agent_map session resumeresume="<session_id>" - id from ResultMessage.session_id
permissions.enforce (write boundary)can_use_tool callback + permission_mode + allowed_tools=["Edit(//src/**)"]
UsageBreakdown ($ + tokens)ResultMessage.total_cost_usd + usage deltas
model stack per phasemodel= per call - Claude models via SDK, non-Claude (GPT) via Pi

Your model stack - why "both" earns its keep

PhaseModelBackend
PlannerOpus 5 / Fable 5 - routed per-run by task complexityClaude Agent SDK
BuilderGPT-5.6 SolPi
Reviewer · Documenteryour call (TBD)SDK or Pi, by model

This split is exactly why D1 = both: Claude planners (Opus 5 / Fable 5) run through the Agent SDK; GPT-5.6 Sol builds through Pi. The engine picks the model per ph.call(), so "Opus vs Fable by complexity" is just a per-run branch on the planner phase.

This turns SSSF's stubbed agent_cc.py into a real integration and keeps Pi behind the same abstraction. Herdr can ride along later as an optional way to watch live runs in a terminal - orthogonal to the engine. Verified against the Agent SDK docs (Python: claude-agent-sdk; TS: @anthropic-ai/claude-agent-sdk). The headless CLI (claude -p --output-format stream-json) is the fallback only if the engine ever needs a non-Python driver.

08 Risks & failure modes

RiskSevMitigation
Python ↔ TS schema driftHIGHGenerate TS row types from the Pydantic/SQLite schema; the db definition is the single source. This is the #1 thing Phase 0 must nail.
Web process launching subprocess agentsHIGHLocal-only; auth middleware already fails closed; decouple via run_queue so the cockpit never spawns processes itself. (Deferred to Phase 2 - not in v1.)
Claude Code backend is a stub in SSSFMEDResolved direction: build agent_cc.py against the Agent SDK (claude-agent-sdk), reusing its native resume / permission / cost primitives. Budget real integration work; keep Pi behind the same abstraction.
SQLite write contentionLOWAlready handled - WAL + synchronous=NORMAL + busy_timeout. Cockpit only writes to run_queue.
Polling latency vs true real-timeLOW500ms rowid polling is fine through Phase 4; SSE is a deliberate Phase 5 upgrade, not a rewrite.

Decisions locked - D1 both backends (CC via Agent SDK) · D2 hybrid seam · D3 monorepo · D4 v1 = observe-first · D5 name = Atelier. · Design source: #2 - matched the subject product - rendered in FounderOS's real "Monolith Signal" tokens so the plan previews Atelier's look. · Claims verified against super-simple-software-factory, FounderOS-DEMO, a live walk of the app, and the Claude Agent SDK docs. · Next: Phase 0 scaffold - say the word and I'll start.