Diagnostics
Every diagnostic code of soma check (151), each with a program that triggers it, the diagnostic the compiler really prints, and the fixed program. Errors (E) stop the program; warnings (W) do not.
An agent reads them with soma check --json: each diagnostic carries code, message, fix, line and col. The message names the form to write.
| Code | Name | Meaning |
|---|---|---|
| E0001 | property_contradiction | two properties of one memory slot exclude each other |
| E0002 | invalid_properties | a combination of slot properties that cannot hold |
| E0003 | missing_handler | a face signal has no on handler |
| E0004 | param_mismatch | a handler's parameter count differs from its face signal |
| E0005 | duplicate_cell | two cells share a name |
| E0006 | duplicate_slot | two memory slots of one cell share a name |
| E0007 | duplicate_signal | two handlers of one cell share a name |
| E0008 | shard_not_found | the scale section shards a slot the cell does not declare |
| E0009 | consistency_mismatch | a slot property contradicts the scale section's consistency |
| E0010 | promise_violation | the cell breaks a promise of its face |
| E0011 | interpolation_undefined | a string interpolation names a variable that is not in scope |
| E0012 | dispatch | a call resolves to no handler, to several, or with the wrong argument count |
| E0013 | unmatched_await | an await names a signal nothing sends |
| E0014 | unmatched_handler | a handler answers a signal the face does not declare |
| E0015 | signal_type_mismatch | a handler's parameter types differ from its face signal |
| E0016 | custom_checker_failed | a cell checker rule failed |
| E0017 | sum_type_issue | a match over a sum type is not exhaustive, or names an unknown variant |
| E0018 | determinism_violation | a [deterministic] handler uses a nondeterministic builtin |
| E0019 | model_capability_missing | the configured model lacks a capability the agent needs |
| E0020 | cost_exceeded | a declared cost bound is lower than what the handler can spend |
| E0021 | budget_exceeded | a declared memory budget is lower than the proven peak |
| E0022 | invariant_issue | a memory invariant is malformed or names something it cannot read |
| E0023 | dead_code | statements that can never run |
| E0024 | guard_scope | a transition guard reads a name the calling handler does not bind |
| E0025 | habit | an idiom from another language that means something else in Soma |
| E0026 | foreign_slot | a handler touches a memory slot of another cell |
| E0027 | unknown_transition_target | transition() names a state the machine does not declare |
| E0028 | undefined_variable | a name with no let, parameter, loop variable, match binding or slot |
| E0029 | function_as_value | a handler or builtin used as a value instead of being called |
| E0030 | ws_placement | on ws outside the cell that owns request |
| E0031 | unknown_promise | a promise no checker implements |
| E0032 | undefined_function | a call to a name that is neither a handler nor a builtin |
| E0033 | think_option | an unknown or mistyped think() option |
| E0034 | storage_collision | two slots would share one storage table |
| E0035 | slot_method_on_local | a slot method (.set / .push / .delete) on a local value |
| E0036 | runtime_unknown_cell | the runtime section names a cell that does not exist |
| E0037 | runtime_signal_args | the runtime section sends a signal with the wrong arguments |
| E0038 | native_vocabulary | a [native] handler uses something native code does not have |
| E0039 | int_as_bool | a number, string or list where a condition needs a Bool |
| E0040 | face_return_type | a handler returns a value its face signal does not declare |
| E0041 | arity | a call with the wrong number of arguments |
| E0042 | write_to_undefined | an assignment to a name that was never bound |
| E0043 | write_to_loop_copy | a write to a loop variable, which is a copy |
| E0044 | variant_shape | a variant built with the wrong fields |
| E0045 | unused_value | an expression statement whose value is dropped |
| E0046 | unknown_type | a type name nothing declares |
| E0047 | unknown_state | a state name the machine does not declare |
| E0048 | unknown_handler | a handler name nothing defines |
| E0049 | unknown_handler_property | an unknown handler annotation |
| E0050 | unknown_checker_predicate | a checker rule names a predicate nothing implements |
| E0051 | undefined_delegate | a route delegates to a handler that does not exist |
| E0052 | transition_no_machine | transition() in a program without a state machine |
| E0053 | transition_effect | an effect block on a transition does something it may not |
| E0054 | test_machine_ambiguous | a test rule calls transition() with several machines in scope |
| E0055 | test_helper_shadows | a test helper named like a program handler or a builtin |
| E0056 | task_without_think | a [task] handler that never calls think() |
| E0057 | task_try_write | a [task] handler writes inside a try that spans a think() |
| E0058 | task_transition_before_think | a [task] handler transitions before its last think() |
| E0059 | task_stale_read | a [task] handler uses a value read before a think() |
| E0060 | task_native | [task] and [native] on one handler |
| E0061 | task_ensure | ensure in a [task] handler undoes the current step only |
| E0062 | task_called_atomically | a [task] handler called from a plain handler |
| E0063 | state_annotation | an unknown annotation on a state or transition |
| E0064 | slot_assignment | slot = value — a slot is written through its methods |
| E0065 | scale_memory | the scale section contradicts the memory section |
| E0066 | scalar_slot | a memory slot that is not a Map or a List |
| E0067 | rules_outside_test | a rules block outside a cell test |
| E0068 | return_in_lambda | return inside a lambda |
| E0069 | reserved_handler | a handler named like a reserved builtin |
| E0070 | request_signature | on request with a signature serve cannot call |
| E0071 | refusal_discarded | a refusal() value that is not returned |
| E0072 | quadratic_concat | a list or string grown by concatenation in a loop |
| E0073 | pipe_right_side | the right side of |> is not a call |
| E0074 | param_shadows_slot | a parameter named like a memory slot |
| E0075 | no_initial_state | a state machine without initial: |
| E0076 | nested_quote | an unescaped quote inside an interpolation |
| E0077 | native_primitive_shadowed | a handler named like a native primitive |
| E0078 | multiple_state_machines | more than one state machine in a cell |
| E0079 | mock_target | a mock naming no handler |
| E0080 | local_shadows_slot | a let named like a memory slot |
| E0081 | lambda_scope | a lambda reads a name that is not in scope where it runs |
| E0082 | lambda_assign | a lambda assigns an outer local |
| E0083 | invariant_not_bool | an invariant that is not a condition |
| E0084 | interpolation_trailing | text after the expression of an interpolation |
| E0085 | interpolation_malformed | an interpolation that does not parse |
| E0086 | interpolation_format_spec | a format spec in an interpolation (use format()) |
| E0087 | interior_timer | every / after in an interior cell |
| E0088 | interior_call | a call into an interior cell from outside its parent |
| E0089 | immutable_write | an overwrite or delete on an [immutable] slot |
| E0090 | guard_effect | a guard that calls a handler, think() or writes a slot |
| E0091 | foreign_idiom | syntax carried over from another language |
| E0092 | face_mismatch | a handler and its face signal disagree |
| E0093 | every_zero | every 0 — an interval must be positive |
| E0094 | ensure_after_return | ensure after a return never runs |
| E0095 | empty_test_cell | a test cell that asserts nothing |
| E0096 | empty_program | a file with no cell |
| E0097 | empty_match | a match with no arm |
| E0098 | duplicate_edge | the same transition declared twice |
| E0099 | count_field_default | .len / .size read as a field with a default |
| E0100 | cost_unprovable | a declared cost bound that cannot be proven |
| E0101 | builtin_arity | a builtin called with too few or too many arguments |
| E0102 | budget_annotation | a malformed budget annotation |
| E0103 | break_outside_loop | break / continue outside a loop |
| E0104 | assignment_without_let | an assignment to a name that has no let |
| E0105 | argument_type | an argument whose type differs from the parameter's |
| E0106 | argument_count | a handler called with the wrong number of arguments |
| E0107 | ambiguous_slot | a slot name two cells declare |
| E0108 | syntax | a syntax error |
| E0109 | type_mismatch | an expression whose inferred type cannot be used where it stands |
| E0110 | unknown_field | a field the record type does not declare |
| E0111 | maybe_absent | a value that may be absent () used where a value is required |
| E0112 | edition | an unknown edition in soma.toml |
| E0113 | untrusted_value | a model's answer or an HTTP reply decides a state, a URL, a file or a budget without a check |
| E0114 | load | the program does not load: an import, a manifest or a file it needs |
| E0115 | io | a file the command was given cannot be read |
| E0116 | contract | a face contract (requires / ensures) says something a caller could not evaluate, or sits on a handler that cannot carry one |
| E0117 | await | an await stands where its handler could not be stopped and resumed: outside a [task] handler, or not as a whole statement of its body or of an if branch there |
| E0118 | tool_binding | a tool bound to a server ([mcp: …] / [openapi: …]) that soma.toml does not define, soma.lock does not pin, or whose declaration does not fit the pinned contract |
| E0119 | flesh | a flesh body that cannot go into a skeleton: no skeleton of that name, a second body for one signal, parameters that differ from the signal's, or a helper with an untyped parameter |
| E0120 | frame | a skeleton's frame that names something the skeleton does not have, or a flesh that does something its signal's frame does not grant (a write, a read, a call, an emit or a machine edge) |
| E0121 | skeleton_lock | a skeleton differs from the one skeleton.lock holds (frozen with soma skeleton --freeze) |
| E0122 | nominal_mismatch | two nominal types mixed (cell type Lots = Int with Cents), or a plain value where a nominal one is declared |
| E1001 | expected | the parser expected one token and found another |
| E1002 | unexpected_eof | the file ends inside a construct |
| E1003 | handler_return_type | a return type on a handler — it goes on the face signal |
| E1004 | match_fat_arrow | => in a match arm — arms use -> |
| E1005 | reserved_word | a keyword used as a name |
| E1006 | nesting_too_deep | expressions or blocks nested too deeply |
| E1007 | cell_constant | a let / const directly inside a cell |
| E1008 | statement_as_value | a statement where a value is expected |
| E1009 | fix_it | a near-miss the parser knows the correction for |
| E1010 | lexical | a character, string or number the lexer cannot read |
| W0001 | unhandled_signal | an emitted signal no cell handles |
| W0002 | property_implication | a slot property implies another that is missing |
| W0003 | unknown_property | a slot property nothing defines |
| W0004 | unknown_property_ref | a cell property refers to an unknown property |
| W0005 | unverifiable_promise | a descriptive promise the compiler cannot check |
| W0006 | await_without_handler | an await with no handler for its signal |
| W0007 | scale_eventual_consistency | eventual consistency on a slot that reads its own writes |
| W0008 | agent_missing_state_machine | an agent cell without a state machine |
| W0009 | cost_advisory | a cost bound that is an estimate, not a proof |
| W0010 | cost_proven | a cost bound that is proven (a note) |
| W0011 | dispatch_shadow | a bare call that two definitions could answer |
| W0012 | native_semantics | native code that would differ from the interpreter |
| W0013 | unreachable | code or states that cannot be reached |
| W0014 | habit_warning | an idiom that probably does not mean what it does elsewhere |
| W0015 | interpolation_recoverable | an undefined interpolation variable inside try / assert_fails |
| W0016 | budget_advisory | a memory budget whose proof is incomplete |
| W0017 | budget_ok | a memory budget that holds (a note) |
| W0018 | type_advisory | a type the inference could not settle; checked at run time |
| W0019 | frame_warning | a skeleton that says more than the program does: a frame wider than its body, a machine edge or a slot no frame touches, a helper nothing calls |