{
 "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": 17,
 "domains": {
  "records": 17
 },
 "features": [
  "agent",
  "cost",
  "fail",
  "guard",
  "http",
  "invariant",
  "lambda",
  "match",
  "multi_cell",
  "native",
  "pipeline",
  "service",
  "skeleton",
  "state_machine",
  "sum_type",
  "think",
  "tools",
  "try"
 ],
 "programs": [
  {
   "id": "records/address_book",
   "domain": "records",
   "title": "Address book: Contact records stored in a Map slot, round-tripped through storage, and queried",
   "summary": "Address book: Contact records stored in a Map slot, round-tripped through storage, and queried. Demonstrates record literals, dot-access, storing records in [persistent] map slots, and self-verifying tests.",
   "url": "https://soma-lang.dev/corpus/records/address_book.cell",
   "repo_path": "examples/corpus/records/address_book.cell",
   "lines": 49,
   "features": [],
   "cells": [
    "AddressBook",
    "AddressBookTest"
   ]
  },
  {
   "id": "records/bank",
   "domain": "records",
   "title": "Bank accounts as Account records kept in a persistent Map slot, with deposit/withdraw that read, mutate, and write the record back",
   "summary": "Bank accounts as Account records kept in a persistent Map slot, with deposit/withdraw that read, mutate, and write the record back. Shows the read-modify-write round-trip pattern and a negative (overdraft) path.",
   "url": "https://soma-lang.dev/corpus/records/bank.cell",
   "repo_path": "examples/corpus/records/bank.cell",
   "lines": 57,
   "features": [],
   "cells": [
    "Bank",
    "BankTest"
   ]
  },
  {
   "id": "records/bst",
   "domain": "records",
   "title": "Binary search tree built from Node records with nested `left`/`right` children",
   "summary": "Binary search tree built from Node records with nested `left`/`right` children. Demonstrates trees-of-records, recursive handlers over a record shape, and unit () as the empty subtree.",
   "url": "https://soma-lang.dev/corpus/records/bst.cell",
   "repo_path": "examples/corpus/records/bst.cell",
   "lines": 68,
   "features": [
    "pipeline"
   ],
   "cells": [
    "BST",
    "BSTTest"
   ]
  },
  {
   "id": "records/config",
   "domain": "records",
   "title": "Nested config record with defaults, merge-style overrides, and a deep-path reader",
   "summary": "Nested config record with defaults, merge-style overrides, and a deep-path reader. Demonstrates a settings tree built from records and the ?? null-coalescing guard for optional fields.",
   "url": "https://soma-lang.dev/corpus/records/config.cell",
   "repo_path": "examples/corpus/records/config.cell",
   "lines": 58,
   "features": [
    "match"
   ],
   "cells": [
    "Config",
    "ConfigTest"
   ]
  },
  {
   "id": "records/ecs",
   "domain": "records",
   "title": "Entity-Component shape: each Entity record carries a bag of components",
   "summary": "Entity-Component shape: each Entity record carries a bag of components (position, velocity, health) as nested records. Demonstrates an entity-component data model, nested dot-mutation, and a physics \"tick\".",
   "url": "https://soma-lang.dev/corpus/records/ecs.cell",
   "repo_path": "examples/corpus/records/ecs.cell",
   "lines": 60,
   "features": [
    "pipeline",
    "lambda"
   ],
   "cells": [
    "ECS",
    "ECSTest"
   ]
  },
  {
   "id": "records/employees",
   "domain": "records",
   "title": "Employee directory: records driving group_by / agg / inner_join style reporting",
   "summary": "Employee directory: records driving group_by / agg / inner_join style reporting. Demonstrates records as rows in analytical pipelines and a department roll-up.",
   "url": "https://soma-lang.dev/corpus/records/employees.cell",
   "repo_path": "examples/corpus/records/employees.cell",
   "lines": 54,
   "features": [
    "pipeline",
    "lambda"
   ],
   "cells": [
    "Employees",
    "EmployeesTest"
   ]
  },
  {
   "id": "records/family_tree",
   "domain": "records",
   "title": "Family tree: Person records with a list of `children` records, walked recursively",
   "summary": "Family tree: Person records with a list of `children` records, walked recursively. Demonstrates a multi-way tree of records, recursive counting, and collecting a generation by depth.",
   "url": "https://soma-lang.dev/corpus/records/family_tree.cell",
   "repo_path": "examples/corpus/records/family_tree.cell",
   "lines": 71,
   "features": [
    "pipeline"
   ],
   "cells": [
    "FamilyTree",
    "FamilyTreeTest"
   ]
  },
  {
   "id": "records/geometry",
   "domain": "records",
   "title": "Geometry: Point and Rect records with computed properties",
   "summary": "Geometry: Point and Rect records with computed properties. Demonstrates small value-records, deriving fields from nested records, and float tolerance in assertions.",
   "url": "https://soma-lang.dev/corpus/records/geometry.cell",
   "repo_path": "examples/corpus/records/geometry.cell",
   "lines": 46,
   "features": [],
   "cells": [
    "Geometry",
    "GeometryTest"
   ]
  },
  {
   "id": "records/inventory",
   "domain": "records",
   "title": "Inventory: a list of Item records with in-place quantity mutation, restock/sell operations, and aggregate reporting via pipelines",
   "summary": "Inventory: a list of Item records with in-place quantity mutation, restock/sell operations, and aggregate reporting via pipelines. Demonstrates building a list of records and mutating xs[i].field.",
   "url": "https://soma-lang.dev/corpus/records/inventory.cell",
   "repo_path": "examples/corpus/records/inventory.cell",
   "lines": 59,
   "features": [
    "pipeline",
    "lambda"
   ],
   "cells": [
    "Inventory",
    "InventoryTest"
   ]
  },
  {
   "id": "records/json_roundtrip",
   "domain": "records",
   "title": "Records and JSON: serialize a record to a JSON string and parse it back",
   "summary": "Records and JSON: serialize a record to a JSON string and parse it back. Demonstrates to_json/from_json round-tripping — the record's _type tag is part of its data, so is_a still recognizes it after a full round-trip.",
   "url": "https://soma-lang.dev/corpus/records/json_roundtrip.cell",
   "repo_path": "examples/corpus/records/json_roundtrip.cell",
   "lines": 47,
   "features": [],
   "cells": [
    "JsonRecords",
    "JsonRecordsTest"
   ]
  },
  {
   "id": "records/kanban",
   "domain": "records",
   "title": "Kanban board: Card records stored by id in a Map slot, moved between columns by mutating a field and writing back",
   "summary": "Kanban board: Card records stored by id in a Map slot, moved between columns by mutating a field and writing back. Demonstrates records in a keyed store, a column roll-up, and counting by a record field.",
   "url": "https://soma-lang.dev/corpus/records/kanban.cell",
   "repo_path": "examples/corpus/records/kanban.cell",
   "lines": 55,
   "features": [
    "pipeline",
    "lambda"
   ],
   "cells": [
    "Kanban",
    "KanbanTest"
   ]
  },
  {
   "id": "records/linkedlist",
   "domain": "records",
   "title": "Singly linked list built from Node records whose `next` field is either another Node or () for the tail",
   "summary": "Singly linked list built from Node records whose `next` field is either another Node or () for the tail. Demonstrates a recursive record chain and folding over it without any list builtins.",
   "url": "https://soma-lang.dev/corpus/records/linkedlist.cell",
   "repo_path": "examples/corpus/records/linkedlist.cell",
   "lines": 74,
   "features": [],
   "cells": [
    "LinkedList",
    "LinkedListTest"
   ]
  },
  {
   "id": "records/orders",
   "domain": "records",
   "title": "Order records with nested line-items, computed totals, and a state machine over the order lifecycle",
   "summary": "Order records with nested line-items, computed totals, and a state machine over the order lifecycle. Demonstrates records carrying lists of records, with() copy-update, and records that drive transitions.",
   "url": "https://soma-lang.dev/corpus/records/orders.cell",
   "repo_path": "examples/corpus/records/orders.cell",
   "lines": 58,
   "features": [
    "state_machine",
    "sum_type",
    "pipeline",
    "lambda"
   ],
   "cells": [
    "OrderStatus",
    "Orders",
    "OrdersTest"
   ]
  },
  {
   "id": "records/playlist",
   "domain": "records",
   "title": "Playlist as an ordered list of Track records",
   "summary": "Playlist as an ordered list of Track records. Demonstrates building, reordering, and summarizing a list of records, plus sort_by/pluck over record fields and total-duration aggregation.",
   "url": "https://soma-lang.dev/corpus/records/playlist.cell",
   "repo_path": "examples/corpus/records/playlist.cell",
   "lines": 50,
   "features": [
    "pipeline",
    "lambda"
   ],
   "cells": [
    "Playlist",
    "PlaylistTest"
   ]
  },
  {
   "id": "records/record_ops",
   "domain": "records",
   "title": "Functional record updates: with / without / merge produce new records without mutating the original",
   "summary": "Functional record updates: with / without / merge produce new records without mutating the original. Demonstrates immutable-style field updates and that the source record is left untouched.",
   "url": "https://soma-lang.dev/corpus/records/record_ops.cell",
   "repo_path": "examples/corpus/records/record_ops.cell",
   "lines": 51,
   "features": [
    "pipeline"
   ],
   "cells": [
    "RecordOps",
    "RecordOpsTest"
   ]
  },
  {
   "id": "records/shapes_typed",
   "domain": "records",
   "title": "Typed record literals and runtime type tags",
   "summary": "Typed record literals and runtime type tags. Demonstrates is_a/is_type on record literals, type_of, and dispatching on a record's _type field rather than a sum type — records carry their own type name.",
   "url": "https://soma-lang.dev/corpus/records/shapes_typed.cell",
   "repo_path": "examples/corpus/records/shapes_typed.cell",
   "lines": 46,
   "features": [],
   "cells": [
    "Shapes",
    "ShapesTest"
   ]
  },
  {
   "id": "records/students",
   "domain": "records",
   "title": "Gradebook: Student records each holding a list of Score records",
   "summary": "Gradebook: Student records each holding a list of Score records. Shows records-within-records, averaging a nested list, and assigning a derived letter grade with a guarded match.",
   "url": "https://soma-lang.dev/corpus/records/students.cell",
   "repo_path": "examples/corpus/records/students.cell",
   "lines": 58,
   "features": [
    "pipeline",
    "match",
    "lambda"
   ],
   "cells": [
    "Gradebook",
    "GradebookTest"
   ]
  }
 ]
}