How the system works
Tenwhy is how a company should become. Each customer gets a workforce of named role-agents that runs a real business on their behalf — backed by a dashboard, a database, and a "brain" (a private folder of living documents every agent reads and writes). The agents themselves are produced upstream by a separate software factory: an Executor and a Reviewer that build the tools the workforce consumes.
This page is the comprehensive design reference. The homepage shows the interactive build pipeline, and the stack map covers what runs where.
1 · North star
Most "AI agent" products are a single chatbot pretending to be many things. This is the opposite: a small factory that ships specialized agent-tools, and a clearly ranked workforce that uses them. Specialization on the inside, one human touchpoint on the outside.
2 · The two layers
The whole system splits cleanly in two. The factory is shared infrastructure (one of these exists for all customers). The workforce is per-customer (one of these exists per customer we sign up).
(shared)
(per‑customer)
(per‑customer)
3 · v0.1 — what we build first
The big realization of this grill: Maestro is the first agent we build, not one of the 12 listed specialists. Every future agent depends on Maestro's output to be useful. Building a specialist first would just be a chatbot in costume.
v0.1 milestone — Maestro alone
Factory + Maestro + Dashboard + Brain repo + Postgres. No other agents exist yet. The 12 specialists become a hiring roadmap, not a v1 deliverable. This mirrors how real CEOs work — they do everything themselves until they hire.
| Layer 1 — Factory | Hand-coded for v0.1 (it can't bootstrap itself yet). Becomes the machine that hires the specialists later. |
| Layer 2 — Workforce | Maestro only. Acts as the customer's Personal CEO + CFO + Chief of Staff. |
| Layer 3 — Customer surfaces | A dashboard, a private GitHub brain repo, a Postgres row for operational state. |
how this relates to the build plan The engineering MVP on the build page runs Maestro plus one hand-written specialist (Jon) against a hand-seeded brain — that's the smallest loop that proves the job contract, the audit trail, and the orchestration wiring. v0.1 here is the product milestone: Maestro alone, interviewing real customers and writing real brains. The MVP loop is scaffolding on the way to it; Jon's early presence is a test fixture, not a hiring decision.
4 · Maestro's job
Maestro interviews the customer and writes their findings into a structured "brain." The customer can show up with as little as an idea, a description, or a URL — Maestro takes it from there.
The first decision Maestro makes
Before anything else, Maestro figures out whether this is an idea or an established business. The two flows produce different brain content (aspirational vs. inventory-heavy), so the differentiation has to happen early.
| Mechanism | How it works |
|---|---|
| Ask + verify | Maestro asks the customer directly during the interview, AND verifies via URL if one was given (working site with products = established). Customer can override. |
What Maestro can see (established businesses)
| Source | v0.1 access |
|---|---|
| Customer's answers | Yes — primary input. |
| Public website (URL) | Yes — Maestro scrapes homepage, about, products, pricing to pre-fill drafts. |
| Integrations (Stripe, Shopify, GA, etc.) | Not in v0.1. Comes later. |
5 · The customer's brain — 8 living documents
Maestro's output is a folder of HTML documents (not bare markdown), styled like this page. They live in the customer's private GitHub repo and update as Maestro and future specialists learn more.
Every future agent we hire (Max, Tom, John…) reads from this brain before doing any work. That's why Maestro had to be first — without these documents, no specialist has context.
business.htmlWhat the business / idea is. Problem, value prop, what it does and doesn't do.customer.htmlWho the founder is. Role, background, working style, what they want from the system.product.htmlWhat they sell (or want to sell). Offerings, pricing, format.audience.htmlWho they sell to. Personas, jobs-to-be-done, channels they live on.voice.htmlBrand voice, tone, vocabulary. Words they use, words they avoid.assets.htmlWhat they already have. Existing site, accounts, files, audiences, traffic.goals.htmlWhat they're trying to achieve. North-star metric, near-term targets, time horizons.status.htmlStage marker — idea vs. established, runway, momentum, current bottleneck.
Format note Documents are rendered as HTML in the style of this page (Thariq's "concept explainer" pattern — serif headings, monospace eyebrows, ivory background, clay accents). HTML is what the customer sees; the source-of-truth file committed to git is the same HTML.
6 · How the customer experiences it
The dashboard is a live split-screen: Maestro's chat on the left, the brain documents on the right. As the conversation produces facts, the right side updates in real-time — the customer watches their own "brain" form.
business.html — who's your ideal subscriber?maestro/business.htmlwriting…maestro/customer.htmlqueuedmaestro/product.htmldraft from scrapemaestro/audience.htmlqueuedmaestro/voice.htmlqueuedmaestro/assets.htmldraft from scrapemaestro/goals.htmlqueuedmaestro/status.htmlestablished · confirmedConversation style Guided + open-ended follow-ups. Maestro works through the 8 documents as an agenda (predictable enough to ship), but each section is conversation, not a form. He validates, summarizes, asks follow-ups, and lets the customer steer.
The dashboard is generative
One dashboard application serves every customer (multi-tenant), but the layout itself isn't fixed. After the interview, Maestro emits a JSON spec describing which widgets, metrics, and panels this customer needs. json-render.dev renders that JSON into React UI from a constrained component catalog.
Result: a content business and a product business get different dashboards out of the same app. Maestro keeps updating the spec as the brain evolves and as specialists get hired — adding Max means SEO widgets appear, adding Tom means a media library appears.
| Output of Maestro | Lives in | Purpose |
|---|---|---|
brain/*.html |
Customer's GitHub repo | What we know about the customer (truth) |
dashboard.json |
Postgres (versioned) | How the customer sees + interacts with the work (UI spec) |
7 · Where the data lives
Two stores, each with a clear job. Nothing lives in both.
| Store | What's in it |
|---|---|
tenwhy-brains/<customer>GitHub repo · private |
The brain. Folder per agent: /maestro/ at v0.1; later /max/,
/john/, etc. as specialists get hired. Each agent only writes to its own
folder — clean commit attribution, no merge conflicts.
|
| Shared Postgres RLS on customer_id |
Operational state: customer accounts, chat history, agent task queues, scheduling, audit logs. Same Row-Level Security pattern already in the PRD. |
Why a git repo for the brain (not the database)
Three reasons: it's portable (the customer can clone or export their brain at any time — they own it), it's versioned for free (every change is a commit, with attribution to whichever agent made it), and it forces clear ownership boundaries (one folder per agent, no fighting over rows).
8 · Action history & audit
Every external action — Sac lowering a Meta bid, Jon publishing a product, Vic uploading generated media — leaves a durable, customer-readable trail. Three stores hold it, each with its own job:
| Store | What it holds | Audience |
|---|---|---|
Postgres action_log |
Structured row per action — agent, proposal JSON, validation result, API status, customer_id (RLS-scoped) | System queries · analytics · operators |
| Better Stack | JSON-line stream from every µVM in real time; 30-day retention | On-call · debugging · alerting |
Brain repo · per-agent history.html |
Editorial-styled HTML log, append-only via git commits | Customer · the agent's future runs · third-party auditors |
The customer-facing layer
Every department gets its own log, and Maestro aggregates them into a chronological cross-company timeline.
| Path in brain | Contents |
|---|---|
/sac/history.html | SEM-only — every bid change, paused campaign, spend decision |
/max/history.html | SEO-only — keyword moves, on-page edits, ranking checks |
/jon/history.html | Catalog — product additions, price changes, deletions |
| … one per agent | Same shape for every specialist in the workforce |
/maestro/timeline.html | Cross-company chronological feed; one line per action, deep-links into each per-agent log |
One entry, in detail
Each action becomes a self-contained article appended to the agent's history file:
| Field | Example |
|---|---|
| Timestamp | 2026-05-29 · 14:32 UTC |
| Agent | Sac · SEM |
| Action | Lower bid 10% on campaign-x123 |
| Status | approved · executed |
| Validation | within $50/day cap · campaign on allow-list |
| Outcome | Meta API 200 · bid $0.50 → $0.45 · projected −$42/day spend |
| Drilldowns | raw proposal JSON · API request/response · before/after snapshot (all collapsible) |
Write flow — the platform finalizes
The µVM does not write the audit itself. It returns its result envelope, its
artifacts, and proposed brain updates; the platform finalizes. It
validates the envelope against the job contract, dedupes the delivery (a re-sent or replayed
webhook can't double-write), verifies the plan checksum, writes the action_log
row, renders the canonical history.html and
timeline.html entries from a trusted template over the validated data, and
commits them to the customer's brain repo with a scoped token. The tool
authors report content and proposes updates; only authority over the canonical record
lives with the platform. So the signed commit attests "a validated action occurred" — not
merely "a µVM holding our token wrote this text." (Mechanics: §11.)
Why brain HTML beats Postgres-alone for audit
| Property | Postgres | Brain HTML |
|---|---|---|
| Customer-readable without infra | — | ✓ open in any browser |
| Portable | DB dump required | ✓ git clone |
| Cryptographically auditable | — | ✓ signed git commits |
| Append-only with revision history | trigger-enforced | ✓ git native |
| Survives platform shutdown | — (backups only) | ✓ (customer holds the repo) |
Roll-over
Once an agent's history.html grows past ~500 entries it rolls into monthly
archives — /sac/history/2026-05.html — and the active history.html
shows the latest month with links back to the archives. The customer experience stays the
same; the underlying files just don't grow unbounded.
9 · The job contract
Maestro fires specialists by sending a structured request into the µVM, and the specialist returns a structured response via webhook. The wire protocol (Sapiom + HMAC-signed POST) is already locked (decision #9). The shape of the JSON inside it — the cargo — is what this section pins down.
Without a fixed schema, every new specialist would force a Maestro code change to parse its outputs. With one, the workforce stays pluggable: any factory-built tool that conforms to the contract slots into Maestro without modification.
Request — Maestro → µVM
Passed into the µVM at boot, via Sapiom job env plus a small JSON init file:
| Field | Type | Notes |
|---|---|---|
job_id | uuid | Unique per fire; matches the row in factory_jobs |
customer_id | uuid | RLS scope; sets which Infisical secrets the bootstrap token can fetch |
agent | string | sac, max, jon… — the specialist persona |
task | string | Natural-language brief Maestro composed ("review yesterday's campaigns and adjust bids if ROAS < 1.5") |
brain_snapshot | object | Relevant subset of the customer's docs — not the whole brain (token cost matters) |
constraints | object | max_runtime_ms, max_llm_tokens, max_spend_usd, allow-listed external endpoints |
bootstrap_token | string | Single-use Infisical token; expires 60s after job start |
webhook_url | url | Where the µVM POSTs its result |
hmac_secret_id | string | Infisical key for the per-job HMAC signing secret |
Response — µVM → Maestro webhook
POSTed when the job finishes (success, partial, or failure):
| Field | Type | Notes |
|---|---|---|
job_id | uuid | Mirrors the request |
agent | string | Same persona name |
status | enum | succeeded / partial / failed |
duration_ms | number | Total wall-clock time |
llm_tokens_used | number | For billing + cost accounting |
cost_usd | number | LLM cost + any externally-incurred spend (ads, etc.) |
actions[] | array | Each is a proposal: type, proposal JSON, idempotency_key. For policy-gated actions the µVM may not self-assign validation or executed — the platform's gate and broker stamp those after execution and write the audit_path (§11) |
brain_updates[] | array | File paths + operation (append, edit, create) — for git audit and customer view |
dashboard_updates[] | array | Widget IDs to refresh on the customer's dashboard |
next[] | array | Optional suggestions for follow-up work — { agent: "max", brief: "SEO followup on campaign x123 keywords" } |
errors[], warnings[] | array | Structured (not free-form strings) so Maestro can categorize |
signature | string | HMAC-SHA256 of the body, signed with the per-job secret |
Why each non-obvious field earns its place
| Field | What it unlocks |
|---|---|
audit_path | The customer dashboard can deep-link from a status card straight to the exact entry in the agent's history.html |
next[] | Self-sequencing workforce: Sac can finish and tell Maestro "now ask Max to look at these keywords" without Maestro hard-coding the Sac → Max relationship |
dashboard_updates[] | Generative dashboard (json-render) stays in sync without Maestro knowing which widget belongs to which agent |
brain_updates[] | Maestro can confirm which files moved before declaring the job done; useful for retry logic if a commit failed |
cost_usd | Reconciliation and accounting only — never the enforcement path. A crashed job reports nothing; an under-reporting tool would evade a cap built on it. Spend is bounded before the fact: a preflight monthly-cap check before dispatch plus provider-side hard limits (§11). Runtime/LLM cost and external ad/API spend are tracked as separate lines |
Enforcement
The Reviewer in the factory checks every tool's emitted output against
this schema as part of the build, same gate as lint/test failures — a tool that doesn't
conform doesn't ship. The schema itself lives in the platform (not duplicated in each tool
repo) so it can evolve: tools declare which schema version they target via
contract_version in their spec.yaml, and Maestro routes
accordingly.
10 · What a tool actually is
A "tool" is the unit of work the factory produces and a specialist consumes. It's not just an API or a widget — it's a self-contained pair.
Anatomy of a tool
| Part | What it is |
|---|---|
| CLI binary | A command-line program that does the work (run an SEO scan, sync a catalog, draft a brief). Standalone, scriptable, testable on its own. |
| Skill | A markdown file that teaches an agent how to use the CLI — what it's for, when to invoke it, expected inputs/outputs, examples. Same shape as a Claude Code skill. |
| (optional) widget spec | If the tool needs a dashboard surface, it ships a json-render widget definition that Maestro can include in dashboard.json. |
| (optional) result schema | A registered, versioned schema (tool.kind@version) for the tool's structured output. Tools do not ship migrations against shared operational tables — query-hot result types become platform-owned projections derived from a generic results store. Adding a tool needs zero migrations. |
One tool = one GitHub repo (tenwhy-tools/<name>). Built by the factory
(Executor + Reviewer in a Sapiom µVM), versioned independently, consumed by exactly one
specialist role.
How an agent uses a tool
When a specialist is hired, the platform loads the tool's Skill into that agent's context. The agent reads the skill, decides when to invoke the CLI (based on its shift schedule, a Maestro task, or an event), and runs it. Output gets committed to the agent's folder in the customer's brain repo.
Bash as a secondary capability
Inside the µVM the specialist also has access to bash for ancillary work:
reading downloaded files, running a jq filter on a payload, exploring
transient state. Bash is never the path to external APIs. Read-only,
bounded-cost calls (LLM, scraping) run through the tool's structured CLI inside the µVM;
money-moving or state-mutating actions (Meta, Stripe, Render deploys, etc.)
are only proposed by the CLI — the platform's broker executes the approved plan
(§11), so the gate, the validator, and the audit layer always apply. Think of it the way
Claude Code itself ships both Edit/Read/Grep
and a Bash tool: structured tools for the hot path, bash for the long
tail.
The factory–workforce wall
The Factory and the Workforce are two separate systems. They share a platform and infrastructure, but they never call each other directly. The factory's only output to the workforce is a published tool repo. The workforce never reaches back into the factory.
Each side is aware of the other's existence (the factory has to produce tools in a shape the workforce can consume; the workforce has to be able to load any catalog tool). But the wall makes scaling, deploying, and reasoning about each side independent.
11 · Durable orchestration & the control plane
The job contract (§9) says what Maestro and a µVM exchange. It does not say how a job
survives a crash, a lost webhook, or a retry without double-acting. "Fire a µVM, await its
HMAC webhook" is enough for read-only work and the MVP — and it fails the first time an
apply moves money and the completion webhook is lost to a deploy or a restart,
leaving an effect that happened but a record that didn't. The three hardest guarantees —
crash/re-run with zero loss and no double-effect, no tool moves
money outside policy, results comparable across the fleet — all rest
on a layer that has to be specified, not assumed.
The control plane owns durability; the µVM stays disposable
Between Maestro's decision and the µVM sits a durable control plane. The µVM is modelled as an external async activity — never a durable worker. Durability lives in the platform that dispatches, waits, dedupes, validates, and finalizes.
| Mechanism | What it guarantees |
|---|---|
| Job state machine | queued → dispatched → running → awaiting_approval → applying → {succeeded · partial · failed · timed_out}. Every transition is a durable row. |
action_items ledger | One row per apply item: job_id, plan_item_id, external_idempotency_key, before/after snapshot, terminal state. The skip-if-already-landed check is a ledger read, not a hope. |
| Outbox / inbox | Dispatch and webhook receipt are deduped on unique(job_id, event_type, external_event_id) — a replayed or duplicated delivery is a no-op. |
| Leases + locks | Per-agent, per-customer no-overlap locks and run coalescing — a daily shift over many customers can't stampede or double-run. |
| Durable approval waits | An out-of-policy plan parks as awaiting_approval for hours or days without holding a process; the Approve card resumes it. |
| Reconciliation | A sweep that closes the "effect happened, webhook lost" gap by reading external truth back against the ledger. |
backend For v0.1 this is a Postgres-backed state machine with a transactional outbox/inbox — no new vendor. A durable engine (Inngest, Restate) is a later swap behind the same interface, justified when approvals sit for days or specialist chains grow. The caveat that keeps us honest: an engine buys timers, retries, and waits — it does not buy exactly-once external effects, trustworthy audit, or spend caps. Those come from idempotency keys, credential scoping, and platform-side ledgers regardless of engine.
The gate: deterministic, platform-side, recomputes its own numbers
Money-moving and state-mutating work follows plan → gate → apply. A µVM
plan emits a changeset; the gate sits between plan and apply and
is deterministic and platform-side. Crucially it recomputes the bound from
the raw params plus a live external read-back — it never trusts a tool-authored
projected_impact, because a tool that under-reports its impact would otherwise
walk through. Within standing policy it auto-approves; outside it, an Approve card. Plans
carry an expiry and are re-validated at apply time, so an approval that sat
for days can't act on stale external state.
The broker: execution authority never enters the µVM
A µVM proposes; the platform broker executes the approved
plan, by idempotency key, item by item — partial success is a first-class state,
not an exception. The gate validates the proposal, never the proposer, so a smarter agent
never weakens the guardrail. Spend is enforced the same way: a preflight
monthly-cap check before dispatch, plus provider-side hard limits on both implementations;
self-reported cost_usd is reconciliation only.
open Who holds the external write credential during apply is the one decision left open. Two shapes: the broker holds the credential and the µVM never touches the API (strict); or the apply-µVM holds a tightly scoped credential and safety rests on the ledger + gate + reconciliation (lighter). Decide per provider by one rule — can the credential be scoped, and the provider hard-cap spend, tightly enough that a misbehaving µVM can't exceed the approved blast radius? Default to the broker; allow scoped-cred only where that's verified. Not due until the first money-moving tool — the MVP has no external writes.
The whole system, assembled
Everything from §1–§10 with the control plane (this section) at its center. The worker (dashed) is the only temporary piece — it spins up per job and disappears; Maestro, the brain, and the stores are the permanent project.
12 · Evaluation & the improvement loop
"Evaluation" in this system isn't one component — it's gates at four points in the lifecycle, each checking a different thing. Together they hold quality up; what they do not yet form is a loop that makes the system better over time. This section names what exists and marks what is deliberately still open.
The gates that exist today
| Gate · stage | What it evaluates |
|---|---|
| Reviewer · build-time | In the factory: runs the tests, audits the SKILL.md, and checks the tool's emitted output against the contract schema — the same gate as lint/test failures (§9). Critique is bucketed [MUST]/[SHOULD]/[NICE]/[ASK], loops with the Executor up to three rounds, and zero [MUST] is the bar to ship. Evaluates the tool. |
agent-cli-kit verify · build-time | Contract conformance as a CI quality gate — shape, not runtime (#32). A tool that doesn't conform doesn't ship. Evaluates the tool's contract. |
| Proposal judge · handoff-time | When a specialist returns work, Maestro runs an independent LLM judge — a different model family from the one that drafted it — over the proposal (approve / revise / reject) for safety and scope before accepting the handoff. Evaluates the work product. (shown in the POC: gpt-5.5 judging Max's drafted SEO proposal) |
| The policy gate · action-time | A deterministic, platform-side recompute of spend caps, allow-lists, and time rules before the broker executes; spend is bounded ahead of the fact (#31, §11). Evaluates whether an action is permitted — not whether it is good. |
| Reconciliation · after the fact | A sweep that reads external truth back against the ledger to close the "effect happened, webhook lost" gap (§11). Evaluates system consistency. |
Notice the absence: each gate checks the tool, the action, or the system — none checks whether the work achieved its goal.
The seam — outcome eval
The one place real outcome measurement already appears is inside a tool: a domain specialist that scores its own output. Max auditing a site with Lighthouse — a concrete SEO/performance number — is an outcome eval. The proposal judge above then evaluates what Max suggests — but only the proposal, not the result: nothing applies the change or re-measures the site afterward. The audit layer (§8) already records every action, so the data to close that gap exists — nothing consumes it yet.
The loop that isn't closed yet
Self-improvement is what closes it:
measure (outcome eval) →
attribute (which tool / prompt / decision — from the audit trail, §8) →
propose (a new tool version, prompt, or guardrail) →
gate (Reviewer + verify + the proposal judge + the policy gate) →
ship → re-measure
The substrate is already here: the audit trail is the feedback store, and the
Reviewer, verify, and the policy gate/broker are the gates a change would pass
through. What's missing is two things — (a) a standing
outcome-eval layer per domain (Max + Lighthouse is the template), and
(b) an auto-proposer that turns eval misses into specs the
factory builds.
The stance holds even when it closes: it stays propose → gate → decide, not autonomous self-modification — the same posture as customer-approved hires and gated actions everywhere else here. Today the system grows (the factory commissions new tools and hires — §13) and refines a tool within a build (the Reviewer's three rounds); it does not yet learn from outcomes across time.
| Open | Shape |
|---|---|
| open Outcome eval + the improvement loop | No standing eval of work quality, and no closed loop — distinct from the §15 open decisions: this is a decided-but-unbuilt capability, not an undecided choice. Substrate exists (audit trail = feedback store; Reviewer / verify / gate = the safety gates). Needs (1) a per-domain outcome-eval layer (Max + Lighthouse is the template) and (2) an auto-proposer that turns eval misses into tool specs for the factory. Stays propose→gate→decide; due when the first metric-driven role ships. |
13 · The hiring roadmap
Once Maestro is live, the factory's job is to build the next specialist's tool and ship it into the catalog. When the customer (or Maestro) decides they need that role, Maestro "hires" them — the specialist's folder appears in the brain repo and they start doing their job.
The 12 candidates from the original brief, ordered roughly by likely-first-to-hire. Names marked ? are still unnamed.
| Agent | Job | Tool | Shift |
|---|---|---|---|
| Max | SEO | seo-tool | daily |
| Vic | Media creation | media-tool | daily |
| Sac | SEM | sem-tool | daily |
| Jon | Catalog | catalog-tool | daily |
| Tom | Market research | research-tool | daily |
| Roy | Market watch | market-watch-tool | night |
| Moz | Design | design-tool | daily |
| Sid | Quality assurance | qa-tool | night |
| Sal | Customer support | support-tool | 24/7 |
| Ray | Legal | legal-tool | 1 day/week |
| Lou | Accounting | accounting-tool | daily |
| Nic | Website | web-builder-tool | daily |
All 12 are unhired in v0.1 — only Maestro ships. The factory will build each tool when Maestro suggests the hire and the customer approves (decision #21). Top 4 rows represent the earliest-likely hires.
Also future: Consigliere (strategic advisor sitting alongside Maestro, advises only — decision #19).
Renames from the original brief
| Was | Now | Reason |
|---|---|---|
| John | Jon | 4-letter outlier in the original roster; shortened for consistency with the 3-letter pattern. |
| Tom (Media) | Vic | Tom moved to Market Research; Vic takes Media Creation. |
| Lawyer "Regis" | Ray | 3-letter agent name; "Regis" is no longer used (was the placeholder). |
14 · Decisions locked
Each one is now a constraint on everything downstream.
| # | Decision |
|---|---|
| 1 | locked v2 layers on top of v1 — v1's form-to-app demo stays as the marketing surface. |
| 2 | locked Maestro is the first agent we build, not a 13th invented one. |
| 3 | locked The 12 listed specialists are a hiring roadmap, not a v1 deliverable. |
| 4 | locked Maestro v0.1 = customer interviewer + producer of a living brain. |
| 5 | locked Maestro accepts as little as an idea / description / URL. |
| 6 | locked 8-document brain pack: business · customer · product · audience · voice · assets · goals · status. |
| 7 | locked Idea vs. established: ask the customer + verify via URL. |
| 8 | locked Established business access in v0.1 = answers + public URL scrape. No integrations. |
| 9 | locked Conversation style = guided agenda + open-ended follow-ups. |
| 10 | locked File visibility = live split-screen (chat left, brain right). |
| 11 | locked Brain documents are rendered/stored as HTML, styled like this page. |
| 12 | locked Brain storage = per-customer GitHub repo. Operational state = shared Postgres + RLS. |
| 13 | locked GitHub home = dedicated platform org (e.g. tenwhy-brains). |
| 14 | locked Brain repos are private by default. |
| 15 | locked Repo layout = folder per agent (/maestro/, later /max/…). |
| 16 | locked Maestro runtime = stateless HTTP API (load from DB+repo, call LLM, write back). Fallbacks noted: long-lived worker, µVM-per-session, direct-from-frontend if this doesn't hold up. |
| 17 | locked Dashboard = single multi-tenant app, with a generative UI driven by Maestro's dashboard.json spec, rendered via json-render.dev. |
| 18 | locked Customer auth = email + magic link. No passwords. |
| 19 | locked Consigliere advises only — Maestro has final say in the workforce. (Consigliere may not even ship in v1.) |
| 20 | locked Specialist-vs-Maestro disagreements — Maestro decides. Specialists can flag concerns; Maestro hears them; Maestro calls it. |
| 21 | locked Hiring flow — Maestro suggests, customer approves. Surfaces as an Approve card in the dashboard. |
| 22 | locked Specialist activation = all three: cron (for shifts), on-demand (from Maestro), and events (reactions to brain changes / dashboard actions). |
| 23 | locked One GitHub repo per tool (tenwhy-tools/<name>). Each tool = CLI + Skill (markdown teaching an agent to use the CLI). Same shape as Claude Code skills. |
| 24 | locked Factory runtime = Sapiom µVM per build job. Factory and Workforce share a platform but have no direct interaction — only handoff is a published tool repo. |
| 25 | locked Billing = hybrid, via Stripe Billing (distinct from Stripe Projects, which is procurement). Flat base subscription (Maestro + included specialists) + metered add-ons priced as an allowance + overage credits, fed by the jobs ledger's cost_usd. External spend (ads, paid media) runs on the customer's own connected accounts — they pay Meta/Google directly; tenwhy operates and bills only its fee, carrying no float or money-transmitter liability. |
| 26 | locked Specialist roster locked — all 3-letter names: Max, Vic, Sac, Jon, Tom, Roy, Moz, Sid, Sal, Ray, Lou, Nic. (Orchestrator names — Maestro, Consigliere — keep their full form.) |
| 27 | locked Renames from original brief: John → Jon, Tom (Media) → Vic (Tom moves to Research), Lawyer "Regis" → Ray. |
| 28 | locked Platform-finalized audit. The µVM proposes; the platform validates, renders the canonical history.html/timeline.html from a trusted template over validated data, and commits to the brain with a scoped token. (review · supersedes the §8 in-µVM write) |
| 29 | locked Durable orchestration control plane. Job state machine + action_items idempotency ledger + outbox/inbox dedupe + leases + durable approval waits + reconciliation. Postgres-backed for v0.1; a durable engine is a later swap behind the same interface. (review) |
| 30 | locked Execution authority is the platform's. Mutating/money-moving actions go through plan → deterministic platform-side gate (which recomputes impact from raw params + read-back, with plan expiry) → broker, which executes the approved plan by idempotency key. The µVM never self-certifies executed. (review) |
| 31 | locked Spend enforced ahead of the fact. Preflight monthly-cap check before dispatch + provider-side hard limits on both impls; self-reported cost_usd is reconciliation only. (review) |
| 32 | locked Conformance ≠ security. agent-cli-kit verify is a quality gate (shape, not runtime); the real boundary is runtime — per-job scoped + separate read/write credentials, network-enforced egress allow-listing, brain-path allowlist, signed tool releases. (review) |
15 · Still on the grill
how this was reviewed This architecture was pressure-tested by two independent adversarial reviews (Codex + AMP). Verdict: sound-with-changes — keep the shape, close one gap. That gap (durable orchestration / execution authority) became §11 and the diagram above; the changes are captured as decisions #28–#32; and it left the two decisions below genuinely open.
| Open decision | Shape |
|---|---|
open Write-credential model for apply | Platform broker holds the credential and executes (strict) vs. a tightly-scoped credential in the apply-µVM (lighter). Decide per provider; default to the broker. Narrowed by #25: for ad/commerce providers the credential is the customer's own OAuth token — already scoped to their account and provider-capped — which makes the lighter scoped-cred model viable there. Due before the first money-moving tool. (§11) |
| direction Warm path for 24/7 work | Direction set: latency-sensitive, high-frequency roles (e.g. Sal, support) get a warm path — a small pre-warmed µVM pool, or a long-lived per-customer worker for that one role — so there's no cold boot per event. Kept separate from the default cold-per-job model so it doesn't infect the uniform path. Implementation deferred until a 24/7 role is on the near roadmap; the MVP is Maestro + Jon. |
status 32 decisions locked. The two trailing decisions now each have a direction set (credential model narrowed by #25; warm path scoped), with implementation deferred — scheduled, not forgotten.
What naturally comes next
Not "open questions" — just the obvious work that follows from what we decided:
| Next | What it means |
|---|---|
| Skeleton repos | Create the tenwhy-brains and tenwhy-tools GitHub orgs; reserve repo naming conventions. |
| Maestro v0.1 spec | Write the interview script, prompt, and the 8 HTML brain-doc templates. Decide which model powers Maestro. |
| Dashboard scaffold | Stand up the multi-tenant Next.js app with split-screen chat + json-render canvas. Wire magic-link auth. |
| Factory v0 | Bootstrap the Executor + Reviewer pipeline (Sapiom µVM). Doesn't need to build anything in v0.1 since Maestro is hand-coded — but the pipeline exists, ready for Maestro to commission Max as the first hire in v0.2. |