Resolution

All pages

0008 · The core-services language

Status: accepted, 2026-09-24. The owner directed the build to proceed; spike 3 is proven by the test suite (test/spike-3-kernel.test.ts), spike 4 waits for a model key.

Context

The kernel and the gateway are written by hand and read line by line by the owner (R-BUILD-005). The services need good client libraries for model providers, brokers and data vendors (§28.1, criterion 6). Research and statistics are near-certain to be Python (§28.2). The builder is one person working with coding agents, so readability and strong types both cut errors.

Decision

TypeScript on Node (24 or later), run directly with Node's built-in type stripping. There is no build step and no bundler: the source that runs is the source the owner reads. The Floor is the same language, served as plain ES modules. Research code, when the Lab needs a dataframe, may be Python behind the research store's files; it never touches the kernel, the gateway or the Record.

Model providers are called with fetch against their HTTP APIs rather than through SDKs: two providers' request shapes are about sixty lines, and the dependency surface stays at two packages (the embedded Postgres and the Postgres client).

Alternatives

OptionWhy not chosen
Python throughouttypes are optional; the Floor would be a second language anyway
Goa second language for the Floor and for research; thinner model ecosystem
Split core plus Pythontwo toolchains and a schema boundary to keep in step, for no gain at this scale

Consequences

  • One language from the kernel to the screen; artefact schemas are declared once in src/record/schemas.ts and used by server and Floor alike.
  • Node's type stripping forbids enums, namespaces and parameter properties; the code uses string unions and plain objects, which also read better.
  • tsc --noEmit is available as a check but is not needed to run.

Falsifier

Any of these fails on the full build: the kernel's limits library is not readable in one sitting; its worst-case latency exceeds 50 ms for a full limit set; the seats pipeline misses its schema-failure, repair or cost targets; or the provider HTTP APIs change faster than the sixty lines that call them can follow.

Validated by

Spike 3 (the kernel): proven — the full limits library runs against a replayed year of decisions with identical verdicts on re-run; worst-case latency is printed by the test. Spike 4 (seats and manifests): pending a model key; the manifest, typed output, single repair and cost logging are built and tested against the scripted provider.