For complete source files and commands, follow Compile a Rule to an Intermediate Form.
Read an inspection result
The refund example in the guide produces the following inspection fields. The JSON below is an excerpt from a report.
{
"requirements": ["explicit-input"],
"roots": [
{
"column": 1,
"index": 0,
"line": 1,
"normalized_core": "(define decide (lambda (days) (if (<= days (quote 30)) (quote refund) (quote review))))"
},
{"column": 1, "index": 1, "line": 4, "normalized_core": "(decide input)"}
]
}A root is a top-level expression.
The first root defines decide.
The second calls it with the external value input.
normalized_core shows shorthand rewritten into core forms.
line and column locate each root in the source, starting at 1.
| Report field | Meaning |
|---|---|
artifact.source_sha256 | Identifier of the exact source bytes |
artifact.core_ir_sha256 | Identifier of the complete Core IR file |
artifact.counts | Counts of roots, nodes, bindings, functions, globals, and requirements |
globals | Global cell IDs, names, and initial builtin procedure IDs |
requirements | Explicit inputs required by the program |
roots | Readable normalized expressions and source positions |
execution: "not-run" | This command has not executed the rule |
authority: "integrity-only" | The report describes file integrity |
A cell is a storage location for a variable's value.
A binding connects a variable to a cell.
The compiler consumes the .lpxir file.
The inspection report presents selected information for review.
Fixed identifiers
| Item | Identifier |
|---|---|
| artifact schema | lispex.core-ir/v1 |
| language profile | lispex-profile-1.5 |
| primitive registry | lispex.primitive-registry/v1 |
| cost model | lispex.core-ir-cost/v1 |
| producer family | lispex-rust-core-ir/v1 |
| artifact hash domain | lispex/core-ir-hash/v1 |
| registry hash domain | lispex/primitive-registry-hash/v1 |
The primitive registry assigns stable numeric IDs to 205 executable builtin names. The normalizer rewrites shorthand without capturing user names. Its internal operations refer directly to primitive IDs. Source-visible builtins use ordinary mutable global cells initialized with those IDs. Local shadowing and top-level redefinition therefore retain their language behavior.
What the file records
Compilation reads the exact source, rewrites shorthand into Core forms, resolves bindings and closures, and encodes Core IR.
| Recorded information | Purpose |
|---|---|
| Lexical and global cell IDs | Identify variables by their enclosing scope or global storage |
Fixed and rest parameters, let, letrec, internal definitions | Record where bindings are created |
| Forwarding definition cells | Let references reach definitions activated during execution |
| Closure captures | Share outer mutable cells used by functions, including cells needed by nested functions |
| Ordinary and tail calls | Preserve the call position already determined by Core IR |
| Zero-, one-, and multiple-value contexts | Record the number of values each context accepts |
Guards, exceptions, continuations, and dynamic-wind | Record control structures |
| Literal data and source positions | Preserve constant values and their locations |
| Explicit input requirements | Tell callers which external values to supply |
| Registry and cost-model IDs | Identify the builtin procedures and resource rules |
The inspection view reconstructs the normalized Core used before conversion to Core IR. Other runtime implementations record their own implementation identifiers and execution results.
Encoding and strict reading
Canonical encoding means one prescribed byte representation for the complete recorded artifact. It includes source identity and source positions. Two programs that return the same value can therefore have different Core IR bytes.
The encoding is UTF-8 JSON with fixed field order and tagged arrays. It uses minimal nonnegative decimal integers, exact Unicode strings, and exactly one final line feed. Globals, requirements, captures, bindings, and functions follow fixed ordering and ID continuity rules.
The reader rejects duplicate, missing, unexpected, or reordered fields. It also rejects alternate number or datum spellings, unknown tags or IDs, broken references, invalid captures, and invalid tail positions. Source positions must be valid. Trailing bytes and any difference after re-encoding are rejected.
Limits and file identifiers
Limits are checked before table reads and allocation.
| Item | Maximum |
|---|---|
| Source input | 4 MiB |
| Core IR file | 16 MiB |
| Expression nodes | 100,000 |
| Bindings | 100,000 |
| Functions | 100,000 |
| Globals | 100,000 |
| Structural depth | 1,024 |
source_sha256 identifies exact source bytes using the existing source hash domain.
core_ir_sha256 identifies the complete canonical file using its own hash domain.
A hash domain is a fixed prefix that distinguishes the kind of data being hashed.
Consumers use these reported fields directly.
Commands and exit statuses
These commands are provided by Native.
| Command | Output on success |
|---|---|
core-ir build with a named destination | File plus lispex.core-ir-build/v1 report |
core-ir build --out - | Core IR bytes only on stdout |
core-ir inspect | lispex.core-ir-inspection/v1 report |
core-ir validate | lispex.core-ir-validation/v1 report with valid: true |
| Exit status | Meaning |
|---|---|
| 0 | Command completed |
| 1 | Source or validation error |
| 2 | Usage error |
| 3 | Declared resource limit, input/output failure, or file publication failure |
npm, public WASM, and the Playground provide source execution through the reference runtime. See Lispex Interpreter and Lispex VM for product differences.
Meaning Graph and Lispex Vouch
Core IR records resolved cells, captures, and tail positions for the normalized language profile. Native projects these facts into Meaning Graph v1 while preserving their identifiers.
| Command | Format and behavior |
|---|---|
lower without a version option | Name-level csk.meaning-graph/v0 |
diff-receipt | Existing v0 comparison report |
lower --graph-version v1 | Resolved csk.meaning-graph/v1 from validated Core IR |
eval-graph | Chooses v0 or v1 from the graph tag |
meaning-diff | csk.meaning-differential-report/v1 |
Lispex Vouch derives Core IR again from authenticated exact source in its compiled workflow. Issuer authentication identifies the signer. Recipient policy determines trust. Source and input binding identify the request, re-execution supplies current results, and the Vouch gate records the local decision. The bytecode reference describes the separate compiled container.