Canonical MRTDown data for Singapore rail entities, issue records, and the package tooling that validates and publishes them.
This repository is the source of truth for reviewed data. It does not serve the runtime API; downstream apps consume the generated static GitHub Pages artifact.
npm ci
npm run build:packages
npm run data:validate
npm testFor linting and formatting checks:
npm run lintdata/station,data/line,data/service,data/operator,data/town, anddata/landmark: canonical static entities.data/issue/YYYY/MM/<issue_id>/: canonical issue bundles.fixtures/generated/data: on-demand generated fixture data for tests and examples.packages/core: shared schemas, period helpers, and state helpers.packages/ingest-contracts: webhook payload schemas shared with external evidence producers.packages/fs: file-backed repositories, validation, manifest, and Pages export helpers.packages/triage: LLM-assisted evidence triage and replay utilities.packages/cli: command-line entry point for validating, inspecting, and creating target-layout data.docs/plans: active plans, completed migration reports, and durable tech debt.
npm run build:packages # Build all workspace packages
npm run typecheck # Compile-check workspace packages
npm test # Run deterministic Vitest tests
npm run lint # Run Biome checks
npm run check # Run lint, boundary checks, and docs link checks
npm run data:validate # Validate canonical data
npm run fixtures:validate # Generate and validate fixture data
npm run pages:build # Build the GitHub Pages static data artifactPackage-specific build and test commands are available in package.json when a
change only touches one package.
npm run pages:build writes the static artifact to pages-dist/.
The artifact publishes the canonical export at the root:
index.htmlmanifest.jsonarchive.tar.gzarchive.zipstation/,line/,service/,operator/,town/,landmark/, andissue/
It also includes the deterministic fixture export under fixtures/:
fixtures/index.htmlfixtures/manifest.jsonfixtures/archive.tar.gzfixtures/archive.zip- the fixture data files used to build the fixture manifest
Preview branches and pull requests build the same bundle in CI and upload it as
a short-lived artifact. Only main deploys the bundle to GitHub Pages.
After a successful main Pages deployment, CI triggers the mrtdown-site
internal pull endpoint so the site can import the newly published archive. The
deploy workflow expects these repository secrets:
MRTDOWN_SITE_PULL_URL: the fullmrtdown-site/internal/api/tasks/pullURL.MRTDOWN_SITE_INTERNAL_API_TOKEN: a bearer token present in the site'sINTERNAL_API_TOKENS.
Static data records describe rail lines, services, stations, operators, towns,
and landmarks. Records are JSON files validated by the schemas in
@mrtdown/core.
Issue records live in date-partitioned bundles:
data/issue/YYYY/MM/<issue_id>/
issue.json
evidence.ndjson
impact.ndjson
issue.jsonstores the issue identity, type, and translated title.evidence.ndjsonstores source evidence used to understand the issue.impact.ndjsonstores append-only impact events derived from evidence.
Supported issue types are disruption, maintenance, and infra.
Use open-ended periods for ongoing issues. CLI validation is required whenever canonical data changes.
Webhook evidence payloads use the shared schemas in @mrtdown/ingest-contracts
and can be processed through @mrtdown/triage:
npm run ingest:webhookModel-dependent triage evals are intentionally separate from the deterministic test suite:
npm run test:evalRun evals only when the package's documented environment variables are set and the paid model calls are intentional.
- Keep generated
pages-dist/, packagedist/, and local migration scratch files out of commits unless a change explicitly updates artifact policy. - Keep generated data and hand-authored code in separate pull requests whenever practical.
- If documentation and code disagree, update the documentation in the same change.
Agent-specific repository guidance lives in AGENTS.md.