{
 "description": "Verified Soma programs. Every entry passed `soma check` (and `soma test` / `soma verify` where applicable) on the soma version below, re-run when this index was generated. Fetch `url` for the source. Filter by `domain` or `features` to find a working example of what you are about to write.",
 "soma_version": "3.2.4",
 "count": 5,
 "domains": {
  "skeleton": 5
 },
 "features": [
  "agent",
  "cost",
  "fail",
  "guard",
  "http",
  "invariant",
  "lambda",
  "match",
  "multi_cell",
  "native",
  "pipeline",
  "service",
  "skeleton",
  "state_machine",
  "sum_type",
  "think",
  "tools",
  "try"
 ],
 "programs": [
  {
   "id": "skeleton/review_with_holes",
   "domain": "skeleton",
   "title": "REVIEW WITH HOLES — a design that is proven before it is finished",
   "summary": "REVIEW WITH HOLES — a design that is proven before it is finished. Three of the seven signals have a body; the other four are HOLES: the skeleton declares them, no flesh fills them yet. That is a state the toolchain understands: VERIFY OK (skeleton — the holes above are open obligations) after the holes it calls): accept and decline before decide calling one → fails with kind \"not_implemented\", naming the signal The tests below exercise what exists and pin how a hole behaves.",
   "url": "https://soma-lang.dev/corpus/skeleton/review_with_holes.cell",
   "repo_path": "examples/corpus/skeleton/review_with_holes.cell",
   "lines": 90,
   "features": [
    "state_machine",
    "invariant",
    "fail",
    "skeleton"
   ],
   "cells": [
    "Review",
    "ReviewSoFar"
   ],
   "usage": [
    "soma check   →  passes, and counts the holes",
    "soma verify  →  proves the lifecycle, then",
    "soma holes   →  lists them in the order to write them (a hole comes",
    "soma holes    review_with_holes.cell",
    "soma skeleton review_with_holes.cell Review.decide",
    "soma test     review_with_holes.cell"
   ]
  },
  {
   "id": "skeleton/stock_and_orders",
   "domain": "skeleton",
   "title": "STOCK AND ORDERS — two skeletons, and what one may ask of the other",
   "summary": "STOCK AND ORDERS — two skeletons, and what one may ask of the other. Frames are not transitive: `Orders.place` says `calls Stock.take`, not `writes items` — the slot belongs to Stock, and `take` has its own frame. So the skeleton answers \"who can change the stock?\" in one glance: the signals of Stock whose frame says `writes items`, reached only through the calls the other frames list. Writing `items.set(…)` inside an Orders body is refused twice over: another cell's slot, and outside the frame.",
   "url": "https://soma-lang.dev/corpus/skeleton/stock_and_orders.cell",
   "repo_path": "examples/corpus/skeleton/stock_and_orders.cell",
   "lines": 133,
   "features": [
    "state_machine",
    "invariant",
    "fail",
    "skeleton",
    "multi_cell"
   ],
   "cells": [
    "Stock",
    "Orders",
    "StockAndOrders"
   ],
   "usage": [
    "soma check    stock_and_orders.cell",
    "soma skeleton stock_and_orders.cell Stock.take     who calls it, what it owes",
    "soma verify   stock_and_orders.cell",
    "soma test     stock_and_orders.cell"
   ]
  },
  {
   "id": "skeleton/ticket_desk",
   "domain": "skeleton",
   "title": "TICKET DESK — one cell written skeleton-first",
   "summary": "TICKET DESK — one cell written skeleton-first. The skeleton is the whole design: memory, the lifecycle, and for each signal its frame (what its body may read, write, call, which edges it may take). The flesh below holds the bodies; `soma check` refuses a body that does anything its frame does not say. Read the skeleton and you know that only `open` creates a ticket, that `close` cannot reopen one, and that `summary` writes nothing — without reading a body.",
   "url": "https://soma-lang.dev/corpus/skeleton/ticket_desk.cell",
   "repo_path": "examples/corpus/skeleton/ticket_desk.cell",
   "lines": 122,
   "features": [
    "state_machine",
    "invariant",
    "fail",
    "skeleton"
   ],
   "cells": [
    "Desk",
    "DeskTests"
   ],
   "usage": [
    "soma check    ticket_desk.cell",
    "soma skeleton ticket_desk.cell Desk.assign      the brief for one body",
    "soma verify   ticket_desk.cell",
    "soma test     ticket_desk.cell"
   ]
  },
  {
   "id": "skeleton/triage_agent",
   "domain": "skeleton",
   "title": "TRIAGE AGENT — an LLM inside a frame",
   "summary": "TRIAGE AGENT — an LLM inside a frame. `skeleton agent`: the model call is an effect like any other, so it is in the frame — `calls think` — next to the one slot the signal may write and the edges it may take. Read the skeleton and you know which signals can spend tokens (one), which can move a ticket to `urgent` (one), and that the model's words never reach storage except through `label`. A body that called think() from `stats`, or wrote `labels` from `classify`, would be refused by `soma check`. SOMA_LLM_MOCK='fixed:urgent' soma test triage_agent.cell",
   "url": "https://soma-lang.dev/corpus/skeleton/triage_agent.cell",
   "repo_path": "examples/corpus/skeleton/triage_agent.cell",
   "lines": 98,
   "features": [
    "state_machine",
    "invariant",
    "think",
    "skeleton"
   ],
   "cells": [
    "Triage",
    "TriageTests"
   ],
   "usage": [
    "soma check    triage_agent.cell",
    "soma skeleton triage_agent.cell Triage.label"
   ]
  },
  {
   "id": "skeleton/turnstile_any_edge",
   "domain": "skeleton",
   "title": "TURNSTILE — a signal that may take any edge, and says so",
   "summary": "TURNSTILE — a signal that may take any edge, and says so. `push` hands the visitor's action straight to transition(): the machine itself refuses what it has no edge for (a coin in an unlocked turnstile, a push on a locked one). The target is computed at run time, so no list of edges can describe the body — the frame says `moves * -> *`: this signal can take ANY edge of the machine. It is one visible line in the skeleton; `count` next to it shows the usual, narrow way.",
   "url": "https://soma-lang.dev/corpus/skeleton/turnstile_any_edge.cell",
   "repo_path": "examples/corpus/skeleton/turnstile_any_edge.cell",
   "lines": 84,
   "features": [
    "state_machine",
    "invariant",
    "match",
    "fail",
    "skeleton"
   ],
   "cells": [
    "Turnstile",
    "TurnstileTests"
   ],
   "usage": [
    "soma check    turnstile_any_edge.cell",
    "soma verify   turnstile_any_edge.cell",
    "soma test     turnstile_any_edge.cell"
   ]
  }
 ]
}