The Layered Model
Darwinian Minds composes effective harness state from a fixed stack of layers, then materializes it into downstream agent tools. The layers compose deterministically; later layers override earlier ones for keys they touch.
Composition layers
- Built-in harness source. The packaged
registry/config.json(target enablement, optional MCP toggles, parallel/catalog defaults) andregistry/mcp-servers.json(canonical MCP definitions). This is the deterministic baseline every machine inherits. - Machine overlay at
~/.agents/drwn/machine.json(MachineConfig). Shallow-merges over the baseline fortargets,optional,defaults,catalogs,parallel. Also storesauthoring.scopefordrwn card new. - Card manifests resolved from
projectConfig.cards. Each locked card contributesskills.include,servers,extensions,targets, and its bundled skill content. Manifests merge into the project config viamergeCardManifestsIntoProjectConfig. - Project overlay at
<project>/.agents/drwn/config.json(ProjectConfig). Applied on top of (1) + (3) viamergeProjectConfig. On key collisions with card-contributed values, project wins forservers,extensions, andtargets;skills.includeis a union;skills.excludeis honored last (excludes always win). - Curated layer at
~/.agents/skills. Per-skill symlinks pointing into repo-native, package-backed, or card-bundled sources. Curation membership is set bydrwn skills curate/drwn library defaults add skill.
Effective state is computed by buildEffectiveState. Inside a configured project, the machine overlay is intentionally suppressed: the base is the packaged config, then card manifests, then project overlay. Outside a configured project, the machine overlay applies normally.
Write-time resolution rules
When drwn write resolves a skill name to a filesystem path, it consults three layers in fixed order:
- Locked card — any entry in
card.lockwhose manifest declares the skill name. Resolves to the immutable card store path. - User default — repo-native scope dirs (
skills/{shared,claude-only,codex-only,experimental}) then installed bundles. - Missing — surfaces as a typed write-time hard fail; no downstream mutation.
Cards win over user-defaults at write time, always. A card that declares a skill in its manifest shadows any same-named user-default skill. The alternative source is announced as also available: in dry-run output but never written. This is the opposite directionality from config merge — at config merge time the project overlay overrides card values; at write-time skill resolution the card wins. They operate on different things (config keys vs filesystem paths).
Layered reproducibility (the bigger picture)
drwn cards pin harness state — the skills, MCP servers, extensions, and downstream targets a project should run on. They do not pin the surrounding environment. For full environmental reproducibility, layer drwn with tools that own the other layers:
Layer 8: drwn cards — harness state (this tool)
Layer 6: Docker / Compose — service stack (Postgres, Redis, etc.)
Layer 4: Flox or Nix — Node, Python, system libs, shell hooks
Layer 3: asdf / mise / Flox — runtime / toolchain versions
Layer 2: pnpm / Cargo / pip — app dependencies + lockfile
What cards pin:
- card versions and content-tree integrity in
card.lock - per-card bundled skill attribution in
card.lock - inline content shipped in cards (skills, MCP server definitions) via sha256 content hashing
- the project overlay
What cards do not pin:
- agent tool versions (Claude Code, Codex, Cursor) — vendor-controlled distribution
- MCP server runtime resolution if a card's
argsusesnpx -y <pkg>without a version pin (the shipped registry pins these; card authors should too) - CLI dependencies of skills (
bd,markitdown,git, etc.) - runtime, system libraries, or shell environment
Recommended composition for full reproducibility: drwn card apply for the harness, Flox/Nix (or asdf/mise) at the shell layer to pin Node/Python/system libs, and Docker Compose at the service layer for runtime dependencies. Each tool pins what it owns.
See also
- Local Store — what each path under
~/.agents/drwn/stores - Materialization — how effective state is written to downstream tools
- Ownership and Write Records — drwn-owned vs user-owned cleanup discipline
- Cards — the card subsystem in depth
.ai/knowledges/10_drwn-cli-architecture.md— full as-built architectural reference