soar·quest

§2How it works · engineering codename SQ5

One spec, six verbs, a deterministic interpreter.

A person describes what they want in plain English. An AI calls a small, fixed set of MCP tools that each stage one structural edit — nothing is written until the whole batch commits atomically. A single Go binary validates, versions, materializes, and renders the result.

01The pipeline

From a sentence to a served app.

1 · Stage

The AI stages ops — it never touches the spec directly

Each tool call — createNode, updateNode, deleteNode, connect, disconnect, reorder — stages one small structural edit against a normalized graph with stable IDs. Nothing is written yet; preview can diff the pending batch without committing.

2 · Validate

Commit validates the whole batch, atomically

commit checks every staged op together against the current spec. An invalid batch writes nothing and returns a structured rejection — {code, closure} — with exactly the pointer a one-step fix needs: which op, which id, which name collided.

3 · Version

A valid batch becomes an immutable version

A new spec version is inserted — the previous one is never overwritten — and the batch is appended to an insert-only op-log: a full, replayable history of every edit ever made.

$ sq5 console apply --app jobs-tracker --ops … --deterministic
{"ok": true, "version": {"id": "ver_000001", "seq": 1, "createdAt": "2026-07-22T12:00:00Z"}}
4 · Materialize

Real tables, named by stable ID

The per-tenant SQLite database is materialized: tables and columns are created or altered, named t_<entityID> / c_<fieldID> — so a later rename is a spec-only edit, never a schema migration.

$ sq5 console schema
t_ent_000001: id · created_at · updated_at · version · created_by · updated_by
              tenant · deleted_at · c_fld_000001 · c_fld_000002 · c_fld_000003 · c_fld_000004
5 · Render

The generic Lit SPA renders it immediately

The same single-page app interprets every spec — lists, boards, calendars, dashboards, workflows. No app-specific code was written anywhere in this path.

02The tool surface

The AI never calls anything besides this fixed list.

The stdio MCP server advertises exactly these tools — the entire write surface to app structure. Read tools inspect; staging tools queue ops; commit is the only door to the spec.

capabilities

list the node types, field types, and edge kinds available.

getOverview

list all entities with field counts.

getEntity

get one entity's fields and config by id.

getWorkflow

get one workflow's ordered steps and config by id.

findNodes

find nodes by type and/or name substring.

createNode

stage creating a node (entity or field).

updateNode

stage updating a node's props.

deleteNode

stage deleting a node (and its edges).

connect

stage connecting two nodes via a named edge.

disconnect

stage removing an edge.

reorder

stage reordering an edge's children to an exact order.

preview

preview the pending batch without committing — diff + migration plan + risk flags.

commit

validate + apply the pending batch atomically as a new immutable version.

discardBatch

discard all staged, uncommitted ops.

03The invariants

Decisions, not features.

Spec is data, edited only via 6 opsBounded, reversible, diffable. No free-text code generation in the write path — the AI's entire influence on app structure is six fixed verbs against a validated graph.
Validate at commit, not per-opA change is N ops applied atomically; only the result is checked. Intermediate states can be individually "wrong" (a field before its entity edge) without ever existing on disk.
spec-ops ≠ data-ops — hard boundaryEditing structure and writing a record are separate APIs and separate MCP surfaces. A prompt-injection in one can't reach the other.
Deterministic coreThe op-apply engine is a pure function of (state, ops, clock, gen). Clock and ID generation are always injected — never time.Now() or rand inside the engine — so every apply is replayable byte-for-byte. It's also what makes the metrics gate below deterministic.
Immutable versions + append-only op-logEvery change diffable, reversible, replayable. Time-travel and version-diff aren't features bolted on top; they fall out of the storage model.

04Metrics methodology

What "100% green, 0% drift" actually measures.

First-pass-green: from a cold build prompt, the AI generates both a spec and tests for it; the run is green only if that spec passes its own tests on the first commit — no retries counted. Flat-drift: after an unrelated edit to the same app, the percentage of held-out tests that stopped being green. Code generation accumulates drift as apps grow; a fixed op surface shouldn't — that's the falsifiable part.

Phase / scopeModelGreen%Drift%Verdict
P0 — 8 entity+field appsclaude-sonnet-4-6100% (8/8)0%PASS
P1 — booking, ordersclaude-sonnet-4-6100% (2/2)0%PASS
P2 — full gate, incl. team-tasks permsclaude-sonnet-4-690.9% (10/11)0%PASS booking borderline cold, fixed
P3 — logic promptsclaude-sonnet-4-6100% (3/3)0%PASS
P4 — first slice (agentStep)claude-sonnet-4-6100% (1/1)0%PASS
Current gate — deterministic25/25 = 100%0%PASS held flat through every P5 slice
bar: ≥80% green / ≤5% drift — set before the runs, not after baseline model: claude-sonnet-5 · historical rows ran on claude-sonnet-4-6, kept as-run

05The stack

Small on purpose.

Go · single static binaryOne artifact, ~35 MB, no runtime dependencies. ./sq5 is the server, the console, the MCP surface, and the migration engine.
modernc.org/sqlitePure-Go SQLite, no cgo — the binary cross-compiles anywhere Go does. One database file per tenant.
Lit + lit-html, no build stepThe generic SPA ships as plain modules — no bundler, no framework runtime, mirrored by this site itself.

Designed and built by Ahmed ElBatanony. Go · ~95,000 lines · 924 tests · 618 commits.

Need this built for your business? See the offer →