• 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
3
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
poll-v8.ts
replay.ts
rooms.ts
salience.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
…
Viewing readonly version of v8 branch: v148
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


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 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.