Check
Parse and fully load-check the source before a prototype starts.
It’s only logical.
Spock is a small language and framework for putting durable state and deliberate operations in one inspectable contract. Check it, run it, and inspect the derived interfaces with one command.
npx spock new democd demonpx spock devauth table user {
key id: uuid = auto
username: text check valid_username unique
full_name: text?
avatar: storage_object?
private: bool = false
joined_at: timestamp = now
}
table post {
key id: uuid = auto
author: user = me
caption: text?
published_at: timestamp = now
}One first-class home
Application intent is usually repeated across schemas, serializers, handlers, validation, authorization, storage rules, and tests. Spock gives that intent one small source artifact the toolchain can check, materialize, and expose.
Why it exists
The compiled contract is the specified interchange artifact. The Rust toolchain is one implementation that turns it into a runnable local authority.
Durable data, value rules, deliberate functions, and seeds.
A versioned, inspectable description independent of one host.
A disposable world for validating real application behavior.
Derived interfaces over the same checked source.
Current v0
The implemented surface is narrow enough to understand and complete enough to run. Future declarations such as view, role, and policy remain reserved—not advertised as current syntax.
Explore the normative specificationtable · auth table
Durable entities, references, keys, checks, defaults, and identity.
record
Named structural values carried through the compiled contract.
fn · mut fn
Deliberate read and write operations beside the state they govern.
seed
Repeatable data and local files for a disposable prototype world.
fn valid_username(name: text) -> bool {
unchecked sql("""
SELECT :name NOT GLOB '*[^a-z0-9._]*'
AND length(:name) BETWEEN 1 AND 30
""")
}
auth table user {
key id: uuid = auto
username: text check valid_username unique
full_name: text?
private: bool = false
joined_at: timestamp = now
}The contract runs
The toolchain checks the source, creates a fresh local world, and serves inspectable interfaces over one authority. No production infrastructure theater required.
Parse and fully load-check the source before a prototype starts.
Lower the compiled contract into an embedded SQLite authority.
Expose contract, GraphQL, REST, storage, and Studio on one origin.
Emit TypeScript types and the derived GraphQL schema when needed.
Standalone language
npx spock run app.spockMaterialize the compiled contract into embedded SQLite, load seed data, and serve the developer surfaces locally.
Local surfaces
Inspect what is running
The contract preserves field types, defaults, checks, references, and documentation. The runtime and Spock Studio consume that same metadata instead of reconstructing intent from a database.
Studio currently supports contract-aware tables, filters, sorting, paging, row insertion, actor selection, and storage-backed fields.
Compiled contract
table user
| Field | Type | Contract |
|---|---|---|
| id | uuid | key · auto |
| username | text | check · unique |
| full_name | text? | nullable |
| private | bool | default false |
| joined_at | timestamp | default now |
Optional client layer
A framework project can add an Uhura client under the same command and origin. Composition keeps the responsibilities separate: Spock remains authoritative; Uhura remains optional.
Explore Uhurademo/
├── spock.toml
├── backend/
│ └── app.spock authority
└── client/
└── uhura.toml optional experienceSpock owns
Durable facts, policy boundaries, guarded mutations, and the authority protocols.
Uhura owns
Presentation, experience transitions, and non-authoritative interface-session state.
Know the boundary
Spock exists to validate application contracts—not to host an app at scale. Its language and host protocols are pre-1.0 and may change. The current specification is the source of truth.
Community
Spock is MIT-licensed open-source software. Implementation, documentation, testing, research, and clearly labeled competing pre-1.0 experiments all happen in the public project.