• 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
36
.claude
2
.claude-plugin
2
docs
13
frontend
13
mcp
13
reference
10
scripts
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
docs.ts
help-content.ts
invoke.ts
H
main.ts
replay.ts
rooms.ts
schema-v7.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
…
Viewing readonly version of v8 branch: v2
View latest version
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


The Observation

v6 established the constraint: two axioms (register action, register view), everything else derived. v7 completed the identity model: MCP clients ARE agents, not credential holders.

Both versions still maintain five entity tables: rooms, agents, state, actions, views. Plus auth tables. That's proliferation — a symptom of treating different interpretations of state as different kinds of state.

Actions are state. Views are state. Agents are state. v8 takes this literally.


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 Strategy

Phase 1 is additive. Existing tables remain. New scope conventions are populated in parallel. Reads fall back to legacy tables when scope data is absent. Once validated, legacy tables become read-only, then removable.

Compatibility Layer

The buildContext and dashboardPoll functions detect whether a room is v8 (has _actions scope entries) or legacy (has rows in actions table) and assemble context accordingly. This lets existing rooms continue working while new rooms use the unified model.


Implementation Sequence

  1. Schema: Add log_index table. No changes to existing tables.
  2. Log index population: On every audit append, also populate log_index.
  3. Registration path: _register_action and _register_view write to both legacy tables AND _actions/_views scopes (dual-write).
  4. Context assembly: Read from scope-based entries when present, fall back to legacy tables.
  5. Agent join: Write to _agents scope in addition to agents table.
  6. Temporal queries: New endpoints using log_index for key history.
  7. Deprecation: Stop reading from legacy tables for rooms that have scope entries.
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.