clark/
├── README.md
├── docs/ # Audit documentation
├── scripts/
│ └── doctor.js # Preflight validation
└── example/
└── convex/ # Reference implementation
├── .env.example # Environment template
├── package.json
├── convex/ # Convex backend
│ ├── schema.ts # Database schema
│ ├── http.ts # HTTP endpoints
│ ├── state.ts # State queries/mutations
│ ├── memories.ts # Memory operations
│ ├── knowledge.ts # Knowledge operations
│ └── logs.ts # Logging
├── src/
│ ├── cli.tsx # CLI entry point
│ ├── core/ # Agent runtime, tick system
│ ├── memory/ # Memory store, deduplication
│ ├── knowledge/ # Knowledge base
│ ├── plugins/ # Plugin system
│ ├── llm/ # LLM & embedding clients
│ ├── services/ # Background services
│ ├── templates/ # Prompt templates
│ └── ui/ # Terminal UI (Ink + React)
└── tests/ # Jest tests (179 total)