clawdinators/docs/ARCHITECTURE.md
Josh Palmer 78f57df5a8 🤖 chore: move to moltbot upstream + sync tooling
What:
- swap nix-moltbot inputs, packages, and workflow automation
- update secrets wiring, repo seeds, and org references for moltbot
- fix self-update path and moltbot config/log defaults

Why:
- align infra with moltbot rename and new packaging
- restore update pipeline + consistent bootstrap artifacts

Tests:
- ./scripts/build-image.sh (fails: /build chmod permission on darwin)
2026-01-28 18:36:10 +01:00

1.5 KiB

Architecture (Draft)

Goal: declaratively spawn CLAWDINATOR instances on AWS using OpenTofu + NixOS.

Operating mode:

  • declarative-first, no manual setup
  • machines are created by automation (another CLAWDINATOR)

Core pieces:

  • AWS AMIs are built from a prebuilt NixOS image (nixos-generators + import-image).
  • AWS EC2 instances are launched from those AMIs via OpenTofu.
  • NixOS modules configure moltbot + CLAWDINATOR runtime on each host.
  • Shared memory is mounted at a consistent path on all hosts.

Runtime layout (planned):

  • /var/lib/clawd/memory (shared hive-mind memory)
  • /var/lib/clawd/workspace (agent workspace)
  • /var/lib/clawd/logs (gateway logs)
  • /var/lib/clawd/repos/moltinators (this repo for self-update)

Storage:

  • POC uses one host volume per instance (e.g., EBS), mounted at /var/lib/clawd.
  • In multi-host mode, add a shared filesystem or object-sync layer and keep canonical memory files authoritative.

Instance naming:

  • CLAWDINATOR-{1..n}
  • Daily notes can be per-instance (YYYY-MM-DD_INSTANCE.md)
  • Canonical files are shared (goals, architecture, ops, etc.)

Upstream freshness:

  • Nix flake input tracks github:moltbot/nix-moltbot (latest upstream).
  • Update with nix flake update and rebuild hosts.
  • Optional self-update timer is available in the Nix module.
  • Self-update expects this repo to be present on the host (default: /var/lib/clawd/repos/moltinators).
  • Updates will refresh flake.lock; review before applying in prod.
  • GitHub App tokens are refreshed via a systemd timer when enabled.