---
title: "Architecture and Shadow mode"
description: "Monorepo packages, Git-backed Cloudflare Artifacts ledger, Gatekeeper rules, and Shadow mode egress isolation."
---

> Documentation Index
> Fetch the complete documentation index at: https://adaptive-factory.system3inference.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture and Shadow mode

Adaptive Factory separates its core ledger and SDLC engine from swappable Scout, Floor, and runtime adapters.

## Workspace packages

| Package | Responsibility |
| --- | --- |
| `packages/core` | Domain schemas, YAML/Markdown ledger parser and serializer, linter (`L001`..`L011`), semantic diff engine, Gatekeeper write guards, Board and House summarizers, Promotion gate evaluator, and the Northstar Goods seed. Never imports concrete adapters or Cloudflare bindings. |
| `packages/floors` | Swappable `FloorAdapter` implementations (`skyworker`, `amp-orb`, `orca`, `stored`), registry, and conformance suite. |
| `packages/worker` | Cloudflare Worker serving the tenant HTTP API (`/api/*`), MCP JSON-RPC server (`/mcp`), static Swiss Blueprint SPA (`ASSETS`), and Git ledger persistence over the Cloudflare `ARTIFACTS` binding. |
| `packages/cli` | Headless `af` CLI supporting both local Git ledger mode and remote Worker API mode. |
| `packages/web` | Swiss Blueprint React SPA built with Vite using design tokens from `design-kit/`. |

## Git-backed ledger and Gatekeeper

Each tenant ledger is a real Git repository stored in Cloudflare Artifacts (or a local Git directory when running offline). Every mutation writes a structured commit with author attribution.

The **Gatekeeper** checks actor roles and record state before any write commits:

- Returns HTTP `403` when an agent attempts a human-only action (confirming a Decision, editing a frozen Charter, approving a critical Verdict).
- Returns HTTP `409` on invalid state transitions or edits to frozen records.

## Shadow mode isolation

Challenger builds must pass a boot-time isolation check before Replay starts:

- Platform egress is disabled (`globalOutbound: null`).
- Outbound mail, payment, HTTP, and queue drivers are replaced by intent recorders so the Challenger performs zero real external side effects.

Source: https://adaptive-factory.system3inference.dev/docs/setup/architecture/index.mdx
