Skip to content

Architecture ​

Design Principles ​

  1. Markdown-first — all configuration is human-readable markdown or YAML
  2. Vendor-neutral — no tool is the source of truth; the root files are
  3. Zero dependencies — no runtime, no package manager, no build step
  4. Non-destructive — installers never overwrite, adapters never conflict
  5. Progressive complexity — start with AGENTS.md, add orchestrator later
  6. Safety-first — all write operations require explicit developer approval

Layer Architecture ​

┌──────────────────────────────────────┐
│          Human Layer                 │
│   README.md  CONTRIBUTING.md  docs/  │
├──────────────────────────────────────┤
│    Layer 1: Source of Truth          │
│  AGENTS.md  MEMORY.md  TASKS.md     │
│  RUNBOOK.md                         │
├──────────────────────────────────────┤
│    Layer 2: AI Operating Layer       │
│  .ai/config.yaml                    │
│  .ai/agents/  .ai/context/          │
│  .ai/prompts/ .ai/skills/           │
│  .ai/checks/  .ai/templates/        │
│  .ai/models/  .ai/schema/           │
├──────────────────────────────────────┤
│    Layer 3: Adapter Layer            │
│  adapters/codex/                    │
│  adapters/antigravity/              │
│  adapters/cursor/                   │
│  adapters/claude/                   │
│  adapters/gemini/                   │
│  adapters/vscode/                   │
├──────────────────────────────────────┤
│    Layer 4: Intelligence Layer       │
│  .ai/intelligence/  (memory, handoff)│
│  .ai/registries/    (workflows,     │
│    capabilities, tools, sources,    │
│    trusted-keys)                     │
│  .ai/registry-cache/ (cached remote) │
│  .ai/proposals/     (improvements)  │
│  .ai/policies/      (safety, registry│
│    governance gates)                 │
├──────────────────────────────────────┤
│    Layer 5: CLI Dashboard & Plugins  │
│  dashboard / ui (TUI Command Center) │
│  plugin list/show/validate/install   │
│  catalog list/show/recommend/install │
│  registry list/add/sync/status/verify│
│    /keygen/lock/trust                │
│  onboard / adapter sync              │
└──────────────────────────────────────┘

Data Flow ​

  1. User edits root markdown files (AGENTS.md, etc.)
  2. Adapters read from root files and translate to tool-native format
  3. AI agents read their adapter file + root files
  4. Agents write results back to TASKS.md, MEMORY.md, and session logs
  5. Orchestrator coordinates multi-agent workflows via session logs
  6. Memory engine indexes codebase state into hash-compressed summaries
  7. Feedback loop captures developer corrections and compiles learning rules
  8. Proposal engine drafts improvements, validates safety gates, and applies approved changes
  9. Handoff compiler generates token-compressed session context for agent transfers

v4.2 Gateway Foundation Layer ​

v4.2.0 adds a gateway foundation under src/gateway/:

  • protocol and provider adapter contracts
  • runtime-readable provider/model registries
  • deterministic dry-run route planning
  • resilience planning and simulation
  • localhost mock gateway runtime
  • preview-only client configuration plans
  • bounded local in-memory observability

The executable runtime remains mock-only. External providers are metadata-only, provider credentials are not loaded, live retry/fallback is not active, and Skill OS permissions are not enforced at runtime.

Skill OS remains the control plane. The gateway foundation is a mock-only runtime and routing foundation, with real provider execution deferred until explicit future security and release work.

Governed Execution Supervisor & MCP Control Plane (R5A / R5B) ​

MultiModel Dev OS provides a deterministic execution supervisor and control plane for AI coding agents:

  • Deterministic Governance Policy: The SupervisorPolicyEngine (src/supervisor/policy-engine.js) evaluates execution requests without model interpretation, producing 4 discrete decision outcomes: ALLOW, REQUIRE_APPROVAL, DENY, and UNKNOWN (fails closed).
  • Security Boundaries: Strictly prohibits destructive operations (push, publish, deploy, delete_repository), guards protected paths (.env, .git/, .ai/registry-signing-key), enforces file modification budgets, and prevents directory traversal. Zero model-generated claims can bypass deterministic policy.
  • Isolated Worktree Preparation: WorktreeManager (src/supervisor/worktree-manager.js) and SupervisorManager (src/supervisor/supervisor-manager.js) plan and prepare disposable Git worktrees using git worktree add --detach <dest> <sha>.
  • Primary Workspace Preservation: Existing uncommitted, staged, and untracked user files in the primary workspace remain untouched. Worktrees are created at sibling or temporary paths, never inside .git/worktrees. In addition, task completion in continuity is decoupled from worktree step outcomes.
  • Run Manifests & Diagnostics: Prepared runs are recorded with immutable manifests in .local-ai/state/supervisor/runs/<runId>/manifest.json and logged to append-only .local-ai/state/supervisor/runs.jsonl. If preparation fails, full diagnostics are preserved without corrupting the primary workspace.
  • Step Execution Engine (R5B): StepExecutor (src/supervisor/step-executor.js) executes bounded, auditable steps (READ_FILES, INSPECT_GIT, VALIDATE_PATCH, APPLY_PATCH, METADATA_CHECK, INSPECT_STEP) strictly inside the isolated worktree. Model strings are never executed in a shell. Running repository build/test scripts without container sandbox fails closed (DENIED_SANDBOX_REQUIRED).
  • Cryptographic Approval Authority (R5B): ApprovalManager (src/supervisor/approval-manager.js) requires explicit operator approval for mutating steps. Approval tokens bind to run_id, step_id, worktree fingerprint, expiry, and the canonical SHA-256 digest of input parameters (computeInputDigest). Approvals are single-use; parameter modifications invalidate them.
  • Durable Step Ledger & Crash Resumption (R5B): Step transitions are logged to append-only steps.jsonl and individual step manifests with SHA-256 receipts. Resuming an interrupted run gracefully reconciles RUNNING steps to INTERRUPTED.
  • Modern MCP Conformance (R4E): Supports the modern MCP 2026-07-28 stateless protocol lifecycle with resultType: 'complete', server identity in _meta["io.modelcontextprotocol/serverInfo"], -32022 unsupported version errors, and genuine legacy initialize backward compatibility.
  • Container Sandbox & Trust Boundary Closure (R5C Freeze):
    • DockerSandboxBackend and PodmanSandboxBackend (src/supervisor/sandbox-backend.js) implementing bounded, zero-shell container execution.
    • Mandatory supervisor-issued run manifests on disk; strict rejection of substitute manifests ([UNTRUSTED_WORKTREE]).
    • Worktree registration verification (.git pointer to /.git/worktrees/, common directory match against supervisor workspace root, commit match, non-primary branch enforcement).
    • Primary workspace auto-discovery and protection ([PRIMARY_WORKSPACE_PROTECTION]).
    • Immutable execution plan deep freezing and HMAC-SHA256 signature verification ([UNTRUSTED_EXECUTION_PLAN]).
    • Pinned image requirement with strict cryptographic SHA-256 digest (IMAGE_DIGEST_REGEX); --pull=never enforcement.
    • Daemon locality enforcement (_checkDaemonLocality): rejection of remote DOCKER_HOST, CONTAINER_HOST, DOCKER_CONTEXT, and remote SSH keys ([REMOTE_DAEMON_DENIED]).
    • Bounded output streaming with byte-counted limits, preventing buffer overflow attacks.
    • Container cleanup ownership checks (^mmdo-[a-zA-Z0-9_-]+-[a-zA-Z0-9_-]+-[a-f0-9]+$).
    • Per-run persisted authority keys (.authority.key) and cross-process consumption records (.consumed-authorities.json).
    • Clear truth separation in execution receipts: isolation_verified: false and isolation_status: 'SIMULATED_NOT_VERIFIED' / 'EXECUTION_SUCCEEDED_UNVERIFIED_ISOLATION', with exit code 0 never derived as proof of kernel isolation.

File Ownership ​

FileOwnerWho ReadsWho Writes
AGENTS.mdHumanAll agentsHuman
MEMORY.mdSharedAll agentsHuman + agents
TASKS.mdSharedAll agentsHuman + agents
RUNBOOK.mdHumanAll agentsHuman
.ai/config.yamlHumanSystemHuman
.ai/session-logs/*.mdAgentsNext agentCurrent agent
.ai/intelligence/memory.*SystemAll agentsCLI (memory build)
.ai/intelligence/handoff.mdSystemNext agentCLI (handoff build)
.ai/intelligence/feedback-log.jsonlSystemCLICLI (feedback add)
.ai/proposals/*.mdSystemHuman + CLICLI (improve propose)
.ai/registries/*.yamlSystemCLICLI (init / registry add)
.ai/policies/*.yamlHumanCLIHuman
.ai/registry-cache/SystemCLICLI (registry sync)
adapters/*/CommunitySpecific toolMaintainers

Security Considerations ​

  • Never store secrets in any multimodel-dev-os file
  • Handoff logs may contain sensitive context — gitignored by default
  • Adapter config files should not contain API keys or tokens
  • Use .env files (gitignored) for secrets, referenced in RUNBOOK.md
  • Memory indexes, feedback logs, and proposals are gitignored by default
  • The proposal apply command enforces 12 safety gates including path boundary checks

Released under the MIT License.