Skip to content
(Lispex)2.0Specification · not released

Search documentation

Searches the English specification

Enter a question, symbol, diagnostic code, or command.

Contents

Search the specification
Lispex 2.0 · Diagnostics · V.16

V.16

Diagnostics

Diagnostic phases, stable codes, condition data, and failure reports.

Scope

Use a diagnostic phase and stable code to identify a failure. Canonical condition data carries its meaning. Source paths, translated messages, and stack displays help locate and explain it.

The reader and evaluation cases have distinct phase identities. Their 2.0 expectations follow exact number semantics. Conditions defines guest recovery and terminal failure.

Phase and code

A diagnostic identity combines its phase and stable code. Its data follows the closed catalog. Reading and resolving belong to preparation. Guest Conditions use phase evaluate. Resource exhaustion, admission refusal, profile work, host interruption, and engine defects retain separate identities.

16.1 Identify a failure by phase and code

A diagnostic has a phase, a stable code, and typed canonical parameters. A code alone does not identify the failure. Reader failures and evaluation failures have distinct phase identities. Translated messages and file names do not replace those fields.

Why

The same short code can otherwise describe unrelated failures. Phase and structured data let callers identify the error without parsing human wording.

Identify the evaluation phase

lispex.example.v2.cli-and-diagnostics.domain-identity · rev. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (car input)))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to complete preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "empty-list"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Conditiondomain.type
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "condition": {
    "phase": "evaluate",
    "code": "domain.type",
    "data": {
      "operation": "car",
      "argument": "0",
      "path": [],
      "expected": "pair",
      "actual": "empty-list"
    }
  }
}

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "diagnostic": {
    "phase": "evaluate",
    "code": "domain.type",
    "data": {
      "operation": "car",
      "argument": "0",
      "path": [],
      "expected": "pair",
      "actual": "empty-list"
    }
  }
}
Product invocation

Expected result

The failure of car has an evaluation phase and typed domain parameters. Product invocation awaits its 2.0 adapter.

The source and request files express the 2.0 case. The request file is documentation notation. It does not define command options, codec bytes, artifact fields, diagnostic codes or numeric exit values. Each product plan compares the complete authored expectation. Product execution awaits the 2.0 observation adapter.

Report an incomplete source form

lispex.example.v2.cli-and-diagnostics.reader-phase · rev. 4

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      input)
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to complete preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Result[]

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "prepareReport": {
    "kind": "source-bound-failure",
    "phase": "read",
    "sourceIdentityAvailable": true,
    "programIdentityAvailable": false,
    "canonicalEvaluationSiteAvailable": false,
    "entryEvaluated": false,
    "diagnostic": {
      "phase": "read",
      "code": "source.delimiter",
      "data": {
        "reason": "unexpected-end"
      }
    }
  },
  "diagnostic": {
    "phase": "read",
    "code": "source.delimiter",
    "data": {
      "reason": "unexpected-end"
    }
  },
  "exitStatuses": [
    10
  ]
}
Product invocation

Expected result

The reader reports an incomplete form against the exact source. No entry evaluation occurs. Product invocation awaits its 2.0 adapter.

The source and request files express the 2.0 case. The request file is documentation notation. It does not define command options, codec bytes, artifact fields, diagnostic codes or numeric exit values. Each product plan compares the complete authored expectation. Product execution awaits the 2.0 observation adapter.

16.2 Identify every diagnostic by phase and code

A diagnostic identity is the pair of its phase and code. Every identity uses exactly one schema below. A code alone is insufficient.

PhaseMeaning
invocationCommand arguments are being checked.
ingestionThe product is reading an explicitly supplied host operand.
decodePreparation is decoding source text.
readPreparation is reading source forms.
normalizePreparation is checking and normalizing forms.
resolvePreparation is resolving lexical and module names.
preparePreparation is completing entry or resource checks.
admissionThe product is checking a request before an admitted evaluation exists.
evaluateAn admitted request is decoding values, executing, or checking and encoding its result.
qualificationThe selected profile is checking a completed language result.
evidenceThe selected profile is producing or checking required evidence.
verifyThe product is checking supplied verification operands under its finite host budget.
replayA rerun differs from its required replay operand.
renderThe product is writing a command result or another requested output.
hostAn operational interruption or engine defect ended the attempt.

Source and binding failures follow their source, binding, and preparation rules. This table classifies those failures. It adds no source syntax or module loading behavior.

PhaseCodeExact data fields
decodesource.encodingreason uses SourceEncodingReason
readsource.tokenreason uses SourceTokenReason
readsource.delimiterreason uses SourceDelimiterReason
readsource.numberreason uses SourceNumberReason
normalizesyntax.formform uses Text, reason uses SyntaxReason
normalizebinding.initializerform uses InitializerForm, name uses Text, expected uses InitializerExpectation
normalizebinding.immutablename uses Text
normalize, resolvebinding.duplicatename uses Text, scope uses BindingScope
resolvebinding.unresolvedname uses Text
resolvemodule.referencemodule uses Text, name uses TextOrFalse, reason uses ModuleReason
resolvelibrary.referencename uses Text, reason uses LibraryReason
prepareentry.declarationreason uses EntryReason

The condition catalog defines every guest Condition code and its exact semantic field schema. Each becomes a diagnostic with phase evaluate. This chapter imports those codes and schemas without adding members or fields. The typed field rule defines their wire projection.

Condition field typeDiagnostic field type
StringText
StringOrFalseTextOrFalse
DatumDatumBytes
Every other catalog typeThe same named type with the serialized form below

Entry result checks and terminal resource failures have separate identities. They have no guest Condition constructor.

PhaseCodeExact data fields
evaluatevalue.boundaryreason uses BoundaryReason, count uses Nat, path uses DataPath, actual uses TypeTagOrFalse
prepare, evaluateresource.exhaustedstage uses ResourceStage, axis uses ResourceAxis, event uses EventIdentity

A preparation limit failure uses phase prepare. Its stage records the interrupted preparation step. An evaluation limit failure uses phase evaluate. Its stage records the interrupted evaluation step.

Before a canonical input has been accepted, malformed input uses admission and input.codec. Invalid UTF-8 inside a canonical input packet uses reason invalid-utf8. Source UTF-8 failures use decode and source.encoding. Guest bytevector text conversion uses domain.range with reason invalid-utf8. Input decoding still spends EvaluationLimits. Exhaustion before request identity exists uses admission and input.resource. The charged account does not select the diagnostic phase.

PhaseCodeExact data fields
admissioninput.codecreason uses InputCodecReason
admissioninput.resourceaxis uses InputResourceAxis
admissionrequest.invalidfield uses Text, reason uses RequestReason
admissionproduct.unsupportedsubject uses ProductSubject, requested uses ContractIdentity
admissionartifact.invalidkind uses ArtifactKind, reason uses ArtifactReason
admissioninput.arityexpected uses Nat, actual uses Nat
admissioninput.valueactual uses HostTypeTag, path uses DataPath
admissionhost.envelopecontract uses ContractIdentity, reason uses EnvelopeReason
admission, qualificationrecord.keyentry uses Nat, actual uses HostTypeTag
admission, qualificationrecord.duplicatekey uses Text, first uses Nat, second uses Nat
admission, qualificationrecord.missingkey uses Text

Record identities describe host record mapping. They do not create a guest record value kind. A missing field is reported only when the selected mapping requires that field.

PhaseCodeExact data fields
admissionprofile.admissionprofile uses Identity, rule uses Identity, reason uses ProfileAdmissionReason
qualificationprofile.qualificationprofile uses Identity, rule uses Identity, reason uses QualificationReason
evidenceprofile.evidenceprofile uses Identity, requirement uses Identity, reason uses EvidenceReason
admission, qualification, evidenceprofile.budgetprofile uses Identity, budget uses HostBudgetFieldName

Admission produces no canonical evaluation outcome or evaluation receipt. Qualification and evidence reports preserve the completed language outcome and its receipt eligibility. Profile budget failure uses the phase of the interrupted profile work.

PhaseCodeExact data fields
verifyverification.failedcheck uses VerificationCheck
verifyverification.budgetbudget uses HostBudgetFieldName
replayreplay.mismatchcomponent uses ReplayComponent
invocationcommand.invalidargument uses Nat, reason uses CommandReason
ingestiontransport.inputoperand uses InputOperand, reason uses TransportInputReason
rendertransport.outputchannel uses OutputChannel, reason uses TransportOutputReason
hosthost.interruptedstage uses PhaseTag, reason uses HostReason
hostengine.defectstage uses PhaseTag, reason uses DefectReason

The command argument position starts at zero after the executable token. A missing option value names its introducing option. A missing required option names the end of the argument vector. Input and output transport failures belong to host activity. They do not become guest conditions.

For value.boundary, a count failure has count other than 1, an empty path, and false actual. A non-Datum result uses count 1, its first invalid path, and its type tag. Result checks run after the entry and its guards have returned.

Rows sharing a code have the same field schema. Their phases still distinguish their identities. Unknown pairs are rejected. No historical code is silently renamed.

The typed field rule defines serialized values. Exit mapping maps these phases and failure classes to command status.

Standalone verification uses verify and verification.budget when its finite host budget is exhausted. It preserves recorded outcomes and receipts. It creates no new evaluation receipt.

Evidence bound to another receipt uses verification.failed with evidence-binding. Replay operands bound to different requests use artifact.invalid with identity-mismatch before entry.

The source and preparation mapping assigns these identities to each failed source or prepared artifact check.

Identity work uses the diagnostic of the operation that owns its finite account. A refused host work reservation during profile admission uses admission/profile.budget; during qualification or evidence it uses that phase and profile.budget. The required profile field is the already selected builtin ProfileContractIdentity, and budget is work. Standalone verification work uses verify/verification.budget with budget = work. These closed catalog pairs also apply when hashing, rather than another host check, is the rejected work. Identity helpers do not reclassify such refusals as input.resource or spend EvaluationLimits. Physical host failures retain the host rows. Preparation and evaluation account refusals retain their own resource rows. This mapping selects no new hash event, coefficient, budget default, or check order.

Why

The phase distinguishes failures that have different request and receipt boundaries. Stable codes and typed fields make product behavior comparable. Keeping host admission and profile work separate preserves the result already computed by the language.

Identity hashing uses the host work account of the operation that requests it. The complete event schedule and effective profile host budget remain in Profiles, while the diagnostic catalog fixes their wire observations.

Distinguish source decoding and form failures

lispex.example.v2.cli-and-diagnostics.diagnostics.source-phases · rev. 1

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) input))
)
bom.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) input))
)
directive.scm
#lang lispex
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) input))
)
unclosed.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) input)
)
guard.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (guard (condition (else 0) (#t 1)) input)))
)
unresolved.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) missing))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient through the stated preparation check",
    "evaluate": "finite values sufficient through the stated evaluation and reporting checks"
  },
  "sourceByteNotation": "sourceBytesHex supplies exact source bytes for that case. It does not define a public bundle encoding.",
  "requests": [
    {
      "sourceBytesHex": "ff",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "sourceBytesHex": "ff"
        }
      ]
    },
    {
      "source": "bom.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "bom.scm"
        }
      ]
    },
    {
      "source": "directive.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "directive.scm"
        }
      ]
    },
    {
      "source": "unclosed.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "unclosed.scm"
        }
      ]
    },
    {
      "source": "guard.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "guard.scm"
        }
      ]
    },
    {
      "source": "unresolved.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "unresolved.scm"
        }
      ]
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Diagnosticsource.encoding
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "decode",
    "code": "source.encoding",
    "data": {
      "reason": "invalid-utf8"
    }
  },
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticsource.token
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "read",
    "code": "source.token",
    "data": {
      "reason": "unexpected-source-scalar"
    }
  },
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticsource.token
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "read",
    "code": "source.token",
    "data": {
      "reason": "unsupported-reader-prefix"
    }
  },
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticsource.delimiter
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "read",
    "code": "source.delimiter",
    "data": {
      "reason": "unexpected-end"
    }
  },
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticsyntax.form
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "normalize",
    "code": "syntax.form",
    "data": {
      "form": "guard",
      "reason": "else-position"
    }
  },
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticbinding.unresolved
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "resolve",
    "code": "binding.unresolved",
    "data": {
      "name": "missing"
    }
  },
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "reports": {
    "sourceBound": true,
    "programIdentityAvailable": false,
    "canonicalEvaluationSiteAvailable": false,
    "guestControlEntered": false
  }
}
Product invocation

Expected result

Invalid bytes fail decoding. A leading mark and directive fail reading. Form and binding failures retain their own phases. Product execution awaits its 2.0 adapter.

The request uses documentation notation. A fixtureIdentity, fixtureEvent, or fixtureBudgetField stands for the owning contract value. These markers are not serialized field values. Product execution remains not-run.

Distinguish static bindings from runtime calls

lispex.example.v2.cli-and-diagnostics.diagnostics.bindings-and-calls · rev. 1

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (set! input 1)))
)
duplicate.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (let ((x 1) (x 2)) x)))
)
initializer.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (letrec ((x 1)) x)))
)
not-callable.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (0 1)))
)
arity.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) ((lambda (a b) a) 1)))
)
values.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (+ (values 1 2) 3)))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient through the stated preparation check",
    "evaluate": "finite values sufficient through the stated evaluation and reporting checks"
  },
  "requests": [
    {
      "source": "source.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "source.scm"
        }
      ]
    },
    {
      "source": "duplicate.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "duplicate.scm"
        }
      ]
    },
    {
      "source": "initializer.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "initializer.scm"
        }
      ]
    },
    {
      "source": "not-callable.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "not-callable.scm"
        }
      ]
    },
    {
      "source": "arity.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "arity.scm"
        }
      ]
    },
    {
      "source": "values.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "values.scm"
        }
      ]
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Diagnosticbinding.immutable
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "normalize",
    "code": "binding.immutable",
    "data": {
      "name": "input"
    }
  },
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticbinding.duplicate
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "normalize",
    "code": "binding.duplicate",
    "data": {
      "name": "x",
      "scope": "let"
    }
  },
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticbinding.initializer
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "normalize",
    "code": "binding.initializer",
    "data": {
      "form": "letrec",
      "name": "x",
      "expected": "lambda"
    }
  },
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticruntime.not-callable
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "evaluate",
    "code": "runtime.not-callable",
    "data": {
      "actual": "integer"
    }
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}
Diagnosticruntime.arity
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "evaluate",
    "code": "runtime.arity",
    "data": {
      "minimum": "2",
      "maximum": "2",
      "actual": "1"
    }
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}
Diagnosticruntime.value-count
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "evaluate",
    "code": "runtime.value-count",
    "data": {
      "expected": "1",
      "actual": "2"
    }
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "conditions": {
    "onlyEvaluateRowsHaveGuestConditions": true,
    "procedureAddressReported": false,
    "countsUseExactDecimalStrings": true
  }
}
Product invocation

Expected result

Static binding failures stop preparation. Runtime call failures use the same Condition identities on every product. Product execution awaits its 2.0 adapter.

The request uses documentation notation. A fixtureIdentity, fixtureEvent, or fixtureBudgetField stands for the owning contract value. These markers are not serialized field values. Product execution remains not-run.

Locate value boundaries and equality failures

lispex.example.v2.cli-and-diagnostics.diagnostics.values-and-equality · rev. 1

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (lambda () 7)))
)
count.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (values 1 2)))
)
scalar.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (eq? (vector 1) #f)))
)
nested.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (equal? (list 1 (lambda () 0)) '(1 2))))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient through the stated preparation check",
    "evaluate": "finite values sufficient through the stated evaluation and reporting checks"
  },
  "requests": [
    {
      "source": "source.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "source.scm"
        }
      ]
    },
    {
      "source": "count.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "count.scm"
        }
      ]
    },
    {
      "source": "scalar.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "scalar.scm"
        }
      ]
    },
    {
      "source": "nested.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "nested.scm"
        }
      ]
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Diagnosticvalue.boundary
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "evaluate",
    "code": "value.boundary",
    "data": {
      "reason": "non-datum",
      "count": "1",
      "path": [],
      "actual": "procedure"
    }
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}
Diagnosticvalue.boundary
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "evaluate",
    "code": "value.boundary",
    "data": {
      "reason": "count",
      "count": "2",
      "path": [],
      "actual": false
    }
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}
Diagnosticdomain.equality
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "evaluate",
    "code": "domain.equality",
    "data": {
      "operation": "eq?",
      "operand": "0",
      "path": [],
      "actual": "vector"
    }
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}
Diagnosticdomain.equality
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "evaluate",
    "code": "domain.equality",
    "data": {
      "operation": "equal?",
      "operand": "0",
      "path": [
        {
          "kind": "cdr"
        },
        {
          "kind": "car"
        }
      ],
      "actual": "procedure"
    }
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "recovery": {
    "boundaryHasGuestCondition": false,
    "equalityHasGuestCondition": true,
    "pathStartsAtNamedOperand": true,
    "sourceCoordinatesInData": false
  }
}
Product invocation

Expected result

Entry boundaries distinguish result counts from invalid nested values. Equality failures retain the first invalid operand path. Product execution awaits its 2.0 adapter.

The request uses documentation notation. A fixtureIdentity, fixtureEvent, or fixtureBudgetField stands for the owning contract value. These markers are not serialized field values. Product execution remains not-run.

Separate host record mapping from numeric conditions

lispex.example.v2.cli-and-diagnostics.diagnostics.records-and-numbers · rev. 1

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) input))
)
divide.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (/ 1 0)))
)
numeric.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (raise (make-condition "domain.numeric" '(("operation" . "quantize") ("argument" . 0) ("reason" . "rounding-required"))))))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient through the stated preparation check",
    "evaluate": "finite values sufficient through the stated evaluation and reporting checks"
  },
  "recordMapping": {
    "datumRepresentation": "immutable association list of string-keyed pairs",
    "keyOrder": "unsigned UTF-8 bytes",
    "duplicates": "reject",
    "requiredFields": "only those explicitly named by the selected mapping"
  },
  "requests": [
    {
      "input": {
        "kind": "host-record",
        "fields": [
          {
            "key": {
              "kind": "integer",
              "value": "7"
            },
            "value": {
              "kind": "integer",
              "value": "1"
            }
          }
        ]
      }
    },
    {
      "input": {
        "kind": "host-record",
        "fields": [
          {
            "key": "a",
            "value": {
              "kind": "integer",
              "value": "1"
            }
          },
          {
            "key": "a",
            "value": {
              "kind": "integer",
              "value": "2"
            }
          }
        ]
      }
    },
    {
      "input": {
        "kind": "host-record",
        "fields": []
      },
      "requiredRecordFields": [
        "name"
      ]
    },
    {
      "source": "divide.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "divide.scm"
        }
      ]
    },
    {
      "source": "numeric.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "numeric.scm"
        }
      ]
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Diagnosticrecord.key
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "record.key",
    "data": {
      "entry": "0",
      "actual": "integer"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticrecord.duplicate
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "record.duplicate",
    "data": {
      "key": "a",
      "first": "0",
      "second": "1"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticrecord.missing
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "record.missing",
    "data": {
      "key": "name"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticdomain.division-by-zero
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "evaluate",
    "code": "domain.division-by-zero",
    "data": {
      "operation": "/",
      "argument": "1"
    }
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}
Diagnosticdomain.numeric
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "evaluate",
    "code": "domain.numeric",
    "data": {
      "operation": "quantize",
      "argument": "0",
      "reason": "rounding-required"
    }
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "mapping": {
    "hostRecordHasGuestValueKind": false,
    "recordFailuresEnterGuest": false,
    "numericFailuresHaveGuestConditions": true,
    "constructedNumericConditionExecutesNamedOperation": false
  }
}
Product invocation

Expected result

Host record mapping refuses invalid keys and required fields before entry. Numeric failures retain exact typed arguments and reasons. Product execution awaits its 2.0 adapter.

The request uses documentation notation. A fixtureIdentity, fixtureEvent, or fixtureBudgetField stands for the owning contract value. These markers are not serialized field values. Product execution remains not-run.

Preserve phase and first cause at resource limits

lispex.example.v2.cli-and-diagnostics.diagnostics.resource-phases · rev. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (let loop () (loop))))
)
car.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (car '())))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient through the stated preparation check",
    "evaluate": "finite values sufficient through the stated evaluation and reporting checks"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "limits": {
        "prepare": "the next source decoding work reservation fails, while every prior reservation and other axis succeeds"
      }
    },
    {
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "inputDecode": "the work account exhausts before canonical input validation completes"
    },
    {
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "limits": {
        "evaluate": "work stops the recursion while every other axis remains sufficient through the terminal report"
      }
    },
    {
      "source": "car.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "outputDelivery": "stdout transport fails after the car condition and canonical outcome are committed",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "car.scm"
        }
      ]
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Result{"kind":"prepare-failure","valueCount":0,"canonicalOutcomeProduced":false,"evaluationReceiptEligible":false,"diagnosticIdentity":{"phase":"prepare","code":"resource.exhausted"},"resource":{"stage":"decode","axis":"work","fixtureEvent":"first denied source decoding event"}}
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false,
  "diagnosticIdentity": {
    "phase": "prepare",
    "code": "resource.exhausted"
  },
  "resource": {
    "stage": "decode",
    "axis": "work",
    "fixtureEvent": "first denied source decoding event"
  }
}
Diagnosticinput.resource
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "input.resource",
    "data": {
      "axis": "work"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Resultresource-stop
Outcome details
{
  "kind": "resource-stop",
  "valueCount": 0,
  "terminal": true,
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true,
  "diagnosticIdentity": {
    "phase": "evaluate",
    "code": "resource.exhausted"
  },
  "resource": {
    "stage": "entry",
    "axis": "work",
    "fixtureEvent": "first denied evaluation work event"
  }
}
Diagnosticdomain.type
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "evaluate",
    "code": "domain.type",
    "data": {
      "operation": "car",
      "argument": "0",
      "path": [],
      "expected": "pair",
      "actual": "empty-list"
    }
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "accounting": {
    "sourceLimitAccount": "PrepareLimits",
    "preidentityInputAccount": "EvaluationLimits",
    "chargedAccountIsNotDiagnosticPhase": true,
    "numericLimitsSelected": false
  },
  "presentation": {
    "committedFailurePreserved": true,
    "secondaryHostDiagnostic": {
      "phase": "render",
      "code": "transport.output",
      "data": {
        "channel": "stdout",
        "reason": "unwritable"
      }
    },
    "workUsageInDiagnosticData": false
  }
}
Product invocation

Expected result

Source limits, preidentity input limits, and admitted execution limits have distinct identities. A later output failure preserves the committed car condition. Product execution awaits its 2.0 adapter.

The request and resource fields use documentation notation. diagnosticIdentity selects only the catalog phase and code. For resource exhaustion, resource.stage, resource.axis, and resource.fixtureEvent constrain the interrupted event without supplying serialized Diagnostic.data. The selected finite model supplies the event identity for the complete typed diagnostic. These selectors are not canonical diagnostic bytes. Product execution remains not-run.

Refuse artifacts and requests before guest entry

lispex.example.v2.cli-and-diagnostics.diagnostics.artifact-admission · rev. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) input))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient through the stated preparation check",
    "evaluate": "finite values sufficient through the stated evaluation and reporting checks"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "42"
      },
      "artifactCandidate": {
        "kind": "evaluator-artifact-description",
        "hostImports": [
          "file-read"
        ],
        "otherAdmissionChecks": "satisfied"
      }
    },
    {
      "input": {
        "kind": "integer",
        "value": "42"
      },
      "artifactCandidate": {
        "kind": "prepared-artifact-description",
        "verification": "missing required verification",
        "otherAdmissionChecks": "satisfied"
      }
    },
    {
      "input": {
        "kind": "integer",
        "value": "42"
      },
      "limitsSubmission": {
        "defect": "one required field is missing",
        "field": "work"
      }
    },
    {
      "input": {
        "kind": "integer",
        "value": "42"
      },
      "productSupport": {
        "requestedResourceModel": {
          "fixtureIdentity": "unsupported requested model"
        },
        "otherAdmissionChecks": "satisfied"
      }
    },
    {
      "input": {
        "kind": "integer",
        "value": "42"
      },
      "hostCapacity": {
        "contract": {
          "fixtureIdentity": "requested physical envelope"
        },
        "requiredPhysicalCapacityAvailable": false
      }
    },
    {
      "input": {
        "kind": "host-capability",
        "description": "a callable supplied by the host"
      }
    },
    {
      "inputCodec": {
        "validation": "noncanonical submitted input",
        "otherAdmissionChecks": "satisfied"
      }
    },
    {
      "inputCodec": {
        "validation": "invalid UTF-8 inside a canonical text field",
        "otherAdmissionChecks": "satisfied"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Diagnosticartifact.invalid
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "artifact.invalid",
    "data": {
      "kind": "evaluator",
      "reason": "host-import"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticartifact.invalid
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "artifact.invalid",
    "data": {
      "kind": "prepared",
      "reason": "unverified-content"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticrequest.invalid
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "request.invalid",
    "data": {
      "field": "work",
      "reason": "missing-field"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticproduct.unsupported
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "product.unsupported",
    "data": {
      "subject": "resource-model",
      "requested": {
        "fixtureIdentity": "unsupported requested model"
      }
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnostichost.envelope
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "host.envelope",
    "data": {
      "contract": {
        "fixtureIdentity": "requested physical envelope"
      },
      "reason": "physical-capacity"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticinput.value
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "input.value",
    "data": {
      "actual": "host-capability",
      "path": []
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticinput.codec
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "input.codec",
    "data": {
      "reason": "noncanonical"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticinput.codec
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "input.codec",
    "data": {
      "reason": "invalid-utf8"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "admission": {
    "guestControlEntered": false,
    "fallbackAuthorized": false,
    "canonicalOutcomeProduced": false,
    "evaluationReceiptEligible": false,
    "artifactBytesSpecified": false
  }
}
Product invocation

Expected result

Each request has one stated admission defect. The product reports that defect without entering guest code or changing the requested contract. Product execution awaits its 2.0 adapter.

The request uses documentation notation. A fixtureIdentity, fixtureEvent, or fixtureBudgetField stands for the owning contract value. These markers are not serialized field values. Product execution remains not-run.

Preserve language results through profile refusal

lispex.example.v2.cli-and-diagnostics.diagnostics.profile-boundaries · rev. 1

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) 7))
)
car.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (car '())))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient through the stated preparation check",
    "evaluate": "finite values sufficient through the stated evaluation and reporting checks"
  },
  "importedValues": {
    "profile": {
      "fixtureIdentity": "selected profile contract"
    },
    "rule": {
      "fixtureIdentity": "selected profile rule"
    },
    "evidenceRequirement": {
      "fixtureIdentity": "required evidence contract"
    },
    "hostBudgetField": {
      "fixtureBudgetField": "the first exhausted selected profile host budget field"
    }
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "profileWork": "input schema refuses admission"
    },
    {
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "profileWork": "output schema refuses the completed integer result"
    },
    {
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "profileWork": "required evidence is unavailable after evaluation"
    },
    {
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "profileWork": "profile host budget exhausts before admission"
    },
    {
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "profileWork": "profile host budget exhausts during qualification"
    },
    {
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "profileWork": "profile host budget exhausts during required evidence work"
    },
    {
      "source": "car.scm",
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "profileWork": "required evidence validation refuses after the recorded evaluation failure",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "car.scm"
        }
      ]
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Diagnosticprofile.admission
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "profile.admission",
    "data": {
      "profile": {
        "fixtureIdentity": "selected profile contract"
      },
      "rule": {
        "fixtureIdentity": "selected profile rule"
      },
      "reason": "input-schema"
    }
  },
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Result7
Outcome details
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "integer",
    "value": "7"
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}
Result7
Outcome details
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "integer",
    "value": "7"
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}
Diagnosticprofile.budget
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "profile.budget",
    "data": {
      "profile": {
        "fixtureIdentity": "selected profile contract"
      },
      "budget": {
        "fixtureBudgetField": "the first exhausted selected profile host budget field"
      }
    }
  },
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Result7
Outcome details
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "integer",
    "value": "7"
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}
Result7
Outcome details
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "integer",
    "value": "7"
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}
Diagnosticdomain.type
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "evaluate",
    "code": "domain.type",
    "data": {
      "operation": "car",
      "argument": "0",
      "path": [],
      "expected": "pair",
      "actual": "empty-list"
    }
  },
  "canonicalOutcomeProduced": true,
  "evaluationReceiptEligible": true
}

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "profileReports": [
    {
      "phase": "admission",
      "code": "profile.admission",
      "data": {
        "profile": {
          "fixtureIdentity": "selected profile contract"
        },
        "rule": {
          "fixtureIdentity": "selected profile rule"
        },
        "reason": "input-schema"
      }
    },
    {
      "phase": "qualification",
      "code": "profile.qualification",
      "data": {
        "profile": {
          "fixtureIdentity": "selected profile contract"
        },
        "rule": {
          "fixtureIdentity": "selected profile rule"
        },
        "reason": "output-schema"
      }
    },
    {
      "phase": "evidence",
      "code": "profile.evidence",
      "data": {
        "profile": {
          "fixtureIdentity": "selected profile contract"
        },
        "requirement": {
          "fixtureIdentity": "required evidence contract"
        },
        "reason": "unavailable-evidence"
      }
    },
    {
      "phase": "admission",
      "code": "profile.budget",
      "data": {
        "profile": {
          "fixtureIdentity": "selected profile contract"
        },
        "budget": {
          "fixtureBudgetField": "the first exhausted selected profile host budget field"
        }
      }
    },
    {
      "phase": "qualification",
      "code": "profile.budget",
      "data": {
        "profile": {
          "fixtureIdentity": "selected profile contract"
        },
        "budget": {
          "fixtureBudgetField": "the first exhausted selected profile host budget field"
        }
      }
    },
    {
      "phase": "evidence",
      "code": "profile.budget",
      "data": {
        "profile": {
          "fixtureIdentity": "selected profile contract"
        },
        "budget": {
          "fixtureBudgetField": "the first exhausted selected profile host budget field"
        }
      }
    },
    {
      "phase": "evidence",
      "code": "profile.evidence",
      "data": {
        "profile": {
          "fixtureIdentity": "selected profile contract"
        },
        "requirement": {
          "fixtureIdentity": "required evidence contract"
        },
        "reason": "invalid-evidence"
      }
    }
  ],
  "preservation": {
    "languageOutcomesRewritten": false,
    "evaluationFailureOverwrittenByEvidenceRefusal": false,
    "profileBudgetAddedToLanguageRequest": false,
    "guestRecoveryEntered": false
  }
}
Product invocation

Expected result

Admission has no evaluation outcome. Later qualification and evidence refusals preserve completed values and failures. Product execution awaits its 2.0 adapter.

The request uses documentation notation. A fixtureIdentity, fixtureEvent, or fixtureBudgetField stands for the owning contract value. These markers are not serialized field values. Product execution remains not-run.

Hash refusal keeps its host operation phase

lispex.example.v2.cli-and-diagnostics.diagnostics.identity-hash-owner · rev. 1

lispex · request.json
{
  "notation": "documentation-request",
  "operation": "identity-host-reservation",
  "scope": "Four independent component boundaries with an already selected work owner. These cases do not run qualification after an ineligible outcome or invent a profile event schedule.",
  "profileContractInput": {
    "kind": "profile",
    "name": "base/2",
    "definition": {
      "format": "lispex.profile-contract/2",
      "profile": "base",
      "declaration_format": "lispex.profile/2",
      "schema_format": "lispex.schema/2",
      "work_contract": "lispex.profile-work/2"
    }
  },
  "profileContractIdentityCalculation": {
    "preimageHex": "6c69737065782e646174756d2f3200a50208080606646f6d61696e06116c69737065782e636f6e74726163742f3208080606666f726d617406176c69737065782e6964656e746974792d696e7075742f32080806077061796c6f61640808060a646566696e6974696f6e080806126465636c61726174696f6e5f666f726d617406106c69737065782e70726f66696c652f3208080606666f726d617406196c69737065782e70726f66696c652d636f6e74726163742f320808060770726f66696c650604626173650808060d736368656d615f666f726d6174060f6c69737065782e736368656d612f320808060d776f726b5f636f6e747261637406156c69737065782e70726f66696c652d776f726b2f3200080806046b696e64060770726f66696c65080806046e616d650606626173652f320000",
    "digestHex": "ee922f05c6247a298f4dcabadaf65f819ee3f3f3a9d15abeda3c9ff704056ab1",
    "identityBytesHex": "6c69737065782e646174756d2f320067080806066469676573740a20ee922f05c6247a298f4dcabadaf65f819ee3f3f3a9d15abeda3c9ff704056ab108080606646f6d61696e06116c69737065782e636f6e74726163742f3208080606666f726d617406116c69737065782e6964656e746974792f3200"
  },
  "remainingWork": "0",
  "requiredHashWork": "1",
  "reservationEffect": "No hash starts because 1 exceeds 0.",
  "cases": [
    {
      "owner": "profile-work",
      "phase": "admission",
      "diagnostic": {
        "phase": "admission",
        "code": "profile.budget",
        "data": {
          "profile": {
            "format": "lispex.identity/2",
            "domain": "lispex.contract/2",
            "digest": {
              "bytevectorHex": "ee922f05c6247a298f4dcabadaf65f819ee3f3f3a9d15abeda3c9ff704056ab1"
            }
          },
          "budget": "work"
        }
      },
      "diagnosticPayloadBytesHex": "6c69737065782e646174756d2f3200b80108080604636f6465060e70726f66696c652e6275646765740808060464617461080806066275646765740604776f726b0808060770726f66696c65080806066469676573740a20ee922f05c6247a298f4dcabadaf65f819ee3f3f3a9d15abeda3c9ff704056ab108080606646f6d61696e06116c69737065782e636f6e74726163742f3208080606666f726d617406116c69737065782e6964656e746974792f320000080806057068617365060961646d697373696f6e00"
    },
    {
      "owner": "profile-work",
      "phase": "qualification",
      "diagnostic": {
        "phase": "qualification",
        "code": "profile.budget",
        "data": {
          "profile": {
            "format": "lispex.identity/2",
            "domain": "lispex.contract/2",
            "digest": {
              "bytevectorHex": "ee922f05c6247a298f4dcabadaf65f819ee3f3f3a9d15abeda3c9ff704056ab1"
            }
          },
          "budget": "work"
        }
      },
      "diagnosticPayloadBytesHex": "6c69737065782e646174756d2f3200bc0108080604636f6465060e70726f66696c652e6275646765740808060464617461080806066275646765740604776f726b0808060770726f66696c65080806066469676573740a20ee922f05c6247a298f4dcabadaf65f819ee3f3f3a9d15abeda3c9ff704056ab108080606646f6d61696e06116c69737065782e636f6e74726163742f3208080606666f726d617406116c69737065782e6964656e746974792f320000080806057068617365060d7175616c696669636174696f6e00"
    },
    {
      "owner": "profile-work",
      "phase": "evidence",
      "diagnostic": {
        "phase": "evidence",
        "code": "profile.budget",
        "data": {
          "profile": {
            "format": "lispex.identity/2",
            "domain": "lispex.contract/2",
            "digest": {
              "bytevectorHex": "ee922f05c6247a298f4dcabadaf65f819ee3f3f3a9d15abeda3c9ff704056ab1"
            }
          },
          "budget": "work"
        }
      },
      "diagnosticPayloadBytesHex": "6c69737065782e646174756d2f3200b70108080604636f6465060e70726f66696c652e6275646765740808060464617461080806066275646765740604776f726b0808060770726f66696c65080806066469676573740a20ee922f05c6247a298f4dcabadaf65f819ee3f3f3a9d15abeda3c9ff704056ab108080606646f6d61696e06116c69737065782e636f6e74726163742f3208080606666f726d617406116c69737065782e6964656e746974792f320000080806057068617365060865766964656e636500"
    },
    {
      "owner": "standalone-verification",
      "phase": "verify",
      "diagnostic": {
        "phase": "verify",
        "code": "verification.budget",
        "data": {
          "budget": "work"
        }
      },
      "diagnosticPayloadBytesHex": "6c69737065782e646174756d2f32004808080604636f64650613766572696669636174696f6e2e6275646765740808060464617461080806066275646765740604776f726b00080806057068617365060676657269667900"
    }
  ],
  "transportNotation": "bytevectorHex denotes the exact bytevector value inside a record. Every diagnosticPayloadBytesHex is a complete D(Diagnostic) packet."
}
Specification outcome
ExpectationSemantic details

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "diagnosticIdentities": [
    {
      "phase": "admission",
      "code": "profile.budget"
    },
    {
      "phase": "qualification",
      "code": "profile.budget"
    },
    {
      "phase": "evidence",
      "code": "profile.budget"
    },
    {
      "phase": "verify",
      "code": "verification.budget"
    }
  ],
  "diagnosticPayloadBytesHex": [
    "6c69737065782e646174756d2f3200b80108080604636f6465060e70726f66696c652e6275646765740808060464617461080806066275646765740604776f726b0808060770726f66696c65080806066469676573740a20ee922f05c6247a298f4dcabadaf65f819ee3f3f3a9d15abeda3c9ff704056ab108080606646f6d61696e06116c69737065782e636f6e74726163742f3208080606666f726d617406116c69737065782e6964656e746974792f320000080806057068617365060961646d697373696f6e00",
    "6c69737065782e646174756d2f3200bc0108080604636f6465060e70726f66696c652e6275646765740808060464617461080806066275646765740604776f726b0808060770726f66696c65080806066469676573740a20ee922f05c6247a298f4dcabadaf65f819ee3f3f3a9d15abeda3c9ff704056ab108080606646f6d61696e06116c69737065782e636f6e74726163742f3208080606666f726d617406116c69737065782e6964656e746974792f320000080806057068617365060d7175616c696669636174696f6e00",
    "6c69737065782e646174756d2f3200b70108080604636f6465060e70726f66696c652e6275646765740808060464617461080806066275646765740604776f726b0808060770726f66696c65080806066469676573740a20ee922f05c6247a298f4dcabadaf65f819ee3f3f3a9d15abeda3c9ff704056ab108080606646f6d61696e06116c69737065782e636f6e74726163742f3208080606666f726d617406116c69737065782e6964656e746974792f320000080806057068617365060865766964656e636500",
    "6c69737065782e646174756d2f32004808080604636f64650613766572696669636174696f6e2e6275646765740808060464617461080806066275646765740604776f726b00080806057068617365060676657269667900"
  ],
  "deniedBudgetField": "work",
  "newIdentityAfterRefusal": false,
  "guestEvaluationAccountDebited": false,
  "profileContractIdentityBytesHex": "6c69737065782e646174756d2f320067080806066469676573740a20ee922f05c6247a298f4dcabadaf65f819ee3f3f3a9d15abeda3c9ff704056ab108080606646f6d61696e06116c69737065782e636f6e74726163742f3208080606666f726d617406116c69737065782e6964656e746974792f3200"
}
Product invocation

Expected result

The operation owning a failed host hash reservation fixes its diagnostic. Product invocation awaits its 2.0 adapter.

Profile admission, qualification, and evidence share profile.budget but keep their own phase. Standalone verification uses verification.budget in verify. The complete bytes were calculated from the closed Diagnostic catalog, canonical D/R/U/Z, and the exact builtin base/2 contract. The next hash requirement of 1 and remaining work of 0 are explicit component inputs, not a product tariff. No failed case publishes an identity or debits a guest result account.

Typed field spellings

EBNF
nat = "0" | nonzero digit*
integer = nat | "-" nonzero digit*
hexBytes = hexPair*
hexPair = hexDigit hexDigit
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
nonzero = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
hexDigit = digit | "a" | "b" | "c" | "d" | "e" | "f"

These productions describe string contents. The report contract supplies their surrounding serialization. A hexadecimal string must also decode as the selected canonical Datum codec when used as DatumBytes.

Condition data

Present condition data through the exact phase, code, and typed data fields defined here. Human messages, locale, paths, and stack displays belong to presentation. The source map connects canonical sites to the supplied source.

16.3 Keep condition meaning separate from display

Evaluation reports preserve the canonical failure site and structured condition meaning. Changing a source map, message locale, host path or stack display leaves the canonical outcome unchanged. Guest recovery uses condition data under the Conditions contract.

Why

Callers can replay a failure even when their source layout and diagnostic language differ. A host path or translated sentence should not change a rule decision.

Present the same condition twice

lispex.example.v2.cli-and-diagnostics.condition-display · rev. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (car input)))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to complete preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "empty-list"
      },
      "display": {
        "locale": "en",
        "sourceLabel": "first.scm",
        "stack": "shown"
      }
    },
    {
      "input": {
        "kind": "empty-list"
      },
      "display": {
        "locale": "ko",
        "sourceLabel": "another.scm",
        "stack": "hidden"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Conditiondomain.type
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "condition": {
    "phase": "evaluate",
    "code": "domain.type",
    "data": {
      "operation": "car",
      "argument": "0",
      "path": [],
      "expected": "pair",
      "actual": "empty-list"
    }
  }
}
Conditiondomain.type
Outcome details
{
  "kind": "language-failure",
  "valueCount": 0,
  "condition": {
    "phase": "evaluate",
    "code": "domain.type",
    "data": {
      "operation": "car",
      "argument": "0",
      "path": [],
      "expected": "pair",
      "actual": "empty-list"
    }
  }
}

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "comparison": {
    "canonicalOutcomeEqual": true,
    "canonicalFailureSiteEqual": true,
    "typedConditionDataEqual": true
  },
  "presentation": {
    "localeAffectsMeaning": false,
    "pathAffectsMeaning": false,
    "stackAffectsMeaning": false
  }
}
Product invocation

Expected result

Both requests report the same car domain failure despite different presentation settings. Product invocation awaits its 2.0 adapter.

The source and request files express the 2.0 case. The request file is documentation notation. It does not define command options, codec bytes, artifact fields, diagnostic codes or numeric exit values. Each product plan compares the complete authored expectation. Product execution awaits the 2.0 observation adapter.

16.4 Serialize typed diagnostic fields without coercion

A diagnostic field record has exactly the fields below. The data object has exactly the keys in its catalog schema. Every key is required.

FieldSerialized value
phaseA string from PhaseTag
codeThe exact string from the selected catalog schema
dataThe typed object declared by that schema

Field keys use unsigned UTF-8 byte order. DiagnosticPayloadBytes names the encoding of this field record. The same contract defines the surrounding command envelope. This rule fixes the wire projection of semantic field values.

TypeSerialized form
TextA Unicode scalar string with exact case and no normalization
OperationText with the meaning given by the condition catalog
NatA string matching nat in the field grammar
IntegerA string matching integer
NatOrFalseA Nat string or the Boolean false
TextOrFalseA Text string or the Boolean false
TypeTagOrFalseA TypeTag string or the Boolean false
OperandThe string 0 or 1
DatumBytesLowercase hexadecimal bytes from the request's selected canonical Datum codec. Each byte has two digits. There is no prefix.
IdentityThe named identity form from identity encoding
ContractIdentityThe identity of the selected versioned contract under the same identity encoding
EventIdentityThe event identifier from the resource event catalog
HostBudgetFieldNameThe exact field name from the profile host work contract
DataPathAn array of the exact tagged objects below

The canonical codec defines the complete CanonicalDatumBytes packet nested inside DatumBytes. Diagnostic serialization encodes those bytes as lowercase hexadecimal. It performs no decimal display rounding or alternate value conversion.

Path segmentExact object fields
Pair carkind equals car
Pair cdrkind equals cdr
Vector indexkind equals index, index uses Nat
Record keykind equals key, key uses Text

An empty path selects the whole value. Paths retain segment order. The condition catalog gives the ordinary list representation of these segments inside guest data.

EnumExact string members
PhaseTaginvocation, ingestion, decode, read, normalize, resolve, prepare, admission, evaluate, qualification, evidence, verify, replay, render, host
TypeTagThe exact members of TypeTag in the condition catalog
HostTypeTagEvery imported TypeTag, host-record, inexact-number, host-capability, foreign-value
TypeRequirementThe exact members of TypeRequirement in the condition catalog
EqualityOperationThe exact members of EqualityOperation in the condition catalog
RangeReasonThe exact members of RangeReason in the condition catalog
NumericReasonThe exact members of NumericReason in the condition catalog
ConditionReasonThe exact members of ConditionReason in the condition catalog
SourceEncodingReasoninvalid-utf8
SourceTokenReasoninvalid-token, invalid-escape, invalid-scalar, unterminated-string, unsupported-literal, unexpected-source-scalar, unsupported-reader-prefix
SourceDelimiterReasonunexpected-end, unexpected-close, mismatched-close, improper-form
SourceNumberReasoninvalid-number, zero-denominator, inexact-number
SyntaxReasonexpected-shape, unsupported-form, missing-body, invalid-binding, invalid-formals, invalid-entry, unexpected-definition, guard-variable, guard-body, clause-shape, else-position, else-body, arrow-shape
InitializerFormletrec, internal-definition
InitializerExpectationlambda
BindingScopeparameters, let, letrec, body, module, imports, exports
ModuleReasonmissing-module, missing-export, ambiguous-import, duplicate-module, invalid-import
LibraryReasonunknown-binding, removed-operation
EntryReasonmissing-entry, duplicate-entry, unknown-entry, non-procedure, arity, invalid-initializer
ResourceStagedecode, read, normalize, resolve, prepare, input-decode, entry, result-check, result-encode
ResourceAxiswork, allocation, frames, input, result, diagnostic
InputResourceAxiswork, allocation, input, diagnostic
InputCodecReasonmalformed, noncanonical, trailing-bytes, inexact-value, non-datum, invalid-utf8
RequestReasonmissing-field, unknown-field, invalid-value, overflow, unlimited
ProductSubjectlanguage, engine, library, unicode, resource-model, codec, profile, interface
ArtifactKindevaluator, prepared, graph, receipt, evidence, request
ArtifactReasoninvalid-format, invalid-integrity, unsupported-contract, missing-dependency, host-import, unverified-content, unknown-diagnostic, identity-mismatch
EnvelopeReasonunsupported-limits, physical-capacity, unavailable-product
ProfileAdmissionReasoninput-schema, library-exclusion, engine-feature, evidence-prerequisite
QualificationReasonoutput-schema, qualification-contract
EvidenceReasonunavailable-evidence, invalid-evidence, evidence-mismatch
VerificationCheckrequest-identity, program-identity, source-identity, artifact-identity, outcome, evidence, evidence-binding, signature, trust
ReplayComponentprogram, request, outcome
CommandReasonunknown-command, unknown-option, duplicate-option, missing-operand, unexpected-operand, conflicting-options, invalid-selector, invalid-value
InputOperandbundle, artifact, input, limits, profile, receipt, evidence, trust, graph, request
TransportInputReasonnot-found, not-readable, incomplete, invalid-text
OutputChannelstdout, stderr, artifact, receipt, graph, report, trace
TransportOutputReasonunwritable, interrupted
HostReasoncancelled, physical-exhaustion, unavailable-transport
DefectReasoninvariant-failure, invalid-product-observation
BoundaryReasoncount, non-datum

Unknown phases, codes, fields, enum strings, and mistyped values are rejected. Extra fields and missing fields are rejected. Products reject numbers where exact integer strings are required. They do not normalize text or repair malformed paths.

An unknown diagnostic identity in a submitted artifact uses artifact.invalid with unknown-diagnostic. Other malformed diagnostic fields use artifact.invalid with invalid-format. A product that emits an invalid diagnostic has an engine.defect with invalid-product-observation.

Source coordinates and canonical sites belong to their source report and outcome envelopes. They are not data fields. Message text, locale, host paths, stacks, elapsed time, and work usage counters stay outside this field record.

The failing event reserves its required diagnostic payload under the resource event order. The failure is committed only after that reservation succeeds. Once committed, its first cause remains fixed. Emergency reporting and human formatting cannot replace it with another semantic failure.

Payload limits use the named resource model limits. No field is silently truncated. Product rendering failure remains a separate host report.

Why

Exact field types prevent host numeric widths and message formats from changing a failure. Explicit paths preserve the first invalid component. The selected canonical codec keeps application data portable while report envelopes remain separately versioned.

Reject coercion and preserve exact field strings

lispex.example.v2.cli-and-diagnostics.diagnostics.typed-diagnostic-fields · rev. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) input))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient through the stated preparation check",
    "evaluate": "finite values sufficient through the stated evaluation and reporting checks"
  },
  "reportCandidates": "Each candidate explicitly names its intended report envelope. The fixture tests diagnostic field schemas. It does not treat an admission report as an evaluation receipt. Report bytes use the owning format contract.",
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      },
      "operation": "validate submitted diagnostic field records in receipt descriptions"
    }
  ],
  "diagnosticCandidates": [
    {
      "case": "accepted-arity",
      "envelope": "evaluation-receipt-description",
      "diagnostic": {
        "phase": "evaluate",
        "code": "runtime.arity",
        "data": {
          "minimum": "1",
          "maximum": false,
          "actual": "0"
        }
      }
    },
    {
      "case": "accepted-negative-index",
      "envelope": "evaluation-receipt-description",
      "diagnostic": {
        "phase": "evaluate",
        "code": "domain.index",
        "data": {
          "operation": "vector-ref",
          "argument": "1",
          "index": "-1",
          "length": "3"
        }
      }
    },
    {
      "case": "accepted-raw-key",
      "envelope": "admission-report-description",
      "diagnostic": {
        "phase": "admission",
        "code": "record.missing",
        "data": {
          "key": "é"
        }
      }
    },
    {
      "case": "unknown-phase",
      "envelope": "evaluation-receipt-description",
      "diagnostic": {
        "phase": "runtime",
        "code": "runtime.arity",
        "data": {
          "minimum": "1",
          "maximum": false,
          "actual": "0"
        }
      }
    },
    {
      "case": "code-case",
      "envelope": "evaluation-receipt-description",
      "diagnostic": {
        "phase": "evaluate",
        "code": "Domain.type",
        "data": {
          "operation": "car",
          "argument": "0",
          "path": [],
          "expected": "pair",
          "actual": "empty-list"
        }
      }
    },
    {
      "case": "numeric-coercion",
      "envelope": "evaluation-receipt-description",
      "diagnostic": {
        "phase": "evaluate",
        "code": "runtime.value-count",
        "data": {
          "expected": 1,
          "actual": "2"
        }
      }
    },
    {
      "case": "leading-zero",
      "envelope": "evaluation-receipt-description",
      "diagnostic": {
        "phase": "evaluate",
        "code": "runtime.value-count",
        "data": {
          "expected": "01",
          "actual": "2"
        }
      }
    },
    {
      "case": "negative-zero",
      "envelope": "evaluation-receipt-description",
      "diagnostic": {
        "phase": "evaluate",
        "code": "domain.index",
        "data": {
          "operation": "vector-ref",
          "argument": "1",
          "index": "-0",
          "length": "3"
        }
      }
    },
    {
      "case": "extra-message",
      "envelope": "evaluation-receipt-description",
      "diagnostic": {
        "phase": "evaluate",
        "code": "domain.type",
        "data": {
          "operation": "car",
          "argument": "0",
          "path": [],
          "expected": "pair",
          "actual": "empty-list"
        },
        "message": "pair required"
      }
    },
    {
      "case": "extra-path-field",
      "envelope": "evaluation-receipt-description",
      "diagnostic": {
        "phase": "evaluate",
        "code": "domain.equality",
        "data": {
          "operation": "equal?",
          "operand": "0",
          "path": [
            {
              "kind": "car",
              "index": "0"
            }
          ],
          "actual": "procedure"
        }
      }
    }
  ],
  "hexFieldCandidates": [
    "00",
    "0a",
    "ff",
    "0A",
    "0x0a",
    "a"
  ],
  "invalidProductObservation": {
    "stage": "evaluate",
    "fault": "the product reports a diagnostic with fields outside its declared schema"
  },
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Result[]

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "acceptedRecords": [
    {
      "phase": "evaluate",
      "code": "runtime.arity",
      "data": {
        "minimum": "1",
        "maximum": false,
        "actual": "0"
      }
    },
    {
      "phase": "evaluate",
      "code": "domain.index",
      "data": {
        "operation": "vector-ref",
        "argument": "1",
        "index": "-1",
        "length": "3"
      }
    },
    {
      "phase": "admission",
      "code": "record.missing",
      "data": {
        "key": "é"
      }
    }
  ],
  "rejectedRecords": [
    {
      "defect": "unknown phase",
      "diagnostic": {
        "phase": "runtime",
        "code": "runtime.arity",
        "data": {
          "minimum": "1",
          "maximum": false,
          "actual": "0"
        }
      },
      "rejection": {
        "phase": "admission",
        "code": "artifact.invalid",
        "data": {
          "kind": "receipt",
          "reason": "unknown-diagnostic"
        }
      }
    },
    {
      "defect": "code case changed",
      "diagnostic": {
        "phase": "evaluate",
        "code": "Domain.type",
        "data": {
          "operation": "car",
          "argument": "0",
          "path": [],
          "expected": "pair",
          "actual": "empty-list"
        }
      },
      "rejection": {
        "phase": "admission",
        "code": "artifact.invalid",
        "data": {
          "kind": "receipt",
          "reason": "unknown-diagnostic"
        }
      }
    },
    {
      "defect": "JSON number instead of Nat string",
      "diagnostic": {
        "phase": "evaluate",
        "code": "runtime.value-count",
        "data": {
          "expected": 1,
          "actual": "2"
        }
      },
      "rejection": {
        "phase": "admission",
        "code": "artifact.invalid",
        "data": {
          "kind": "receipt",
          "reason": "invalid-format"
        }
      }
    },
    {
      "defect": "leading zero in Nat string",
      "diagnostic": {
        "phase": "evaluate",
        "code": "runtime.value-count",
        "data": {
          "expected": "01",
          "actual": "2"
        }
      },
      "rejection": {
        "phase": "admission",
        "code": "artifact.invalid",
        "data": {
          "kind": "receipt",
          "reason": "invalid-format"
        }
      }
    },
    {
      "defect": "negative zero in Integer string",
      "diagnostic": {
        "phase": "evaluate",
        "code": "domain.index",
        "data": {
          "operation": "vector-ref",
          "argument": "1",
          "index": "-0",
          "length": "3"
        }
      },
      "rejection": {
        "phase": "admission",
        "code": "artifact.invalid",
        "data": {
          "kind": "receipt",
          "reason": "invalid-format"
        }
      }
    },
    {
      "defect": "extra presentation field",
      "diagnostic": {
        "phase": "evaluate",
        "code": "domain.type",
        "data": {
          "operation": "car",
          "argument": "0",
          "path": [],
          "expected": "pair",
          "actual": "empty-list"
        },
        "message": "pair required"
      },
      "rejection": {
        "phase": "admission",
        "code": "artifact.invalid",
        "data": {
          "kind": "receipt",
          "reason": "invalid-format"
        }
      }
    },
    {
      "defect": "extra path field",
      "diagnostic": {
        "phase": "evaluate",
        "code": "domain.equality",
        "data": {
          "operation": "equal?",
          "operand": "0",
          "path": [
            {
              "kind": "car",
              "index": "0"
            }
          ],
          "actual": "procedure"
        }
      },
      "rejection": {
        "phase": "admission",
        "code": "artifact.invalid",
        "data": {
          "kind": "receipt",
          "reason": "invalid-format"
        }
      }
    }
  ],
  "lexicalFields": {
    "hexAcceptedByGrammar": [
      "00",
      "0a",
      "ff"
    ],
    "hexRejectedByGrammar": [
      "0A",
      "0x0a",
      "a"
    ],
    "hexAcceptanceProvesCanonicalDatum": false,
    "datumBytesUseSelectedCanonicalCodec": true,
    "unicodeStringPreserved": "é",
    "fieldKeysUseUnsignedUtf8Order": true
  },
  "invalidProductObservation": {
    "phase": "host",
    "code": "engine.defect",
    "data": {
      "stage": "evaluate",
      "reason": "invalid-product-observation"
    }
  }
}
Product invocation

Expected result

Field parsing rejects unknown identities, extra keys, numeric coercion, and noncanonical spellings. Lowercase hexadecimal describes codec bytes without selecting a codec. Product execution awaits its 2.0 adapter.

The request uses documentation notation. A fixtureIdentity, fixtureEvent, or fixtureBudgetField stands for the owning contract value. These markers are not serialized field values. Product execution remains not-run.

Preparation reports

A read or normalization failure can occur before any valid canonical program exists. Its preparation report is bound to the exact submitted source. Such a report carries the source location needed for repair. Evaluation locations use canonical sites after preparation succeeds. The identity chapter defines the separate records.

16.5 Bind an early report to source

A read or normalization failure produces a source bound preparation report. It identifies the exact submitted source and stops before entry evaluation. It does not invent a canonical program identity or canonical evaluation site for that failed source.

Why

A malformed source still needs a useful report. Binding the report to submitted bytes preserves its meaning without pretending that program resolution succeeded.

16.6 Source and preparation diagnostic mapping

Source and preparation failures use the catalog identities below. The owning Rules still determine the first failed check. Mapping a failure adds no check and changes no reservation order.

The source order and module order remain authoritative. A diagnostic phase identifies its catalog family. It does not move a check to another step.

Reader checkPhaseCodeExact data
Invalid source UTF-8decodesource.encodingreason = invalid-utf8
Invalid bare identifier, character token, token boundary, Boolean token, bracket, or quotation prefixreadsource.tokenreason = invalid-token
Unknown string or identifier escapereadsource.tokenreason = invalid-escape
Invalid scalar escape or literal control scalarreadsource.tokenreason = invalid-scalar
Unterminated string or barred identifierreadsource.tokenreason = unterminated-string
Unexpected source scalar, including a byte order markreadsource.tokenreason = unexpected-source-scalar
Unsupported reader prefix or directivereadsource.tokenreason = unsupported-reader-prefix
Invalid bytevector element or unsupported unit imaginary literalreadsource.tokenreason = unsupported-literal
Unfinished list or block comment, or missing quoted or commented datumreadsource.delimiterreason = unexpected-end
Unmatched closing parenthesisreadsource.delimiterreason = unexpected-close
Invalid dotted tail or vector element shapereadsource.delimiterreason = improper-form
Invalid numeric spellingreadsource.numberreason = invalid-number
Zero literal denominatorreadsource.numberreason = zero-denominator
Infinity or NaN spellingreadsource.numberreason = inexact-number

Numeric token classification follows the reader grammar. A token that enters numeric scanning keeps that classification. An unsupported exactness prefix uses the reader prefix row.

Binding or form checkPhaseCodeExact data
Malformed parameter group or parameter identifiernormalizesyntax.formform = lambda or the written procedure shorthand head define. reason = invalid-formals
Malformed binding group, member, or binding identifiernormalizesyntax.formform is the written owning form head. reason = invalid-binding
Missing procedure bodynormalizesyntax.formform = lambda or define. reason = missing-body
Definition after an expression outside a guard bodynormalizesyntax.formform = define. reason = unexpected-definition
Assignment to an immutable bindingnormalizebinding.immutablename is the assigned identifier
Duplicate parameternormalizebinding.duplicatename is the repeated identifier. scope = parameters
Duplicate parallel let bindingnormalizebinding.duplicatename is the repeated identifier. scope = let
Duplicate recursive bindingnormalizebinding.duplicatename is the repeated identifier. scope = letrec
Duplicate internal definitionnormalizebinding.duplicatename is the repeated identifier. scope = body
Duplicate module definition or import and definition collisionnormalizebinding.duplicatename is the repeated identifier. scope = module
Duplicate import local namenormalizebinding.duplicatename is the repeated local identifier. scope = imports
Duplicate export public namenormalizebinding.duplicatename is the repeated public identifier. scope = exports
Non-lambda recursive initializernormalizebinding.initializerform = letrec or internal-definition. name is the binding. expected = lambda
Unresolved lexical nameresolvebinding.unresolvedname is the unresolved identifier
Removed library operationresolvelibrary.referencename is the removed public binding. reason = removed-operation

For syntax.form, form is the decoded source keyword. Procedure shorthand uses define. Guard clauses and bodies keep the reasons from the guard grammar.

All names preserve their decoded scalar values. Sequential let shadowing remains valid. Its repeated names do not enter a duplicate row.

Module checkPhaseCodeExact data
Missing selected root or import targetresolvemodule.referencemodule is the absent module. name = false. reason = missing-module
Duplicate source module nameresolvemodule.referencemodule is the least duplicated name. name = false. reason = duplicate-module
Declared module name differs from the submitted namenormalizesyntax.formform = module. reason = invalid-binding
Repeated module in one import clausenormalizesyntax.formform = import. reason = invalid-binding
Invalid wrapper or clause ordernormalizesyntax.formform = module. reason = expected-shape
Invalid module name, import or export binding, or rename membernormalizesyntax.formform = module, import, or export. reason = invalid-binding
Malformed import or export clausenormalizesyntax.formform = import or export. reason = expected-shape
Imported public name is absentresolvemodule.referencemodule is the target module. name is the requested public name. reason = missing-export
Export has no local bindingresolvemodule.referencemodule is the exporting module. name is the missing local name. reason = missing-export
Dependency cycle or self dependencyresolvemodule.referencemodule is the active ancestor reached by the first closing edge. name = false. reason = invalid-import

Cycle selection follows the existing canonical graph traversal. The reported module is the start of that selected cycle.

Entry checkPhaseCodeExact data
Malformed entry clausenormalizesyntax.formform = entry. reason = invalid-entry
Root has no entry declarationprepareentry.declarationreason = missing-entry
Module repeats its entry declarationprepareentry.declarationreason = duplicate-entry
Declared entry has no matching public exportprepareentry.declarationreason = unknown-entry
Entry initializer is a non-procedure literalprepareentry.declarationreason = non-procedure
Entry initializer does not have the required lambda formprepareentry.declarationreason = invalid-initializer
Entry lambda does not accept one argumentprepareentry.declarationreason = arity

Entry selection follows the entry Rules. A factory call fails the initializer check without running that call.

Prepared artifact checkPhaseCodeExact data
Unsupported version or encoding contractadmissionartifact.invalidkind = prepared. reason = unsupported-contract
Malformed framing, record, index, binding, child, site, tail flag, or event roleadmissionartifact.invalidkind = prepared. reason = invalid-format
Missing required submitted dependencyadmissionartifact.invalidkind = prepared. reason = missing-dependency
Incompatible fixed identity, dependency identity, or requested program identityadmissionartifact.invalidkind = prepared. reason = identity-mismatch
Reused handle lacks its verified local issuer sealadmissionartifact.invalidkind = prepared. reason = unverified-content

Malformed magic uses invalid-format. An understood format with an unsupported version uses unsupported-contract. Artifact mutation labels identify test cases. They are not additional diagnostic reasons.

The validation order decides the first artifact failure. Validation still leaves dynamic call and result checks at evaluation. Preparation exhaustion uses prepare and resource.exhausted. Its data contain the interrupted stage, rejected axis, and required event from the selected resource model.

Some examples leave model fields or host fault details symbolic. Their diagnosticIdentity selects only a phase and code. A separate reason constrains that catalog reason when specified. These are documentation selectors. A product supplies every required typed field in its complete diagnostic. The selectors do not define a report encoding.

Guest failures use the Condition schema. Preparation and admission failures have no guest Condition. Generic resource cases retain their named finite limits under cost-model-freeze.

Why

One identity and one field schema let every product report the same failed check. Existing reasons cover the source and prepared artifact failures. More codes would duplicate their validation families. Product aliases would make equivalent failures differ. The mapping preserves the adopted check order and its resource boundaries.

Reader checks select existing families

lispex.example.v2.cli-and-diagnostics.diagnostics.reader-family-mapping · rev. 1

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) input))
)
bytevector.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) #u8(256)))
)
imaginary.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) +i))
)
number.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) 1x))
)
inexact.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) +inf.0))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to reach the stated validation failure",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "source": "bytevector.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "bytevector.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "source": "imaginary.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "imaginary.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "source": "number.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "number.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "source": "inexact.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "inexact.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Diagnosticsource.token
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "read",
    "code": "source.token",
    "data": {
      "reason": "unsupported-literal"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticsource.token
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "read",
    "code": "source.token",
    "data": {
      "reason": "unsupported-literal"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticsource.number
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "read",
    "code": "source.number",
    "data": {
      "reason": "invalid-number"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticsource.number
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "read",
    "code": "source.number",
    "data": {
      "reason": "inexact-number"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}

Specification outcome. Product runs are pending the 2.0 adapter.

Product invocation

Expected result

Literal checks retain the token or numeric family selected by the reader. Product execution awaits its 2.0 adapter.

Each case uses the same fixed semantics and sufficient finite preparation limits. The first failed check selects the stated catalog identity. No entry is evaluated.

Source forms, modules, and entry checks keep their identities

lispex.example.v2.cli-and-diagnostics.diagnostics.module-entry-mapping · rev. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) input))
)
repeated.scm
(module main
  (import (dep a) (dep b))
  (export rule)
  (entry rule)
  (define rule (lambda (input) input))
)
dep.scm
(module dep
  (import)
  (export a b)
  (define a 1)
  (define b 2)
)
mismatch.scm
(module other
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) input))
)
cycle-main.scm
(module main
  (import (a value))
  (export rule)
  (entry rule)
  (define rule (lambda (input) input))
)
a.scm
(module a
  (import (b (rename value other)))
  (export value)
  (define value (lambda (input) input))
)
b.scm
(module b
  (import (a (rename value other)))
  (export value)
  (define value (lambda (input) input))
)
nonprocedure.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule 7)
)
factory.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define make-rule (lambda () (lambda (input) input)))
  (define rule (make-rule))
)
malformed.scm
(module main
  (import)
  (export rule)
  (entry rule spare)
  (define rule (lambda (input) input))
)
unknown.scm
(module main
  (import)
  (export rule)
  (entry missing)
  (define rule (lambda (input) input))
)
parameter.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (1) 0))
)
binding.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) (let ((1 2)) input)))
)
shorthand.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define (rule 1) 0)
)
body.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input)))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to reach the stated validation failure",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "source": "repeated.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "repeated.scm"
        },
        {
          "name": "dep",
          "source": "dep.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "source": "mismatch.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "mismatch.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "source": "cycle-main.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "cycle-main.scm"
        },
        {
          "name": "a",
          "source": "a.scm"
        },
        {
          "name": "b",
          "source": "b.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "source": "nonprocedure.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "nonprocedure.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "source": "factory.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "factory.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "source": "malformed.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "malformed.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "source": "unknown.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "unknown.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "source": "parameter.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "parameter.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "source": "binding.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "binding.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "source": "shorthand.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "shorthand.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "source": "body.scm",
      "rootModule": "main",
      "moduleSources": [
        {
          "name": "main",
          "source": "body.scm"
        }
      ],
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Diagnosticsyntax.form
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "normalize",
    "code": "syntax.form",
    "data": {
      "form": "import",
      "reason": "invalid-binding"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticsyntax.form
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "normalize",
    "code": "syntax.form",
    "data": {
      "form": "module",
      "reason": "invalid-binding"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticmodule.reference
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "resolve",
    "code": "module.reference",
    "data": {
      "module": "a",
      "name": false,
      "reason": "invalid-import"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticentry.declaration
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "prepare",
    "code": "entry.declaration",
    "data": {
      "reason": "non-procedure"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticentry.declaration
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "prepare",
    "code": "entry.declaration",
    "data": {
      "reason": "invalid-initializer"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticsyntax.form
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "normalize",
    "code": "syntax.form",
    "data": {
      "form": "entry",
      "reason": "invalid-entry"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticentry.declaration
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "prepare",
    "code": "entry.declaration",
    "data": {
      "reason": "unknown-entry"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticsyntax.form
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "normalize",
    "code": "syntax.form",
    "data": {
      "form": "lambda",
      "reason": "invalid-formals"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticsyntax.form
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "normalize",
    "code": "syntax.form",
    "data": {
      "form": "let",
      "reason": "invalid-binding"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticsyntax.form
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "normalize",
    "code": "syntax.form",
    "data": {
      "form": "define",
      "reason": "invalid-formals"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticsyntax.form
Outcome details
{
  "kind": "prepare-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "normalize",
    "code": "syntax.form",
    "data": {
      "form": "lambda",
      "reason": "missing-body"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}

Specification outcome. Product runs are pending the 2.0 adapter.

Product invocation

Expected result

Form, module graph, and entry checks use their existing catalog families. Product execution awaits its 2.0 adapter.

Each case uses the same fixed semantics and sufficient finite preparation limits. The first failed check selects the stated catalog identity. No entry is evaluated.

Prepared failures share the closed schema

lispex.example.v2.cli-and-diagnostics.diagnostics.prepared-family-mapping · rev. 1

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (input) input))
)
Request and files
artifact-mutations.json
[
  {
    "name": "unknown-version",
    "action": "replace-header",
    "hex": "4c58424302"
  },
  {
    "name": "trailing-octet",
    "action": "append-after-the-final-node",
    "hex": "00"
  },
  {
    "name": "library-identity",
    "action": "replace-library-identity-with-another-valid-identity"
  },
  {
    "name": "missing-local-issuer-seal",
    "action": "submit-an-unsealed-handle-without-full-validation"
  }
]
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to reach the stated validation failure",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "operation": "validate-prepared",
      "preparedReference": "the canonical bytecode/1 program prepared from source.scm under the fixed semantics",
      "mutation": "unknown-version",
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "operation": "validate-prepared",
      "preparedReference": "the canonical bytecode/1 program prepared from source.scm under the fixed semantics",
      "mutation": "trailing-octet",
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "operation": "validate-prepared",
      "preparedReference": "the canonical bytecode/1 program prepared from source.scm under the fixed semantics",
      "mutation": "library-identity",
      "input": {
        "kind": "integer",
        "value": "0"
      }
    },
    {
      "operation": "present-copied-fields-as-handle",
      "preparedReference": "the verified local handle prepared from source.scm under the fixed semantics",
      "mutation": "missing-local-issuer-seal",
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Diagnosticartifact.invalid
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "artifact.invalid",
    "data": {
      "kind": "prepared",
      "reason": "unsupported-contract"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticartifact.invalid
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "artifact.invalid",
    "data": {
      "kind": "prepared",
      "reason": "invalid-format"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticartifact.invalid
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "artifact.invalid",
    "data": {
      "kind": "prepared",
      "reason": "identity-mismatch"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Diagnosticartifact.invalid
Outcome details
{
  "kind": "admission-failure",
  "valueCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "artifact.invalid",
    "data": {
      "kind": "prepared",
      "reason": "unverified-content"
    }
  },
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}

Specification outcome. Product runs are pending the 2.0 adapter.

Product invocation

Expected result

Prepared artifacts preserve format, contract, identity, and verified-handle distinctions through existing reasons. Product execution awaits its 2.0 adapter.

Each case uses the same fixed semantics and sufficient finite preparation limits. The first failed check selects the stated catalog identity. No entry is evaluated.

Terminal failures

Apply the terminal-failure rule when presenting guest recovery and resource stops. Present earlier failures under the source-bound report rule.

The termination evidence rule separates admission reports, canonical evaluation outcomes, and operational attempts. Qualification and evidence refusal follow the profile work report contract.

16.7 Preserve the first terminal cause

Terminal diagnostic presentation follows the first-failure rule and the terminal-failure rule. Preserve the exhausted axis and canonical site under the canonical-outcome rule. Earlier failures and operational attempts follow their report and receipt boundary.

Why

A caller needs the actual cause of a stopped request. Replacing it with cleanup output or a fallback value would hide the boundary that ended execution.

Stop an unending rule

lispex.example.v2.cli-and-diagnostics.resource-stop · rev. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (let loop ()
        (loop))))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to prepare this rule",
    "evaluate": "finite values sufficient to enter the recursive call. The settled event order selects the first exhausted axis."
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Resultresource-stop
Outcome details
{
  "kind": "resource-stop",
  "valueCount": 0,
  "terminal": true,
  "diagnosticIdentity": {
    "phase": "evaluate",
    "code": "resource.exhausted"
  }
}

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "firstCause": {
    "preserved": true,
    "exhaustedAxisPreserved": true,
    "canonicalSitePreserved": true,
    "convertedToSuccess": false
  },
  "returnedControl": true,
  "exitClasses": [
    "deterministic-failure"
  ],
  "exitStatuses": [
    21
  ]
}
Product invocation

Expected result

The finite request stops with its first resource cause and returns control without a success value. Product invocation awaits its 2.0 adapter.

The source and request files express the 2.0 case. The request file is documentation notation. It does not define command options, codec bytes, artifact fields, diagnostic codes or numeric exit values. Each product plan compares the complete authored expectation. Product execution awaits the 2.0 observation adapter.

Separate interrupted attempts

lispex.example.v2.cli-and-diagnostics.operational-attempts · rev. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      input))
)
Request and files
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to complete preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "42"
      },
      "hostFault": "controlled cancellation after admission"
    },
    {
      "input": {
        "kind": "integer",
        "value": "42"
      },
      "hostFault": "controlled evaluator invariant failure"
    }
  ],
  "operationUnderTest": "Use controlled product fault hooks after admission. A physical admission check still applies before execution.",
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Specification outcome
Result[]

Specification outcome. Product runs are pending the 2.0 adapter.

Semantic details
{
  "attemptReports": [
    {
      "kind": "operational-interruption",
      "semanticReceiptAvailable": false,
      "successValueAvailable": false,
      "diagnostic": {
        "phase": "host",
        "code": "host.interrupted",
        "data": {
          "stage": "evaluate",
          "reason": "cancelled"
        }
      }
    },
    {
      "kind": "engine-defect",
      "semanticReceiptAvailable": false,
      "successValueAvailable": false,
      "diagnostic": {
        "phase": "host",
        "code": "engine.defect",
        "data": {
          "stage": "evaluate",
          "reason": "invariant-failure"
        }
      }
    }
  ],
  "exitClasses": [
    "operational-failure",
    "operational-failure"
  ],
  "exitStatuses": [
    50,
    51
  ]
}
Product invocation

Expected result

An interrupted attempt and an engine defect produce separate attempt reports without semantic outcomes or receipts. Product invocation awaits its 2.0 adapter.

The source and request files express the 2.0 case. The request file is documentation notation. It does not define command options, codec bytes, artifact fields, diagnostic codes or numeric exit values. Each product plan compares the complete authored expectation. Product execution awaits the 2.0 observation adapter.

Related chapters

CLI and diagnostics

Conditions

Source and normalization

Resources

Identity, receipt, replay