TSTS is the TypeScript compiler generated from Microsoft's pinned TS-Go source by the pinned GoToTS compiler.
This repository owns reproducible product assembly:
- the exact TS-Go and GoToTS revisions;
- the selected Go build and translation profile;
- certified product-specific implementations;
- differential runtime and performance certification;
- guarded generation, strict typechecking, runtime replay, and artifact evidence
under
.temp/.
Canonical GoToTS output is first checked by pinned TSTS. The pinned TypeScript target then transforms that exact TS-Go AST using finalized marker facts, and a pinned Go TS-Go adapter prints the transformed AST. The target declares its runtime package; this repository resolves that exact package from its pinned local submodule without publishing or inventing a second runtime contract. Bootstrap tools run from one isolated package graph containing exactly one TSTS package, so the checker, fact owners, target transformer, and AST encoder share node and symbol identity.
Generated TypeScript and JavaScript are transient build and validation
artifacts under .temp/. They are never hand-edited or committed; their exact
manifests, logs, and guarded transaction evidence remain inspectable locally.
The selected product uses GoToTS's one fixed synchronous serial execution contract. The TypeScript target performs pointer, scalar, and representation lowering only; it does not run a post-generation effect analysis or repair callable execution. Any provider-facing asynchronous contract and any reached operation that would require suspension fail before publication.
Required target-neutral primitive facts are concretized by exact checked-node
identity (int64 to bigint, narrower numeric primitives to number, and so
on). This is not spelling recognition: an unrelated local alias with the same
name remains unchanged, and the selected marker import must be absent from the
strictly checked target output.
Select the bootstrap inputs explicitly before building. The current callable
contracts select the official go1.26.4.linux-amd64.tar.gz distribution
(SHA-256 1153d3d50e0ac764b447adfe05c2bcf08e889d42a02e0fe0259bd47f6733ad7f).
The automatically downloaded golang.org/toolchain package is a different
distribution even when go version agrees: the exact source snapshot includes
the complete Go root, not just its version or executable.
export TSTS_GO_BUILDER=/path/to/go1.26.4/bin/go
export TSTS_GO_MODULE_CACHE=/path/to/populated/go-module-cache
export TSTS_NODE_BUILDER="$(command -v node)"
export TSTS_NPM_CLI="$(readlink -f "$(command -v npm)")"
export TSTS_HOST_PLATFORM_PATH=/usr/binThe module cache must already contain the dependencies selected by the pinned
GoToTS and TS-Go go.mod/go.sum files. Toolchain assembly resolves that cache
offline. The npm selection must be the real package-owned npm-cli.js, not a
wrapper from a previously sealed toolchain. Go installation, Node installation,
and the supplied module cache are inputs; assembly snapshots and seals them
without changing the installed tools.
git submodule update --init --recursive
npm run buildCanonical Tsonic-flavored TypeScript is sealed in .temp/generated.
TypeScript-target output is written to .temp/target.
Generate and certify the compiler with:
npm run generateThe resulting product is visible locally at:
.temp/target/: final executable TypeScript and its exact target manifest;.temp/target/out/: emitted JavaScript runtime evidence;.temp/run-*.timeand.temp/run-*.finished: guarded resource and status evidence.
Product-specific hot-path rewrites remain authoritative under
implementations/ (or an explicitly selected translation/target profile),
then flow into transient output through regeneration. Generated files are
never the editing surface.
All package and callable implementations share the certified source-core
declaration projection at implementations/certification/tsonic-core.d.ts.
Run node scripts/tsonic-core-certification.mjs --check to verify that it is
byte-exact with the selected provider model; bundle-local declaration files
contain only implementation-private dependencies.
The target profile also pins measured product-acceptance denominators. They verify the target's independently fact-selected output; they never act as source-name allowlists or optimization selectors.
Run the smallest Go pointer -> canonical marker -> TSTS fact -> target AST -> executable TypeScript proof with:
npm run check:scalarRun the complete generated/native compiler differential with:
npm run checkThat command regenerates into .temp/, strict-typechecks the complete product,
and performs runtime parity against pinned native TS-Go.