LightClaw Architecture

August 23, 2026 ยท View on GitHub

LightClaw is a Telegram-first control surface around hosted model providers and local coding-agent CLIs. The public top-level modules remain compatibility facades; stable implementation domains live under core/.

Runtime domains

DomainOwnerDoes not own
Provider protocolcore/llm/Telegram handlers, persistence, vendor SDK behavior outside adapters
Telegram command routingcore/bot/commands/agent_router.pyPlan normalization, worker acceptance, durable execution
Multi-agent planningcore/bot/delegation/planning.pyProcess execution, job state, acceptance
Worker task contractscore/bot/delegation/tasks.pyScheduler state or process lifecycle
Acceptancecore/bot/commands/agent_acceptance.pyPlanning and worker execution
Durable execution coordinationcore/bot/commands/agent_execution.pyAcceptance rules and plan normalization
Local process executioncore/bot/delegation/execution.pyTelegram command routing and planning
Job persistencecore/jobs.pyUI rendering and model planning
Receipts/artifactscore/receipts.py, core/artifacts.pyExecution authorization
Filesystem state primitivescore/fs.pyDomain policy

Compatibility compositions in core/bot/commands/agent.py and core/bot/delegation/multi.py preserve existing mixin imports without recombining implementation responsibilities.

Contribution map

ChangeStart hereRequired evidence
Authentication, capabilities, process environmentcore/security.py, core/bot/delegation/execution.pySecurity regression and threat-boundary note
Telegram command behaviorcore/bot/commands/, core/bot/handlers.pyAuthorized and unauthorized handler tests
Plans and worker contractscore/bot/delegation/planning.py, tasks.pyDeterministic DAG/fixture test
Jobs, receipts, files, workspacescore/jobs.py, core/receipts.py, core/fs.py, core/workspaces.pyRestart, redaction, symlink, or ownership test as applicable
Memorymemory.pyNamespace/retention test and evaluation when retrieval changes
Skillsskills.pyManifest, hash, provenance, and permission test
Provider adapterscore/llm/Recorded fixture plus shared contract test
CLI/install lifecyclelightclaw_cli.py, core/paths.pyIsolated-home or clean-wheel smoke test

Run python scripts/quality.py after changing any domain. Changes that cross multiple rows should explain why a smaller boundary is insufficient.

Enforced budget

The versioned core budget caps total runtime lines, module/function size, AST branch points, direct dependencies, cold-start p95, and wheel size. Module boundaries assert separate planning, execution, persistence, rendering, and acceptance owners.

python scripts/check_architecture.py --check
python -m bench.runtime_footprint --output /tmp/lightclaw-runtime-footprint.json

CI rejects stale metrics and budget overruns. Raising a limit requires an explicit architecture rationale; limits are not silently moved to make a change pass. Release builds attach a machine-readable runtime footprint containing cold-start samples, direct dependency list, and wheel size.

Decisions