Compile .st -> .scb
The compile command converts Strata Text (.st) into Strata Core Binary (.scb).
This is a canonical compilation step. The output bytes are the only valid binary representation of the input value.
Purpose
compile exists to:
Parse human-authored Strata Text
Validate all syntax and semantics
Produce canonical Strata Core Binary
Reject any invalid or ambiguous input
It is the only supported way to produce .scb from .st.
Command
strata-js compile <input.st> <output.scb>Compilation pipeline
The command performs the following steps, in order:
Parse
The
.stfile is parsed into a Strata valueAll syntax rules are enforced
All integers are range-checked
All bytes and strings are validated
Validate
The value model is validated against Strata rules
Invalid constructs are rejected
No normalization or coercion is performed
Encode
The value is encoded into canonical Strata Core Binary
Map keys are ordered canonically
Integers are encoded using canonical varints
Strings are encoded as validated UTF-8
Write
The resulting bytes are written exactly as produced
No metadata or headers are added
Canonical guarantee
For a given .st file:
The output
.scbis deterministicRecompiling produces byte-identical output
Hashes computed over the output are stable
Any change in output bytes indicates:
A change in input
Or a regression in the implementation
Error handling
Compilation fails if:
The input contains invalid syntax
An integer is out of range
A string is malformed
The input violates Strata rules
On failure:
No output file is written
The command exits with a non-zero code
An error message is printed
No partial success
compile is atomic.
Either:
The entire file is valid and compiled
Or nothing is produced
There is no partial output.
Example
This:
Reads
config.stProduces
config.scbGuarantees canonical encoding
Relationship to hashing
Hashes are not computed during compilation.
However:
The output
.scbis hash-readyHashing the result is guaranteed to be stable
Hashing before or after transport yields the same result
Summary
compile is the boundary between human input and canonical data.
Once a value is compiled:
It is frozen
It is unambiguous
It is safe to hash, transmit, and store
All Strata pipelines start here.
Last updated
Was this helpful?