agent-farm-gauntlet

Minimal Agent Task Ledger with WORM audit trail, Ed25519 signing, and formal verification.

Zero runtime dependencies. TypeScript + Node.js native http + JSONL storage.

54
Files
21/21
Tests Pass
8/8
WORM Entries
7
Proven Theorems

Quickstart

git clone https://github.com/SNAPKITTYWEST/agent-farm-gauntlet.git
cd agent-farm-gauntlet
npm install
npm run verify
npm start

Server runs on http://127.0.0.1:3847.

Commands

CommandDescription
npm installInstall dependencies
npm run buildCompile TypeScript
npm testRun 21 tests
npm startStart server on :3847
npm run verifyBuild + test + chain verify
node scripts/doctor.jsCheck environment
node scripts/verify-chain.jsVerify WORM chain

Architecture

┌─────────────────────────────────────────────────────────┐
│                  CONSTITUTION                           │
│  Supreme governance. Immutable. 86 lines.               │
└───────────────────────┬─────────────────────────────────┘
                        │
                        ▼
┌─────────────────────────────────────────────────────────┐
│                  TRUST DEED                             │
│  TD-GAUNTLET-001. 4 obligations. 4 conditions.         │
│  deployment_allowed := security ∧ compliance            │
│                     ∧ logic ∧ human                     │
└───────────────────────┬─────────────────────────────────┘
                        │
                        ▼
┌─────────────────────────────────────────────────────────┐
│                  AGENT RUNTIME                          │
│  8 source files. 996 lines. Ed25519 signing.            │
│  HTTP server → Middleware → State machine → WORM        │
└───────────────────────┬─────────────────────────────────┘
                        │
                        ▼
┌─────────────────────────────────────────────────────────┐
│                  WORM LEDGER                            │
│  8 entries. Hash-chained. Append-only. Sealed.          │
└─────────────────────────────────────────────────────────┘

Security Model

ControlMechanismStatus
Agent IdentityEd25519 keypairsENFORCED
Request SigningrequireSignedAgent middlewareENFORCED
Hash ChainSHA-256 with | delimitersENFORCED
Atomic Writestmp → fsync → renameENFORCED
File LockingPID-based stale detectionENFORCED
Body Size Limit100KB maxENFORCED
State MachineValidated transitionsENFORCED
Tamper DetectionHash chain (sorry in Lean)PARTIAL

Proven vs Modeled

PropertyStatusLocation
deployment_allowed → security_passedPROVENTrustDeed.lean:34
deployment_allowed → human_approvedPROVENTrustDeed.lean:39
trust_deed_is_supremePROVENTrustDeed.lean:82
completed_is_terminalPROVENTaskInvariants.lean:33
rejected_is_terminalPROVENTaskInvariants.lean:38
pending_cannot_completePROVENTaskInvariants.lean:43
in_progress_cannot_rollbackPROVENTaskInvariants.lean:48
tamper_detectedsorryLedgerChain.lean:72
chain_implies_monotonicsorryLedgerChain.lean:87

API

MethodPathDescription
GET/healthHealth check
GET/cold-bootCold boot visualization
GET/agents/:name/public-keyAgent public key
POST/tasksCreate task (signed)
GET/tasksList tasks
GET/tasks/:idGet task
POST/tasks/:id/startStart task (signed)
POST/tasks/:id/completeComplete task (signed)
POST/tasks/:id/rejectReject task (signed)
GET/wormView WORM chain
POST/worm/verifyVerify chain integrity

Project Structure

agent-farm-gauntlet/
  constitution/ — Supreme governance (immutable)
  deeds/ — Trust Deed TD-GAUNTLET-001
  schemas/ — Task and LedgerEntry JSON schemas
  agents/ — FORGE, SENTINEL, LEDGE, OPERATOR
  proofs/ — Lean 4 formal specifications
  apps/agent-task-ledger/
    src/ — 8 source files, 996 lines
    tests/ — 21 tests, 10 suites
  worm/ — 8 WORM entries
  audit/ — Audit trail and reports
  scripts/ — doctor, verify-chain, demo
  docs/ — This documentation site

License

MIT