koda.systems

Spec Compliance by Section

SectionStatusDonePartialMissingSkipped
InfrastructureDone16000
Database (Section 9)Done10000
Signal Integration (Section 3)Done9001
Message Pipeline (Section 2-3)Done7000
RBAC (Section 5)Done10000
Memory System (Section 4.4)Done7000
AI Instructions (Section 6)Done7000
Skills System (Section 7)Done5000
Self-Modification Protocol (Section 8)Done5000
Security (Section 10)Done7000
Email Integration (Section 11)Partial0103
Calendar Integration (Section 12)Done0001
Credential Management (Section 13)Done6000
File Handling (Section 14)Done5000
Playwright / Browser Automation (Section 15)Done7000
Web Deployment — Cloudflare (Section 16)Done10000
Usage Monitoring (Section 18)Done7000
Error Handling (Section 17)Done10000
Interaction Modes & Commands (Section 17)Done5000
Resilience & Operations (Section 19)Done9000
Testing (Section 20)Done4000
.env Completeness (Section 22.4)Done13001
Show detailed breakdown

Infrastructure

DoneNode.js via NVM (v24.14.0)
DonePostgreSQL 16 (Homebrew service)
DonePostgREST (launchd, port 3000)
DoneDocker Desktop
Donesignal-cli REST API Docker (json-rpc mode, port 8080)
DoneBridge server (launchd, port 3033)
DonePlaywright MCP (launchd, port 8931)
DoneWrangler CLI installed
DoneWrangler authenticated (wrangler login)
DoneCloudflare account ID + API token in .env (set via /config Signal command)
DoneGit repo (github.com/cliaz/koda)
DoneSSH deploy key on GitHub
DoneCentral env file (scripts/koda-env.sh) for PATH management
DonePostgreSQL + NVM node in ~/.bashrc PATH
DoneSleep disabled (sudo pmset -a sleep 0 disksleep 0)
DoneAuto-login enabled

Database (Section 9)

DoneAll 17 tables created (users, groups, messages, sessions, tasks, memories, attachments, instructions, skills, deployments, credentials, browser_sessions, email_actions, audit_log, error_log, usage_alert_config, system_config)
Donekoda_bridge role + grants
Donekoda_agent role + grants
Donekoda_owner role (created with SELECT grants)
DoneRLS enabled on project-scoped tables
Donekoda_agent RLS policies (all 8 tables)
Donekoda_bridge RLS policies (all tables — full access)
DonePostgREST JWTs generated
Donepg_hba.conf trust auth for local sockets
DoneResponse caching for identical read-only queries within 60s (in-memory, invalidated on writes)

Signal Integration (Section 3)

DoneSignal bot registered (+61460036867)
DoneDevice linked as secondary
DoneWebSocket receiver (json-rpc mode)
Done@mention trigger detection in groups
DonePiecemeal batching in DM
DoneRead receipts
DoneMarkdown stripping from Claude responses
DoneChunk numbering [1/N] format
SkippedMessage edit handling (out of scope)
DoneUnknown UUID silent ignore (logged, no response)
DeviationDM batching uses timer (1500ms) not explicit @mention trigger — simpler, functionally equivalent

Message Pipeline (Section 2-3)

DoneInbound message logging to DB
DoneOutbound message logging
DoneMessage chunking at 1500 chars
DoneWorking... notification before Claude invocation
DoneConcurrency control with FIFO queue (queued requests notified)
DoneGlobal rate limit (RATE_LIMIT_GLOBAL)
DoneOwner exempt from per-user rate limit

RBAC (Section 5)

DoneUUID-based user lookup
DoneOwner/Admin/User roles
DonePermissions table + capability grants
DonehasPermission / hasRole functions
DoneSlash command aliases (/adduser, /removeuser, /setrole, /listusers, /grant, /revoke)
DoneFull capability enforcement for all 15 grantable capabilities
DoneCapability validation on /user grant (rejects invalid capability names)
DoneSender capabilities included in Claude Code system prompt
Done/grants <uuid> command (list grants for a user)
Done/listusers shows roles and current grants per user
Deviation/user add takes phone (generates UUID) — spec says /adduser <uuid> <role>

Memory System (Section 4.4)

DoneMemory schema (memories table with priority column)
Done/memory list|add|delete|search commands
DoneMemories injected into system prompt (global + session, priority-sorted, token budget enforced)
DoneMemory token budget enforcement (MEMORY_TOKEN_BUDGET, ~4 chars/token estimate)
Done/memory clear global sub-command
Done/memory list includes global memories (queries group_id match + IS NULL)
Done/memory commands restricted to owner

AI Instructions (Section 6)

Done/instructions set (supports inline text or .md/.txt file attachment)
DoneContent hash to skip recondensation
DoneCondensation via truncation (2000 chars) — replaced Claude subprocess in Round 4
Done<!-- ALWAYS INCLUDE --> marker support
Donefs.watch on instructions directory
Done/instructions clear command
DoneGlobal vs session scope enforcement (global = owner only, session = set_instructions_session capability)

Skills System (Section 7)

Doneskills/ directory + index.json
Done/skills list (also accepts /skill)
Done/skills show <name>
Done/skills delete <name> (owner only)
DoneSkills index path in system prompt

Self-Modification Protocol (Section 8)

DonePre/post git checkpoints (self-modify.sh)
DoneAuto-rollback on failure (verify health, revert file + commit)
DoneOne-file-per-change rule enforcement (system prompt instructions)
Done/modify command (owner only, 10 min timeout, auto-approved)
DoneSelf-modification skill file + index entry

Security (Section 10)

DoneAES-256-GCM credential encryption
Done.secrets/credential_key (chmod 600)
Done.gitignore excludes .env, .secrets/, node_modules/
Donepg_hba.conf trust auth
DoneFile permissions health check on startup
Deviation--dangerously-skip-permissions always on (required because bridge is non-interactive)
DoneCredential heuristic detection in plain messages
DoneMessage redaction for /cred and /config commands

Email Integration (Section 11)

SkippedGmail MCP (deferred by user)
PartialSMTP config in .env (vars present, empty values) (Variables present but empty)
SkippedAction item extraction
Skipped/emailsend autoapprove

Calendar Integration (Section 12)

SkippedGoogle Calendar MCP (deferred by user)

Credential Management (Section 13)

Done/cred set (encrypt + store)
Done/cred get (decrypt + return)
Done/cred delete
Done/config set|get|list — .env management via Signal (allowlisted keys, sensitive values encrypted at rest)
DoneMessage redaction from log on credential commands
DoneCredential heuristic detection
DeviationUses /cred set|get|delete instead of spec's /addcredential, /removecredential — no aliases

File Handling (Section 14)

DoneInbound attachment save to disk
DoneAttachment metadata to DB
DoneDirectory structure (attachments/, instructions/, skills/, logs/, screenshots/)
Doneupload_files capability enforcement
DoneOutbound file send (detects file paths in Claude output, sends as Signal attachments)

Playwright / Browser Automation (Section 15)

Done@playwright/mcp installed globally
DoneChromium binary installed
DoneLaunchd plist running (port 8931)
DoneSSE protocol client in bridge (callPlaywrightMCPTool)
DonePersistent browser profile for claude.ai (.browser-profile/)
DoneClaude.ai login session established
DonePrompt injection mitigation in system prompt (instructs Claude to ignore web page instructions)

Web Deployment — Cloudflare (Section 16)

DoneWrangler installed
DoneWrangler authenticated
DoneCloudflare account ID in .env
DoneCloudflare API token in .env (encrypted at rest)
DoneAuto-deploy watcher script (deploy-watch.sh + fswatch)
DoneDeploy-watch launchd plist (com.koda.deploy-watch)
Donekoda.systems custom domain + SSL
Donekoda.systems dashboard deployed and live
DoneDashboard password protected (SHA-256 gate)
Doneinstall-checklist.md + install-notes.md downloadable from dashboard

Usage Monitoring (Section 18)

DonePlaywright-based scraping of claude.ai/settings/usage (headed mode, persistent profile)
DoneIn-memory cache (sessionPct, weeklyPct, reset times)
DoneActivity-aware polling (5 min after invocations, 60 min idle)
DoneThreshold crossing detection (once per crossing)
Done/usage command suite (plain, refresh, set target, set thresholds, alerts, status)
Doneusage_alert_config DB persistence
DoneScrape failure handling (logged + alerts owner via Signal)

Error Handling (Section 17)

Doneerror_log table + logError function
DoneuncaughtException handler
DoneunhandledRejection handler
DoneClaude Code exit handling (logged + error message to user + owner notification)
DoneApproval timeout (configurable via APPROVAL_TIMEOUT_MINUTES, default 30 min)
DoneunhandledRejection notifies Owner via Signal + logs to error_log
DoneSignal send retry with backoff (3x, exponential)
DonePostgREST retry with backoff (3x, skips 4xx client errors)
DoneEmpty Claude response sends fallback message to user
DoneSignal send failures propagated and logged (signalSend/signalSendGroup return boolean, sendChunked tracks failures)

Interaction Modes & Commands (Section 17)

DoneNormal mode (message -> Claude Code)
DoneAuto-approve mode (/autoapprove on|off with autoapprove capability)
DeviationApproval relay is dead code — --dangerously-skip-permissions bypasses all prompts
Done/autoapprove status sub-command
Done/status sub-commands (errors, logs, sessions, users, memories)
Deviation/cred uses consolidated naming, not spec's /addcredential /removecredential
DoneVS Code model routing via /model vscode (extension + bridge)

Resilience & Operations (Section 19)

DoneBridge launchd (KeepAlive)
DonePostgREST launchd
DonePlaywright MCP launchd
DoneDocker restart policy (unless-stopped)
Donelogrotate.conf
Doneprune-logs.sh
DoneCrontab entry for log pruning (daily 3am)
DoneDaily log file rotation (bridge-YYYY-MM-DD.log with symlink)
DoneGraceful shutdown with drain (30s timeout, rejects new messages during drain)

Testing (Section 20)

Donetests/run_tests.js (62 tests passing)
DoneTest coverage (encryption, chunking, rate limiting, JWT, PostgREST, Signal, file structure, RBAC, markdown stripping, outbound file detection, memories, sessions, instructions, message pipeline, skills, audit/error logs)
DoneTest DB (koda_test) separate from production
DoneTest results to JSON file (tests/results.json)

.env Completeness (Section 22.4)

DoneSignal vars
DoneProcessing vars (MAX_CONCURRENT_CLAUDE, BATCH_DELAY_MS, MAX_SIGNAL_CHUNK)
DonePostgREST vars
DoneCloudflare vars (all set)
DoneUsage monitoring vars
DoneSMTP vars (present, empty)
DoneAPPROVAL_TIMEOUT_MINUTES
DoneRATE_LIMIT_GLOBAL
DoneMEMORY_TOKEN_BUDGET
DoneAUTO_APPROVE_DEFAULT
SkippedEMAIL_SEND_AUTOAPPROVE (email deferred)
DoneTEST_DB_NAME, TEST_SIGNAL_GROUP_ID, TEST_OWNER_UUID
DeviationSome env var names differ from spec (SIGNAL_PHONE vs SIGNAL_BOT_NUMBER, MAX_SIGNAL_CHUNK vs MESSAGE_SPLIT_LENGTH, etc.) — implementation names are clearer
DoneModel selection persisted to system_config table (survives restarts)
DoneAll env vars documented in .env.example (AUTO_APPROVE_DEFAULT, CLAUDE_MODEL, MEMORY_TOKEN_BUDGET, RATE_LIMIT_GLOBAL)