• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
c15r

c15r

sync

Agent collaboration layer https://sync.parc.land
Public
Like
1
sync
Home
Code
41
.claude
2
.claude-plugin
2
docs
13
frontend
13
mcp
13
reference
10
scripts
11
skills
1
static
1
.gitignore
.mcp.json
.vtignore
CLAUDE.md
INSTALL.md
PLUGIN.md
README.md
actions.ts
agents.ts
audit.ts
auth.ts
cel.ts
context.ts
deno.json
deps.ts
docs.ts
help-content.ts
invoke.ts
H
main.ts
meta.ts
poll-v8.ts
replay.ts
rooms.ts
sampling.ts
schema-v7.ts
schema-v8.ts
schema.ts
timers.ts
tokens.ts
utils.ts
views.ts
wait.ts
Connections
Environment variables
2
Branches
8
Pull requests
Remixes
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
reference
/
v8.md
Code
/
reference
/
v8.md
Search
…
v8.md

sync v8 — Two Primitives

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


Status

Phase 1: Unification — ✅ Complete, verified live

  • log_index table with backfill from existing audit entries
  • CEL dependency extraction (hybrid AST walking + regex for pipe expressions)
  • Dual-write to _actions, _views, _agents scopes 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.description evaluable as CEL

Phase 2: Log-Based Temporal — ✅ Complete, verified live

  • View value sampling piggybacked on dashboardPoll (60s interval)
  • kind: "sample" audit entries indexed under _samples scope
  • /samples/:viewId endpoint 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
  • _salience system view injected in agent context with transparent scoring
  • /salience endpoint 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 deleted
  • dashboardPoll() deleted (old 6-query legacy poll)
  • PollData type deleted — frontend consumes PollDataV8 exclusively

Phase 5: Legacy Table Removal — ✅ Complete, verified live

  • views table: DROPPED — all CRUD via _views scope only
  • actions table: DROPPED — timer cooldown state in _timer field of _actions scope value
  • agents table: DROPPED — tokens migrated to unified tokens table (82 agents), last_seen_seq in _agents scope, heartbeat via tokens.last_used_at + scope
  • timers.ts: removed references to dropped tables
  • replay.ts: already v8-clean (reconstructs from _audit scope, no legacy reads)
  • Schema: DROP TABLE IF EXISTS views/actions/agents in migration chain

Two Primitives

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 }

Reserved Scopes as Entity Types

Scope PrefixInterpretationReplaces
_sharedShared substrate(unchanged)
_actionsWrite affordancesactions table
_viewsRead lensesviews table
_agentsParticipant presenceagents table
_messagesCommunication log(unchanged)
_auditEvent history(unchanged)
_helpGuidance namespace(unchanged)
_configRoom configuration_shared._dashboard
{agent-id}Agent-private scope(unchanged)

The Log Index

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.


Migration — Complete

All legacy entity tables (actions, views, agents) have been dropped. The database now contains:

TablePurpose
roomsRoom identity + admin/view token hashes
stateThe substrate — all domain data via scope conventions
tokensUnified credential store (room, agent, MCP, device auth tokens)
log_indexTemporal query index over audit entries
smcp_*MCP auth infrastructure (users, credentials, sessions, etc.)
device_codesOAuth Device Authorization flow

Tables Remaining

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.


Architecture

Two Primitives

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.

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.