Skip to content

Technical Preview— Spock is early stage and not recommended for production.

Spock

The logical product compiler.

$npm i -g spock
Read the docs

Spock is a programming language that gives the whole team one source of truth. Check product rules and interface behavior together, then run a prototype that can say no.

project/
backend/app.spockclient/uhura.tomlmachine.uhuraui.uhuraevidence.uhurahost.toml
spock dev
/~studioStudioauthority console/Editorchecked previews/playPlayinteractive experience

framework

One project

Check the authority backend and Uhura client, then serve Studio, Editor, and Play together.

backend

Spock language

Model backend data, relationships, constraints, defaults, and operations.

experience

Uhura language

Model UI-session state, experience transitions, and presentation.

the product contract

The product should only have to say it once.

Spock keeps durable product truth—data, constraints, defaults, and operations—in one compact authority model. People and agents work from the same explicit text, with structured diagnostics when the contract does not hold.

spock language

Write the rule beside the data it governs.

Define tables, relationships, defaults, value constraints, and operation signatures close enough to reason about together. The compiler turns that source into a contract that runtimes and tools can inspect.

backend/app.spockauthority
auth table user {
  key id: uuid = auto
  username: text unique
  full_name: text?
  private: bool = false
  joined_at: timestamp = now
}

spock studio

Run the contract. Inspect the result.

Studio reads the active compiled contract. Browse and filter rows, insert valid data, run functions, inspect storage when enabled, and compare actor-sensitive outcomes—without building a separate prototype console.

Spock Studio showing the post table and the generated form for adding a row from the compiled contract.

the experience contract

Design the outcome, not just the screen.

Uhura models UI-session state and transitions. Author the loading, empty, optimistic, confirmed, and refused examples the product needs. The checker validates them; Editor presents the previews together before the production UI is built.

Uhura Editor canvas showing checked Instagram page states, transitions, and preview provenance.

one action, end to end

Optimistic first. Durable truth still wins.

Follow one action from immediate interface feedback to confirmation or rollback. Uhura owns the temporary experience state; the authority backend decides whether the attempted change becomes durable.

optimistic

The like appears before the authority has answered.

8
client/machine.uhuraUhura 0.4
on ToggleLike(post, liked) {
  if like_pending.contains(post) {
    return Duplicate;
  }
  let serial: PositiveInt = next_request + 1;
  let request = RequestId(serial);
  next_request = serial;
  like_overlay = like_overlay.put(post, liked);
  like_pending = like_pending.add(post);
  pending = pending.put(request, Mutation::SetLike {
    post, liked,
  });
  emit mutations.Request(request, Mutation::SetLike {
    post, liked,
  });
  Accepted
}

on mutations.Settled(request, result) {
  let mutation = match pending.get(request) {
    None => return Stale,
    Some(mutation) => mutation,
  };
  pending = pending.remove(request);
  match mutation {
    Mutation::SetLike { post, liked: _ } => {
      like_pending = like_pending.remove(post);
      match result {
        Settlement::Accepted => {},
        Settlement::Refused { .. } => {
          like_overlay = like_overlay.remove(post);
          notice.updates.show("Couldn't update this like. Try again.");
        },
        _ => return Invalid("unexpected settlement"),
      }
    },
    // Other mutation arms are omitted from this excerpt.
    _ => {},
  }
  Accepted
}

what survives

The prototype is temporary. The decisions survive.

Use Spock to resolve the product’s data, rules, states, and boundaries while change is cheap. Then carry the checked contracts forward as the production specification—not as infrastructure you have to deploy.

beforeProduct questions
spockRunning product contract
afterProduction implementation

Make decisions while they are cheap

Exercise data shapes, constraints, storage, and refusal paths before implementation choices harden.

Give agents a bounded world

Explicit contracts name the types, operations, outcomes, and states production work must preserve.

Start production with answers

Choose the real stack after the team has exercised the product end to end—not while its rules are still guesses.

Spock is a local prototype runtime, not a production platform. Keep the checked contracts; replace the runtime.