12. Conformance and Test Mapping
12.1 Conformance Claim
A baseline conformance claim requires:
- Normative behavior alignment with this requirement set, especially Chapter 4 and Chapters 5-9
- Passing mapped conformance tests for the baseline
- Versioned evidence artifacts for regression comparability
12.2 Coverage Domains
Conformance covers:
- Grammar/parser behavior
- AST to IR compilation and span guarantees
- Semantic validation contracts
- Type and unit checking
- Plan lowering behavior
- Runtime state transitions and error policy
- Material conservation and binding behavior
- Surface sugar to domain built-in lowering contracts
- Content classification whitelist and diagnostic-stage mapping
- Runtime material-accounting and report-projection behavior
Scope:
- Conformance scope includes single-source parsing, definition dependency loading, and CLI batch fan-out behavior.
LOAD_*diagnostics and entry-source/dependency-loading hard-error behavior require dedicated conformance rows because source loading is part of the public execution contract.- Protocol parameterization (
protocolparams + named call args +PLAN_CALL_*) is part of scope. - Repeat-binding scope coverage MUST accept name reuse across sibling repeat statements whose scopes do not overlap and reject shadowing of parameters, local
letnames, or active enclosing repeat bindings. - Entry-source script execution and omission of dependency-file top-level statements from execution are part of scope.
- CLI single-run and batch execution surfaces are part of scope.
- Direct execution of an entry source without an executable entry fails, while the same source remains valid as a definition dependency.
12.3 Requirement-to-Test Matrix Source
Requirement-to-test mapping is maintained across:
culsma-reference/04_surface_grammar_and_statement_forms.mdculsma-reference/05_operation_vocabulary_and_call_contracts.mdculsma-reference/06_validation_and_diagnostics.mdculsma-reference/07_execution_model.md- the project conformance test suite that checks those contracts
The combined reference-plus-tests surface is the conformance registry for the baseline.
12.4 Minimal CI Gate
Minimum suite for a baseline conformance claim:
- parser/source-surface tests
- frontend resolution tests
- IR compilation tests
- semantic validation tests
- type/unit checking tests
- plan-lowering tests
- runtime execution tests
- material-state compute tests
- Appendix A fixture coverage
- container/content constructor and material-state tests
12.5 Evidence Artifacts
Recommended evidence bundle includes:
- parser / IR / plan assertions captured by unit tests
- runtime
events,step_status, andprotocol_outputsassertions from kernel runtime tests - CLI artifact bundles (
summary.json,ast.json,ir.json,validate.json,typecheck.json,plan.json,run.json,output.json,result.json) when generated for regression evidence - Machine-readable single-run CLI output that keeps protocol returns separate from the derived run report
- Machine-readable batch CLI output where each item preserves an independent return value, report, diagnostics, and runtime artifact set
- Appendix A fixture evidence
- Diagnostic summaries and failing-case traces
12.6 Change Management Rule
Spec-changing updates must be synchronized across:
- Requirement text
- Requirement-to-test mapping rows
- Test implementation and snapshots
A change is not complete until all three layers are updated together.
12.7 Non-Conformance Cases
Typical non-conformance examples:
- Behavior changes without updating requirement mappings
- New diagnostics without stable code contracts
- Passing implementation tests that no longer map to declared requirements
- Sugar-lowering behavior changes without updating constructor contract tests
- Whitelist policy changes without updating semantic/type/runtime diagnostic mapping
12.8 Material Content Requirement Mapping
The following referenced requirements must have test rows before claiming baseline conformance:
- Chapter 6
content_kindwhitelist enforcement under strict mode - Chapter 6 closed canonical
content_typetable andother_*fallback behavior - Chapter 4/6 constructor lowering equivalence (
blood(...)vs canonicalDefineContent(...)) - Chapter 8 earliest-decidable diagnostics for content contract failures
- Chapter 7/8 runtime material diagnostics for missing/invalid content identities
- Chapter 8 content diagnostic mapping table alignment (
8.2.2) - Chapter 6
attrs.roletreatment without a top-levelroleAPI - Chapter 7 and the Scientific Model Extension Contract: authored-decision precedence, explicit capability binding, built-in default provider, provenance, proposal validation, and unresolved results without mutation.
- Built-in Material Rulebook provider behavior, including canonical classification, exact ideal routing, relationship transitions, and explicit
UNRESOLVEDinstead of conservative equal-split guesses. - Author-supplied
sep.transitionsbehavior, including ordered live-material index selectors, exact container-local entry-ID selectors, static selector aliases, omission of zero-quantity entries, exact program-owned output-enum matching, every pair in the closed author-settableMaterialRelationdomain, rejection of strings, bare identifiers, cross-program output members, unknown members, andUNRESOLVED, typed component-entry association targets, positive-output checks, atomic candidate rejection, and thebead_bound -> freeelution regression. - Runtime component-entry collision allocation, including unsuffixed IDs,
_1/_2ordinal suffixes, and preservation of pre-existing opaque IDs.
12.9 Conformance Evidence Categories
culsma-reference/04_surface_grammar_and_statement_forms.mdculsma-reference/05_operation_vocabulary_and_call_contracts.mdculsma-reference/06_validation_and_diagnostics.mdculsma-reference/07_execution_model.md- conformance-linked project tests
12.10 Statement-First Atomic Contract Coverage
Conformance should include explicit rows for Chapter 6 atomic contracts:
<<parsing + style constraints (full-transfer vs quantified, program source shape).source.partition(program)[i]mutation source parsing, accepted binary partition program family, invalid program rejection, static binary index validation, and mutation-source-only context rejection.container.contents[i]mutation source parsing, static index validation, mutation-source-only context rejection, missing/stale/preservation-context contents-state runtime diagnostics, selected-part transfer, and same-container disturbance behavior.with envshape and required target binding.sepcore/program split binding, concrete*_program(...)family checks, program-specific material component partition coverage, let-bound group return compatibility, and standalone contents-state behavior.fracordered return, stable index usage, let-bound group return compatibility, and standalone contents-state behavior.img/ecp/phyreadout call contracts and return type checks.agitover a single container, an explicit container group, and a let-bound container group, including independent per-member effects, preservation of material quantities, invalidation of prior indexed-contents organization, and failure before group effects when any member cannot be resolved.plate(...)selector expansion, including inheritance of an explicit per-wellcapacity, static indexing of the resulting ordered well group, original-well identity preservation, and out-of-range index rejection.- Chapter 7 logical container identity distinctions across definition scopes, repeated or nested invocations, and allocating iterations, including their independence from labels, external identifiers, and physical-carrier metadata. Coverage checks observable identity behavior and does not prescribe an identifier representation or encoding.
12.10.1 Electrical Control and Disruption Method Mapping
The following hooks cover the accepted Chapter 6 program contracts and the Chapter 8/11 diagnostic and unit boundaries. Test identifiers refer to the companion Culsma implementation; they are evidence, not additional semantics.
| Requirement | Conformance hook | Implementation evidence |
|---|---|---|
FIELD-CONTROL-01 | Accept exactly one of voltage, current, or the compatibility field alias; reject missing and conflicting controls. | tests/test_kernel_validate.py: test_validate_field_program_accepts_one_electrical_control_mode, test_validate_field_program_requires_an_electrical_control_mode, test_validate_field_program_rejects_conflicting_control_modes |
FIELD-CONTROL-02 | Emit SEM_FIELD_PROGRAM_FIELD_ALIAS for field; canonicalize inline and let-bound descriptors to voltage. | tests/test_kernel_validate.py: test_validate_field_program_field_alias_warns; tests/test_kernel_plan.py: test_plan_canonicalizes_field_program_control_args, test_plan_canonicalizes_let_bound_field_program_alias |
FIELD-CONTROL-03 | Accept electric-potential units for voltage/field and electric-current units for current; reject cross-dimension controls. | tests/test_kernel_typecheck.py: test_typecheck_field_program_accepts_typed_electrical_control_modes, test_typecheck_field_program_rejects_wrong_control_dimensions |
FIELD-CONTROL-04 | The bundled Electrophoresis portal lowers its voltage parameter through field_program(voltage=...). | tests/test_kernel_plan.py: test_plan_let_bound_electrophoresis_stdlib_has_no_legacy_electrophoresis_step |
DISRUPT-METHOD-01 | Accept omitted method and all five controlled method values; reject unknown values. | tests/test_kernel_validate.py: test_validate_disrupt_program_accepts_current_optional_args, test_validate_disrupt_program_accepts_device_independent_methods, test_validate_disrupt_program_rejects_unknown_method |
DISRUPT-METHOD-02 | Keep equipment binding outside disrupt_program; reject a device argument. | tests/test_kernel_validate.py: test_validate_disrupt_program_rejects_device_binding |
Additional coverage for environment targets and container target views:
| Coverage area | Required coverage |
|---|---|
| Env target declaration shape | canonical positional hold(target) form, scope legality, direct-child declaration collection, legacy named-argument compatibility, and preservation that hold(...) declarations do not narrow the lexical env context for executable body statements |
| Container target-view accessors | accepted contents and structure.top/bottom/sidewall forms, plus rejection of incomplete, invalid, or deeper structure paths |
| Target-view typing | target views accepted only in HoldTarget / ContainerTargetView positions and rejected as ordinary material containers |
| Grouped target views | explicit grouping of target-view expressions and rejection of unsupported broadcast-like member access |
| Diagnostic and error mapping | hold scope/shape failures covered as source/compile hard errors; invalid target-view paths covered by SEM_CONTAINER_TARGET_VIEW_INVALID; target-view use in material-container positions covered by TYPE_CONTAINER_TARGET_VIEW_POSITION_INVALID |
12.11 Observation Non-Mutation Coverage
Conformance should include checks that:
img/ecp/phydo not mutate material-state quantities.- Observation outputs are persisted as readout/result references.
- Material conservation assertions are not incorrectly applied to pure readout steps.
12.12 Protocol Return Projection Coverage
Conformance should include checks that:
- Returning a single concrete container projects
container_ref. - Returning multiple named concrete containers preserves named bindings and projects each binding as
container_ref. - Returning direct
group([c1, c2])projectscontainer_group_refwith orderedmembersandmember_count. - Returning a let-bound
group([c1, c2])projectscontainer_group_refwith orderedmembersandmember_count. - Returning a
sepgroup projects both ordered material slots ascontainer_group_ref. - Returning a
fracgroup projects all ordered material slots ascontainer_group_ref. - Returning a plate selector-derived well group projects all ordered selected wells as
container_group_ref. - Returning
data_refordata_group_refremains a data/readout projection and is not coerced into material projection. - CLI output renders
container_group_refclearly while preserving existing single-container display behavior.
12.13 Core Scope Boundary
Core conformance mapping stops at the atomic statement/operator layer.
Higher-level workflow libraries are outside the scope of this chapter.
12.14 Material-Accounting Report Coverage
Conformance tests for the Chapter 9 derived report contract MUST cover:
- registration of externally supplied initial inventory as input lots;
- registration of stocks introduced by
LoadContentas input lots; - source-to-destination accounting for multi-source and multi-target material movements;
- Chapter 9 runtime rejection with
MAT_MOVEMENT_CONTRACT_MISSINGwhen material quantities change without an auditable movement contract; - exclusion of generated intermediate material from reagent consumption unless explicitly registered as inputs;
- complete, untruncated reagent-consumption output;
- Chapter 9 independent volume and mass accounting, including
nullfor an unavailable quantity axis; and - report assertions covering every semantic content area required by Chapter 9, independently of implementation-specific envelope or schema-title names.
- independent cell-count load, movement, accounting, and public-result projection without container-volume inflation; and
- preservation of count through
sepandfrac, including a suspension whose cellular count and carrier volume follow different partition fates. - constructor finalization for explicit carrier, count-only inferred carrier, adherent count without carrier, invalid policy, and capacity overflow;
- count-to-volume resolution shared by ordinary, source-local partition, and indexed-contents transfers, including non-homogeneous rejection and quantity-axis conflicts; and
- separation fate precedence for authored rules and selected-provider decisions, including invalid rules, missing source content, invalid provider proposals, and no mutation on unresolved results.
- separation aggregate projection from routed component quantities for volume-only, mass-only, count-plus-carrier, and mixed-axis material; aggregate fields must equal the normalized detail projection; compatibility-only aggregate input must become movable, provenance-bearing component detail before separation, and stale aggregate cache values must not affect routing.
- exact built-in-provider routing of sedimentable cellular content under
centrifuge_program: zero cellular count insupernatant, complete cellular count inpellet, conservation across both slots, independently routed carrier volume, and exclusion of zero-quantity cells from primary-component reporting. - invariant material execution with and without external inventory input: undeclared sources and insufficient runtime material fail identically, conservation remains enforced, and no source is provisioned or topped up.
- optional post-runtime inventory reconciliation: checked/sufficient status, required/available/shortage/remaining quantities on independent axes, external shortage without runtime failure, and no mutation of runtime or supplied inventory state.
- cross-container movement of counted cells with container-surface association: the moved fraction becomes a suspension, the residual source remains adherent, canonical
attrs.stateand the compatibilityattrs.culture_statespelling behave consistently, stale separation-output partition classes are replaced, and unrelated non-homogeneous states are not released. - explicit third-party provider replacement and explicit composite-provider fallback, including recorded provider identity/version/configuration and proof that runtime never appends an implicit built-in fallback.
