Multi-Agent Orchestration: Writing an OS Prototype in Eight Days

    How multi-agent orchestration turns AI coding from impressive demos into real working software — covering architecture, verification loops, and a practical checklist for engineering teams.

    From “Looks Right” to “Actually Works”

    Over the past two years, teams using AI coding tools for prototyping have repeatedly hit the same gap: the UI renders nicely, but clicking buttons does nothing, and critical code paths are missing. The problem isn’t generation capability — it’s the absence of verification. Generated code never gets executed in a real environment.

    Recent public cases point to a shift in where the capability lives: AI coding tools are no longer limited to completing code snippets; they can now take on long-running tasks involving “days of continuous work, thousands of sub-agents, writing and testing simultaneously.” A video creator had a model generate custom photo-editing and video-editing tools that matched their years of habits around control layouts, shortcuts, and layer logic — import, zoom, layers, text, and timeline workflows all worked, with the model integrated for “editing while watching the result.” An engineering team started from an empty directory and produced a working OS prototype with a kernel, disk and keyboard drivers, file storage, a window system, a login screen, an installer, and the ability to connect to models over the network. On the math side, over a thousand agents and roughly thirty hours were used to translate an existing human-written proof into a machine-verifiable formal proof, step by step.

    The common thread across these cases isn’t “the model got smarter” — it’s that the task was organized in an engineering discipline.

    The Three Ceiling Limits of a Single Agent

    Context capacity and attention dilution. A repository at the scale of an operating system far exceeds any context window, and mid-section information utilization drops noticeably in long contexts.

    Error accumulation from task coupling. In a single-threaded approach, an early mistake in an interface signature propagates along the call chain and only surfaces at compile time — rework costs are enormous.

    No independent review perspective. When the generator is also the reviewer, it systematically “fails to see” its own oversights.

    Multi-agent orchestration targets exactly these three points: divide-and-conquer addresses capacity, interfaces-first addresses coupling, and independent review addresses blind spots.

    The Orchestration Skeleton: Orchestrator – Workers – Verifiers

    A structure that works in practice typically has four layers:

    • Orchestrator: handles only planning, dispatch, merging, and conflict resolution — it writes no business code;
    • Workers (sub-agents): single responsibility, independent context, independent sandboxed workspace;
    • Verifier: compilation, unit tests, integration tests, static checks, performance and memory checks — outputs structured conclusions;
    • Memory and artifact layer: interface contracts, decision records, a failure case library, and reusable artifacts.

    Task decomposition should be expressed as a directed acyclic graph (DAG), for example:

    1. task: os-prototype
    2. contracts: # interfaces first, contracts frozen
    3. - hal: {disk.read, disk.write, kbd.poll}
    4. - vfs: {mount, open, read, write, close}
    5. - sched: {spawn, yield, wait}
    6. nodes:
    7. - id: boot
    8. deps: [contracts]
    9. verify: [build, qemu-boot-smoke]
    10. - id: drivers
    11. deps: [contracts]
    12. verify: [unit, hal-fuzz]
    13. - id: vfs
    14. deps: [drivers]
    15. verify: [unit, fs-stress]
    16. - id: wm
    17. deps: [vfs, drivers]
    18. verify: [ui-snapshot, input-e2e]
    19. - id: review
    20. deps: [boot, drivers, vfs, wm]
    21. verify: [static-analysis, independent-review]

    The orchestrator loop’s pseudocode can be extremely simple — the key is that every node must carry an executable verification condition:

    1. while pending(dag):
    2. batch = select_ready(dag, max_parallel=64)
    3. results = run_workers(batch, sandbox=per_task_isolation)
    4. for r in results:
    5. if r.verifier.passed:
    6. merge(r.branch, run_integration=True)
    7. else:
    8. requeue_with_feedback(r, r.verifier.log) # feed failure logs back

    Three practical rules: parallelism is constrained by merge conflicts and shared resources, so assign ownership by directory/module; failures must feed back with evidence (compile errors, test assertions, crash stacks), not just tell the sub-agent to “try again”; merging must pass integration verification — passing unit tests does not mean the system works.

    Compiling Personal Workflows into Software

    The essence of the photo/video tool case is requirements as specification: the user’s muscle memory (frequent functions, control placement, shortcuts) is made explicit as executable acceptance criteria. The approach has three steps:

    1. Turn features into a checklist: distill high-frequency operations into no more than twenty core use cases, each with inputs, expected outputs, and acceptance criteria;
    2. Turn interaction into a contract: define shortcuts and menu structure before generating the implementation, avoiding “functionally correct but wrong in feel”;
    3. Close the loop with real usage: put the generated tool into a real production workflow (e.g., channel covers, internal demo videos) and iterate with real material.

    The reusable takeaway: having domain experts participate in writing the spec yields far more benefit than endlessly tuning prompts.

    Formal Verification: Making “Correct” Machine-Checkable

    Translating a human proof into a machine-checkable formal proof matters because it drops verification cost from “peer review” to “machine checking.” The loop is generic:

    1. generate(target theorem) -> proof checker
    2. | failure (unclosed goal / type mismatch / timeout)
    3. -> locate first failing goal -> local rewrite -> re-check
    4. | success
    5. -> archive proof script, no sorry/admit placeholders

    In engineering practice, placeholders and “trusted bypasses” must be banned, otherwise formal verification becomes just a formality. The same pattern applies to ordinary business code: upgrade “tests pass” to “properties are decidable,” replacing a handful of example assertions with property-based testing and fuzzing.

    Rollout Checklist and Risk Controls

    • Observability: record each sub-agent’s task, token consumption, tool calls, and verification results; centralize logs; pair monitoring and alerting with failure-rate and cost thresholds;
    • Isolation and permissions: sub-agents run in independent sandboxes with least privilege, source code mounted read-only, writes restricted to working branches, and no access to production credentials;
    • Cost governance: tiered model routing (strong models for planning, lightweight models for batch rewriting), result caching, and idempotent re-runs;
    • Evaluation set: maintain a set of tasks with acceptance scripts; run regression on any orchestration strategy change to avoid “impressive demos, unstable daily use”;
    • Cloud support: mainstream cloud service categories suffice — container platforms for sandboxes and parallel tasks, object storage for artifacts and datasets, message queues for task dispatch and backpressure, and logging plus monitoring/alerting services for full-chain tracing.

    Risk boundaries should be written down explicitly: license and provenance compliance for generated code, reproducible dependency versions (version pinning, hash verification), security audits that cannot be skipped (input validation, output encoding, parameterized queries, least privilege), and clear human-AI responsibility boundaries — output from long-running autonomous tasks must go through human review and signed releases.

    Conclusion

    “Writing a working OS prototype in eight days” isn’t a showcase of a single model capability — it’s the result of four engineering factors working together: orchestration, contracts, verification, and isolation. For enterprise teams, the transferable moves are clear: first formalize high-frequency workflows into specs, then introduce the orchestrator–worker–verifier structure, and finally stabilize it with executable acceptance criteria and observability. Whoever builds the verification loop first captures this wave of capability gains first.