8. Validation and Diagnostics
Diagnostics in Culsma are stage-placed:
- each stage emits the failures it can decide earliest
- diagnostic prefixes (
LOAD/LIB,SEM,TYPE,ENTRY,PLAN,RT,MAT) mark that stage placement - the diagnostic code set and stage boundary do not imply a single monolithic diagnostic subsystem
8.1 Validation Stages
Culsma uses staged checks:
- Entry-source and definition-dependency loading
- Library-definition resolution
- Compilation to a normalized intermediate representation
- Semantic validation
- Type/unit validation
- Entry resolution
- Execution-plan construction
- Runtime execution
Pipeline order:
- The standard pipeline order is load -> resolve -> compile -> validate -> typecheck -> entry -> plan -> runtime.
- Compilation produces Canonical IR plus semantic-analysis input; semantic validation consumes both.
- Execution-plan construction may emit
PLAN_*diagnostics while still producing an execution plan; runtime execution consumes plan diagnostics according to the runtime error policy. - Runtime material compute, observation recording, and protocol-output capture are part of runtime execution, not separate pre-runtime stages.
8.2 Operation Contract Check Placement
Operation vocabulary definitions and call contracts are specified in Chapter 6.
Rules:
- Step-call syntax accepts
IDENTIFIER(...), but semantic validity requires operation presence in vocabulary. - Unknown operation names produce
SEM_UNKNOWN_STEP. - Missing required args, unknown args, and duplicate args are semantic contract diagnostics.
Constructor built-ins and sugar-lowering note:
container/contentsugar legality is checked after lowering to canonical domain built-in calls (Chapter 4 -> Chapter 6).- Constructor built-ins use the same staged contract model (
SEM_*->TYPE_*->MAT_*).
8.2.1 Canonical Content Whitelist
content_kind and standard content_type values are constrained by the canonical whitelist defined in Chapter 6.
Validation policy:
- Missing
content_kindis semantic error. - Non-whitelisted
content_kindis semantic error in strict mode. content_typeuses lowercase snake_case tokens.- Standard
content_typevalues should use canonical tokens. - The canonical
content_typesurface is closed; uncommon material identities should use the Chapter 6other_*fallback for theirkind. - Standard
attrs.rolevalues are recommended/controlled by Chapter 6, butattrsremains open metadata; unknown attr keys are not rejected solely for being unknown.
Validation contract:
- The whitelist is part of the content contract.
- Dedicated content diagnostics below are part of the staged diagnostic contract.
- Legacy content kind/type aliases, including older custom/unknown type strings, are compatibility inputs only when legacy normalization mode is explicitly enabled. Such inputs should produce warning diagnostics and normalize to Chapter 6 canonical values.
8.2.2 Diagnostic Mapping Table (Content + Mutation Model)
| Failure condition | Earliest stage | Diagnostic code | Status |
|---|---|---|---|
missing content_kind in DefineContent | semantic | SEM_MISSING_CONTENT_KIND | current |
non-whitelisted content_kind (strict mode) | semantic | SEM_INVALID_CONTENT_KIND | current |
invalid content_type normalization (required mode) | semantic | SEM_INVALID_CONTENT_TYPE_FORMAT | current |
unsupported content_type token in strict canonical mode | semantic | SEM_INVALID_CONTENT_TYPE_VALUE | current |
legacy or unknown content taxonomy normalized to canonical value or other_* in compatibility mode | semantic | SEM_CONTENT_TAXONOMY_COMPAT_NORMALIZED | current warning |
unsupported constructor container kind | semantic | SEM_INVALID_CONTAINER_KIND | current |
surface(...) constructor provides volume capacity | semantic | SEM_SURFACE_CAPACITY_FORBIDDEN | current |
constructor load = [...] item is not a valid content_spec:quantity pair list | semantic | SEM_INVALID_LOAD_ITEM | current |
invalid container target-view member path such as container.structure, container.structure.upper, or container.structure.top.inner | semantic | SEM_CONTAINER_TARGET_VIEW_INVALID | current |
non-text content_kind | type | TYPE_CONTENT_KIND_NOT_TEXT | current |
non-text content_type | type | TYPE_CONTENT_TYPE_NOT_TEXT | current |
non-text content_code | type | TYPE_CONTENT_CODE_NOT_TEXT | current |
non-record attrs | type | TYPE_CONTENT_ATTRS_NOT_RECORD | current |
ContainerTargetView is used where a material Container is required | type | TYPE_CONTAINER_TARGET_VIEW_POSITION_INVALID | current |
| mutation source list mixes quantified and full-transfer items | semantic | SEM_MUTATION_QUANTITY_STYLE_CONFLICT | current |
mutation statement uses legacy per-source program(...) payload shape | semantic | SEM_MUTATION_PROGRAM_SOURCE_SHAPE_CONFLICT | current |
source.partition(program)[i] is used outside mutation source position | semantic | SEM_SOURCE_PARTITION_CONTEXT_INVALID | current |
source.partition(program)[i] program does not resolve to a partition-capable concrete program | semantic | SEM_PROGRAM_OWNER_MISMATCH / SEM_PROGRAM_KIND_INVALID | current |
source.partition(program)[i] index is missing, non-static, negative, or outside binary range | semantic | SEM_INDEX_NOT_STATIC_INTEGER / SEM_INDEX_NOT_NONNEGATIVE_INTEGER / SEM_INDEX_OUT_OF_RANGE | current |
container.contents[i] is used outside mutation source position | semantic | SEM_CONTAINER_CONTENTS_INDEX_CONTEXT_INVALID | current |
container.contents[i] index is missing, non-static, or negative | semantic | SEM_INDEX_NOT_STATIC_INTEGER / SEM_INDEX_NOT_NONNEGATIVE_INTEGER | current |
| standalone content init appears in execution flow | semantic | SEM_STANDALONE_CONTENT_INIT_FORBIDDEN | current |
| unknown content identity at load/apply | material | MAT_CONTENT_NOT_FOUND | current |
| incompatible amount axis in content loading | material | MAT_CONTENT_LOAD_AXIS_MISMATCH | current |
| immutable content metadata conflict | material | MAT_CONTENT_METADATA_CONFLICT | current |
selected scientific provider is absent, not applicable, or returns UNRESOLVED | material | MAT_SCIENTIFIC_MODEL_UNRESOLVED | current |
| selected scientific provider fails | material | MAT_SCIENTIFIC_MODEL_FAILED | current |
| selected scientific provider returns an invalid proposal | material | MAT_SCIENTIFIC_MODEL_PROPOSAL_INVALID | current |
sep.component_fates is not a nested record, omits an output, uses an unknown output name, contains an invalid ratio, or does not sum to 100% | semantic | SEM_SEPARATION_FATE_RULE_SHAPE_INVALID / SEM_SEPARATION_FATE_RULE_SLOT_INVALID / SEM_SEPARATION_FATE_RULE_VALUE_INVALID / SEM_SEPARATION_FATE_RULE_TOTAL_INVALID | current |
sep.component_fates references content absent from the runtime source | material | MAT_SEPARATION_FATE_COMPONENT_NOT_FOUND | current |
sep.transitions is not a list of typed transition(...) values, uses an invalid selector, uses a bare/cross-program/unknown output member, supplies a string, bare, unknown, or internal target state, or supplies an invalid association selector | semantic | SEM_MATERIAL_TRANSITIONS_SHAPE_INVALID / SEM_MATERIAL_TRANSITION_* / SEM_MATERIAL_SELECTOR_* | current |
sep.transitions target is outside the author-settable MaterialRelation enum, a selected index or exact entry ID is unavailable, the selected output has zero quantity, or a component-bound association target is missing from that output | material | MAT_MATERIAL_TRANSITION_* / MAT_MATERIAL_INDEX_OUT_OF_RANGE / MAT_MATERIAL_ENTRY_ID_NOT_FOUND / MAT_MATERIAL_RELATION_INVALID | current |
container.contents[i] is read without a current valid indexed contents state | material | MAT_CONTENTS_STATE_NOT_INDEXED | current |
container.contents[i] index does not exist in the current contents state | material | MAT_CONTENTS_STATE_INDEX_OUT_OF_RANGE | current |
container.contents[i] reads a preserved indexed contents state outside its required preservation context | material | MAT_CONTENTS_STATE_PRESERVATION_NOT_SATISFIED | current |
8.2.3 Diagnostic Mapping Table (Atomic Statements + Readout)
| Failure condition | Earliest stage | Diagnostic code | Status |
|---|---|---|---|
with env(...) inferred/explicit-hold target missing | semantic | SEM_ENV_TARGET_REQUIRED | current |
with env(...) missing body and explicit hold form | semantic | SEM_ENV_BODY_REQUIRED | current |
with env(...) missing every supported environment dimension | semantic | SEM_ENV_THERMAL_REQUIRED | current |
scalar with env(thermal = ..., ...) missing required duration for pure hold/incubation or env-bound time scheduling | semantic | SEM_ENV_DURATION_REQUIRED | current |
with env(duration=...) without thermal | semantic | SEM_ENV_DURATION_WITHOUT_THERMAL | current |
outer duration is used together with thermal_program(...) | semantic | SEM_ENV_DURATION_FORBIDDEN_WITH_THERMAL_PROGRAM | current |
with env(...) uses thermal-only modifier outside thermal scope | semantic | SEM_ENV_ARG_CONFLICT | current |
hold(...) appears outside a direct with env(...) body, including inside a nested non-env sub-block | source/compile | hard error | current |
hold(...) has zero args, multiple args, or an unsupported argument shape | source/compile | hard error | current |
hold(...) target is not a valid env target shape | source/compile | hard error | current |
legacy hold(sample = ...) compatibility spelling is accepted | source compatibility | no diagnostic | current |
agit(...) uses unsupported mode | semantic | SEM_AGIT_MODE_UNKNOWN | current |
agit(...) uses mode/arg combination not allowed by current contract | semantic | SEM_AGIT_ARG_CONFLICT | current |
attached program = ... does not resolve to a concrete *_program(...) call | semantic | SEM_PROGRAM_KIND_INVALID | current |
legacy generic program(...) form is used | semantic | SEM_LEGACY_PROGRAM_FORM_FORBIDDEN | current |
concrete *_program(...) kind is not valid for the owning operator family | semantic | SEM_PROGRAM_OWNER_MISMATCH | current |
concrete *_program(...) enum field uses unsupported token | semantic | SEM_INVALID_PROGRAM_ARG_VALUE | current |
| mutually exclusive program fields are supplied together | semantic | SEM_PROGRAM_ARG_CONFLICT | current |
field_program.field is used instead of field_program.voltage | semantic | SEM_FIELD_PROGRAM_FIELD_ALIAS | current |
with constraint(...) missing body | semantic | SEM_CONSTRAINT_BODY_REQUIRED | current |
with constraint(...) provides neither requirement nor option | semantic | SEM_CONSTRAINT_ITEM_REQUIRED | current |
with constraint(...) names unknown requirement | semantic | SEM_UNKNOWN_REQUIREMENT | current |
with constraint(...) duplicates an option key | semantic | SEM_CONSTRAINT_DUPLICATE_OPTION | current |
| requirement is not valid for block scope | semantic | SEM_CONSTRAINT_SCOPE_INVALID | current |
customized is mixed with standard requirements | semantic | SEM_CONSTRAINT_CUSTOMIZED_EXCLUSIVE | current |
constraint(customized, ...) omits schema_ref | semantic | SEM_CONSTRAINT_CUSTOMIZED_SCHEMA_REQUIRED | current |
| unsupported constraint option is supplied | semantic | SEM_CONSTRAINT_UNKNOWN_OPTION | current |
| active requirement does not allow the action family | semantic | SEM_CONSTRAINT_ACTION_FAMILY_MISMATCH | current |
active cold_chain requirement conflicts with env thermal setting | semantic | SEM_CONSTRAINT_ENV_CONFLICT | current |
| statement-level quantity field uses a globally invalid/unknown unit form | type | TYPE_DIMENSION_MISMATCH / TYPE_UNKNOWN_UNIT / TYPE_UNIT_NOT_ALLOWED | current |
| program field quantity/dimension mismatch | type | TYPE_PROGRAM_FIELD_KIND_MISMATCH / TYPE_PROGRAM_FIELD_DIMENSION_MISMATCH | current |
8.3 Semantic Diagnostics (SEM_*)
Primary semantic diagnostics:
These codes cover statement legality, argument shape, binding legality, requirement compatibility, and operator-family membership:
SEM_UNKNOWN_STEP: step/operator name is not in the semantic vocabularySEM_MISSING_REQUIRED_ARG: a required argument is missingSEM_UNKNOWN_ARG: an argument name is not allowed for the callSEM_DUPLICATE_ARG: the same argument name appears more than onceSEM_UNBOUND_NAME_REFERENCE: a referenced local/runtime-visible name is not bound in scopeSEM_MISSING_CONTENT_KIND: content declaration omits required kindSEM_INVALID_CONTENT_KIND: content kind is outside the whitelistSEM_INVALID_CONTENT_TYPE_FORMAT: content type token shape is invalidSEM_INVALID_CONTENT_TYPE_VALUE: content type token is not allowed for the selected kindSEM_INVALID_CONTAINER_KIND: constructor uses an unsupported container kindSEM_SURFACE_CAPACITY_FORBIDDEN:surface(...)uses forbidden volume capacitySEM_INVALID_LOAD_ITEM: constructorload=[...]item shape is invalidSEM_STANDALONE_CONTENT_INIT_FORBIDDEN: execution flow contains standalone content-init material formsSEM_MUTATION_QUANTITY_STYLE_CONFLICT: one mutation source list mixes incompatible quantified/full-transfer stylesSEM_MUTATION_PROGRAM_SOURCE_SHAPE_CONFLICT: mutation-attached program shape is invalid for the source styleSEM_ENV_TARGET_REQUIRED:with env(...)has no inferred or explicit targetSEM_ENV_BODY_REQUIRED:with env(...)has neither body nor explicit hold formSEM_ENV_THERMAL_REQUIRED:with env(...)provides no supported environment dimensionSEM_ENV_DURATION_REQUIRED: scalar thermal env is missing an explicit duration where the block is a pure hold/incubation or otherwise requires an enclosing time boundarySEM_ENV_DURATION_WITHOUT_THERMAL: duration appears without thermalSEM_ENV_DURATION_FORBIDDEN_WITH_THERMAL_PROGRAM: outer duration is used withthermal_program(...)SEM_ENV_ARG_CONFLICT: env arguments conflict with the selected env modeSEM_CONTAINER_TARGET_VIEW_INVALID: container target-view member path is incomplete or outside the closed accessor setSEM_AGIT_MODE_UNKNOWN:agit(...)mode is unsupportedSEM_AGIT_ARG_CONFLICT:agit(...)arg combination is invalid for the selected modeSEM_PROGRAM_KIND_INVALID: attached program does not resolve to a known concrete*_program(...)SEM_LEGACY_PROGRAM_FORM_FORBIDDEN: legacy genericprogram(...)form is forbiddenSEM_PROGRAM_OWNER_MISMATCH: concrete*_program(...)kind is not valid for the owning operator familySEM_INVALID_PROGRAM_ARG_VALUE: program enum/token field value is unsupportedSEM_PROGRAM_ARG_CONFLICT: mutually exclusive program fields are supplied togetherSEM_FIELD_PROGRAM_FIELD_ALIAS:field_program.fieldis used instead offield_program.voltageSEM_UNKNOWN_REQUIREMENT:constraint(...)names an unknown requirementSEM_CONSTRAINT_BODY_REQUIRED:with constraint(...)is missing a bodySEM_CONSTRAINT_ITEM_REQUIRED:with constraint(...)provides neither requirement nor optionSEM_CONSTRAINT_DUPLICATE_OPTION: the same constraint option key appears more than onceSEM_CONSTRAINT_SCOPE_INVALID: requirement is not legal in the current scopeSEM_CONSTRAINT_CONFLICT: two active requirements conflictSEM_CONSTRAINT_CUSTOMIZED_EXCLUSIVE:customizedis mixed with standard requirementsSEM_CONSTRAINT_CUSTOMIZED_SCHEMA_REQUIRED:customizedomits requiredschema_refSEM_CONSTRAINT_UNKNOWN_OPTION: unsupported constraint option key is suppliedSEM_CONSTRAINT_ACTION_FAMILY_MISMATCH: active requirement disallows the action familySEM_CONSTRAINT_ENV_CONFLICT: active requirement conflicts with env settingsSEM_MATERIAL_TRANSITIONS_SHAPE_INVALID/SEM_MATERIAL_TRANSITION_SHAPE_INVALID/SEM_MATERIAL_TRANSITION_ARGS_INVALID: thesep.transitionscollection or onetransition(...)call has an invalid shape.SEM_MATERIAL_SELECTOR_INVALID/SEM_MATERIAL_SELECTOR_CONTAINER_MISMATCH: a transition subject or association target is neither a same-samplematerials[index]selector nor a same-samplematerials.get(entry_id)selector with a statically resolvable non-empty string key.SEM_MATERIAL_TRANSITION_OUTPUT_INVALID:outputis not a namespaced member of the concrete output enum owned by the selected separation program, including bare identifiers and members of another program's output enum.SEM_MATERIAL_TRANSITION_TARGET_INVALID:tois a string, a bare or unknown identifier, a member of another enum, or the internalMaterialRelation.UNRESOLVEDsentinel rather than an author-settableMaterialRelation.MEMBER.SEM_MATERIAL_TRANSITION_ASSOCIATION_REQUIRED/SEM_MATERIAL_TRANSITION_ASSOCIATION_FORBIDDEN/SEM_MATERIAL_TRANSITION_ASSOCIATION_INVALID:associated_withdoes not match the target relation's typed association contract.
8.3.1 Content/Constructor Semantic Diagnostics
For container/content constructor built-ins and lowered sugar forms:
SEM_MISSING_CONTENT_KIND:DefineContent(...)missing requiredkind.SEM_INVALID_CONTENT_KIND:kindnot in the canonical Chapter 6 whitelist.SEM_INVALID_CONTENT_TYPE_FORMAT:typepresent but not normalized identifier form.SEM_INVALID_CONTAINER_KIND:AllocContainer(kind=...)uses unsupported concrete kind.
8.3.2 Statement-First Mutation Semantic Diagnostics
For mutation statements (target << [sources...]) in the statement-first model:
SEM_MUTATION_QUANTITY_STYLE_CONFLICT: one source list mixes full-transfer and quantified-transfer items.SEM_MUTATION_PROGRAM_SOURCE_SHAPE_CONFLICT: mutation-specific program payloads are authored in a legacy shape that the source surface no longer accepts.SEM_STANDALONE_CONTENT_INIT_FORBIDDEN: execution flow contains standalonecontent/blood/buffer/...init as flowable material. Contract:These codes are part of the mutation/content-model contract.
The codes above are emitted in the pipeline.
8.4 Type Diagnostics (TYPE_*)
Primary type/unit diagnostics:
These codes cover quantity dimensions, unit families, typed assignment, and typed constructor/program fields:
TYPE_DIMENSION_MISMATCH: value has the wrong physical dimensionTYPE_UNKNOWN_UNIT: unit token is unknown to the typecheckerTYPE_UNIT_NOT_ALLOWED: a quantity/unit is not allowed in the contract positionTYPE_UNIT_LEGACY_ALIAS: unit token is accepted as a legacy alias but is not a canonical spellingTYPE_ENV_THERMAL_DIMENSION_MISMATCH:thermalvalue is not temperature-compatibleTYPE_ENV_DURATION_DIMENSION_MISMATCH:durationvalue is not time-compatibleTYPE_ENV_PERCENT_DIMENSION_MISMATCH:co2/rhvalue is not percent-compatibleTYPE_MUTATION_QUANTITY_UNIT_REQUIRED: quantified mutation source is missing a unit-bearing quantityTYPE_MUTATION_QUANTITY_DIMENSION_MISMATCH: quantified mutation source uses the wrong dimensionTYPE_LOAD_QUANTITY_UNIT_REQUIRED: constructor/load amount is missing required unit-bearing quantityTYPE_LOAD_QUANTITY_DIMENSION_MISMATCH: constructor/load amount uses the wrong dimensionTYPE_PROGRAM_FIELD_KIND_MISMATCH: program field has the wrong value kindTYPE_PROGRAM_FIELD_DIMENSION_MISMATCH: program quantity field has the wrong dimensionTYPE_LOCAL_ASSIGN_TARGET_FORBIDDEN: local assignment target form is not type-legalTYPE_LOCAL_ASSIGN_MISMATCH: assigned value is not type-compatible with the local targetTYPE_MEMBER_ASSIGN_TARGET_FORBIDDEN: member assignment target root is not type-legalTYPE_MEMBER_ASSIGN_PATH_FORBIDDEN: member assignment path is not allowedTYPE_CONTAINER_TARGET_VIEW_POSITION_INVALID: aContainerTargetViewis used where a materialContaineris required
8.4.1 Content Metadata Type Diagnostics
TYPE_CONTENT_ATTRS_NOT_RECORD:attrsfor content declaration is not a record/map.TYPE_CONTENT_CODE_NOT_TEXT:content_codeis not text-like.TYPE_CONTENT_KIND_NOT_TEXT:content_kindargument is not text-like in constructor call.
Contract:
- These diagnostics are emitted by type/semantic boundary checks after constructor lowering.
8.5 Entry Resolution Diagnostics (ENTRY_*)
Entry resolution runs after semantic and type validation and before plan lowering:
ENTRY_LEGACY_IMPLICIT_PROTOCOL(warning): entry resolution selected the unique unreferenced root protocol through the version-scoped compatibility ruleENTRY_NO_ENTRYPOINT(error): the entry source contains no top-level executable statements and does not satisfy the compatibility entry rule
An entry-resolution error prevents plan execution. Dependency files do not undergo entry resolution and therefore may contain definitions without an executable entry.
8.6 Plan Diagnostics (PLAN_*)
Primary plan diagnostics:
These codes cover protocol-reference expansion, call-frame binding, and compatibility-entry parameter resolution:
PLAN_UNKNOWN_REFERENCE: referenced protocol cannot be found during plan expansionPLAN_REFERENCE_CYCLE: protocol-reference expansion forms a cyclePLAN_CALL_ARG_MISSING: a referenced protocol call is missing a required argumentPLAN_CALL_ARG_UNKNOWN: a referenced protocol call supplies an unknown argumentPLAN_CALL_ARG_DUPLICATE: a referenced protocol call duplicates an argument namePLAN_CALL_ARG_DEFAULT_EVAL_FAILED: a default parameter value cannot be resolved in call bindingPLAN_CALL_PARAM_REDECLARED: protocol body redefines a protected parameter namePLAN_ENTRY_PARAM_MISSING: the selected compatibility protocol is missing a required entry argumentPLAN_SELECTED_PROTOCOL_NOT_FOUND: plan lowering received a protocol entry resolution whose selected protocol is absent from the supplied IR program
These diagnostics cover repeated/recursive reference expansion and parameterized protocol binding failures.
8.7 Load Diagnostics (LOAD_*)
For entry-source loading and definition dependency loading, load/frontend stage may emit:
LOAD_DUPLICATE_PROTOCOL_NAME: loaded source files define the same protocol name twiceLOAD_NO_INPUT_SOURCES: no entry sources were providedLOAD_SOURCE_NOT_FOUND: an input source path cannot be foundLIB_IMPORT_NOT_FOUND: a library import cannot be resolvedLIB_IMPORT_CYCLE: library imports form a cycleLIB_PROTOCOL_NAME_CONFLICT: imported/external protocol names conflict with existing names
Contract:
- Load/frontend failures are decided by the source-loading / frontend-resolution stage and must not be replaced by
SEM_*codes. - Load/library failures may surface as hard exceptions with stable string prefixes rather than in-memory
Diagnosticobjects. LOAD_*covers entry-source and include dependency loading;LIB_*covers import resolution and external protocol namespace assembly.
8.8 Runtime and Material Diagnostics (RT_*, MAT_*)
Execution/runtime layer:
These codes cover scheduler/runtime orchestration failures and runtime binding failures that remain after earlier stages:
RT_DRIVER_ERROR: driver execution failedRT_MATERIAL_ERROR: runtime step failed because material update failedRT_ABORTED_AFTER_FAILURE: fail-fast runtime aborted further dispatch after a failureRT_UNSATISFIED_DEPENDENCY: a step cannot run because dependencies never became satisfiableRT_STUCK_STEP: scheduler detected no progress for pending workRT_SCHEDULER_GUARD_LIMIT: scheduler hit the no-progress/guard limitRT_RUNTIME_CONDITION_UNRESOLVED: runtime condition could not be evaluatedRT_DRIVER_REQUIREMENT_UNSUPPORTED: selected driver cannot satisfy an active requirementRT_LOCAL_ASSIGN_INVALID_TARGET: runtime local assignment target shape is invalidRT_LOCAL_ASSIGN_UNRESOLVED: runtime local assignment value could not be resolvedRT_MEMBER_ASSIGN_TARGET_INVALID: runtime member assignment target is invalidRT_MEMBER_ASSIGN_VALUE_UNRESOLVED: runtime member assignment value could not be resolvedRT_APPEND_TARGET_INVALID: runtime append target is invalidRT_APPEND_VALUE_UNRESOLVED: runtime append value could not be resolvedRT_REPEAT_BODY_INVALID: repeat body structure is invalid at runtime executionRT_REPEAT_ITERABLE_INVALID: repeat iterable does not resolve to a valid runtime iterable
Material compute layer:
MAT_BINDING_NOT_FOUND: referenced runtime material binding cannot be resolvedMAT_INSUFFICIENT_VOLUME/MAT_INSUFFICIENT_MASS/MAT_INSUFFICIENT_COUNT: source material is insufficient for the requested transferMAT_DILUTION_UNDERSPECIFIED/MAT_DILUTION_INVALID_TARGET: dilution operation is missing required information or uses an invalid targetMAT_MISSING_DENSITY/MAT_INVALID_DENSITY: density bridge is required but missing or invalidMAT_INVALID_RECOVERY_RATIO: requested recovery ratio is invalidMAT_CONSERVATION_VIOLATION: material conservation check failedMAT_CONTAINER_OVERFLOW: post-step volume exceeds container capacityMAT_INVALID_CAPACITY: declared container capacity is invalidMAT_CONTENT_NOT_FOUND: referenced content identity cannot be resolved at material stageMAT_CONTENT_LOAD_AXIS_MISMATCH: requested content load axis is incompatible with runtime representationMAT_CONTENT_METADATA_CONFLICT: immutable content metadata conflict is detected at runtimeMAT_SCIENTIFIC_MODEL_UNRESOLVED: the selected provider is absent, not applicable, or returnsUNRESOLVED; committed material remains unchangedMAT_SCIENTIFIC_MODEL_FAILED: the selected provider fails; committed material remains unchangedMAT_SCIENTIFIC_MODEL_PROPOSAL_INVALID: kernel validation rejects a provider proposal; committed material remains unchangedMAT_UNSUPPORTED_UNIT: runtime material layer does not support the requested unit conversion or axisMAT_MOVEMENT_CONTRACT_MISSING: a successful material operation changed container quantities without exposing an auditable source-to-destination movement contractMAT_CELL_COUNT_VALUE_INVALID: an authored load or quantified transfer uses a negative or non-integral cell countMAT_INVALID_CELL_SUSPENSION_CONCENTRATION: required cell-suspension concentration is missing, non-finite, zero, or negativeMAT_COUNT_TRANSFER_SOURCE_NOT_SUSPENSION: a count aliquot is requested from adherent, pellet, or otherwise non-homogeneous materialMAT_COUNT_TRANSFER_AMBIGUOUS: a count aliquot does not identify one population when multiple cellular populations are presentMAT_IMPLICIT_CARRIER_OVERFLOW: constructor finalization would materialize implicit carrier beyond container capacityMAT_CONTENT_QUANTITY_AXIS_CONFLICT: the same content identity would merge incompatible quantity axesMAT_SEPARATION_FATE_COMPONENT_NOT_FOUND/MAT_SEPARATION_FATE_RULE_*: runtime source-dependent validation of authored component fate rules failedMAT_MATERIAL_INDEX_OUT_OF_RANGE/MAT_MATERIAL_ENTRY_ID_NOT_FOUND/MAT_MATERIAL_ENTRY_ID_AMBIGUOUS/MAT_MATERIAL_ENTRY_INVALID/MAT_MATERIAL_RELATION_INVALID: runtime cannot resolve exactly one selected live material entry or its current enum relation.MAT_MATERIAL_TRANSITION_TARGET_INVALID: the target is outside the author-settableMaterialRelationenum domain; free text andUNRESOLVEDare rejected.MAT_MATERIAL_TRANSITION_OUTPUT_EMPTY/MAT_MATERIAL_TRANSITION_OUTPUT_UNRESOLVED/MAT_MATERIAL_TRANSITION_DUPLICATE: the output-scoped transition cannot be applied uniquely to positive quantity.MAT_MATERIAL_TRANSITION_ASSOCIATION_REQUIRED/MAT_MATERIAL_TRANSITION_ASSOCIATION_FORBIDDEN/MAT_MATERIAL_TRANSITION_ASSOCIATION_KIND_INVALID/MAT_MATERIAL_TRANSITION_ASSOCIATION_OUTPUT_EMPTY: the target relationship's typed association invariant is not satisfied.
Count-specific type diagnostics:
TYPE_CELL_COUNT_VALUE_INVALID: a statically visible authored cell count is negative or non-integral.TYPE_LOAD_COUNT_CONTENT_MISMATCH:cellsis applied to content that is statically known not to bebio_cellular.
8.8.1 Content Runtime Diagnostics
MAT_CONTENT_NOT_FOUND: referenced content identity cannot be resolved at load/apply stage.MAT_CONTENT_LOAD_AXIS_MISMATCH: requested load axis/amount is incompatible with available content representation.MAT_CONTENT_METADATA_CONFLICT: runtime detects conflicting immutable content metadata during merge/load.- Scientific-model diagnostics are owned by Section 8.8.2; unresolved or invalid provider output never mutates material state.
Contract:
- These diagnostics are emitted in the content-aware runtime path.
- They do not replace existing
MAT_BINDING_NOT_FOUNDand conservation diagnostics.
8.8.2 Scientific Model Diagnostics
MAT_SCIENTIFIC_MODEL_UNRESOLVED: no selected provider produced an applicable typed decision.MAT_SCIENTIFIC_MODEL_FAILED: the selected provider failed before producing a proposal.MAT_SCIENTIFIC_MODEL_PROPOSAL_INVALID: the selected provider produced a proposal rejected by kernel validation.
Contract:
- Provider diagnostics are structured evidence; they do not directly become committed runtime diagnostics.
- Runtime maps provider status and validation outcome to the codes above.
- Every failure path leaves committed material state unchanged.
- Runtime MUST NOT replace these outcomes with an equal-split or other guessed scientific result.
8.9 Earliest-Decidable Rule
Diagnostics should be emitted by the earliest stage that can decide them:
- Step/arg/name contract failures at semantic stage
- Constructor whitelist/shape failures at semantic stage
- Unit/dimension and metadata type incompatibilities at type stage
- Execution-entry selection at entry-resolution stage
- Reference graph and plan consistency issues at plan stage
- Source and dependency loading errors at load/frontend stage
- State-dependent failures at runtime/material stage
8.10 Diagnostic Object Contract
Diagnostic objects should include:
codemessageseverityspan(where available)node_id(where available)
Diagnostic object fields:
- The shared diagnostic object carries
code,message,severity,span, andnode_id. stageand stability classification are diagnostic classifications; they are not required fields on every in-memory diagnostic object.
8.11 Conformance Boundary
Diagnostic producers across source loading, semantic validation, type checking, entry resolution, planning, runtime execution, and material-state handling must conform to the diagnostic codes and stage placement in this chapter. Module layout and test file names are not part of the diagnostic contract.
