Integrate in minutes. Prove in production.

TraceScript is a TypeScript DSL — runtime SDK, Supabase edge proxies, 212+ route OpenAPI, and a live ingest → evaluate → replay demo. Every important transition can emit a receipt you can audit.

Governed path demo

Four-step flow via Supabase edge → Fly.io API. Emits a real integrity receipt and replays it.

  1. API live
  2. Ingest signal
  3. Evaluate integrity
  4. Replay receipt
Initializing…

Application quickstarts

API routes

Grouped by layer — TrustScript first, then core path, product depth, and ops.

Hosted API:
OpenAPI: substrate-runtime.openapi.json

@substrate/client SDK

Lightweight fetch client for direct API or Supabase edge proxies. Monorepo package at packages/substrate-client.

import { SubstrateEdgeClient, DEMO_PRESETS } from "@substrate/client";

const client = new SubstrateEdgeClient({
  supabaseUrl: process.env.SUPABASE_URL!,
  anonKey: process.env.SUPABASE_PUBLISHABLE_KEY!,
  tenantId: "00000000-0000-0000-0000-000000000001",
  functions: {
    apiLive: "substrate-api-live",
    signalsIngest: "substrate-signals-ingest",
    integrityEvaluate: "substrate-integrity-evaluate",
    receiptReplay: "substrate-receipt-replay",
  },
});

const body = {
  ...DEMO_PRESETS.policyCorpus.body,
  sourceId: `demo-${Date.now()}`,
};

const result = await client.runGovernedPathDemo(body);
console.log(result.receiptId, result.replay?.replayStatus);

Direct HTTP (Fly or local): use SubstrateHttpClient with baseUrl + x-tenant-id.

OpenAPI explorer

212+ routes generated from the live Fastify registry — route parity enforced in CI. Schema depth is generic today; typed request bodies land in Phase E.

Download OpenAPI View in repo

Self-host quickstart

git clone https://github.com/kevinbrodzinski/tracescript-substrate.git
cd tracescript-substrate
pnpm install --frozen-lockfile
docker compose up -d postgres
pnpm db:migrate
pnpm dev:api
pnpm smoke:api

Remote smoke

export SUBSTRATE_API_URL=https://tracescript-substrate-api.fly.dev
export SUPABASE_URL=https://igkxlzaultmzjvfdckzg.supabase.co
export SUPABASE_PUBLISHABLE_KEY=your-publishable-key
pnpm smoke:remote

Application whitepapers map to demo presets — Policy Corpus, Disclosure Firewall, Action Firewall, Retrieval Integrity, Memory Firewall. For the full language lineage (specs v0.1–v0.5, Code Medium, configuration assembly), see Language foundation.