brain
Runs a 9-step reasoning scaffold over the cycle's analytics → a Decision Memo with falsifiable hypotheses and budget allocation. Also runs the post-cycle Reflect grading.
The EngineerDad Marketing OS is a closed-loop marketing driver: each cycle it reads live ad-performance signals, reasons about what worked, writes its own briefs, scripts and renders bilingual creatives, designs the next experiment, and ships — with a human approving at every gate and a regulatory compliance scanner on every write. Built on Claude Code subagents, 15 custom MCP servers, and Postgres.
One run walks the stages in fixed order, driven by a typed, resumable orchestrator
(plan → verify → advance). Cyan stages spawn an agent with genuine decision space;
everything else is deterministic code. At each amber gate the loop stops until a human
approves in the review webapp.
Dependency flows strictly downward. The conductor talks to exactly two surfaces — the orchestrator MCP and Claude Code's task spawner — and no MCP server ever opens a client to another MCP server.
The runtime entry points. /loop is the domain-agnostic conductor; scoped delegators
(/brief, /content, /produce, /distribute…) resume a run at a stage.
The conductor reasons; it never executes domain logic itself.
Four subagents, each spawned by one stage — brain, brief-writer, content-writer, creative-director. Each has genuine open decision space. Nothing else in the system is an agent.
Pure typed logic in packages/; thin stdio MCP adapters over it. The orchestrator
state machine, the compliance scanner, analytics + bandit math, BM25 corpus search, renderers and
platform adapters — all testable without a model in the loop.
Runs a 9-step reasoning scaffold over the cycle's analytics → a Decision Memo with falsifiable hypotheses and budget allocation. Also runs the post-cycle Reflect grading.
Turns the Memo's angles into 12 message-based briefs — persona, promise, proof type, funnel stage, budget bucket. Angles, not audiences: creative-as-targeting doctrine.
Approved briefs → hook banks (≥30 hooks, 6 emotional registers), scripts with data-bound claims, and AEO/GEO authority articles. Grounded on the BM25 corpus; 80% proof rule enforced.
The taste layer — decomposes each script into storyboards, hook rotation, thumbnail briefs and chart selection. Returns a plan; never writes, never renders. Mechanical spec derivation is code.
Each server is a thin adapter over a sibling package library. Cross-server sequencing goes through the orchestrator hub; inside the workspace, library imports beat stdio calls (ADR-023).
Grounding without a vector DB: all generation is grounded on a local, committed BM25 index over the compliance / courses / proof / knowledge corpus. Quantitative claims are bound to vetted datasets at authoring time (ADR-030) and enforced by verifiers — a chart ships only if a source-of-record dataset depicts it.
public9 entity tables — briefs → learnings; the content lifecycleorchestratorruns, steps, claim-check step results (JSONB + size audit)analyticsevents audit trail, Meta insights, bandit signalscompliance/SC Malaysia · FIMM · Public Mutual rules + banned phrasescourses/ proof/brand doctrine, frameworks, persona-keyed proofdata/datasets (source-of-record) → charts (derived, cited).index/BM25 index — travels with the cloneThe compliance scanner fires at the store-package write boundary — one auditable choke point that both MCP writes and webapp server-action writes must pass through. Layer-aware, not transport-aware.
Every external write passes a human gate in the review webapp. Ad activation is human-only — the OS never sets a Meta ad to ACTIVE.
meta-ads creates PAUSED, youtube uploads unlisted, meta-organic schedules only. Safety is hard-wired into the adapter, not the prompt.
SC-Malaysia / FIMM rules from the corpus run against the four content entities at the single write boundary. Non-compliant content cannot persist.
Numbers in creatives must trace to vetted datasets; concept visuals may carry no digits. Verifiers enforce both — refusal is mechanical, not behavioural.
The load-bearing ones, if you read only a few:
ADR-005MCP thin-adapter doctrine — and no MCP-to-MCP mesh, everADR-010Bilingual EN / Bahasa Malaysia on every artifactADR-015Write-API safety — PAUSED / unlisted hard-wiredADR-020The agentic litmus test + orchestrator state machineADR-022Claim-check messaging — workers pass references, not payloadsADR-023Orchestrator-resident execution — the conductor reasons, code transmitsADR-028HeyGen-native multi-scene reel assembly — no local stitchingADR-030Data-first claim binding — quantitative claims bind to vetted data