-- Dashboard surfaces (design-comp redesign): persist a claw's model binding so -- the claw card/anatomy can show it (today it's ephemeral in the ZeroClaw -- runtime config), and journal routine firings so the routines panel can show -- run history. Everything else the dashboard needs (compartments, counts, -- now-running) is aggregated from existing tables at read time. -- The model a claw was deployed with (e.g. "claude", "gemini", "glm-5.2"). -- NULL for claws created before this migration / outside the team flow. ALTER TABLE agents ADD COLUMN model_binding TEXT; -- One row per routine firing — the routines panel's run history + live loops. CREATE TABLE routine_runs ( id UUID PRIMARY KEY, routine_id UUID NOT NULL REFERENCES routines (id) ON DELETE CASCADE, status TEXT NOT NULL DEFAULT 'running', -- running | ok | error started_at TIMESTAMPTZ NOT NULL DEFAULT now(), completed_at TIMESTAMPTZ, error TEXT ); CREATE INDEX routine_runs_routine_idx ON routine_runs (routine_id, started_at DESC);