Skip to content

refactor: migrate maintained runtime support to TypeScript - #991

Merged
tomdps merged 6 commits into
mainfrom
codex/migrate-runtime-support-typescript
Aug 11, 2026
Merged

refactor: migrate maintained runtime support to TypeScript#991
tomdps merged 6 commits into
mainfrom
codex/migrate-runtime-support-typescript

Conversation

@tomdps

@tomdps tomdps commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • migrate CLI export/watch formatting, routing helpers, execution boundaries, state snapshots, and nested-cluster support from maintained JavaScript to strict TypeScript
  • preserve every existing CommonJS runtime path, export order, function/class arity, and packed-package output
  • add unknown-first runtime guards at untyped process, JSON, worker, message-bus, and validator boundaries without any or TypeScript suppressions
  • split state snapshot normalization into a shared internal module to satisfy file-size and clone policy

Validation

  • npm run typecheck
  • npm run lint -- --quiet
  • npx mocha tests/package-smoke.test.js
  • focused CLI/routing/execution/snapshot/nested-cluster suites
  • differential execution against the committed JavaScript for snapshot reducers, snapshotter class surface, sub-cluster validation/defaults, and bridge forwarding
  • real worker-thread copy behavior probe
  • npm run opcore:check
  • opcore-zero check --repo . --staged --json
  • opcore-zero sense --repo . --staged --json

@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown

Greptile Summary

This PR migrates maintained CLI, orchestration, snapshot, nested-cluster, and execution-boundary runtime modules to strict TypeScript while retaining generated CommonJS entrypoints.

  • Adds runtime guards at untyped module, worker, message, JSON, and process boundaries.
  • Splits snapshot normalization into a shared internal module.
  • Extends package smoke coverage to verify generated runtime files are included in packed artifacts.
  • Updates build-output ignore and lint configuration for generated CommonJS files.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
cli/json-export.ts Migrates streaming ledger export to strict TypeScript while preserving incremental file-descriptor and stream output.
src/state-snapshot.ts Migrates snapshot reducers to TypeScript and delegates unknown-value normalization to the new shared module.
src/state-snapshotter.ts Migrates snapshot bootstrap, topic folding, hashing, and publication while adding guards around ledger messages.
src/message-bus-bridge.ts Migrates parent/child cluster forwarding and loop prevention with typed bus and message contracts.
src/schemas/sub-cluster.ts Migrates nested-cluster validation and defaults while validating the lazily loaded config-validator boundary.
src/copy-worker.ts Migrates the worker-thread copy boundary and validates worker data before copying files.
tests/package-smoke.test.js Expands packed-package verification for generated CommonJS runtime outputs.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  TS[Maintained TypeScript sources] --> Build[Legacy runtime TypeScript build]
  Build --> CJS[Generated CommonJS runtime paths]
  CJS --> CLI[CLI and export/watch formatting]
  CJS --> Orchestrator[Orchestrator and trigger evaluation]
  CJS --> Snapshot[State snapshot reducers and snapshotter]
  CJS --> Nested[Nested-cluster schema and message bridge]
  CJS --> Boundaries[Worker, credential, and environment boundaries]
  CJS --> Pack[npm packed package]
Loading

Reviews (2): Last reviewed commit: "test: allow package smoke build headroom" | Re-trigger Greptile

@tomdps
tomdps enabled auto-merge August 11, 2026 21:43
@tomdps
tomdps added this pull request to the merge queue Aug 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 11, 2026
@tomdps
tomdps added this pull request to the merge queue Aug 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 11, 2026
@tomdps
tomdps added this pull request to the merge queue Aug 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 11, 2026
@tomdps
tomdps added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit e8d9a8b Aug 11, 2026
12 checks passed
@tomdps
tomdps deleted the codex/migrate-runtime-support-typescript branch August 11, 2026 23:29
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 6.39.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant