# Soma verified corpus — 319 programs (soma 2.5.0)


## aerospace

- [aerospace/autopilot_authority](https://soma-lang.dev/corpus/aerospace/autopilot_authority.cell): AUTOPILOT AUTHORITY — Aeroflot 593: the half-disconnected autopilot [state_machine, invariant, try]
- [aerospace/cabin_pressurization](https://soma-lang.dev/corpus/aerospace/cabin_pressurization.cell): CABIN PRESSURIZATION — Helios 522: the manual-mode takeoff, unrepresentable [state_machine, invariant, try]
- [aerospace/cargo_door](https://soma-lang.dev/corpus/aerospace/cargo_door.cell): CARGO DOOR — Turkish Airlines 981: "indicated locked" is not LOCKED [state_machine, invariant, try]
- [aerospace/docking_approach](https://soma-lang.dev/corpus/aerospace/docking_approach.cell): DOCKING APPROACH — Progress / Mir 1997: abort means ABORT [state_machine, invariant, try]
- [aerospace/fire_bottle](https://soma-lang.dev/corpus/aerospace/fire_bottle.cell): ENGINE FIRE BOTTLE — one-shot suppression, fuel off FIRST An engine fire bottle is halon under pressure, and it is ONE-SHOT [state_machine, invariant, try]
- [aerospace/fuel_crossfeed](https://soma-lang.dev/corpus/aerospace/fuel_crossfeed.cell): FUEL CROSSFEED — Air Transat 236: never feed a leak from the good tank [state_machine, invariant, try]
- [aerospace/gear_interlock](https://soma-lang.dev/corpus/aerospace/gear_interlock.cell): LANDING GEAR — weight-on-wheels interlock, made unrepresentable [state_machine, invariant, try]
- [aerospace/launch_commit](https://soma-lang.dev/corpus/aerospace/launch_commit.cell): LAUNCH COMMIT CRITERIA — Challenger: no waiver path to ignition [state_machine, invariant, try]
- [aerospace/oxygen_tank_heater](https://soma-lang.dev/corpus/aerospace/oxygen_tank_heater.cell): CRYO TANK HEATER — Apollo 13: the thermostat that welded shut [state_machine, invariant, try]
- [aerospace/parachute_sequence](https://soma-lang.dev/corpus/aerospace/parachute_sequence.cell): 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 [state_machine, invariant, try]
- [aerospace/range_safety](https://soma-lang.dev/corpus/aerospace/range_safety.cell): RANGE SAFETY — the flight termination system's three one-way doors [state_machine, invariant, try]
- [aerospace/stage_separation](https://soma-lang.dev/corpus/aerospace/stage_separation.cell): STAGE SEPARATION — the ascent sequence as a proven order [state_machine, invariant, try]
- [aerospace/tcas_ra](https://soma-lang.dev/corpus/aerospace/tcas_ra.cell): TCAS RESOLUTION ADVISORY — Überlingen: the opposite maneuver is no state [state_machine, invariant, try]
- [aerospace/thrust_reverser](https://soma-lang.dev/corpus/aerospace/thrust_reverser.cell): THRUST REVERSER — Lauda Air 004: in-flight deployment, made structural [state_machine, invariant, try]
- [aerospace/unreliable_airspeed](https://soma-lang.dev/corpus/aerospace/unreliable_airspeed.cell): 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 [state_machine, invariant, try]

## agents

- [agents/approval_gate](https://soma-lang.dev/corpus/agents/approval_gate.cell): Human-in-the-loop approval gate guarding an irreversible action [state_machine, agent]
- [agents/bounded_retry](https://soma-lang.dev/corpus/agents/bounded_retry.cell): Bounded-retry agent — the verified-termination poster child [state_machine, agent]
- [agents/budget_guard](https://soma-lang.dev/corpus/agents/budget_guard.cell): Token-budget enforcement, made testable [state_machine, agent, think, try]
- [agents/guarded_agent](https://soma-lang.dev/corpus/agents/guarded_agent.cell): Agent with preconditions and a memory invariant — refuses bad input [state_machine, invariant, agent, fail]
- [agents/memory_agent](https://soma-lang.dev/corpus/agents/memory_agent.cell): Agent with persistent memory via remember()/recall() [state_machine, agent, think, try]
- [agents/multi_agent_pipeline](https://soma-lang.dev/corpus/agents/multi_agent_pipeline.cell): Multi-agent content pipeline with verified handoffs [state_machine, agent, multi_cell]
- [agents/planner](https://soma-lang.dev/corpus/agents/planner.cell): Planning agent: decompose a goal into ordered subtasks, then execute [state_machine, agent, fail]
- [agents/react_calculator](https://soma-lang.dev/corpus/agents/react_calculator.cell): A ReAct-style agent whose tools are real, deterministic computations [state_machine, agent, think, pipeline, try, lambda, tools]
- [agents/sentiment_router](https://soma-lang.dev/corpus/agents/sentiment_router.cell): Sentiment-routing agent: classify a message, route by polarity [state_machine, agent, think, match, tools]
- [agents/tool_dispatcher](https://soma-lang.dev/corpus/agents/tool_dispatcher.cell): Reflective tool-dispatch agent: routes a named action to the right tool [state_machine, agent, think, match, try, tools]
- [agents/trace_audit](https://soma-lang.dev/corpus/agents/trace_audit.cell): Self-auditing agent: it inspects its own execution trace [state_machine, agent, think, try, tools]
- [agents/triage_agent](https://soma-lang.dev/corpus/agents/triage_agent.cell): Support-ticket triage agent [state_machine, agent, think, tools]
- [agents/turn_bounded_chat](https://soma-lang.dev/corpus/agents/turn_bounded_chat.cell): Turn-bounded conversation agent — proves a chat loop terminates [state_machine, agent, think, try, fail]
- [agents/typed_lifecycle](https://soma-lang.dev/corpus/agents/typed_lifecycle.cell): Agent lifecycle typed against a sum type — typos become compile errors [state_machine, agent, sum_type, match]
- [agents/verified_termination](https://soma-lang.dev/corpus/agents/verified_termination.cell): The killer feature: an agent whose termination is PROVEN by soma verify [state_machine, agent, think, try]

## algorithms

- [algorithms/bfs](https://soma-lang.dev/corpus/algorithms/bfs.cell): Breadth-first search on a small directed graph represented as an adjacency Map<String, List> []
- [algorithms/binary_search_list](https://soma-lang.dev/corpus/algorithms/binary_search_list.cell): Binary search over a sorted List<Int> — returns the index or -1 []
- [algorithms/bubble_sort](https://soma-lang.dev/corpus/algorithms/bubble_sort.cell): Bubble sort over a list, with the classic early-exit optimization []
- [algorithms/counting_sort](https://soma-lang.dev/corpus/algorithms/counting_sort.cell): 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 []
- [algorithms/dfs](https://soma-lang.dev/corpus/algorithms/dfs.cell): Depth-first search on a directed graph: preorder traversal and cycle detection via the classic white/grey/black coloring []
- [algorithms/edit_distance](https://soma-lang.dev/corpus/algorithms/edit_distance.cell): Levenshtein edit distance — classic 2D dynamic programming []
- [algorithms/fibonacci_memo](https://soma-lang.dev/corpus/algorithms/fibonacci_memo.cell): Fibonacci three ways: naive recursion, bottom-up iteration, and a memoized version backed by a [persistent] memory slot []
- [algorithms/gcd_lcm](https://soma-lang.dev/corpus/algorithms/gcd_lcm.cell): Euclid's algorithm: GCD (iterative + recursive), LCM, the extended Euclid algorithm returning Bezout coefficients, and a coprimality check []
- [algorithms/insertion_sort](https://soma-lang.dev/corpus/algorithms/insertion_sort.cell): Insertion sort and binary insertion sort on a List<Int> []
- [algorithms/knapsack](https://soma-lang.dev/corpus/algorithms/knapsack.cell): 0/1 knapsack — maximize value within a weight budget via 2D DP []
- [algorithms/lis](https://soma-lang.dev/corpus/algorithms/lis.cell): Longest increasing subsequence (LIS) — O(n^2) dynamic programming []
- [algorithms/merge_sort](https://soma-lang.dev/corpus/algorithms/merge_sort.cell): Merge sort on a List<Int> — top-down, purely functional []
- [algorithms/min_coins](https://soma-lang.dev/corpus/algorithms/min_coins.cell): Coin change, minimum number of coins to make an amount (unbounded knapsack) []
- [algorithms/queue](https://soma-lang.dev/corpus/algorithms/queue.cell): A FIFO queue and a sliding-window maximum over a List []
- [algorithms/quicksort](https://soma-lang.dev/corpus/algorithms/quicksort.cell): Quicksort on a List<Int> — Lomuto partition, recursive []
- [algorithms/stack](https://soma-lang.dev/corpus/algorithms/stack.cell): A stack (LIFO) backed by a List, used to check balanced brackets [match]
- [algorithms/two_sum](https://soma-lang.dev/corpus/algorithms/two_sum.cell): Two-sum with a hash set, and the count of distinct pairs summing to a target []
- [algorithms/word_count](https://soma-lang.dev/corpus/algorithms/word_count.cell): Word frequency counting with a Map<String, Int> — the canonical hash-map histogram []

## civic

- [civic/campaign_finance](https://soma-lang.dev/corpus/civic/campaign_finance.cell): CAMPAIGN FINANCE — the contribution limit lives in the ledger, not the law [state_machine, invariant, try]
- [civic/census](https://soma-lang.dev/corpus/civic/census.cell): 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 [state_machine, invariant, try]
- [civic/disaster_aid](https://soma-lang.dev/corpus/civic/disaster_aid.cell): DISASTER AID — one emergency grant per household, however many times asked [state_machine, invariant, try]
- [civic/election_audit](https://soma-lang.dev/corpus/civic/election_audit.cell): ELECTION AUDIT — a risk-limiting audit that cannot count a ballot twice [state_machine, invariant, try]
- [civic/foia](https://soma-lang.dev/corpus/civic/foia.cell): FOIA — the statutory clock cannot be silently ignored 5 U.S.C [state_machine, invariant, try]
- [civic/grants](https://soma-lang.dev/corpus/civic/grants.cell): GRANTS — budget conservation: the fund cannot award money it does not have [state_machine, invariant, try]
- [civic/jury](https://soma-lang.dev/corpus/civic/jury.cell): JURY — strikes are counted by the bench, not by the honor system [state_machine, invariant, try]
- [civic/land_registry](https://soma-lang.dev/corpus/civic/land_registry.cell): LAND REGISTRY — a parcel cannot be sold to two buyers at once [state_machine, invariant, try]
- [civic/lottery](https://soma-lang.dev/corpus/civic/lottery.cell): LOTTERY — committed entries, a published seed, and a draw that closes forever [state_machine, invariant, try]
- [civic/permit](https://soma-lang.dev/corpus/civic/permit.cell): PERMIT — a building permit that cannot skip a review [state_machine, invariant, try]
- [civic/petition](https://soma-lang.dev/corpus/civic/petition.cell): PETITION — one signature per citizen, a wall in memory, not a clerk's eye [state_machine, invariant, try]
- [civic/procurement](https://soma-lang.dev/corpus/civic/procurement.cell): PROCUREMENT — sealed bids stay sealed, and the unsealing ends the auction [state_machine, invariant, try]
- [civic/sunshine](https://soma-lang.dev/corpus/civic/sunshine.cell): SUNSHINE — a council cannot vote on what the public never got to discuss [state_machine, invariant, try]
- [civic/vital_records](https://soma-lang.dev/corpus/civic/vital_records.cell): VITAL RECORDS — a person dies at most once, and benefits know it instantly [state_machine, invariant, try]

## data

- [data/ab_test](https://soma-lang.dev/corpus/data/ab_test.cell): A/B test rollup: per-variant conversions and lift over control [pipeline, lambda]
- [data/basket_analysis](https://soma-lang.dev/corpus/data/basket_analysis.cell): Market-basket analysis: transactions of (order, product) lines [pipeline]
- [data/cohort_retention](https://soma-lang.dev/corpus/data/cohort_retention.cell): Cohort analysis: bucket users by signup month, then measure how many were still active in a later month [pipeline, lambda]
- [data/csv_transform](https://soma-lang.dev/corpus/data/csv_transform.cell): CSV-shaped transform: clean -> derive -> project [pipeline, lambda]
- [data/dedup_events](https://soma-lang.dev/corpus/data/dedup_events.cell): Deduplication of an event stream with distinct() [pipeline]
- [data/expense_tracker](https://soma-lang.dev/corpus/data/expense_tracker.cell): Expense report over a List<Map> of line items [pipeline, lambda]
- [data/funnel](https://soma-lang.dev/corpus/data/funnel.cell): Conversion funnel: count distinct users reaching each stage, then compute step-to-step conversion rates [pipeline]
- [data/group_reduce](https://soma-lang.dev/corpus/data/group_reduce.cell): 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) [pipeline, lambda]
- [data/inner_join_orders](https://soma-lang.dev/corpus/data/inner_join_orders.cell): Relational inner_join: enrich order rows with customer details, then roll up spend per customer tier [pipeline, match]
- [data/leaderboard](https://soma-lang.dev/corpus/data/leaderboard.cell): Game leaderboard: rank players by score, award medals, compute gaps [pipeline]
- [data/left_join_inventory](https://soma-lang.dev/corpus/data/left_join_inventory.cell): left_join keeps every left row even when the right side has no match [pipeline, lambda]
- [data/log_analysis](https://soma-lang.dev/corpus/data/log_analysis.cell): Web access log analysis over List<Map> entries [pipeline]
- [data/record_pipeline](https://soma-lang.dev/corpus/data/record_pipeline.cell): Pipeline over typed Record literals (Name { field: v }) instead of map() [pipeline]
- [data/sales_report](https://soma-lang.dev/corpus/data/sales_report.cell): Sales report: a List<Map> of orders rolled up by region and category [pipeline]
- [data/stream_ingest](https://soma-lang.dev/corpus/data/stream_ingest.cell): Streaming ingest pipeline: push records into an ephemeral buffer slot, then aggregate the buffer in the same handler [pipeline]
- [data/survey_scores](https://soma-lang.dev/corpus/data/survey_scores.cell): Survey scoring: normalize raw responses, roll up per question, and flag low-confidence questions [pipeline, lambda]
- [data/topn_movies](https://soma-lang.dev/corpus/data/topn_movies.cell): Top-N and bottom-N reporting over a movie ratings table [pipeline]

## devops

- [devops/backup_retention](https://soma-lang.dev/corpus/devops/backup_retention.cell): BACKUP RETENTION — the floor you cannot prune through [state_machine, invariant, try]
- [devops/blue_green_cutover](https://soma-lang.dev/corpus/devops/blue_green_cutover.cell): BLUE/GREEN CUTOVER — there is no state where nobody serves traffic [state_machine, invariant, try]
- [devops/cert_rotation](https://soma-lang.dev/corpus/devops/cert_rotation.cell): CERT ROTATION — expiry is an escalation ladder, not a surprise [state_machine, invariant, try]
- [devops/db_migration](https://soma-lang.dev/corpus/devops/db_migration.cell): DB MIGRATION — applied migrations are immutable history [state_machine, invariant, try]
- [devops/deploy_canary](https://soma-lang.dev/corpus/devops/deploy_canary.cell): 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 [state_machine, invariant, try]
- [devops/dns_change_control](https://soma-lang.dev/corpus/devops/dns_change_control.cell): DNS CHANGE CONTROL — no record goes live without passing validation [state_machine, invariant, try]
- [devops/feature_flag_kill_switch](https://soma-lang.dev/corpus/devops/feature_flag_kill_switch.cell): 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 [state_machine, invariant, try]
- [devops/fleet_sync_activation](https://soma-lang.dev/corpus/devops/fleet_sync_activation.cell): FLEET SYNC — no activation until every node runs the same code [state_machine, invariant, try]
- [devops/image_promotion](https://soma-lang.dev/corpus/devops/image_promotion.cell): IMAGE PROMOTION — nothing unscanned, unsigned, or vulnerable ships [state_machine, invariant, try]
- [devops/incident_ladder](https://soma-lang.dev/corpus/devops/incident_ladder.cell): INCIDENT LADDER — severity only climbs, and closure needs a postmortem Two ways incident processes rot [state_machine, invariant, try]
- [devops/pager_escalation](https://soma-lang.dev/corpus/devops/pager_escalation.cell): PAGER ESCALATION — no page resolves without a human acknowledging it [state_machine, invariant, try]
- [devops/rate_limiter](https://soma-lang.dev/corpus/devops/rate_limiter.cell): RATE LIMITER — admission control with a quota the memory enforces [state_machine, invariant, try]
- [devops/secret_rotation](https://soma-lang.dev/corpus/devops/secret_rotation.cell): SECRET ROTATION — a revoked credential never logs in again In 2016, attackers found Uber's AWS keys sitting in a private GitHub repo [state_machine, invariant, try]
- [devops/state_lock](https://soma-lang.dev/corpus/devops/state_lock.cell): STATE LOCK — two concurrent applies can never both hold the lock [state_machine, invariant, try]

## energy

- [energy/anti_islanding](https://soma-lang.dev/corpus/energy/anti_islanding.cell): 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 [state_machine, invariant, try]
- [energy/battery_soc](https://soma-lang.dev/corpus/energy/battery_soc.cell): BATTERY DISPATCH — the charge window is a wall, not a setpoint [invariant, try]
- [energy/black_start](https://soma-lang.dev/corpus/energy/black_start.cell): 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 [state_machine, invariant, try]
- [energy/breaker_reclose](https://soma-lang.dev/corpus/energy/breaker_reclose.cell): RECLOSER — a trip is permanent until a human walks the line [state_machine, invariant, try]
- [energy/demand_response](https://soma-lang.dev/corpus/energy/demand_response.cell): DEMAND RESPONSE — no payment before measurement, and settlement is final [state_machine, invariant, try]
- [energy/ev_charging](https://soma-lang.dev/corpus/energy/ev_charging.cell): EV CHARGING — no current before the handshake, no session past the cap Two real failure modes, one charging post [state_machine, invariant, try]
- [energy/gas_purge](https://soma-lang.dev/corpus/energy/gas_purge.cell): GAS TURBINE LIGHT-OFF — purge before every ignition attempt, no exceptions [state_machine, invariant, try]
- [energy/generator_sync](https://soma-lang.dev/corpus/energy/generator_sync.cell): GENERATOR PARALLELING — sync-check before the breaker, always [state_machine, invariant, try]
- [energy/load_shedding](https://soma-lang.dev/corpus/energy/load_shedding.cell): LOAD SHEDDING — the transformer's nameplate is a wall, hospitals shed last [invariant, try]
- [energy/meter_billing](https://soma-lang.dev/corpus/energy/meter_billing.cell): METER BILLING — you are billed exactly what the meter read, once [state_machine, invariant, match, try]
- [energy/spillway_gates](https://soma-lang.dev/corpus/energy/spillway_gates.cell): SPILLWAY GATES — a dam may never lose its last release path [state_machine, invariant, try]
- [energy/spinning_reserve](https://soma-lang.dev/corpus/energy/spinning_reserve.cell): SPINNING RESERVE — every megawatt you sell must claim real iron [invariant, try]
- [energy/substation_loto](https://soma-lang.dev/corpus/energy/substation_loto.cell): LOCKOUT-TAGOUT — test before touch, and nobody re-energizes over a lock [state_machine, invariant, try]
- [energy/transformer_overload](https://soma-lang.dev/corpus/energy/transformer_overload.cell): TRANSFORMER EMERGENCY LOADING — overload only with every fan running [state_machine, invariant, try]
- [energy/wind_overspeed](https://soma-lang.dev/corpus/energy/wind_overspeed.cell): WIND TURBINE OVERSPEED — after an emergency brake, inspection or nothing [state_machine, invariant, try]

## escrow_finance

- [escrow_finance/chargeback_window](https://soma-lang.dev/corpus/escrow_finance/chargeback_window.cell): CHARGEBACK WINDOW — disputes die at day 120, reversals happen exactly once Card networks give cardholders ~120 days to dispute a charge [state_machine, invariant]
- [escrow_finance/client_money_segregation](https://soma-lang.dev/corpus/escrow_finance/client_money_segregation.cell): CLIENT MONEY SEGREGATION — the firm can only ever touch its own excess [invariant]
- [escrow_finance/crowdfund_all_or_nothing](https://soma-lang.dev/corpus/escrow_finance/crowdfund_all_or_nothing.cell): ALL-OR-NOTHING CROWDFUNDING — miss the goal, every backer gets refunded The all-or-nothing pledge model only works if "nothing" is enforced [state_machine, invariant]
- [escrow_finance/dividend_pool](https://soma-lang.dev/corpus/escrow_finance/dividend_pool.cell): DIVIDEND DISTRIBUTION — payments can never exceed the declared pool [state_machine, invariant]
- [escrow_finance/dvp_settlement](https://soma-lang.dev/corpus/escrow_finance/dvp_settlement.cell): DELIVERY-VERSUS-PAYMENT — no securities leave before the cash arrives [state_machine, invariant]
- [escrow_finance/invoice_factoring](https://soma-lang.dev/corpus/escrow_finance/invoice_factoring.cell): INVOICE FACTORING — no advance on unverified paper, no double-selling [state_machine, invariant]
- [escrow_finance/letter_of_credit](https://soma-lang.dev/corpus/escrow_finance/letter_of_credit.cell): LETTER OF CREDIT — the bank pays against verified documents, never trust [state_machine, invariant]
- [escrow_finance/loan_amortization](https://soma-lang.dev/corpus/escrow_finance/loan_amortization.cell): LOAN AMORTIZATION — principal never goes negative, never grows back [state_machine, invariant]
- [escrow_finance/milestone_escrow](https://soma-lang.dev/corpus/escrow_finance/milestone_escrow.cell): MILESTONE ESCROW — a contractor is paid per accepted milestone, never ahead [state_machine, invariant]
- [escrow_finance/multisig_disburse](https://soma-lang.dev/corpus/escrow_finance/multisig_disburse.cell): MULTISIG TREASURY — 2-of-3 distinct approvals, proven before a cent moves [state_machine, invariant]
- [escrow_finance/payroll_run](https://soma-lang.dev/corpus/escrow_finance/payroll_run.cell): PAYROLL RUN — the payslips must sum EXACTLY to the approved total [state_machine, invariant]
- [escrow_finance/security_deposit](https://soma-lang.dev/corpus/escrow_finance/security_deposit.cell): SECURITY DEPOSIT — deductions can never exceed what the tenant paid [state_machine, invariant]
- [escrow_finance/two_party_escrow](https://soma-lang.dev/corpus/escrow_finance/two_party_escrow.cell): TWO-PARTY ESCROW — funds move only when BOTH sides say so, and never leak [state_machine, invariant]
- [escrow_finance/vesting_schedule](https://soma-lang.dev/corpus/escrow_finance/vesting_schedule.cell): VESTING SCHEDULE — cliff then linear, and over-vesting is unwritable [state_machine, invariant]
- [escrow_finance/wire_dual_control](https://soma-lang.dev/corpus/escrow_finance/wire_dual_control.cell): WIRE DUAL CONTROL — the maker can never be the checker [state_machine, invariant]

## finance

- [finance/bond_pricer](https://soma-lang.dev/corpus/finance/bond_pricer.cell): Fixed-coupon bond pricing: present value of coupons plus redemption, current yield, and a par/premium/discount classifier []
- [finance/budget_tracker](https://soma-lang.dev/corpus/finance/budget_tracker.cell): Monthly budget tracker with a spend cap invariant [invariant, try]
- [finance/chip_ledger](https://soma-lang.dev/corpus/finance/chip_ledger.cell): Chip/cash ledger with a non-negative balance invariant [invariant, try]
- [finance/compound_interest](https://soma-lang.dev/corpus/finance/compound_interest.cell): Compound interest: future value, with periodic compounding and a continuous-compounding variant []
- [finance/currency_converter](https://soma-lang.dev/corpus/finance/currency_converter.cell): FX converter with a rate table in memory and a non-negative rate invariant [invariant, try]
- [finance/dividend_yield](https://soma-lang.dev/corpus/finance/dividend_yield.cell): Equity income metrics: dividend yield, payout ratio, dividend-discount (Gordon growth) fair value, and yield-on-cost []
- [finance/fee_calculator](https://soma-lang.dev/corpus/finance/fee_calculator.cell): Brokerage fee calculator: tiered commission, bps fee with a floor, and a maker/taker exchange fee [match]
- [finance/loan_amortization](https://soma-lang.dev/corpus/finance/loan_amortization.cell): Fixed-rate loan amortization: monthly payment, remaining balance after k payments, and total interest paid []
- [finance/moving_average](https://soma-lang.dev/corpus/finance/moving_average.cell): Moving averages over a price series: simple MA window, full-series mean, and a momentum signal from an SMA crossover []
- [finance/npv](https://soma-lang.dev/corpus/finance/npv.cell): Discounted cash flow: present value of a single flow, net present value of a cash-flow stream, and a simple payback-period count []
- [finance/option_payoff](https://soma-lang.dev/corpus/finance/option_payoff.cell): European option payoffs at expiry, plus a long straddle []
- [finance/order_lifecycle](https://soma-lang.dev/corpus/finance/order_lifecycle.cell): Order lifecycle as a verified state machine: an order flows from new to filled or rejected, and a fill settles [state_machine, guard]
- [finance/portfolio_pnl](https://soma-lang.dev/corpus/finance/portfolio_pnl.cell): Portfolio P&L tracker over a list of position records [pipeline, lambda]
- [finance/position_limit](https://soma-lang.dev/corpus/finance/position_limit.cell): Position-limit risk gate [invariant, try]
- [finance/returns_stats](https://soma-lang.dev/corpus/finance/returns_stats.cell): Return-series statistics: arithmetic mean return, volatility (sample stdev), annualized Sharpe ratio, and max drawdown of an equity curve []
- [finance/tax_brackets](https://soma-lang.dev/corpus/finance/tax_brackets.cell): Progressive income tax over marginal brackets, plus effective rate and marginal rate lookup []
- [finance/trade_settlement](https://soma-lang.dev/corpus/finance/trade_settlement.cell): Trade settlement as a sum type [sum_type, match]

## games

- [games/blackjack](https://soma-lang.dev/corpus/games/blackjack.cell): 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 [match]
- [games/card_deck](https://soma-lang.dev/corpus/games/card_deck.cell): Card deck — build, deterministic Fisher-Yates shuffle, and deal A 52-card deck is built as "Rank of Suit" strings []
- [games/connect_four](https://soma-lang.dev/corpus/games/connect_four.cell): Connect Four — drop a disc and detect four-in-a-row The board is a flat row-major 6x7 grid (row 0 = top) []
- [games/conway_life](https://soma-lang.dev/corpus/games/conway_life.cell): 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 []
- [games/craps](https://soma-lang.dev/corpus/games/craps.cell): 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" [match]
- [games/game_2048](https://soma-lang.dev/corpus/games/game_2048.cell): 2048 — slide-and-merge a single row (the core move primitive) []
- [games/guessing_game](https://soma-lang.dev/corpus/games/guessing_game.cell): Number guessing game — hi/lo feedback and a binary-search solver feedback() compares a guess to the secret and returns "low" / "high" / "correct" [match]
- [games/hanoi](https://soma-lang.dev/corpus/games/hanoi.cell): Tower of Hanoi — minimum moves and an explicit move list min_moves(n) = 2^n - 1 []
- [games/mastermind](https://soma-lang.dev/corpus/games/mastermind.cell): Mastermind — score a guess with black and white pegs Black pegs = right colour in the right position [match]
- [games/maze_step](https://soma-lang.dev/corpus/games/maze_step.cell): Maze movement — one step with wall collision on a grid The maze is a flat row-major list: 0 = open, 1 = wall []
- [games/minesweeper](https://soma-lang.dev/corpus/games/minesweeper.cell): Minesweeper — compute the neighbour-mine board from a mine layout mines is a flat row-major r×c list of 0/1 []
- [games/nim](https://soma-lang.dev/corpus/games/nim.cell): 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 []
- [games/pig_dice](https://soma-lang.dev/corpus/games/pig_dice.cell): Pig — the press-your-luck dice game, scored from a roll log [lambda]
- [games/rock_paper_scissors](https://soma-lang.dev/corpus/games/rock_paper_scissors.cell): Rock-paper-scissors — round judging and best-of-N scoring judge(a, b) returns "p1", "p2", or "tie" from the two throws [match]
- [games/snake](https://soma-lang.dev/corpus/games/snake.cell): Snake — one movement tick with growth, wall and self collision The snake is a list of {y, x} segments, head first [lambda]
- [games/tic_tac_toe](https://soma-lang.dev/corpus/games/tic_tac_toe.cell): Tic-tac-toe win detection — pure board logic A board is a flat list of 9 cells, each "X", "O", or "" (empty) [lambda]
- [games/turn_tracker](https://soma-lang.dev/corpus/games/turn_tracker.cell): Turn tracker — round/phase state machine with player rotation [state_machine]
- [games/war](https://soma-lang.dev/corpus/games/war.cell): War — the card-comparison game, played to exhaustion Each card is an integer rank 2..14 (J=11..A=14) []
- [games/yahtzee](https://soma-lang.dev/corpus/games/yahtzee.cell): Yahtzee — score a roll of five dice in any category counts() buckets the five dice into face frequencies [lambda]

## games_economy

- [games_economy/auction_house](https://soma-lang.dev/corpus/games_economy/auction_house.cell): AUCTION HOUSE — escrowed bids, gold that cannot be printed [state_machine, invariant, try]
- [games_economy/battle_pass](https://soma-lang.dev/corpus/games_economy/battle_pass.cell): BATTLE PASS — every tier reward claimed exactly once [state_machine, invariant, try]
- [games_economy/battle_turns](https://soma-lang.dev/corpus/games_economy/battle_turns.cell): BATTLE TURNS — nobody acts twice, and the dead stay dead [state_machine, invariant]
- [games_economy/crafting_forge](https://soma-lang.dev/corpus/games_economy/crafting_forge.cell): CRAFTING FORGE — ingredients consumed exactly once [state_machine, invariant, try]
- [games_economy/daily_chest](https://soma-lang.dev/corpus/games_economy/daily_chest.cell): DAILY CHEST — one claim per day, clock tricks be damned [state_machine, invariant, try]
- [games_economy/gem_store](https://soma-lang.dev/corpus/games_economy/gem_store.cell): GEM STORE — a purchase receipt credits exactly once [state_machine, invariant, try]
- [games_economy/guild_bank](https://soma-lang.dev/corpus/games_economy/guild_bank.cell): GUILD BANK — the heist needs a key an expelled member cannot hold [state_machine, invariant, try]
- [games_economy/harvest_node](https://soma-lang.dev/corpus/games_economy/harvest_node.cell): HARVEST NODE — one vein, one yield per respawn cycle [state_machine, invariant, try]
- [games_economy/loot_roll](https://soma-lang.dev/corpus/games_economy/loot_roll.cell): LOOT ROLL — one roll per raider, one award per drop [state_machine, invariant, try]
- [games_economy/loot_trade](https://soma-lang.dev/corpus/games_economy/loot_trade.cell): LOOT TRADE — an item exists in exactly one inventory, ever [state_machine, invariant, try]
- [games_economy/pity_banner](https://soma-lang.dev/corpus/games_economy/pity_banner.cell): PITY BANNER — the 90-pull guarantee that cannot be skipped Gacha games promise a "pity timer": a guaranteed top-rarity drop by pull 90 [invariant]
- [games_economy/season_ladder](https://soma-lang.dev/corpus/games_economy/season_ladder.cell): SEASONAL LADDER — decay you cannot dodge, ratings that cannot underflow Two real ladder failures [state_machine, invariant, try]
- [games_economy/stamina](https://soma-lang.dev/corpus/games_economy/stamina.cell): STAMINA — the energy bar that cannot be overfilled or driven negative Mobile-game energy systems are attacked two ways [invariant, try]
- [games_economy/tournament_bracket](https://soma-lang.dev/corpus/games_economy/tournament_bracket.cell): TOURNAMENT BRACKET — eliminated means eliminated [state_machine, match, try]
- [games_economy/veterancy_ranks](https://soma-lang.dev/corpus/games_economy/veterancy_ranks.cell): VETERANCY RANKS — promotion is earned and can never be rolled back [state_machine, invariant, try]
- [games_economy/wager_duel](https://soma-lang.dev/corpus/games_economy/wager_duel.cell): WAGER DUEL — staked gold that exactly one fighter can win [state_machine, invariant, match, try]

## governance

- [governance/amendment](https://soma-lang.dev/corpus/governance/amendment.cell): AMENDMENT — supermajority ratification, and a "yes" that cannot be unsaid [state_machine, invariant, try]
- [governance/anti_deficiency](https://soma-lang.dev/corpus/governance/anti_deficiency.cell): ANTI-DEFICIENCY — no obligation of funds Congress never appropriated The Anti-Deficiency Act (31 U.S.C [state_machine, invariant, try]
- [governance/auditor_independence](https://soma-lang.dev/corpus/governance/auditor_independence.cell): AUDITOR INDEPENDENCE — one firm, one client, ONE role In 2000, Arthur Andersen billed Enron $25 million for the audit — and $27 million for consulting [state_machine, invariant, try]
- [governance/board_motion](https://soma-lang.dev/corpus/governance/board_motion.cell): BOARD MOTION — Robert's Rules where "no quorum, no vote" is structural [state_machine, invariant, try]
- [governance/emergency_sunset](https://soma-lang.dev/corpus/governance/emergency_sunset.cell): EMERGENCY SUNSET — extraordinary powers that cannot become ordinary Egypt declared a state of emergency in 1981 after Sadat's assassination [state_machine, invariant, try]
- [governance/four_eyes_approval](https://soma-lang.dev/corpus/governance/four_eyes_approval.cell): FOUR-EYES APPROVAL — the maker cannot be the checker, by construction [state_machine, invariant, try]
- [governance/grant_milestones](https://soma-lang.dev/corpus/governance/grant_milestones.cell): GRANT MILESTONES — money moves only behind verified work, and only once [state_machine, invariant, try]
- [governance/judicial_recusal](https://soma-lang.dev/corpus/governance/judicial_recusal.cell): JUDICIAL RECUSAL — a conflicted judge cannot sit, and cases aren't shopped Caperton v [state_machine, invariant, try]
- [governance/minutes_adoption](https://soma-lang.dev/corpus/governance/minutes_adoption.cell): MINUTES ADOPTION — the corporate record cannot be edited after the fact [state_machine, invariant, try]
- [governance/open_meetings](https://soma-lang.dev/corpus/governance/open_meetings.cell): OPEN MEETINGS — no public decision without public notice, structurally Every U.S [state_machine, invariant, try]
- [governance/peer_review](https://soma-lang.dev/corpus/governance/peer_review.cell): PEER REVIEW — double-blind where the blind cannot be lifted early [state_machine, invariant, try]
- [governance/release_pipeline](https://soma-lang.dev/corpus/governance/release_pipeline.cell): RELEASE PIPELINE — "tests pass before deploy" as a theorem, not a habit [state_machine, invariant, try]
- [governance/sealed_bids](https://soma-lang.dev/corpus/governance/sealed_bids.cell): SEALED BIDS — the envelope opens once, for everyone, after the deadline [state_machine, invariant, try]
- [governance/term_limits](https://soma-lang.dev/corpus/governance/term_limits.cell): TERM LIMITS — the third term is not forbidden, it is unrepresentable [state_machine, invariant, try]
- [governance/three_readings](https://soma-lang.dev/corpus/governance/three_readings.cell): THREE READINGS — an ordinance cannot be law the night it is introduced [state_machine, invariant, try, fail]
- [governance/whistleblower_shield](https://soma-lang.dev/corpus/governance/whistleblower_shield.cell): WHISTLEBLOWER SHIELD — retaliation against a reporter is unrepresentable [state_machine, invariant, try]

## logistics

- [logistics/bonded_warehouse](https://soma-lang.dev/corpus/logistics/bonded_warehouse.cell): BONDED WAREHOUSE — no duty, no exit A customs bonded warehouse holds imported goods on which duty has NOT yet been paid [state_machine, invariant, try]
- [logistics/cold_chain_custody](https://soma-lang.dev/corpus/logistics/cold_chain_custody.cell): COLD-CHAIN CUSTODY — a warm vaccine never gets cold again [state_machine, invariant, try]
- [logistics/container_seal_custody](https://soma-lang.dev/corpus/logistics/container_seal_custody.cell): CONTAINER SEAL — a broken seal cannot be quietly replaced [state_machine, invariant, match, try]
- [logistics/container_weight](https://soma-lang.dev/corpus/logistics/container_weight.cell): CONTAINER WEIGHT — the misdeclared box that breaks the ship [state_machine, invariant, try]
- [logistics/customs_clearance](https://soma-lang.dev/corpus/logistics/customs_clearance.cell): CUSTOMS CLEARANCE — no release without an examination verdict [state_machine, invariant, try]
- [logistics/dock_door_interlock](https://soma-lang.dev/corpus/logistics/dock_door_interlock.cell): DOCK DOOR INTERLOCK — the trailer that drives off with the forklift [state_machine, try]
- [logistics/gate_appointment](https://soma-lang.dev/corpus/logistics/gate_appointment.cell): GATE APPOINTMENTS — a dock door cannot be double-booked [invariant]
- [logistics/hazmat_bay_segregation](https://soma-lang.dev/corpus/logistics/hazmat_bay_segregation.cell): HAZMAT BAY SEGREGATION — Beirut, as a state that cannot exist [state_machine, invariant, try]
- [logistics/inventory_conservation](https://soma-lang.dev/corpus/logistics/inventory_conservation.cell): INVENTORY CONSERVATION — stock never teleports, never goes negative [invariant, pipeline, try, lambda]
- [logistics/package_tracking](https://soma-lang.dev/corpus/logistics/package_tracking.cell): PACKAGE TRACKING — delivered is FOREVER [state_machine, invariant, try]
- [logistics/proof_of_delivery](https://soma-lang.dev/corpus/logistics/proof_of_delivery.cell): PROOF OF DELIVERY — no signature, no "delivered" [state_machine, try]
- [logistics/rack_slot_capacity](https://soma-lang.dev/corpus/logistics/rack_slot_capacity.cell): RACK SLOT CAPACITY — the pallet that brings down the aisle Warehouse racking collapses kill [invariant, try]
- [logistics/recall_quarantine](https://soma-lang.dev/corpus/logistics/recall_quarantine.cell): RECALL QUARANTINE — the recalled lot that ships anyway [state_machine, invariant, try]
- [logistics/reefer_setpoint](https://soma-lang.dev/corpus/logistics/reefer_setpoint.cell): REEFER SETPOINT — the typo that thaws forty tonnes of tuna [state_machine, invariant, try]
- [logistics/uld_loadmaster](https://soma-lang.dev/corpus/logistics/uld_loadmaster.cell): ULD LOADMASTER — National Airlines 102, refused at the manifest [state_machine, invariant, try]

## math

- [math/bisection_root](https://soma-lang.dev/corpus/math/bisection_root.cell): Bisection — bracket a root of a continuous function and halve [native]
- [math/combinatorics](https://soma-lang.dev/corpus/math/combinatorics.cell): Combinatorics — factorial, permutations, combinations factorial folds product over range(1, n+1) []
- [math/complex](https://soma-lang.dev/corpus/math/complex.cell): Complex numbers — records carrying real and imaginary parts Soma has no native complex type, so a Complex is a record { re, im } []
- [math/ext_euclid](https://soma-lang.dev/corpus/math/ext_euclid.cell): Extended Euclidean algorithm — Bezout coefficients and modular inverse []
- [math/fibonacci](https://soma-lang.dev/corpus/math/fibonacci.cell): Fibonacci — iterative, and the closed-form Binet approximation The iterative version carries the last two terms in two variables []
- [math/gcd_lcm](https://soma-lang.dev/corpus/math/gcd_lcm.cell): GCD / LCM — Euclid's algorithm and its consequences gcd() is a builtin (Euclid on absolute values) [pipeline, lambda]
- [math/integration](https://soma-lang.dev/corpus/math/integration.cell): Numerical integration — trapezoidal and Simpson's rule Approximate the area under f over [a,b] with n panels [native]
- [math/linear_solve](https://soma-lang.dev/corpus/math/linear_solve.cell): Solving 2x2 linear systems — Cramer's rule via determinants []
- [math/matrix_algebra](https://soma-lang.dev/corpus/math/matrix_algebra.cell): Matrix algebra — product, transpose, determinant, trace Matrices are List<List<Float>> built by reshape []
- [math/modular](https://soma-lang.dev/corpus/math/modular.cell): Modular arithmetic — fast exponentiation and Fermat primality pow_mod(base, exp, m) is a builtin doing square-and-multiply mod m []
- [math/monte_carlo_pi](https://soma-lang.dev/corpus/math/monte_carlo_pi.cell): 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 []
- [math/newton_sqrt](https://soma-lang.dev/corpus/math/newton_sqrt.cell): Newton's method — square root and reciprocal without division/sqrt [native]
- [math/primes](https://soma-lang.dev/corpus/math/primes.cell): Primes — primality test, prime list, factorization Trial division up to √n decides primality []
- [math/quadratic](https://soma-lang.dev/corpus/math/quadratic.cell): Quadratic equations — discriminant and the two real roots []
- [math/series](https://soma-lang.dev/corpus/math/series.cell): Power series — e via 1/k!, and pi via the Leibniz / Nilakantha series e = Σ 1/k! [native]
- [math/statistics](https://soma-lang.dev/corpus/math/statistics.cell): Descriptive statistics — mean, variance, stddev, median via sort Mean is sum/len [pipeline, lambda]
- [math/vector_ops](https://soma-lang.dev/corpus/math/vector_ops.cell): Vector operations — dot product, norm, cosine similarity Vectors are plain lists [pipeline, lambda]

## medical

- [medical/bloodbank](https://soma-lang.dev/corpus/medical/bloodbank.cell): BLOOD BANK — an ABO-incompatible transfusion is unrepresentable, and [invariant, match, try, lambda]
- [medical/chain_of_custody](https://soma-lang.dev/corpus/medical/chain_of_custody.cell): LAB CHAIN OF CUSTODY — a sample whose custody broke can never be [state_machine, try]
- [medical/coldchain](https://soma-lang.dev/corpus/medical/coldchain.cell): VACCINE COLD-CHAIN — a temperature breach is PERMANENT, not "probably fine" [state_machine, invariant, try, lambda]
- [medical/controlled_substance](https://soma-lang.dev/corpus/medical/controlled_substance.cell): CONTROLLED SUBSTANCE CABINET — the narcotic count must reconcile, always [invariant, try]
- [medical/dialysis](https://soma-lang.dev/corpus/medical/dialysis.cell): DIALYSIS — fluid removal is capped, and a session always ends with the [state_machine, invariant, try]
- [medical/infusion_pump](https://soma-lang.dev/corpus/medical/infusion_pump.cell): 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 [invariant, try, lambda]
- [medical/isolation](https://soma-lang.dev/corpus/medical/isolation.cell): ISOLATION PRECAUTIONS — a contagious patient cannot be discharged to a [state_machine, invariant, try]
- [medical/med_administration](https://soma-lang.dev/corpus/medical/med_administration.cell): MEDICATION ADMINISTRATION — the "five rights" enforced by barcode, no [state_machine, match, try]
- [medical/prescription_lockout](https://soma-lang.dev/corpus/medical/prescription_lockout.cell): PRESCRIPTION INTERACTION LOCKOUT — a lethal drug combination is refused [invariant, try, lambda]
- [medical/sepsis_bundle](https://soma-lang.dev/corpus/medical/sepsis_bundle.cell): SEPSIS BUNDLE — antibiotics never go in before the blood cultures are [state_machine, invariant, try]
- [medical/sterilization](https://soma-lang.dev/corpus/medical/sterilization.cell): AUTOCLAVE STERILIZATION — a failed cycle can never release instruments [state_machine, invariant, try, lambda]
- [medical/surgical_checklist](https://soma-lang.dev/corpus/medical/surgical_checklist.cell): SURGICAL SAFETY CHECKLIST — no incision before time-out, and the count [state_machine, invariant, match, try]
- [medical/transplant](https://soma-lang.dev/corpus/medical/transplant.cell): ORGAN ALLOCATION — one organ, one recipient, and no taking it back once [state_machine, try]
- [medical/triage](https://soma-lang.dev/corpus/medical/triage.cell): EMERGENCY TRIAGE — the sickest patient is seen first, by construction [invariant, try]

## records

- [records/address_book](https://soma-lang.dev/corpus/records/address_book.cell): Address book: Contact records stored in a Map slot, round-tripped through storage, and queried []
- [records/bank](https://soma-lang.dev/corpus/records/bank.cell): Bank accounts as Account records kept in a persistent Map slot, with deposit/withdraw that read, mutate, and write the record back []
- [records/bst](https://soma-lang.dev/corpus/records/bst.cell): Binary search tree built from Node records with nested `left`/`right` children [pipeline]
- [records/config](https://soma-lang.dev/corpus/records/config.cell): Nested config record with defaults, merge-style overrides, and a deep-path reader [match]
- [records/ecs](https://soma-lang.dev/corpus/records/ecs.cell): Entity-Component shape: each Entity record carries a bag of components (position, velocity, health) as nested records [pipeline, lambda]
- [records/employees](https://soma-lang.dev/corpus/records/employees.cell): Employee directory: records driving group_by / agg / inner_join style reporting [pipeline, lambda]
- [records/family_tree](https://soma-lang.dev/corpus/records/family_tree.cell): Family tree: Person records with a list of `children` records, walked recursively [pipeline]
- [records/geometry](https://soma-lang.dev/corpus/records/geometry.cell): Geometry: Point and Rect records with computed properties []
- [records/inventory](https://soma-lang.dev/corpus/records/inventory.cell): Inventory: a list of Item records with in-place quantity mutation, restock/sell operations, and aggregate reporting via pipelines [pipeline, lambda]
- [records/json_roundtrip](https://soma-lang.dev/corpus/records/json_roundtrip.cell): Records and JSON: serialize a record to a JSON string and parse it back []
- [records/kanban](https://soma-lang.dev/corpus/records/kanban.cell): Kanban board: Card records stored by id in a Map slot, moved between columns by mutating a field and writing back [pipeline, lambda]
- [records/linkedlist](https://soma-lang.dev/corpus/records/linkedlist.cell): Singly linked list built from Node records whose `next` field is either another Node or () for the tail []
- [records/orders](https://soma-lang.dev/corpus/records/orders.cell): Order records with nested line-items, computed totals, and a state machine over the order lifecycle [state_machine, sum_type, pipeline, lambda]
- [records/playlist](https://soma-lang.dev/corpus/records/playlist.cell): Playlist as an ordered list of Track records [pipeline, lambda]
- [records/record_ops](https://soma-lang.dev/corpus/records/record_ops.cell): Functional record updates: with / without / merge produce new records without mutating the original [pipeline]
- [records/shapes_typed](https://soma-lang.dev/corpus/records/shapes_typed.cell): Typed record literals and runtime type tags []
- [records/students](https://soma-lang.dev/corpus/records/students.cell): Gradebook: Student records each holding a list of Score records [pipeline, match, lambda]

## safety_interlocks

- [safety_interlocks/autoclave_door](https://soma-lang.dev/corpus/safety_interlocks/autoclave_door.cell): AUTOCLAVE DOOR — a quick-opening door never unlocks under pressure [state_machine, invariant, try]
- [safety_interlocks/blast_furnace_door](https://soma-lang.dev/corpus/safety_interlocks/blast_furnace_door.cell): BLAST FURNACE TOP — never open a door against live CO gas [state_machine, invariant, try]
- [safety_interlocks/chlorine_dosing](https://soma-lang.dev/corpus/safety_interlocks/chlorine_dosing.cell): CHLORINE DOSING — no chemical feed without proven water flow [state_machine, invariant, try]
- [safety_interlocks/conveyor_pullcord](https://soma-lang.dev/corpus/safety_interlocks/conveyor_pullcord.cell): GRAIN CONVEYOR PULL-CORD — a latched trip, and a broken safety circuit that stays broken [state_machine, invariant, try]
- [safety_interlocks/crane_load_moment](https://soma-lang.dev/corpus/safety_interlocks/crane_load_moment.cell): CRANE LOAD MOMENT — the tipping write is refused by the ledger [state_machine, invariant, try]
- [safety_interlocks/drawbridge](https://soma-lang.dev/corpus/safety_interlocks/drawbridge.cell): DRAWBRIDGE — the span never moves while the deck is open to traffic [state_machine, invariant, try]
- [safety_interlocks/gas_burner_purge](https://soma-lang.dev/corpus/safety_interlocks/gas_burner_purge.cell): GAS BURNER IGNITION — purge before spark, lockout is forever [state_machine, invariant, try]
- [safety_interlocks/lockout_tagout](https://soma-lang.dev/corpus/safety_interlocks/lockout_tagout.cell): LOCKOUT/TAGOUT — a machine with a personal lock on it cannot start [state_machine, invariant, try]
- [safety_interlocks/mine_hoist](https://soma-lang.dev/corpus/safety_interlocks/mine_hoist.cell): MINE HOIST — no motion with the gate open, and a trip is forever [state_machine, invariant, try]
- [safety_interlocks/pig_trap_closure](https://soma-lang.dev/corpus/safety_interlocks/pig_trap_closure.cell): PIPELINE PIG TRAP — the closure never opens against trapped pressure [state_machine, invariant, try]
- [safety_interlocks/pressure_relief](https://soma-lang.dev/corpus/safety_interlocks/pressure_relief.cell): PRESSURE RELIEF VALVE — a live vessel can never lose its relief path [state_machine, invariant, try]
- [safety_interlocks/railway_block](https://soma-lang.dev/corpus/safety_interlocks/railway_block.cell): RAILWAY BLOCK SIGNALING — two trains never share a block [state_machine, invariant, try]
- [safety_interlocks/robot_cell_gate](https://soma-lang.dev/corpus/safety_interlocks/robot_cell_gate.cell): ROBOT CELL GATE — full-speed automation only behind a closed gate [state_machine, invariant, try, guard]
- [safety_interlocks/two_hand_press](https://soma-lang.dev/corpus/safety_interlocks/two_hand_press.cell): TWO-HAND PRESS CONTROL — anti-tie-down, anti-repeat, structural [state_machine, invariant, try]

## services

- [services/payments_approval](https://soma-lang.dev/corpus/services/payments_approval.cell): PAYMENTS APPROVAL — a whole service in one file: a ledger that cannot [state_machine, invariant, http, match, try, fail, multi_cell, service]
- [services/refund_agent](https://soma-lang.dev/corpus/services/refund_agent.cell): REFUND AGENT — an LLM decides, the language decides what it may do [state_machine, invariant, agent, sum_type, think, match, try, guard, fail, cost, tools]
- [services/warehouse_reservations](https://soma-lang.dev/corpus/services/warehouse_reservations.cell): WAREHOUSE RESERVATIONS — two cells: a stock ledger with hard bounds and a reservation lifecycle with a supervisor guard, behind one HTTP router [state_machine, invariant, http, match, try, guard, fail, multi_cell, service]

## state_machines

- [state_machines/document_review](https://soma-lang.dev/corpus/state_machines/document_review.cell): Document editorial workflow with a typed (sum-type) state machine [state_machine, sum_type]
- [state_machines/elevator](https://soma-lang.dev/corpus/state_machines/elevator.cell): An elevator door + motion interlock [state_machine]
- [state_machines/expense_approval](https://soma-lang.dev/corpus/state_machines/expense_approval.cell): Multi-step expense-approval workflow with guarded transitions [state_machine, invariant, fail]
- [state_machines/game_match](https://soma-lang.dev/corpus/state_machines/game_match.cell): Online game-match lifecycle [state_machine, invariant, match]
- [state_machines/media_player](https://soma-lang.dev/corpus/state_machines/media_player.cell): A media-player transport state machine [state_machine, sum_type]
- [state_machines/order_lifecycle](https://soma-lang.dev/corpus/state_machines/order_lifecycle.cell): Order lifecycle as a typed state machine [state_machine, sum_type]
- [state_machines/shipment_tracking](https://soma-lang.dev/corpus/state_machines/shipment_tracking.cell): Parcel shipment tracking with a delivery-exception loop [state_machine]
- [state_machines/subscription_billing](https://soma-lang.dev/corpus/state_machines/subscription_billing.cell): Subscription billing state machine [state_machine, invariant]
- [state_machines/support_ticket](https://soma-lang.dev/corpus/state_machines/support_ticket.cell): Support-ticket lifecycle with a reopen path [state_machine]
- [state_machines/tcp_connection](https://soma-lang.dev/corpus/state_machines/tcp_connection.cell): A simplified TCP connection state machine (active-open path) [state_machine, sum_type]
- [state_machines/thermostat](https://soma-lang.dev/corpus/state_machines/thermostat.cell): An HVAC thermostat control loop [state_machine, fail]
- [state_machines/traffic_interlock](https://soma-lang.dev/corpus/state_machines/traffic_interlock.cell): A two-road traffic-light interlock proven safe by construction [state_machine, match]
- [state_machines/turnstile](https://soma-lang.dev/corpus/state_machines/turnstile.cell): A coin-operated turnstile — the textbook two-state machine, plus an out-of-service state reachable only via maintenance [state_machine]
- [state_machines/vending_machine](https://soma-lang.dev/corpus/state_machines/vending_machine.cell): A vending machine state machine [state_machine, invariant, fail]

## text

- [text/acronym](https://soma-lang.dev/corpus/text/acronym.cell): Acronym / initials — first letter of each word, uppercased "Portable Network Graphics" -> "PNG" [pipeline, lambda]
- [text/anagram](https://soma-lang.dev/corpus/text/anagram.cell): Anagram check — same multiset of letters Two strings are anagrams iff sorting their letters yields the same string []
- [text/caesar](https://soma-lang.dev/corpus/text/caesar.cell): Caesar cipher — shift letters using an alphabet lookup []
- [text/csv](https://soma-lang.dev/corpus/text/csv.cell): CSV split/join — parse rows and project columns [pipeline, lambda]
- [text/csv_to_markdown](https://soma-lang.dev/corpus/text/csv_to_markdown.cell): CSV to Markdown table — render rows as a pipe-delimited table [pipeline, lambda]
- [text/number_to_words](https://soma-lang.dev/corpus/text/number_to_words.cell): Number to words — spell out integers 0..999 Composes English number words from ones/teens/tens tables []
- [text/pad_align](https://soma-lang.dev/corpus/text/pad_align.cell): Padding & alignment — left/right pad to a fixed width Builds padding by appending a fill character until the target width is met []
- [text/palindrome](https://soma-lang.dev/corpus/text/palindrome.cell): Palindrome check — punctuation- and case-insensitive Strips everything but letters/digits, lowercases, then compares the cleaned string against its reverse []
- [text/reverse_words](https://soma-lang.dev/corpus/text/reverse_words.cell): Reverse word order — "hello world" -> "world hello" Splits on spaces, reverses the resulting list, and re-joins [pipeline, lambda]
- [text/rot13](https://soma-lang.dev/corpus/text/rot13.cell): ROT13 — self-inverse letter rotation Rotates each letter by 13, preserving case; applying it twice restores the original []
- [text/run_length](https://soma-lang.dev/corpus/text/run_length.cell): Run-length encoding — compress repeated characters "aaabbc" -> "a3b2c1" []
- [text/slugify](https://soma-lang.dev/corpus/text/slugify.cell): Slugify — turn a title into a URL-safe slug []
- [text/substring_search](https://soma-lang.dev/corpus/text/substring_search.cell): Substring search — count and locate occurrences []
- [text/template](https://soma-lang.dev/corpus/text/template.cell): Tiny template renderer — substitute [[key]] placeholders Fills each [[key]] in a template with its value []
- [text/title_case](https://soma-lang.dev/corpus/text/title_case.cell): 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 [pipeline, lambda]
- [text/tokenizer](https://soma-lang.dev/corpus/text/tokenizer.cell): Tokenizer — split text into normalized word tokens Lowercases the input, replaces punctuation with spaces, then splits on whitespace and drops empty fragments [pipeline, lambda]
- [text/vowel_count](https://soma-lang.dev/corpus/text/vowel_count.cell): Vowel / consonant counter Walks each character, classifying letters as vowels or consonants and ignoring everything else []
- [text/word_frequency](https://soma-lang.dev/corpus/text/word_frequency.cell): Word frequency — count occurrences of each word Splits a sentence into words and tallies each into a Map using a list-of words walk []

## web

- [web/blog_tags](https://soma-lang.dev/corpus/web/blog_tags.cell): Mini blog API with tag filtering [http, pipeline, match, lambda]
- [web/contact_form](https://soma-lang.dev/corpus/web/contact_form.cell): Form handler with server-side validation [http, match]
- [web/counter_api](https://soma-lang.dev/corpus/web/counter_api.cell): Counter API: a persistent integer counter exposed over HTTP [http, match]
- [web/feature_flags](https://soma-lang.dev/corpus/web/feature_flags.cell): Feature-flag service: toggle named flags on/off, query state, list all [http, match]
- [web/guestbook](https://soma-lang.dev/corpus/web/guestbook.cell): Guestbook: append-only signed entries, rendered as a small HTML page [http, match]
- [web/kv_store](https://soma-lang.dev/corpus/web/kv_store.cell): Key-value store API with namespaced keys and a bulk export endpoint [http, match]
- [web/leaderboard](https://soma-lang.dev/corpus/web/leaderboard.cell): Leaderboard API: submit a score, get the ranked top-N [http, pipeline, match]
- [web/metrics_api](https://soma-lang.dev/corpus/web/metrics_api.cell): Metrics / health endpoint [http, match]
- [web/notes_crud](https://soma-lang.dev/corpus/web/notes_crud.cell): CRUD JSON API over a persistent Map: notes with title + body [http, match]
- [web/paginated_list](https://soma-lang.dev/corpus/web/paginated_list.cell): Paginated product list: GET /products?page=N&size=M slices a stored list [http, match]
- [web/poll_api](https://soma-lang.dev/corpus/web/poll_api.cell): Voting / poll API: fixed options, one counter per option, results sorted [http, pipeline, match, lambda]
- [web/sessions](https://soma-lang.dev/corpus/web/sessions.cell): Session/login toy: POST /login issues a token, GET /me/<token> returns the user, POST /logout invalidates it [http, match]
- [web/site_router](https://soma-lang.dev/corpus/web/site_router.cell): Multi-page static site: home, about, and a dynamic greeting route [http, match]
- [web/todo_state](https://soma-lang.dev/corpus/web/todo_state.cell): Todo service backed by a typed state machine (sum type TodoStatus) [state_machine, sum_type, http, match]
- [web/url_shortener](https://soma-lang.dev/corpus/web/url_shortener.cell): URL shortener: POST a long URL, get a short code; GET the code redirects [http, match]
- [web/webhook_log](https://soma-lang.dev/corpus/web/webhook_log.cell): Webhook receiver + event log [http, pipeline, match, lambda]
