The room is the world model. Actions are the transition function. Views are the observation function. The audit log is the trajectory. What's missing? The reward signal. That's adaptive salience.
— kernel.ts, closing comment
Phase 1: Unification — ✅ Complete, verified live
log_indextable with backfill from existing audit entries- CEL dependency extraction (hybrid AST walking + regex for pipe expressions)
- Dual-write to
_actions,_views,_agentsscopes alongside legacy tables - Temporal query endpoints:
/history/:scope/:key, prefix queries - Structural event indexing (register/delete actions, views, agents)
- Observable vocabulary:
state._actions.add_concept.descriptionevaluable as CEL
Phase 2: Log-Based Temporal — ✅ Complete, verified live
- View value sampling piggybacked on dashboardPoll (60s interval)
kind: "sample"audit entries indexed under_samplesscope/samples/:viewIdendpoint for temporal sparkline data- marked.js (v15) + mermaid.js (v11.4) loaded in dashboard shell
- MarkdownSurface renders markdown + detects mermaid code blocks
Phase 3: Adaptive Salience — ✅ Complete, verified live
- Six structural signals: recency, dependency, authorship, directed, contest, delta
- Per-room configurable weights via
_config.salience_weights _saliencesystem view injected in agent context with transparent scoring/salienceendpoint for full map with per-key signal breakdown- Salience is observable — agents can inspect their own relevance map
Phase 4: Clean Break — ✅ Complete, verified live
- Dashboard poll reads state table only (single SQL query via
poll-v8.ts) - Surfaces.tsx decoupled from PollData — uses minimal inline interfaces
- Dashboard.tsx and Replay.tsx build SurfaceContext directly from v8 data
v8ToLegacyPoll()adapter created, used, and deleteddashboardPoll()deleted (old 6-query legacy poll)PollDatatype deleted — frontend consumesPollDataV8exclusively
Phase 5: Legacy Table Removal — ✅ Complete, verified live
viewstable: DROPPED — all CRUD via_viewsscope onlyactionstable: DROPPED — timer cooldown state in_timerfield of_actionsscope valueagentstable: DROPPED — tokens migrated to unifiedtokenstable (82 agents),last_seen_seqin_agentsscope, heartbeat viatokens.last_used_at+ scopetimers.ts: removed references to dropped tablesreplay.ts: already v8-clean (reconstructs from_auditscope, no legacy reads)- Schema:
DROP TABLE IF EXISTS views/actions/agentsin migration chain
A sync room is exactly two things:
State — a finite partial function from located keys to versioned values. The current projection of all truth.
Log — an append-only sequence of events. The complete causal history.
Everything else is convention and interpretation.
state(room_id, scope, key) → { value, revision, hash, updated_at }
log(room_id, seq) → { kind, ts, agent, payload }
| Scope Prefix | Interpretation | Replaces |
|---|---|---|
_shared | Shared substrate | (unchanged) |
_actions | Write affordances | actions table |
_views | Read lenses | views table |
_agents | Participant presence | agents table |
_messages | Communication log | (unchanged) |
_audit | Event history | (unchanged) |
_help | Guidance namespace | (unchanged) |
_config | Room configuration | _shared._dashboard |
{agent-id} | Agent-private scope | (unchanged) |
The audit trail (now: log) is optimised for sequential replay. The log_index table makes it queryable by affected key:
CREATE TABLE log_index (
room_id TEXT NOT NULL,
seq INTEGER NOT NULL,
scope TEXT NOT NULL,
key TEXT NOT NULL
);
CREATE INDEX idx_li_key ON log_index(room_id, scope, key);
CREATE INDEX idx_li_seq ON log_index(room_id, seq);
This replaces proposed state_history and view_journal tables. The log IS the history.
All legacy entity tables (actions, views, agents) have been dropped. The database now contains:
| Table | Purpose |
|---|---|
rooms | Room identity + admin/view token hashes |
state | The substrate — all domain data via scope conventions |
tokens | Unified credential store (room, agent, MCP, device auth tokens) |
log_index | Temporal query index over audit entries |
smcp_* | MCP auth infrastructure (users, credentials, sessions, etc.) |
device_codes | OAuth Device Authorization flow |
The state table is the single source of truth for all domain data. The tokens table handles all authentication. Everything else is MCP auth plumbing.
State and Log. One is the current projection, the other is causal history. Everything else — actions, views, agents, messages — is convention interpreted by scope prefix.