{
"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. This is the light index; /corpus/<domain>/index.json and /corpus/full.json add a `summary` per program.",
"soma_version": "2.5.0",
"count": 319,
"domains": {
"aerospace": 15,
"agents": 15,
"algorithms": 18,
"civic": 14,
"data": 17,
"devops": 14,
"energy": 15,
"escrow_finance": 15,
"finance": 17,
"games": 19,
"games_economy": 16,
"governance": 16,
"logistics": 15,
"math": 17,
"medical": 14,
"records": 17,
"safety_interlocks": 14,
"services": 3,
"state_machines": 14,
"text": 18,
"web": 16
},
"features": [
"agent",
"cost",
"fail",
"guard",
"http",
"invariant",
"lambda",
"match",
"multi_cell",
"native",
"pipeline",
"service",
"state_machine",
"sum_type",
"think",
"tools",
"try"
],
"programs": [
{
"id": "aerospace/autopilot_authority",
"title": "AUTOPILOT AUTHORITY — Aeroflot 593: the half-disconnected autopilot",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 108,
"url": "https://soma-lang.dev/corpus/aerospace/autopilot_authority.cell"
},
{
"id": "aerospace/cabin_pressurization",
"title": "CABIN PRESSURIZATION — Helios 522: the manual-mode takeoff, unrepresentable",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 106,
"url": "https://soma-lang.dev/corpus/aerospace/cabin_pressurization.cell"
},
{
"id": "aerospace/cargo_door",
"title": "CARGO DOOR — Turkish Airlines 981: \"indicated locked\" is not LOCKED",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 116,
"url": "https://soma-lang.dev/corpus/aerospace/cargo_door.cell"
},
{
"id": "aerospace/docking_approach",
"title": "DOCKING APPROACH — Progress / Mir 1997: abort means ABORT",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 116,
"url": "https://soma-lang.dev/corpus/aerospace/docking_approach.cell"
},
{
"id": "aerospace/fire_bottle",
"title": "ENGINE FIRE BOTTLE — one-shot suppression, fuel off FIRST An engine fire bottle is halon under pressure, and it is ONE-SHOT",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 117,
"url": "https://soma-lang.dev/corpus/aerospace/fire_bottle.cell"
},
{
"id": "aerospace/fuel_crossfeed",
"title": "FUEL CROSSFEED — Air Transat 236: never feed a leak from the good tank",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 118,
"url": "https://soma-lang.dev/corpus/aerospace/fuel_crossfeed.cell"
},
{
"id": "aerospace/gear_interlock",
"title": "LANDING GEAR — weight-on-wheels interlock, made unrepresentable",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 99,
"url": "https://soma-lang.dev/corpus/aerospace/gear_interlock.cell"
},
{
"id": "aerospace/launch_commit",
"title": "LAUNCH COMMIT CRITERIA — Challenger: no waiver path to ignition",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 127,
"url": "https://soma-lang.dev/corpus/aerospace/launch_commit.cell"
},
{
"id": "aerospace/oxygen_tank_heater",
"title": "CRYO TANK HEATER — Apollo 13: the thermostat that welded shut",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 110,
"url": "https://soma-lang.dev/corpus/aerospace/oxygen_tank_heater.cell"
},
{
"id": "aerospace/parachute_sequence",
"title": "PARACHUTE SEQUENCE — Genesis: the drogue that never fired On 8 September 2004 the Genesis sample-return capsule hit the Utah desert at 311 km/h",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 105,
"url": "https://soma-lang.dev/corpus/aerospace/parachute_sequence.cell"
},
{
"id": "aerospace/range_safety",
"title": "RANGE SAFETY — the flight termination system's three one-way doors",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 114,
"url": "https://soma-lang.dev/corpus/aerospace/range_safety.cell"
},
{
"id": "aerospace/stage_separation",
"title": "STAGE SEPARATION — the ascent sequence as a proven order",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 90,
"url": "https://soma-lang.dev/corpus/aerospace/stage_separation.cell"
},
{
"id": "aerospace/tcas_ra",
"title": "TCAS RESOLUTION ADVISORY — Überlingen: the opposite maneuver is no state",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 121,
"url": "https://soma-lang.dev/corpus/aerospace/tcas_ra.cell"
},
{
"id": "aerospace/thrust_reverser",
"title": "THRUST REVERSER — Lauda Air 004: in-flight deployment, made structural",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 100,
"url": "https://soma-lang.dev/corpus/aerospace/thrust_reverser.cell"
},
{
"id": "aerospace/unreliable_airspeed",
"title": "UNRELIABLE AIRSPEED — AF447: the autopilot never flies on bad data On 1 June 2009, Air France 447's pitot tubes iced over in a storm over the Atlantic",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 105,
"url": "https://soma-lang.dev/corpus/aerospace/unreliable_airspeed.cell"
},
{
"id": "agents/approval_gate",
"title": "Human-in-the-loop approval gate guarding an irreversible action",
"features": [
"state_machine",
"agent"
],
"lines": 70,
"url": "https://soma-lang.dev/corpus/agents/approval_gate.cell"
},
{
"id": "agents/bounded_retry",
"title": "Bounded-retry agent — the verified-termination poster child",
"features": [
"state_machine",
"agent"
],
"lines": 60,
"url": "https://soma-lang.dev/corpus/agents/bounded_retry.cell"
},
{
"id": "agents/budget_guard",
"title": "Token-budget enforcement, made testable",
"features": [
"state_machine",
"agent",
"think",
"try"
],
"lines": 52,
"url": "https://soma-lang.dev/corpus/agents/budget_guard.cell"
},
{
"id": "agents/guarded_agent",
"title": "Agent with preconditions and a memory invariant — refuses bad input",
"features": [
"state_machine",
"invariant",
"agent",
"fail"
],
"lines": 59,
"url": "https://soma-lang.dev/corpus/agents/guarded_agent.cell"
},
{
"id": "agents/memory_agent",
"title": "Agent with persistent memory via remember()/recall()",
"features": [
"state_machine",
"agent",
"think",
"try"
],
"lines": 61,
"url": "https://soma-lang.dev/corpus/agents/memory_agent.cell"
},
{
"id": "agents/multi_agent_pipeline",
"title": "Multi-agent content pipeline with verified handoffs",
"features": [
"state_machine",
"agent",
"multi_cell"
],
"lines": 70,
"url": "https://soma-lang.dev/corpus/agents/multi_agent_pipeline.cell"
},
{
"id": "agents/planner",
"title": "Planning agent: decompose a goal into ordered subtasks, then execute",
"features": [
"state_machine",
"agent",
"fail"
],
"lines": 64,
"url": "https://soma-lang.dev/corpus/agents/planner.cell"
},
{
"id": "agents/react_calculator",
"title": "A ReAct-style agent whose tools are real, deterministic computations",
"features": [
"state_machine",
"agent",
"think",
"pipeline",
"try",
"lambda",
"tools"
],
"lines": 63,
"url": "https://soma-lang.dev/corpus/agents/react_calculator.cell"
},
{
"id": "agents/sentiment_router",
"title": "Sentiment-routing agent: classify a message, route by polarity",
"features": [
"state_machine",
"agent",
"think",
"match",
"tools"
],
"lines": 67,
"url": "https://soma-lang.dev/corpus/agents/sentiment_router.cell"
},
{
"id": "agents/tool_dispatcher",
"title": "Reflective tool-dispatch agent: routes a named action to the right tool",
"features": [
"state_machine",
"agent",
"think",
"match",
"try",
"tools"
],
"lines": 77,
"url": "https://soma-lang.dev/corpus/agents/tool_dispatcher.cell"
},
{
"id": "agents/trace_audit",
"title": "Self-auditing agent: it inspects its own execution trace",
"features": [
"state_machine",
"agent",
"think",
"try",
"tools"
],
"lines": 59,
"url": "https://soma-lang.dev/corpus/agents/trace_audit.cell"
},
{
"id": "agents/triage_agent",
"title": "Support-ticket triage agent",
"features": [
"state_machine",
"agent",
"think",
"tools"
],
"lines": 65,
"url": "https://soma-lang.dev/corpus/agents/triage_agent.cell"
},
{
"id": "agents/turn_bounded_chat",
"title": "Turn-bounded conversation agent — proves a chat loop terminates",
"features": [
"state_machine",
"agent",
"think",
"try",
"fail"
],
"lines": 61,
"url": "https://soma-lang.dev/corpus/agents/turn_bounded_chat.cell"
},
{
"id": "agents/typed_lifecycle",
"title": "Agent lifecycle typed against a sum type — typos become compile errors",
"features": [
"state_machine",
"agent",
"sum_type",
"match"
],
"lines": 57,
"url": "https://soma-lang.dev/corpus/agents/typed_lifecycle.cell"
},
{
"id": "agents/verified_termination",
"title": "The killer feature: an agent whose termination is PROVEN by soma verify",
"features": [
"state_machine",
"agent",
"think",
"try"
],
"lines": 52,
"url": "https://soma-lang.dev/corpus/agents/verified_termination.cell"
},
{
"id": "algorithms/bfs",
"title": "Breadth-first search on a small directed graph represented as an adjacency Map<String, List>",
"features": [],
"lines": 69,
"url": "https://soma-lang.dev/corpus/algorithms/bfs.cell"
},
{
"id": "algorithms/binary_search_list",
"title": "Binary search over a sorted List<Int> — returns the index or -1",
"features": [],
"lines": 50,
"url": "https://soma-lang.dev/corpus/algorithms/binary_search_list.cell"
},
{
"id": "algorithms/bubble_sort",
"title": "Bubble sort over a list, with the classic early-exit optimization",
"features": [],
"lines": 51,
"url": "https://soma-lang.dev/corpus/algorithms/bubble_sort.cell"
},
{
"id": "algorithms/counting_sort",
"title": "Counting sort — a non-comparison O(n + k) sort for small non-negative integers, plus the Sieve of Eratosthenes for the primes up to n",
"features": [],
"lines": 64,
"url": "https://soma-lang.dev/corpus/algorithms/counting_sort.cell"
},
{
"id": "algorithms/dfs",
"title": "Depth-first search on a directed graph: preorder traversal and cycle detection via the classic white/grey/black coloring",
"features": [],
"lines": 89,
"url": "https://soma-lang.dev/corpus/algorithms/dfs.cell"
},
{
"id": "algorithms/edit_distance",
"title": "Levenshtein edit distance — classic 2D dynamic programming",
"features": [],
"lines": 53,
"url": "https://soma-lang.dev/corpus/algorithms/edit_distance.cell"
},
{
"id": "algorithms/fibonacci_memo",
"title": "Fibonacci three ways: naive recursion, bottom-up iteration, and a memoized version backed by a [persistent] memory slot",
"features": [],
"lines": 58,
"url": "https://soma-lang.dev/corpus/algorithms/fibonacci_memo.cell"
},
{
"id": "algorithms/gcd_lcm",
"title": "Euclid's algorithm: GCD (iterative + recursive), LCM, the extended Euclid algorithm returning Bezout coefficients, and a coprimality check",
"features": [],
"lines": 81,
"url": "https://soma-lang.dev/corpus/algorithms/gcd_lcm.cell"
},
{
"id": "algorithms/insertion_sort",
"title": "Insertion sort and binary insertion sort on a List<Int>",
"features": [],
"lines": 53,
"url": "https://soma-lang.dev/corpus/algorithms/insertion_sort.cell"
},
{
"id": "algorithms/knapsack",
"title": "0/1 knapsack — maximize value within a weight budget via 2D DP",
"features": [],
"lines": 55,
"url": "https://soma-lang.dev/corpus/algorithms/knapsack.cell"
},
{
"id": "algorithms/lis",
"title": "Longest increasing subsequence (LIS) — O(n^2) dynamic programming",
"features": [],
"lines": 41,
"url": "https://soma-lang.dev/corpus/algorithms/lis.cell"
},
{
"id": "algorithms/merge_sort",
"title": "Merge sort on a List<Int> — top-down, purely functional",
"features": [],
"lines": 64,
"url": "https://soma-lang.dev/corpus/algorithms/merge_sort.cell"
},
{
"id": "algorithms/min_coins",
"title": "Coin change, minimum number of coins to make an amount (unbounded knapsack)",
"features": [],
"lines": 49,
"url": "https://soma-lang.dev/corpus/algorithms/min_coins.cell"
},
{
"id": "algorithms/queue",
"title": "A FIFO queue and a sliding-window maximum over a List",
"features": [],
"lines": 48,
"url": "https://soma-lang.dev/corpus/algorithms/queue.cell"
},
{
"id": "algorithms/quicksort",
"title": "Quicksort on a List<Int> — Lomuto partition, recursive",
"features": [],
"lines": 42,
"url": "https://soma-lang.dev/corpus/algorithms/quicksort.cell"
},
{
"id": "algorithms/stack",
"title": "A stack (LIFO) backed by a List, used to check balanced brackets",
"features": [
"match"
],
"lines": 69,
"url": "https://soma-lang.dev/corpus/algorithms/stack.cell"
},
{
"id": "algorithms/two_sum",
"title": "Two-sum with a hash set, and the count of distinct pairs summing to a target",
"features": [],
"lines": 47,
"url": "https://soma-lang.dev/corpus/algorithms/two_sum.cell"
},
{
"id": "algorithms/word_count",
"title": "Word frequency counting with a Map<String, Int> — the canonical hash-map histogram",
"features": [],
"lines": 54,
"url": "https://soma-lang.dev/corpus/algorithms/word_count.cell"
},
{
"id": "civic/campaign_finance",
"title": "CAMPAIGN FINANCE — the contribution limit lives in the ledger, not the law",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 106,
"url": "https://soma-lang.dev/corpus/civic/campaign_finance.cell"
},
{
"id": "civic/census",
"title": "CENSUS — after certification, the count is history, not a database row The decennial census count, once certified and delivered for apportionment (13 U.S.C",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 106,
"url": "https://soma-lang.dev/corpus/civic/census.cell"
},
{
"id": "civic/disaster_aid",
"title": "DISASTER AID — one emergency grant per household, however many times asked",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 116,
"url": "https://soma-lang.dev/corpus/civic/disaster_aid.cell"
},
{
"id": "civic/election_audit",
"title": "ELECTION AUDIT — a risk-limiting audit that cannot count a ballot twice",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 117,
"url": "https://soma-lang.dev/corpus/civic/election_audit.cell"
},
{
"id": "civic/foia",
"title": "FOIA — the statutory clock cannot be silently ignored 5 U.S.C",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 99,
"url": "https://soma-lang.dev/corpus/civic/foia.cell"
},
{
"id": "civic/grants",
"title": "GRANTS — budget conservation: the fund cannot award money it does not have",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 107,
"url": "https://soma-lang.dev/corpus/civic/grants.cell"
},
{
"id": "civic/jury",
"title": "JURY — strikes are counted by the bench, not by the honor system",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 118,
"url": "https://soma-lang.dev/corpus/civic/jury.cell"
},
{
"id": "civic/land_registry",
"title": "LAND REGISTRY — a parcel cannot be sold to two buyers at once",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 110,
"url": "https://soma-lang.dev/corpus/civic/land_registry.cell"
},
{
"id": "civic/lottery",
"title": "LOTTERY — committed entries, a published seed, and a draw that closes forever",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 96,
"url": "https://soma-lang.dev/corpus/civic/lottery.cell"
},
{
"id": "civic/permit",
"title": "PERMIT — a building permit that cannot skip a review",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 118,
"url": "https://soma-lang.dev/corpus/civic/permit.cell"
},
{
"id": "civic/petition",
"title": "PETITION — one signature per citizen, a wall in memory, not a clerk's eye",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 100,
"url": "https://soma-lang.dev/corpus/civic/petition.cell"
},
{
"id": "civic/procurement",
"title": "PROCUREMENT — sealed bids stay sealed, and the unsealing ends the auction",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 112,
"url": "https://soma-lang.dev/corpus/civic/procurement.cell"
},
{
"id": "civic/sunshine",
"title": "SUNSHINE — a council cannot vote on what the public never got to discuss",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 135,
"url": "https://soma-lang.dev/corpus/civic/sunshine.cell"
},
{
"id": "civic/vital_records",
"title": "VITAL RECORDS — a person dies at most once, and benefits know it instantly",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 107,
"url": "https://soma-lang.dev/corpus/civic/vital_records.cell"
},
{
"id": "data/ab_test",
"title": "A/B test rollup: per-variant conversions and lift over control",
"features": [
"pipeline",
"lambda"
],
"lines": 60,
"url": "https://soma-lang.dev/corpus/data/ab_test.cell"
},
{
"id": "data/basket_analysis",
"title": "Market-basket analysis: transactions of (order, product) lines",
"features": [
"pipeline"
],
"lines": 61,
"url": "https://soma-lang.dev/corpus/data/basket_analysis.cell"
},
{
"id": "data/cohort_retention",
"title": "Cohort analysis: bucket users by signup month, then measure how many were still active in a later month",
"features": [
"pipeline",
"lambda"
],
"lines": 59,
"url": "https://soma-lang.dev/corpus/data/cohort_retention.cell"
},
{
"id": "data/csv_transform",
"title": "CSV-shaped transform: clean -> derive -> project",
"features": [
"pipeline",
"lambda"
],
"lines": 51,
"url": "https://soma-lang.dev/corpus/data/csv_transform.cell"
},
{
"id": "data/dedup_events",
"title": "Deduplication of an event stream with distinct()",
"features": [
"pipeline"
],
"lines": 52,
"url": "https://soma-lang.dev/corpus/data/dedup_events.cell"
},
{
"id": "data/expense_tracker",
"title": "Expense report over a List<Map> of line items",
"features": [
"pipeline",
"lambda"
],
"lines": 62,
"url": "https://soma-lang.dev/corpus/data/expense_tracker.cell"
},
{
"id": "data/funnel",
"title": "Conversion funnel: count distinct users reaching each stage, then compute step-to-step conversion rates",
"features": [
"pipeline"
],
"lines": 59,
"url": "https://soma-lang.dev/corpus/data/funnel.cell"
},
{
"id": "data/group_reduce",
"title": "group_by returns a Map<String, List>; iterate its entries to compute a custom reduction the built-in agg doesn't cover (here: weighted average)",
"features": [
"pipeline",
"lambda"
],
"lines": 58,
"url": "https://soma-lang.dev/corpus/data/group_reduce.cell"
},
{
"id": "data/inner_join_orders",
"title": "Relational inner_join: enrich order rows with customer details, then roll up spend per customer tier",
"features": [
"pipeline",
"match"
],
"lines": 57,
"url": "https://soma-lang.dev/corpus/data/inner_join_orders.cell"
},
{
"id": "data/leaderboard",
"title": "Game leaderboard: rank players by score, award medals, compute gaps",
"features": [
"pipeline"
],
"lines": 60,
"url": "https://soma-lang.dev/corpus/data/leaderboard.cell"
},
{
"id": "data/left_join_inventory",
"title": "left_join keeps every left row even when the right side has no match",
"features": [
"pipeline",
"lambda"
],
"lines": 54,
"url": "https://soma-lang.dev/corpus/data/left_join_inventory.cell"
},
{
"id": "data/log_analysis",
"title": "Web access log analysis over List<Map> entries",
"features": [
"pipeline"
],
"lines": 59,
"url": "https://soma-lang.dev/corpus/data/log_analysis.cell"
},
{
"id": "data/record_pipeline",
"title": "Pipeline over typed Record literals (Name { field: v }) instead of map()",
"features": [
"pipeline"
],
"lines": 46,
"url": "https://soma-lang.dev/corpus/data/record_pipeline.cell"
},
{
"id": "data/sales_report",
"title": "Sales report: a List<Map> of orders rolled up by region and category",
"features": [
"pipeline"
],
"lines": 54,
"url": "https://soma-lang.dev/corpus/data/sales_report.cell"
},
{
"id": "data/stream_ingest",
"title": "Streaming ingest pipeline: push records into an ephemeral buffer slot, then aggregate the buffer in the same handler",
"features": [
"pipeline"
],
"lines": 55,
"url": "https://soma-lang.dev/corpus/data/stream_ingest.cell"
},
{
"id": "data/survey_scores",
"title": "Survey scoring: normalize raw responses, roll up per question, and flag low-confidence questions",
"features": [
"pipeline",
"lambda"
],
"lines": 50,
"url": "https://soma-lang.dev/corpus/data/survey_scores.cell"
},
{
"id": "data/topn_movies",
"title": "Top-N and bottom-N reporting over a movie ratings table",
"features": [
"pipeline"
],
"lines": 59,
"url": "https://soma-lang.dev/corpus/data/topn_movies.cell"
},
{
"id": "devops/backup_retention",
"title": "BACKUP RETENTION — the floor you cannot prune through",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 102,
"url": "https://soma-lang.dev/corpus/devops/backup_retention.cell"
},
{
"id": "devops/blue_green_cutover",
"title": "BLUE/GREEN CUTOVER — there is no state where nobody serves traffic",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 114,
"url": "https://soma-lang.dev/corpus/devops/blue_green_cutover.cell"
},
{
"id": "devops/cert_rotation",
"title": "CERT ROTATION — expiry is an escalation ladder, not a surprise",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 108,
"url": "https://soma-lang.dev/corpus/devops/cert_rotation.cell"
},
{
"id": "devops/db_migration",
"title": "DB MIGRATION — applied migrations are immutable history",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 104,
"url": "https://soma-lang.dev/corpus/devops/db_migration.cell"
},
{
"id": "devops/deploy_canary",
"title": "DEPLOY CANARY — the staged rollout you cannot skip On July 19, 2024, CrowdStrike pushed a content update to every Windows sensor on Earth at once",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 102,
"url": "https://soma-lang.dev/corpus/devops/deploy_canary.cell"
},
{
"id": "devops/dns_change_control",
"title": "DNS CHANGE CONTROL — no record goes live without passing validation",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 102,
"url": "https://soma-lang.dev/corpus/devops/dns_change_control.cell"
},
{
"id": "devops/feature_flag_kill_switch",
"title": "KILL SWITCH — a dead flag stays dead On August 1, 2012, Knight Capital repurposed an old feature flag — \"Power Peg\", dead code from 2003 — for a new router",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 105,
"url": "https://soma-lang.dev/corpus/devops/feature_flag_kill_switch.cell"
},
{
"id": "devops/fleet_sync_activation",
"title": "FLEET SYNC — no activation until every node runs the same code",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 100,
"url": "https://soma-lang.dev/corpus/devops/fleet_sync_activation.cell"
},
{
"id": "devops/image_promotion",
"title": "IMAGE PROMOTION — nothing unscanned, unsigned, or vulnerable ships",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 105,
"url": "https://soma-lang.dev/corpus/devops/image_promotion.cell"
},
{
"id": "devops/incident_ladder",
"title": "INCIDENT LADDER — severity only climbs, and closure needs a postmortem Two ways incident processes rot",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 118,
"url": "https://soma-lang.dev/corpus/devops/incident_ladder.cell"
},
{
"id": "devops/pager_escalation",
"title": "PAGER ESCALATION — no page resolves without a human acknowledging it",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 110,
"url": "https://soma-lang.dev/corpus/devops/pager_escalation.cell"
},
{
"id": "devops/rate_limiter",
"title": "RATE LIMITER — admission control with a quota the memory enforces",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 119,
"url": "https://soma-lang.dev/corpus/devops/rate_limiter.cell"
},
{
"id": "devops/secret_rotation",
"title": "SECRET ROTATION — a revoked credential never logs in again In 2016, attackers found Uber's AWS keys sitting in a private GitHub repo",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 115,
"url": "https://soma-lang.dev/corpus/devops/secret_rotation.cell"
},
{
"id": "devops/state_lock",
"title": "STATE LOCK — two concurrent applies can never both hold the lock",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 114,
"url": "https://soma-lang.dev/corpus/devops/state_lock.cell"
},
{
"id": "energy/anti_islanding",
"title": "ANTI-ISLANDING — a solar inverter must never energize a \"dead\" line When a feeder breaker opens, every lineworker on that circuit treats the wire as dead",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 107,
"url": "https://soma-lang.dev/corpus/energy/anti_islanding.cell"
},
{
"id": "energy/battery_soc",
"title": "BATTERY DISPATCH — the charge window is a wall, not a setpoint",
"features": [
"invariant",
"try"
],
"lines": 83,
"url": "https://soma-lang.dev/corpus/energy/battery_soc.cell"
},
{
"id": "energy/black_start",
"title": "BLACK START — you cannot boot a power plant from a dead grid out of order August 14, 2003: the Northeast blackout dropped 61,800 MW and 50 million people",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 118,
"url": "https://soma-lang.dev/corpus/energy/black_start.cell"
},
{
"id": "energy/breaker_reclose",
"title": "RECLOSER — a trip is permanent until a human walks the line",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 94,
"url": "https://soma-lang.dev/corpus/energy/breaker_reclose.cell"
},
{
"id": "energy/demand_response",
"title": "DEMAND RESPONSE — no payment before measurement, and settlement is final",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 124,
"url": "https://soma-lang.dev/corpus/energy/demand_response.cell"
},
{
"id": "energy/ev_charging",
"title": "EV CHARGING — no current before the handshake, no session past the cap Two real failure modes, one charging post",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 124,
"url": "https://soma-lang.dev/corpus/energy/ev_charging.cell"
},
{
"id": "energy/gas_purge",
"title": "GAS TURBINE LIGHT-OFF — purge before every ignition attempt, no exceptions",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 134,
"url": "https://soma-lang.dev/corpus/energy/gas_purge.cell"
},
{
"id": "energy/generator_sync",
"title": "GENERATOR PARALLELING — sync-check before the breaker, always",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 137,
"url": "https://soma-lang.dev/corpus/energy/generator_sync.cell"
},
{
"id": "energy/load_shedding",
"title": "LOAD SHEDDING — the transformer's nameplate is a wall, hospitals shed last",
"features": [
"invariant",
"try"
],
"lines": 112,
"url": "https://soma-lang.dev/corpus/energy/load_shedding.cell"
},
{
"id": "energy/meter_billing",
"title": "METER BILLING — you are billed exactly what the meter read, once",
"features": [
"state_machine",
"invariant",
"match",
"try"
],
"lines": 115,
"url": "https://soma-lang.dev/corpus/energy/meter_billing.cell"
},
{
"id": "energy/spillway_gates",
"title": "SPILLWAY GATES — a dam may never lose its last release path",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 121,
"url": "https://soma-lang.dev/corpus/energy/spillway_gates.cell"
},
{
"id": "energy/spinning_reserve",
"title": "SPINNING RESERVE — every megawatt you sell must claim real iron",
"features": [
"invariant",
"try"
],
"lines": 109,
"url": "https://soma-lang.dev/corpus/energy/spinning_reserve.cell"
},
{
"id": "energy/substation_loto",
"title": "LOCKOUT-TAGOUT — test before touch, and nobody re-energizes over a lock",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 137,
"url": "https://soma-lang.dev/corpus/energy/substation_loto.cell"
},
{
"id": "energy/transformer_overload",
"title": "TRANSFORMER EMERGENCY LOADING — overload only with every fan running",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 134,
"url": "https://soma-lang.dev/corpus/energy/transformer_overload.cell"
},
{
"id": "energy/wind_overspeed",
"title": "WIND TURBINE OVERSPEED — after an emergency brake, inspection or nothing",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 136,
"url": "https://soma-lang.dev/corpus/energy/wind_overspeed.cell"
},
{
"id": "escrow_finance/chargeback_window",
"title": "CHARGEBACK WINDOW — disputes die at day 120, reversals happen exactly once Card networks give cardholders ~120 days to dispute a charge",
"features": [
"state_machine",
"invariant"
],
"lines": 109,
"url": "https://soma-lang.dev/corpus/escrow_finance/chargeback_window.cell"
},
{
"id": "escrow_finance/client_money_segregation",
"title": "CLIENT MONEY SEGREGATION — the firm can only ever touch its own excess",
"features": [
"invariant"
],
"lines": 100,
"url": "https://soma-lang.dev/corpus/escrow_finance/client_money_segregation.cell"
},
{
"id": "escrow_finance/crowdfund_all_or_nothing",
"title": "ALL-OR-NOTHING CROWDFUNDING — miss the goal, every backer gets refunded The all-or-nothing pledge model only works if \"nothing\" is enforced",
"features": [
"state_machine",
"invariant"
],
"lines": 120,
"url": "https://soma-lang.dev/corpus/escrow_finance/crowdfund_all_or_nothing.cell"
},
{
"id": "escrow_finance/dividend_pool",
"title": "DIVIDEND DISTRIBUTION — payments can never exceed the declared pool",
"features": [
"state_machine",
"invariant"
],
"lines": 96,
"url": "https://soma-lang.dev/corpus/escrow_finance/dividend_pool.cell"
},
{
"id": "escrow_finance/dvp_settlement",
"title": "DELIVERY-VERSUS-PAYMENT — no securities leave before the cash arrives",
"features": [
"state_machine",
"invariant"
],
"lines": 111,
"url": "https://soma-lang.dev/corpus/escrow_finance/dvp_settlement.cell"
},
{
"id": "escrow_finance/invoice_factoring",
"title": "INVOICE FACTORING — no advance on unverified paper, no double-selling",
"features": [
"state_machine",
"invariant"
],
"lines": 108,
"url": "https://soma-lang.dev/corpus/escrow_finance/invoice_factoring.cell"
},
{
"id": "escrow_finance/letter_of_credit",
"title": "LETTER OF CREDIT — the bank pays against verified documents, never trust",
"features": [
"state_machine",
"invariant"
],
"lines": 116,
"url": "https://soma-lang.dev/corpus/escrow_finance/letter_of_credit.cell"
},
{
"id": "escrow_finance/loan_amortization",
"title": "LOAN AMORTIZATION — principal never goes negative, never grows back",
"features": [
"state_machine",
"invariant"
],
"lines": 100,
"url": "https://soma-lang.dev/corpus/escrow_finance/loan_amortization.cell"
},
{
"id": "escrow_finance/milestone_escrow",
"title": "MILESTONE ESCROW — a contractor is paid per accepted milestone, never ahead",
"features": [
"state_machine",
"invariant"
],
"lines": 106,
"url": "https://soma-lang.dev/corpus/escrow_finance/milestone_escrow.cell"
},
{
"id": "escrow_finance/multisig_disburse",
"title": "MULTISIG TREASURY — 2-of-3 distinct approvals, proven before a cent moves",
"features": [
"state_machine",
"invariant"
],
"lines": 109,
"url": "https://soma-lang.dev/corpus/escrow_finance/multisig_disburse.cell"
},
{
"id": "escrow_finance/payroll_run",
"title": "PAYROLL RUN — the payslips must sum EXACTLY to the approved total",
"features": [
"state_machine",
"invariant"
],
"lines": 100,
"url": "https://soma-lang.dev/corpus/escrow_finance/payroll_run.cell"
},
{
"id": "escrow_finance/security_deposit",
"title": "SECURITY DEPOSIT — deductions can never exceed what the tenant paid",
"features": [
"state_machine",
"invariant"
],
"lines": 99,
"url": "https://soma-lang.dev/corpus/escrow_finance/security_deposit.cell"
},
{
"id": "escrow_finance/two_party_escrow",
"title": "TWO-PARTY ESCROW — funds move only when BOTH sides say so, and never leak",
"features": [
"state_machine",
"invariant"
],
"lines": 117,
"url": "https://soma-lang.dev/corpus/escrow_finance/two_party_escrow.cell"
},
{
"id": "escrow_finance/vesting_schedule",
"title": "VESTING SCHEDULE — cliff then linear, and over-vesting is unwritable",
"features": [
"state_machine",
"invariant"
],
"lines": 118,
"url": "https://soma-lang.dev/corpus/escrow_finance/vesting_schedule.cell"
},
{
"id": "escrow_finance/wire_dual_control",
"title": "WIRE DUAL CONTROL — the maker can never be the checker",
"features": [
"state_machine",
"invariant"
],
"lines": 98,
"url": "https://soma-lang.dev/corpus/escrow_finance/wire_dual_control.cell"
},
{
"id": "finance/bond_pricer",
"title": "Fixed-coupon bond pricing: present value of coupons plus redemption, current yield, and a par/premium/discount classifier",
"features": [],
"lines": 49,
"url": "https://soma-lang.dev/corpus/finance/bond_pricer.cell"
},
{
"id": "finance/budget_tracker",
"title": "Monthly budget tracker with a spend cap invariant",
"features": [
"invariant",
"try"
],
"lines": 54,
"url": "https://soma-lang.dev/corpus/finance/budget_tracker.cell"
},
{
"id": "finance/chip_ledger",
"title": "Chip/cash ledger with a non-negative balance invariant",
"features": [
"invariant",
"try"
],
"lines": 54,
"url": "https://soma-lang.dev/corpus/finance/chip_ledger.cell"
},
{
"id": "finance/compound_interest",
"title": "Compound interest: future value, with periodic compounding and a continuous-compounding variant",
"features": [],
"lines": 46,
"url": "https://soma-lang.dev/corpus/finance/compound_interest.cell"
},
{
"id": "finance/currency_converter",
"title": "FX converter with a rate table in memory and a non-negative rate invariant",
"features": [
"invariant",
"try"
],
"lines": 60,
"url": "https://soma-lang.dev/corpus/finance/currency_converter.cell"
},
{
"id": "finance/dividend_yield",
"title": "Equity income metrics: dividend yield, payout ratio, dividend-discount (Gordon growth) fair value, and yield-on-cost",
"features": [],
"lines": 49,
"url": "https://soma-lang.dev/corpus/finance/dividend_yield.cell"
},
{
"id": "finance/fee_calculator",
"title": "Brokerage fee calculator: tiered commission, bps fee with a floor, and a maker/taker exchange fee",
"features": [
"match"
],
"lines": 57,
"url": "https://soma-lang.dev/corpus/finance/fee_calculator.cell"
},
{
"id": "finance/loan_amortization",
"title": "Fixed-rate loan amortization: monthly payment, remaining balance after k payments, and total interest paid",
"features": [],
"lines": 48,
"url": "https://soma-lang.dev/corpus/finance/loan_amortization.cell"
},
{
"id": "finance/moving_average",
"title": "Moving averages over a price series: simple MA window, full-series mean, and a momentum signal from an SMA crossover",
"features": [],
"lines": 64,
"url": "https://soma-lang.dev/corpus/finance/moving_average.cell"
},
{
"id": "finance/npv",
"title": "Discounted cash flow: present value of a single flow, net present value of a cash-flow stream, and a simple payback-period count",
"features": [],
"lines": 57,
"url": "https://soma-lang.dev/corpus/finance/npv.cell"
},
{
"id": "finance/option_payoff",
"title": "European option payoffs at expiry, plus a long straddle",
"features": [],
"lines": 56,
"url": "https://soma-lang.dev/corpus/finance/option_payoff.cell"
},
{
"id": "finance/order_lifecycle",
"title": "Order lifecycle as a verified state machine: an order flows from new to filled or rejected, and a fill settles",
"features": [
"state_machine",
"guard"
],
"lines": 63,
"url": "https://soma-lang.dev/corpus/finance/order_lifecycle.cell"
},
{
"id": "finance/portfolio_pnl",
"title": "Portfolio P&L tracker over a list of position records",
"features": [
"pipeline",
"lambda"
],
"lines": 63,
"url": "https://soma-lang.dev/corpus/finance/portfolio_pnl.cell"
},
{
"id": "finance/position_limit",
"title": "Position-limit risk gate",
"features": [
"invariant",
"try"
],
"lines": 59,
"url": "https://soma-lang.dev/corpus/finance/position_limit.cell"
},
{
"id": "finance/returns_stats",
"title": "Return-series statistics: arithmetic mean return, volatility (sample stdev), annualized Sharpe ratio, and max drawdown of an equity curve",
"features": [],
"lines": 62,
"url": "https://soma-lang.dev/corpus/finance/returns_stats.cell"
},
{
"id": "finance/tax_brackets",
"title": "Progressive income tax over marginal brackets, plus effective rate and marginal rate lookup",
"features": [],
"lines": 70,
"url": "https://soma-lang.dev/corpus/finance/tax_brackets.cell"
},
{
"id": "finance/trade_settlement",
"title": "Trade settlement as a sum type",
"features": [
"sum_type",
"match"
],
"lines": 58,
"url": "https://soma-lang.dev/corpus/finance/trade_settlement.cell"
},
{
"id": "games/blackjack",
"title": "Blackjack — hand scoring with soft/hard aces and bust detection hand_value() sums card ranks, counting each Ace as 11 then demoting to 1 while the total busts",
"features": [
"match"
],
"lines": 86,
"url": "https://soma-lang.dev/corpus/games/blackjack.cell"
},
{
"id": "games/card_deck",
"title": "Card deck — build, deterministic Fisher-Yates shuffle, and deal A 52-card deck is built as \"Rank of Suit\" strings",
"features": [],
"lines": 85,
"url": "https://soma-lang.dev/corpus/games/card_deck.cell"
},
{
"id": "games/connect_four",
"title": "Connect Four — drop a disc and detect four-in-a-row The board is a flat row-major 6x7 grid (row 0 = top)",
"features": [],
"lines": 93,
"url": "https://soma-lang.dev/corpus/games/connect_four.cell"
},
{
"id": "games/conway_life",
"title": "Conway's Game of Life — one generation step on a fixed grid The grid is a flat row-major list of 0/1 over an r×c board",
"features": [],
"lines": 82,
"url": "https://soma-lang.dev/corpus/games/conway_life.cell"
},
{
"id": "games/craps",
"title": "Craps — the come-out roll and point-resolution rules come_out(total) resolves the first roll: 7/11 wins, 2/3/12 craps out, any other number becomes the \"point\"",
"features": [
"match"
],
"lines": 77,
"url": "https://soma-lang.dev/corpus/games/craps.cell"
},
{
"id": "games/game_2048",
"title": "2048 — slide-and-merge a single row (the core move primitive)",
"features": [],
"lines": 77,
"url": "https://soma-lang.dev/corpus/games/game_2048.cell"
},
{
"id": "games/guessing_game",
"title": "Number guessing game — hi/lo feedback and a binary-search solver feedback() compares a guess to the secret and returns \"low\" / \"high\" / \"correct\"",
"features": [
"match"
],
"lines": 67,
"url": "https://soma-lang.dev/corpus/games/guessing_game.cell"
},
{
"id": "games/hanoi",
"title": "Tower of Hanoi — minimum moves and an explicit move list min_moves(n) = 2^n - 1",
"features": [],
"lines": 78,
"url": "https://soma-lang.dev/corpus/games/hanoi.cell"
},
{
"id": "games/mastermind",
"title": "Mastermind — score a guess with black and white pegs Black pegs = right colour in the right position",
"features": [
"match"
],
"lines": 92,
"url": "https://soma-lang.dev/corpus/games/mastermind.cell"
},
{
"id": "games/maze_step",
"title": "Maze movement — one step with wall collision on a grid The maze is a flat row-major list: 0 = open, 1 = wall",
"features": [],
"lines": 82,
"url": "https://soma-lang.dev/corpus/games/maze_step.cell"
},
{
"id": "games/minesweeper",
"title": "Minesweeper — compute the neighbour-mine board from a mine layout mines is a flat row-major r×c list of 0/1",
"features": [],
"lines": 77,
"url": "https://soma-lang.dev/corpus/games/minesweeper.cell"
},
{
"id": "games/nim",
"title": "Nim — optimal play via the Sprague-Grundy nim-sum In normal-play Nim a position is a loss for the player to move iff the XOR of all heap sizes is 0",
"features": [],
"lines": 75,
"url": "https://soma-lang.dev/corpus/games/nim.cell"
},
{
"id": "games/pig_dice",
"title": "Pig — the press-your-luck dice game, scored from a roll log",
"features": [
"lambda"
],
"lines": 66,
"url": "https://soma-lang.dev/corpus/games/pig_dice.cell"
},
{
"id": "games/rock_paper_scissors",
"title": "Rock-paper-scissors — round judging and best-of-N scoring judge(a, b) returns \"p1\", \"p2\", or \"tie\" from the two throws",
"features": [
"match"
],
"lines": 72,
"url": "https://soma-lang.dev/corpus/games/rock_paper_scissors.cell"
},
{
"id": "games/snake",
"title": "Snake — one movement tick with growth, wall and self collision The snake is a list of {y, x} segments, head first",
"features": [
"lambda"
],
"lines": 75,
"url": "https://soma-lang.dev/corpus/games/snake.cell"
},
{
"id": "games/tic_tac_toe",
"title": "Tic-tac-toe win detection — pure board logic A board is a flat list of 9 cells, each \"X\", \"O\", or \"\" (empty)",
"features": [
"lambda"
],
"lines": 67,
"url": "https://soma-lang.dev/corpus/games/tic_tac_toe.cell"
},
{
"id": "games/turn_tracker",
"title": "Turn tracker — round/phase state machine with player rotation",
"features": [
"state_machine"
],
"lines": 71,
"url": "https://soma-lang.dev/corpus/games/turn_tracker.cell"
},
{
"id": "games/war",
"title": "War — the card-comparison game, played to exhaustion Each card is an integer rank 2..14 (J=11..A=14)",
"features": [],
"lines": 76,
"url": "https://soma-lang.dev/corpus/games/war.cell"
},
{
"id": "games/yahtzee",
"title": "Yahtzee — score a roll of five dice in any category counts() buckets the five dice into face frequencies",
"features": [
"lambda"
],
"lines": 99,
"url": "https://soma-lang.dev/corpus/games/yahtzee.cell"
},
{
"id": "games_economy/auction_house",
"title": "AUCTION HOUSE — escrowed bids, gold that cannot be printed",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 124,
"url": "https://soma-lang.dev/corpus/games_economy/auction_house.cell"
},
{
"id": "games_economy/battle_pass",
"title": "BATTLE PASS — every tier reward claimed exactly once",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 92,
"url": "https://soma-lang.dev/corpus/games_economy/battle_pass.cell"
},
{
"id": "games_economy/battle_turns",
"title": "BATTLE TURNS — nobody acts twice, and the dead stay dead",
"features": [
"state_machine",
"invariant"
],
"lines": 89,
"url": "https://soma-lang.dev/corpus/games_economy/battle_turns.cell"
},
{
"id": "games_economy/crafting_forge",
"title": "CRAFTING FORGE — ingredients consumed exactly once",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 98,
"url": "https://soma-lang.dev/corpus/games_economy/crafting_forge.cell"
},
{
"id": "games_economy/daily_chest",
"title": "DAILY CHEST — one claim per day, clock tricks be damned",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 57,
"url": "https://soma-lang.dev/corpus/games_economy/daily_chest.cell"
},
{
"id": "games_economy/gem_store",
"title": "GEM STORE — a purchase receipt credits exactly once",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 101,
"url": "https://soma-lang.dev/corpus/games_economy/gem_store.cell"
},
{
"id": "games_economy/guild_bank",
"title": "GUILD BANK — the heist needs a key an expelled member cannot hold",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 102,
"url": "https://soma-lang.dev/corpus/games_economy/guild_bank.cell"
},
{
"id": "games_economy/harvest_node",
"title": "HARVEST NODE — one vein, one yield per respawn cycle",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 79,
"url": "https://soma-lang.dev/corpus/games_economy/harvest_node.cell"
},
{
"id": "games_economy/loot_roll",
"title": "LOOT ROLL — one roll per raider, one award per drop",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 84,
"url": "https://soma-lang.dev/corpus/games_economy/loot_roll.cell"
},
{
"id": "games_economy/loot_trade",
"title": "LOOT TRADE — an item exists in exactly one inventory, ever",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 101,
"url": "https://soma-lang.dev/corpus/games_economy/loot_trade.cell"
},
{
"id": "games_economy/pity_banner",
"title": "PITY BANNER — the 90-pull guarantee that cannot be skipped Gacha games promise a \"pity timer\": a guaranteed top-rarity drop by pull 90",
"features": [
"invariant"
],
"lines": 73,
"url": "https://soma-lang.dev/corpus/games_economy/pity_banner.cell"
},
{
"id": "games_economy/season_ladder",
"title": "SEASONAL LADDER — decay you cannot dodge, ratings that cannot underflow Two real ladder failures",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 98,
"url": "https://soma-lang.dev/corpus/games_economy/season_ladder.cell"
},
{
"id": "games_economy/stamina",
"title": "STAMINA — the energy bar that cannot be overfilled or driven negative Mobile-game energy systems are attacked two ways",
"features": [
"invariant",
"try"
],
"lines": 68,
"url": "https://soma-lang.dev/corpus/games_economy/stamina.cell"
},
{
"id": "games_economy/tournament_bracket",
"title": "TOURNAMENT BRACKET — eliminated means eliminated",
"features": [
"state_machine",
"match",
"try"
],
"lines": 73,
"url": "https://soma-lang.dev/corpus/games_economy/tournament_bracket.cell"
},
{
"id": "games_economy/veterancy_ranks",
"title": "VETERANCY RANKS — promotion is earned and can never be rolled back",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 92,
"url": "https://soma-lang.dev/corpus/games_economy/veterancy_ranks.cell"
},
{
"id": "games_economy/wager_duel",
"title": "WAGER DUEL — staked gold that exactly one fighter can win",
"features": [
"state_machine",
"invariant",
"match",
"try"
],
"lines": 122,
"url": "https://soma-lang.dev/corpus/games_economy/wager_duel.cell"
},
{
"id": "governance/amendment",
"title": "AMENDMENT — supermajority ratification, and a \"yes\" that cannot be unsaid",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 129,
"url": "https://soma-lang.dev/corpus/governance/amendment.cell"
},
{
"id": "governance/anti_deficiency",
"title": "ANTI-DEFICIENCY — no obligation of funds Congress never appropriated The Anti-Deficiency Act (31 U.S.C",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 126,
"url": "https://soma-lang.dev/corpus/governance/anti_deficiency.cell"
},
{
"id": "governance/auditor_independence",
"title": "AUDITOR INDEPENDENCE — one firm, one client, ONE role In 2000, Arthur Andersen billed Enron $25 million for the audit — and $27 million for consulting",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 117,
"url": "https://soma-lang.dev/corpus/governance/auditor_independence.cell"
},
{
"id": "governance/board_motion",
"title": "BOARD MOTION — Robert's Rules where \"no quorum, no vote\" is structural",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 155,
"url": "https://soma-lang.dev/corpus/governance/board_motion.cell"
},
{
"id": "governance/emergency_sunset",
"title": "EMERGENCY SUNSET — extraordinary powers that cannot become ordinary Egypt declared a state of emergency in 1981 after Sadat's assassination",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 136,
"url": "https://soma-lang.dev/corpus/governance/emergency_sunset.cell"
},
{
"id": "governance/four_eyes_approval",
"title": "FOUR-EYES APPROVAL — the maker cannot be the checker, by construction",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 115,
"url": "https://soma-lang.dev/corpus/governance/four_eyes_approval.cell"
},
{
"id": "governance/grant_milestones",
"title": "GRANT MILESTONES — money moves only behind verified work, and only once",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 148,
"url": "https://soma-lang.dev/corpus/governance/grant_milestones.cell"
},
{
"id": "governance/judicial_recusal",
"title": "JUDICIAL RECUSAL — a conflicted judge cannot sit, and cases aren't shopped Caperton v",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 121,
"url": "https://soma-lang.dev/corpus/governance/judicial_recusal.cell"
},
{
"id": "governance/minutes_adoption",
"title": "MINUTES ADOPTION — the corporate record cannot be edited after the fact",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 115,
"url": "https://soma-lang.dev/corpus/governance/minutes_adoption.cell"
},
{
"id": "governance/open_meetings",
"title": "OPEN MEETINGS — no public decision without public notice, structurally Every U.S",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 118,
"url": "https://soma-lang.dev/corpus/governance/open_meetings.cell"
},
{
"id": "governance/peer_review",
"title": "PEER REVIEW — double-blind where the blind cannot be lifted early",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 132,
"url": "https://soma-lang.dev/corpus/governance/peer_review.cell"
},
{
"id": "governance/release_pipeline",
"title": "RELEASE PIPELINE — \"tests pass before deploy\" as a theorem, not a habit",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 133,
"url": "https://soma-lang.dev/corpus/governance/release_pipeline.cell"
},
{
"id": "governance/sealed_bids",
"title": "SEALED BIDS — the envelope opens once, for everyone, after the deadline",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 131,
"url": "https://soma-lang.dev/corpus/governance/sealed_bids.cell"
},
{
"id": "governance/term_limits",
"title": "TERM LIMITS — the third term is not forbidden, it is unrepresentable",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 128,
"url": "https://soma-lang.dev/corpus/governance/term_limits.cell"
},
{
"id": "governance/three_readings",
"title": "THREE READINGS — an ordinance cannot be law the night it is introduced",
"features": [
"state_machine",
"invariant",
"try",
"fail"
],
"lines": 145,
"url": "https://soma-lang.dev/corpus/governance/three_readings.cell"
},
{
"id": "governance/whistleblower_shield",
"title": "WHISTLEBLOWER SHIELD — retaliation against a reporter is unrepresentable",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 119,
"url": "https://soma-lang.dev/corpus/governance/whistleblower_shield.cell"
},
{
"id": "logistics/bonded_warehouse",
"title": "BONDED WAREHOUSE — no duty, no exit A customs bonded warehouse holds imported goods on which duty has NOT yet been paid",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 125,
"url": "https://soma-lang.dev/corpus/logistics/bonded_warehouse.cell"
},
{
"id": "logistics/cold_chain_custody",
"title": "COLD-CHAIN CUSTODY — a warm vaccine never gets cold again",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 105,
"url": "https://soma-lang.dev/corpus/logistics/cold_chain_custody.cell"
},
{
"id": "logistics/container_seal_custody",
"title": "CONTAINER SEAL — a broken seal cannot be quietly replaced",
"features": [
"state_machine",
"invariant",
"match",
"try"
],
"lines": 108,
"url": "https://soma-lang.dev/corpus/logistics/container_seal_custody.cell"
},
{
"id": "logistics/container_weight",
"title": "CONTAINER WEIGHT — the misdeclared box that breaks the ship",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 97,
"url": "https://soma-lang.dev/corpus/logistics/container_weight.cell"
},
{
"id": "logistics/customs_clearance",
"title": "CUSTOMS CLEARANCE — no release without an examination verdict",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 112,
"url": "https://soma-lang.dev/corpus/logistics/customs_clearance.cell"
},
{
"id": "logistics/dock_door_interlock",
"title": "DOCK DOOR INTERLOCK — the trailer that drives off with the forklift",
"features": [
"state_machine",
"try"
],
"lines": 86,
"url": "https://soma-lang.dev/corpus/logistics/dock_door_interlock.cell"
},
{
"id": "logistics/gate_appointment",
"title": "GATE APPOINTMENTS — a dock door cannot be double-booked",
"features": [
"invariant"
],
"lines": 100,
"url": "https://soma-lang.dev/corpus/logistics/gate_appointment.cell"
},
{
"id": "logistics/hazmat_bay_segregation",
"title": "HAZMAT BAY SEGREGATION — Beirut, as a state that cannot exist",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 120,
"url": "https://soma-lang.dev/corpus/logistics/hazmat_bay_segregation.cell"
},
{
"id": "logistics/inventory_conservation",
"title": "INVENTORY CONSERVATION — stock never teleports, never goes negative",
"features": [
"invariant",
"pipeline",
"try",
"lambda"
],
"lines": 92,
"url": "https://soma-lang.dev/corpus/logistics/inventory_conservation.cell"
},
{
"id": "logistics/package_tracking",
"title": "PACKAGE TRACKING — delivered is FOREVER",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 84,
"url": "https://soma-lang.dev/corpus/logistics/package_tracking.cell"
},
{
"id": "logistics/proof_of_delivery",
"title": "PROOF OF DELIVERY — no signature, no \"delivered\"",
"features": [
"state_machine",
"try"
],
"lines": 105,
"url": "https://soma-lang.dev/corpus/logistics/proof_of_delivery.cell"
},
{
"id": "logistics/rack_slot_capacity",
"title": "RACK SLOT CAPACITY — the pallet that brings down the aisle Warehouse racking collapses kill",
"features": [
"invariant",
"try"
],
"lines": 85,
"url": "https://soma-lang.dev/corpus/logistics/rack_slot_capacity.cell"
},
{
"id": "logistics/recall_quarantine",
"title": "RECALL QUARANTINE — the recalled lot that ships anyway",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 110,
"url": "https://soma-lang.dev/corpus/logistics/recall_quarantine.cell"
},
{
"id": "logistics/reefer_setpoint",
"title": "REEFER SETPOINT — the typo that thaws forty tonnes of tuna",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 111,
"url": "https://soma-lang.dev/corpus/logistics/reefer_setpoint.cell"
},
{
"id": "logistics/uld_loadmaster",
"title": "ULD LOADMASTER — National Airlines 102, refused at the manifest",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 111,
"url": "https://soma-lang.dev/corpus/logistics/uld_loadmaster.cell"
},
{
"id": "math/bisection_root",
"title": "Bisection — bracket a root of a continuous function and halve",
"features": [
"native"
],
"lines": 61,
"url": "https://soma-lang.dev/corpus/math/bisection_root.cell"
},
{
"id": "math/combinatorics",
"title": "Combinatorics — factorial, permutations, combinations factorial folds product over range(1, n+1)",
"features": [],
"lines": 64,
"url": "https://soma-lang.dev/corpus/math/combinatorics.cell"
},
{
"id": "math/complex",
"title": "Complex numbers — records carrying real and imaginary parts Soma has no native complex type, so a Complex is a record { re, im }",
"features": [],
"lines": 63,
"url": "https://soma-lang.dev/corpus/math/complex.cell"
},
{
"id": "math/ext_euclid",
"title": "Extended Euclidean algorithm — Bezout coefficients and modular inverse",
"features": [],
"lines": 70,
"url": "https://soma-lang.dev/corpus/math/ext_euclid.cell"
},
{
"id": "math/fibonacci",
"title": "Fibonacci — iterative, and the closed-form Binet approximation The iterative version carries the last two terms in two variables",
"features": [],
"lines": 66,
"url": "https://soma-lang.dev/corpus/math/fibonacci.cell"
},
{
"id": "math/gcd_lcm",
"title": "GCD / LCM — Euclid's algorithm and its consequences gcd() is a builtin (Euclid on absolute values)",
"features": [
"pipeline",
"lambda"
],
"lines": 54,
"url": "https://soma-lang.dev/corpus/math/gcd_lcm.cell"
},
{
"id": "math/integration",
"title": "Numerical integration — trapezoidal and Simpson's rule Approximate the area under f over [a,b] with n panels",
"features": [
"native"
],
"lines": 66,
"url": "https://soma-lang.dev/corpus/math/integration.cell"
},
{
"id": "math/linear_solve",
"title": "Solving 2x2 linear systems — Cramer's rule via determinants",
"features": [],
"lines": 46,
"url": "https://soma-lang.dev/corpus/math/linear_solve.cell"
},
{
"id": "math/matrix_algebra",
"title": "Matrix algebra — product, transpose, determinant, trace Matrices are List<List<Float>> built by reshape",
"features": [],
"lines": 56,
"url": "https://soma-lang.dev/corpus/math/matrix_algebra.cell"
},
{
"id": "math/modular",
"title": "Modular arithmetic — fast exponentiation and Fermat primality pow_mod(base, exp, m) is a builtin doing square-and-multiply mod m",
"features": [],
"lines": 54,
"url": "https://soma-lang.dev/corpus/math/modular.cell"
},
{
"id": "math/monte_carlo_pi",
"title": "Monte Carlo — estimate pi by dart-throwing Throw random points into the unit square; the fraction landing inside the quarter circle (x²+y² ≤ 1) approaches pi/4",
"features": [],
"lines": 44,
"url": "https://soma-lang.dev/corpus/math/monte_carlo_pi.cell"
},
{
"id": "math/newton_sqrt",
"title": "Newton's method — square root and reciprocal without division/sqrt",
"features": [
"native"
],
"lines": 67,
"url": "https://soma-lang.dev/corpus/math/newton_sqrt.cell"
},
{
"id": "math/primes",
"title": "Primes — primality test, prime list, factorization Trial division up to √n decides primality",
"features": [],
"lines": 76,
"url": "https://soma-lang.dev/corpus/math/primes.cell"
},
{
"id": "math/quadratic",
"title": "Quadratic equations — discriminant and the two real roots",
"features": [],
"lines": 54,
"url": "https://soma-lang.dev/corpus/math/quadratic.cell"
},
{
"id": "math/series",
"title": "Power series — e via 1/k!, and pi via the Leibniz / Nilakantha series e = Σ 1/k!",
"features": [
"native"
],
"lines": 75,
"url": "https://soma-lang.dev/corpus/math/series.cell"
},
{
"id": "math/statistics",
"title": "Descriptive statistics — mean, variance, stddev, median via sort Mean is sum/len",
"features": [
"pipeline",
"lambda"
],
"lines": 69,
"url": "https://soma-lang.dev/corpus/math/statistics.cell"
},
{
"id": "math/vector_ops",
"title": "Vector operations — dot product, norm, cosine similarity Vectors are plain lists",
"features": [
"pipeline",
"lambda"
],
"lines": 56,
"url": "https://soma-lang.dev/corpus/math/vector_ops.cell"
},
{
"id": "medical/bloodbank",
"title": "BLOOD BANK — an ABO-incompatible transfusion is unrepresentable, and",
"features": [
"invariant",
"match",
"try",
"lambda"
],
"lines": 129,
"url": "https://soma-lang.dev/corpus/medical/bloodbank.cell"
},
{
"id": "medical/chain_of_custody",
"title": "LAB CHAIN OF CUSTODY — a sample whose custody broke can never be",
"features": [
"state_machine",
"try"
],
"lines": 125,
"url": "https://soma-lang.dev/corpus/medical/chain_of_custody.cell"
},
{
"id": "medical/coldchain",
"title": "VACCINE COLD-CHAIN — a temperature breach is PERMANENT, not \"probably fine\"",
"features": [
"state_machine",
"invariant",
"try",
"lambda"
],
"lines": 126,
"url": "https://soma-lang.dev/corpus/medical/coldchain.cell"
},
{
"id": "medical/controlled_substance",
"title": "CONTROLLED SUBSTANCE CABINET — the narcotic count must reconcile, always",
"features": [
"invariant",
"try"
],
"lines": 133,
"url": "https://soma-lang.dev/corpus/medical/controlled_substance.cell"
},
{
"id": "medical/dialysis",
"title": "DIALYSIS — fluid removal is capped, and a session always ends with the",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 148,
"url": "https://soma-lang.dev/corpus/medical/dialysis.cell"
},
{
"id": "medical/infusion_pump",
"title": "INFUSION PUMP — the programmed rate can never exceed the drug's hard limit (\"guardrails\") A nurse programming an IV pump types the rate by hand",
"features": [
"invariant",
"try",
"lambda"
],
"lines": 113,
"url": "https://soma-lang.dev/corpus/medical/infusion_pump.cell"
},
{
"id": "medical/isolation",
"title": "ISOLATION PRECAUTIONS — a contagious patient cannot be discharged to a",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 155,
"url": "https://soma-lang.dev/corpus/medical/isolation.cell"
},
{
"id": "medical/med_administration",
"title": "MEDICATION ADMINISTRATION — the \"five rights\" enforced by barcode, no",
"features": [
"state_machine",
"match",
"try"
],
"lines": 135,
"url": "https://soma-lang.dev/corpus/medical/med_administration.cell"
},
{
"id": "medical/prescription_lockout",
"title": "PRESCRIPTION INTERACTION LOCKOUT — a lethal drug combination is refused",
"features": [
"invariant",
"try",
"lambda"
],
"lines": 142,
"url": "https://soma-lang.dev/corpus/medical/prescription_lockout.cell"
},
{
"id": "medical/sepsis_bundle",
"title": "SEPSIS BUNDLE — antibiotics never go in before the blood cultures are",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 147,
"url": "https://soma-lang.dev/corpus/medical/sepsis_bundle.cell"
},
{
"id": "medical/sterilization",
"title": "AUTOCLAVE STERILIZATION — a failed cycle can never release instruments",
"features": [
"state_machine",
"invariant",
"try",
"lambda"
],
"lines": 159,
"url": "https://soma-lang.dev/corpus/medical/sterilization.cell"
},
{
"id": "medical/surgical_checklist",
"title": "SURGICAL SAFETY CHECKLIST — no incision before time-out, and the count",
"features": [
"state_machine",
"invariant",
"match",
"try"
],
"lines": 146,
"url": "https://soma-lang.dev/corpus/medical/surgical_checklist.cell"
},
{
"id": "medical/transplant",
"title": "ORGAN ALLOCATION — one organ, one recipient, and no taking it back once",
"features": [
"state_machine",
"try"
],
"lines": 145,
"url": "https://soma-lang.dev/corpus/medical/transplant.cell"
},
{
"id": "medical/triage",
"title": "EMERGENCY TRIAGE — the sickest patient is seen first, by construction",
"features": [
"invariant",
"try"
],
"lines": 123,
"url": "https://soma-lang.dev/corpus/medical/triage.cell"
},
{
"id": "records/address_book",
"title": "Address book: Contact records stored in a Map slot, round-tripped through storage, and queried",
"features": [],
"lines": 49,
"url": "https://soma-lang.dev/corpus/records/address_book.cell"
},
{
"id": "records/bank",
"title": "Bank accounts as Account records kept in a persistent Map slot, with deposit/withdraw that read, mutate, and write the record back",
"features": [],
"lines": 57,
"url": "https://soma-lang.dev/corpus/records/bank.cell"
},
{
"id": "records/bst",
"title": "Binary search tree built from Node records with nested `left`/`right` children",
"features": [
"pipeline"
],
"lines": 68,
"url": "https://soma-lang.dev/corpus/records/bst.cell"
},
{
"id": "records/config",
"title": "Nested config record with defaults, merge-style overrides, and a deep-path reader",
"features": [
"match"
],
"lines": 58,
"url": "https://soma-lang.dev/corpus/records/config.cell"
},
{
"id": "records/ecs",
"title": "Entity-Component shape: each Entity record carries a bag of components (position, velocity, health) as nested records",
"features": [
"pipeline",
"lambda"
],
"lines": 60,
"url": "https://soma-lang.dev/corpus/records/ecs.cell"
},
{
"id": "records/employees",
"title": "Employee directory: records driving group_by / agg / inner_join style reporting",
"features": [
"pipeline",
"lambda"
],
"lines": 54,
"url": "https://soma-lang.dev/corpus/records/employees.cell"
},
{
"id": "records/family_tree",
"title": "Family tree: Person records with a list of `children` records, walked recursively",
"features": [
"pipeline"
],
"lines": 71,
"url": "https://soma-lang.dev/corpus/records/family_tree.cell"
},
{
"id": "records/geometry",
"title": "Geometry: Point and Rect records with computed properties",
"features": [],
"lines": 46,
"url": "https://soma-lang.dev/corpus/records/geometry.cell"
},
{
"id": "records/inventory",
"title": "Inventory: a list of Item records with in-place quantity mutation, restock/sell operations, and aggregate reporting via pipelines",
"features": [
"pipeline",
"lambda"
],
"lines": 59,
"url": "https://soma-lang.dev/corpus/records/inventory.cell"
},
{
"id": "records/json_roundtrip",
"title": "Records and JSON: serialize a record to a JSON string and parse it back",
"features": [],
"lines": 47,
"url": "https://soma-lang.dev/corpus/records/json_roundtrip.cell"
},
{
"id": "records/kanban",
"title": "Kanban board: Card records stored by id in a Map slot, moved between columns by mutating a field and writing back",
"features": [
"pipeline",
"lambda"
],
"lines": 55,
"url": "https://soma-lang.dev/corpus/records/kanban.cell"
},
{
"id": "records/linkedlist",
"title": "Singly linked list built from Node records whose `next` field is either another Node or () for the tail",
"features": [],
"lines": 74,
"url": "https://soma-lang.dev/corpus/records/linkedlist.cell"
},
{
"id": "records/orders",
"title": "Order records with nested line-items, computed totals, and a state machine over the order lifecycle",
"features": [
"state_machine",
"sum_type",
"pipeline",
"lambda"
],
"lines": 58,
"url": "https://soma-lang.dev/corpus/records/orders.cell"
},
{
"id": "records/playlist",
"title": "Playlist as an ordered list of Track records",
"features": [
"pipeline",
"lambda"
],
"lines": 50,
"url": "https://soma-lang.dev/corpus/records/playlist.cell"
},
{
"id": "records/record_ops",
"title": "Functional record updates: with / without / merge produce new records without mutating the original",
"features": [
"pipeline"
],
"lines": 51,
"url": "https://soma-lang.dev/corpus/records/record_ops.cell"
},
{
"id": "records/shapes_typed",
"title": "Typed record literals and runtime type tags",
"features": [],
"lines": 46,
"url": "https://soma-lang.dev/corpus/records/shapes_typed.cell"
},
{
"id": "records/students",
"title": "Gradebook: Student records each holding a list of Score records",
"features": [
"pipeline",
"match",
"lambda"
],
"lines": 58,
"url": "https://soma-lang.dev/corpus/records/students.cell"
},
{
"id": "safety_interlocks/autoclave_door",
"title": "AUTOCLAVE DOOR — a quick-opening door never unlocks under pressure",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 96,
"url": "https://soma-lang.dev/corpus/safety_interlocks/autoclave_door.cell"
},
{
"id": "safety_interlocks/blast_furnace_door",
"title": "BLAST FURNACE TOP — never open a door against live CO gas",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 83,
"url": "https://soma-lang.dev/corpus/safety_interlocks/blast_furnace_door.cell"
},
{
"id": "safety_interlocks/chlorine_dosing",
"title": "CHLORINE DOSING — no chemical feed without proven water flow",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 88,
"url": "https://soma-lang.dev/corpus/safety_interlocks/chlorine_dosing.cell"
},
{
"id": "safety_interlocks/conveyor_pullcord",
"title": "GRAIN CONVEYOR PULL-CORD — a latched trip, and a broken safety circuit that stays broken",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 88,
"url": "https://soma-lang.dev/corpus/safety_interlocks/conveyor_pullcord.cell"
},
{
"id": "safety_interlocks/crane_load_moment",
"title": "CRANE LOAD MOMENT — the tipping write is refused by the ledger",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 90,
"url": "https://soma-lang.dev/corpus/safety_interlocks/crane_load_moment.cell"
},
{
"id": "safety_interlocks/drawbridge",
"title": "DRAWBRIDGE — the span never moves while the deck is open to traffic",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 85,
"url": "https://soma-lang.dev/corpus/safety_interlocks/drawbridge.cell"
},
{
"id": "safety_interlocks/gas_burner_purge",
"title": "GAS BURNER IGNITION — purge before spark, lockout is forever",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 82,
"url": "https://soma-lang.dev/corpus/safety_interlocks/gas_burner_purge.cell"
},
{
"id": "safety_interlocks/lockout_tagout",
"title": "LOCKOUT/TAGOUT — a machine with a personal lock on it cannot start",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 91,
"url": "https://soma-lang.dev/corpus/safety_interlocks/lockout_tagout.cell"
},
{
"id": "safety_interlocks/mine_hoist",
"title": "MINE HOIST — no motion with the gate open, and a trip is forever",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 86,
"url": "https://soma-lang.dev/corpus/safety_interlocks/mine_hoist.cell"
},
{
"id": "safety_interlocks/pig_trap_closure",
"title": "PIPELINE PIG TRAP — the closure never opens against trapped pressure",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 99,
"url": "https://soma-lang.dev/corpus/safety_interlocks/pig_trap_closure.cell"
},
{
"id": "safety_interlocks/pressure_relief",
"title": "PRESSURE RELIEF VALVE — a live vessel can never lose its relief path",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 88,
"url": "https://soma-lang.dev/corpus/safety_interlocks/pressure_relief.cell"
},
{
"id": "safety_interlocks/railway_block",
"title": "RAILWAY BLOCK SIGNALING — two trains never share a block",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 80,
"url": "https://soma-lang.dev/corpus/safety_interlocks/railway_block.cell"
},
{
"id": "safety_interlocks/robot_cell_gate",
"title": "ROBOT CELL GATE — full-speed automation only behind a closed gate",
"features": [
"state_machine",
"invariant",
"try",
"guard"
],
"lines": 84,
"url": "https://soma-lang.dev/corpus/safety_interlocks/robot_cell_gate.cell"
},
{
"id": "safety_interlocks/two_hand_press",
"title": "TWO-HAND PRESS CONTROL — anti-tie-down, anti-repeat, structural",
"features": [
"state_machine",
"invariant",
"try"
],
"lines": 78,
"url": "https://soma-lang.dev/corpus/safety_interlocks/two_hand_press.cell"
},
{
"id": "services/payments_approval",
"title": "PAYMENTS APPROVAL — a whole service in one file: a ledger that cannot",
"features": [
"state_machine",
"invariant",
"http",
"match",
"try",
"fail",
"multi_cell",
"service"
],
"lines": 165,
"url": "https://soma-lang.dev/corpus/services/payments_approval.cell"
},
{
"id": "services/refund_agent",
"title": "REFUND AGENT — an LLM decides, the language decides what it may do",
"features": [
"state_machine",
"invariant",
"agent",
"sum_type",
"think",
"match",
"try",
"guard",
"fail",
"cost",
"tools"
],
"lines": 162,
"url": "https://soma-lang.dev/corpus/services/refund_agent.cell"
},
{
"id": "services/warehouse_reservations",
"title": "WAREHOUSE RESERVATIONS — two cells: a stock ledger with hard bounds and a reservation lifecycle with a supervisor guard, behind one HTTP router",
"features": [
"state_machine",
"invariant",
"http",
"match",
"try",
"guard",
"fail",
"multi_cell",
"service"
],
"lines": 187,
"url": "https://soma-lang.dev/corpus/services/warehouse_reservations.cell"
},
{
"id": "state_machines/document_review",
"title": "Document editorial workflow with a typed (sum-type) state machine",
"features": [
"state_machine",
"sum_type"
],
"lines": 59,
"url": "https://soma-lang.dev/corpus/state_machines/document_review.cell"
},
{
"id": "state_machines/elevator",
"title": "An elevator door + motion interlock",
"features": [
"state_machine"
],
"lines": 60,
"url": "https://soma-lang.dev/corpus/state_machines/elevator.cell"
},
{
"id": "state_machines/expense_approval",
"title": "Multi-step expense-approval workflow with guarded transitions",
"features": [
"state_machine",
"invariant",
"fail"
],
"lines": 81,
"url": "https://soma-lang.dev/corpus/state_machines/expense_approval.cell"
},
{
"id": "state_machines/game_match",
"title": "Online game-match lifecycle",
"features": [
"state_machine",
"invariant",
"match"
],
"lines": 81,
"url": "https://soma-lang.dev/corpus/state_machines/game_match.cell"
},
{
"id": "state_machines/media_player",
"title": "A media-player transport state machine",
"features": [
"state_machine",
"sum_type"
],
"lines": 57,
"url": "https://soma-lang.dev/corpus/state_machines/media_player.cell"
},
{
"id": "state_machines/order_lifecycle",
"title": "Order lifecycle as a typed state machine",
"features": [
"state_machine",
"sum_type"
],
"lines": 58,
"url": "https://soma-lang.dev/corpus/state_machines/order_lifecycle.cell"
},
{
"id": "state_machines/shipment_tracking",
"title": "Parcel shipment tracking with a delivery-exception loop",
"features": [
"state_machine"
],
"lines": 67,
"url": "https://soma-lang.dev/corpus/state_machines/shipment_tracking.cell"
},
{
"id": "state_machines/subscription_billing",
"title": "Subscription billing state machine",
"features": [
"state_machine",
"invariant"
],
"lines": 93,
"url": "https://soma-lang.dev/corpus/state_machines/subscription_billing.cell"
},
{
"id": "state_machines/support_ticket",
"title": "Support-ticket lifecycle with a reopen path",
"features": [
"state_machine"
],
"lines": 60,
"url": "https://soma-lang.dev/corpus/state_machines/support_ticket.cell"
},
{
"id": "state_machines/tcp_connection",
"title": "A simplified TCP connection state machine (active-open path)",
"features": [
"state_machine",
"sum_type"
],
"lines": 58,
"url": "https://soma-lang.dev/corpus/state_machines/tcp_connection.cell"
},
{
"id": "state_machines/thermostat",
"title": "An HVAC thermostat control loop",
"features": [
"state_machine",
"fail"
],
"lines": 75,
"url": "https://soma-lang.dev/corpus/state_machines/thermostat.cell"
},
{
"id": "state_machines/traffic_interlock",
"title": "A two-road traffic-light interlock proven safe by construction",
"features": [
"state_machine",
"match"
],
"lines": 62,
"url": "https://soma-lang.dev/corpus/state_machines/traffic_interlock.cell"
},
{
"id": "state_machines/turnstile",
"title": "A coin-operated turnstile — the textbook two-state machine, plus an out-of-service state reachable only via maintenance",
"features": [
"state_machine"
],
"lines": 76,
"url": "https://soma-lang.dev/corpus/state_machines/turnstile.cell"
},
{
"id": "state_machines/vending_machine",
"title": "A vending machine state machine",
"features": [
"state_machine",
"invariant",
"fail"
],
"lines": 89,
"url": "https://soma-lang.dev/corpus/state_machines/vending_machine.cell"
},
{
"id": "text/acronym",
"title": "Acronym / initials — first letter of each word, uppercased \"Portable Network Graphics\" -> \"PNG\"",
"features": [
"pipeline",
"lambda"
],
"lines": 43,
"url": "https://soma-lang.dev/corpus/text/acronym.cell"
},
{
"id": "text/anagram",
"title": "Anagram check — same multiset of letters Two strings are anagrams iff sorting their letters yields the same string",
"features": [],
"lines": 41,
"url": "https://soma-lang.dev/corpus/text/anagram.cell"
},
{
"id": "text/caesar",
"title": "Caesar cipher — shift letters using an alphabet lookup",
"features": [],
"lines": 49,
"url": "https://soma-lang.dev/corpus/text/caesar.cell"
},
{
"id": "text/csv",
"title": "CSV split/join — parse rows and project columns",
"features": [
"pipeline",
"lambda"
],
"lines": 54,
"url": "https://soma-lang.dev/corpus/text/csv.cell"
},
{
"id": "text/csv_to_markdown",
"title": "CSV to Markdown table — render rows as a pipe-delimited table",
"features": [
"pipeline",
"lambda"
],
"lines": 49,
"url": "https://soma-lang.dev/corpus/text/csv_to_markdown.cell"
},
{
"id": "text/number_to_words",
"title": "Number to words — spell out integers 0..999 Composes English number words from ones/teens/tens tables",
"features": [],
"lines": 66,
"url": "https://soma-lang.dev/corpus/text/number_to_words.cell"
},
{
"id": "text/pad_align",
"title": "Padding & alignment — left/right pad to a fixed width Builds padding by appending a fill character until the target width is met",
"features": [],
"lines": 52,
"url": "https://soma-lang.dev/corpus/text/pad_align.cell"
},
{
"id": "text/palindrome",
"title": "Palindrome check — punctuation- and case-insensitive Strips everything but letters/digits, lowercases, then compares the cleaned string against its reverse",
"features": [],
"lines": 54,
"url": "https://soma-lang.dev/corpus/text/palindrome.cell"
},
{
"id": "text/reverse_words",
"title": "Reverse word order — \"hello world\" -> \"world hello\" Splits on spaces, reverses the resulting list, and re-joins",
"features": [
"pipeline",
"lambda"
],
"lines": 46,
"url": "https://soma-lang.dev/corpus/text/reverse_words.cell"
},
{
"id": "text/rot13",
"title": "ROT13 — self-inverse letter rotation Rotates each letter by 13, preserving case; applying it twice restores the original",
"features": [],
"lines": 45,
"url": "https://soma-lang.dev/corpus/text/rot13.cell"
},
{
"id": "text/run_length",
"title": "Run-length encoding — compress repeated characters \"aaabbc\" -> \"a3b2c1\"",
"features": [],
"lines": 66,
"url": "https://soma-lang.dev/corpus/text/run_length.cell"
},
{
"id": "text/slugify",
"title": "Slugify — turn a title into a URL-safe slug",
"features": [],
"lines": 45,
"url": "https://soma-lang.dev/corpus/text/slugify.cell"
},
{
"id": "text/substring_search",
"title": "Substring search — count and locate occurrences",
"features": [],
"lines": 49,
"url": "https://soma-lang.dev/corpus/text/substring_search.cell"
},
{
"id": "text/template",
"title": "Tiny template renderer — substitute [[key]] placeholders Fills each [[key]] in a template with its value",
"features": [],
"lines": 43,
"url": "https://soma-lang.dev/corpus/text/template.cell"
},
{
"id": "text/title_case",
"title": "Title case — capitalize the first letter of every word Splits on spaces, uppercases each word's first character and lowercases the rest, then re-joins",
"features": [
"pipeline",
"lambda"
],
"lines": 40,
"url": "https://soma-lang.dev/corpus/text/title_case.cell"
},
{
"id": "text/tokenizer",
"title": "Tokenizer — split text into normalized word tokens Lowercases the input, replaces punctuation with spaces, then splits on whitespace and drops empty fragments",
"features": [
"pipeline",
"lambda"
],
"lines": 45,
"url": "https://soma-lang.dev/corpus/text/tokenizer.cell"
},
{
"id": "text/vowel_count",
"title": "Vowel / consonant counter Walks each character, classifying letters as vowels or consonants and ignoring everything else",
"features": [],
"lines": 55,
"url": "https://soma-lang.dev/corpus/text/vowel_count.cell"
},
{
"id": "text/word_frequency",
"title": "Word frequency — count occurrences of each word Splits a sentence into words and tallies each into a Map using a list-of words walk",
"features": [],
"lines": 54,
"url": "https://soma-lang.dev/corpus/text/word_frequency.cell"
},
{
"id": "web/blog_tags",
"title": "Mini blog API with tag filtering",
"features": [
"http",
"pipeline",
"match",
"lambda"
],
"lines": 61,
"url": "https://soma-lang.dev/corpus/web/blog_tags.cell"
},
{
"id": "web/contact_form",
"title": "Form handler with server-side validation",
"features": [
"http",
"match"
],
"lines": 54,
"url": "https://soma-lang.dev/corpus/web/contact_form.cell"
},
{
"id": "web/counter_api",
"title": "Counter API: a persistent integer counter exposed over HTTP",
"features": [
"http",
"match"
],
"lines": 68,
"url": "https://soma-lang.dev/corpus/web/counter_api.cell"
},
{
"id": "web/feature_flags",
"title": "Feature-flag service: toggle named flags on/off, query state, list all",
"features": [
"http",
"match"
],
"lines": 61,
"url": "https://soma-lang.dev/corpus/web/feature_flags.cell"
},
{
"id": "web/guestbook",
"title": "Guestbook: append-only signed entries, rendered as a small HTML page",
"features": [
"http",
"match"
],
"lines": 66,
"url": "https://soma-lang.dev/corpus/web/guestbook.cell"
},
{
"id": "web/kv_store",
"title": "Key-value store API with namespaced keys and a bulk export endpoint",
"features": [
"http",
"match"
],
"lines": 65,
"url": "https://soma-lang.dev/corpus/web/kv_store.cell"
},
{
"id": "web/leaderboard",
"title": "Leaderboard API: submit a score, get the ranked top-N",
"features": [
"http",
"pipeline",
"match"
],
"lines": 86,
"url": "https://soma-lang.dev/corpus/web/leaderboard.cell"
},
{
"id": "web/metrics_api",
"title": "Metrics / health endpoint",
"features": [
"http",
"match"
],
"lines": 63,
"url": "https://soma-lang.dev/corpus/web/metrics_api.cell"
},
{
"id": "web/notes_crud",
"title": "CRUD JSON API over a persistent Map: notes with title + body",
"features": [
"http",
"match"
],
"lines": 77,
"url": "https://soma-lang.dev/corpus/web/notes_crud.cell"
},
{
"id": "web/paginated_list",
"title": "Paginated product list: GET /products?page=N&size=M slices a stored list",
"features": [
"http",
"match"
],
"lines": 57,
"url": "https://soma-lang.dev/corpus/web/paginated_list.cell"
},
{
"id": "web/poll_api",
"title": "Voting / poll API: fixed options, one counter per option, results sorted",
"features": [
"http",
"pipeline",
"match",
"lambda"
],
"lines": 63,
"url": "https://soma-lang.dev/corpus/web/poll_api.cell"
},
{
"id": "web/sessions",
"title": "Session/login toy: POST /login issues a token, GET /me/<token> returns the user, POST /logout invalidates it",
"features": [
"http",
"match"
],
"lines": 58,
"url": "https://soma-lang.dev/corpus/web/sessions.cell"
},
{
"id": "web/site_router",
"title": "Multi-page static site: home, about, and a dynamic greeting route",
"features": [
"http",
"match"
],
"lines": 42,
"url": "https://soma-lang.dev/corpus/web/site_router.cell"
},
{
"id": "web/todo_state",
"title": "Todo service backed by a typed state machine (sum type TodoStatus)",
"features": [
"state_machine",
"sum_type",
"http",
"match"
],
"lines": 82,
"url": "https://soma-lang.dev/corpus/web/todo_state.cell"
},
{
"id": "web/url_shortener",
"title": "URL shortener: POST a long URL, get a short code; GET the code redirects",
"features": [
"http",
"match"
],
"lines": 75,
"url": "https://soma-lang.dev/corpus/web/url_shortener.cell"
},
{
"id": "web/webhook_log",
"title": "Webhook receiver + event log",
"features": [
"http",
"pipeline",
"match",
"lambda"
],
"lines": 71,
"url": "https://soma-lang.dev/corpus/web/webhook_log.cell"
}
]
}