Skip to content

Migrate TypeScript checks to Effect TSGo#2851

Merged
juliusmarminge merged 10 commits into
mainfrom
codex/typescript-6-base
May 28, 2026
Merged

Migrate TypeScript checks to Effect TSGo#2851
juliusmarminge merged 10 commits into
mainfrom
codex/typescript-6-base

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented May 28, 2026

Summary

  • move direct TypeScript checking to @effect/tsgo on @typescript/native-preview@7.0.0-dev.20260527.2, while retaining JavaScript typescript for the Astro app
  • remove the legacy @effect/language-service runtime dependency and patch native tsgo during install
  • keep strict Effect diagnostics inherited across the repository; the web config now lists only its plain-global opt-outs (globalDate, globalConsole, globalRandom, globalTimers, and globalFetch)
  • enforce globalFetch and globalFetchInEffect; apps/web opts out of plain globalFetch only, while server integration requests use HttpClient and HttpBody.json
  • preserve typed UUID generation failures: startup and checkpoint paths retain PlatformError, and websocket dispatch maps them to OrchestrationDispatchCommandError
  • use Effect.all / Effect.flatMap for UUID-dependent dispatch composition and remove all TSGo-reported unnecessaryEffectGen wrappers
  • decode lenient JSONC through Schema.decodeEffect rather than a sync decoder wrapped in Effect.try, with malformed-input coverage
  • disable lazyEffect, replace all reported unnecessaryTypeofType usages with direct schema types, and regenerate Codex metadata from the corrected generator
  • collapse the remaining TSGo-reported server multipleCatchTag and redundantMapError patterns
  • retain the TypeScript 6 contracts cleanup that keeps packages/contracts independent of Node ambient types

Validation

  • bun fmt
  • bun lint (passes with 9 existing warnings)
  • bun typecheck (passes with no Effect TSGo suggestions)
  • bun run test --filter=t3 --filter=@t3tools/desktop --filter=@t3tools/ssh --filter=@t3tools/shared after the HTTP client, generator-wrapper, and lenient JSON cleanups
  • bun run test --filter=t3 --filter=effect-acp --filter=effect-codex-app-server after direct-schema generation and final server TSGo suggestion cleanups
  • Earlier full affected-package test run for the migration: bun run test --filter=t3 --filter=@t3tools/contracts --filter=@t3tools/desktop --filter=@t3tools/web --filter=@t3tools/shared --filter=@t3tools/ssh --filter=effect-acp --filter=effect-codex-app-server

Test Results

  • apps/server: 1023 passed, 4 skipped after the final TSGo cleanup
  • apps/web: 1049 passed
  • apps/desktop: 97 passed
  • packages/contracts: 142 passed
  • packages/shared: 120 passed
  • packages/ssh: 23 passed
  • packages/effect-acp: 16 passed
  • packages/effect-codex-app-server: 4 passed

Note

High Risk
Renaming Context.Service identifier strings can break runtime resolution if anything still looks up services by the old keys; auth, orchestration, and websocket paths now depend on Crypto service failures propagating correctly across a very large diff.

Overview
Migrates monorepo typechecking from tsc to tsgo (@effect/tsgo / native preview on TypeScript 6), swaps prepare to effect-tsgo patch, and drops per-package @effect/language-service + typescript dev deps where checks now run through tsgo.

Aligns code with stricter Effect/TSGo diagnostics: Context.Service keys are renamed to path-style identifiers (desktop @t3tools/..., server t3/sourceControl/..., etc.); crypto.randomUUID() is replaced with Crypto.Crypto.randomUUIDv4 in auth, startup, checkpoint reactor, and websocket dispatch so UUID failures stay typed; orchestration activity/command IDs are composed with Effect.all / yield* instead of sync UUIDs.

Test and codegen cleanups: server integration tests use HttpClient + HttpBody.json instead of fetch; generated Codex RPC typings use CodexSchema.X instead of typeof CodexSchema.X.Type; provider logging and settings tests use schema encode/decode Effect paths; web tsconfig only overrides plain-global diagnostic severities.

Smaller fixes: Effect.catchTags on orchestration HTTP routes, simplified OpenCode probe wiring, lenient JSONC decode tests in shared, deterministic activity IDs in web session-logic tests, and removal of redundant Effect.gen wrappers flagged by TSGo.

Reviewed by Cursor Bugbot for commit c13d21c. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Migrate all TypeScript type-checking from tsc to tsgo (Effect TSGo)

  • Replaces tsc --noEmit with tsgo --noEmit across all packages and apps; removes @effect/language-service and typescript devDependencies in favor of @effect/tsgo and TypeScript 6.0.3.
  • Updates the root prepare script from effect-language-service patch to effect-tsgo patch.
  • Migrates all Context.Service tag identifier strings to path-based conventions (e.g. "t3/source-control/Foo""t3/sourceControl/Foo", "t3/desktop/Foo""@t3tools/desktop/…/Foo") to satisfy tsgo naming requirements.
  • Replaces all direct crypto.randomUUID() calls with the Effect Crypto.Crypto service (randomUUIDv4) across auth, orchestration, and WebSocket layers so UUID generation is effectful and testable.
  • Risk: Context.Service identifier renames are runtime breaking changes for any persisted or serialized service contexts that relied on the old strings.

Macroscope summarized c13d21c.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 486853d8-2803-485b-b6ff-f140924aa9c1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/typescript-6-base

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels May 28, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes May 28, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 28, 2026

Approvability

Verdict: Needs human review

Beyond the tooling migration (tsc → tsgo), this PR changes UUID generation from synchronous global crypto to Effect's Crypto service across auth, checkpoint, and websocket code paths. This introduces new failure modes and error type propagation that warrant review of the runtime behavior impact.

You can customize Macroscope's approvability policy. Learn more.

Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge juliusmarminge force-pushed the codex/typescript-6-base branch from 35fde9c to 7323b05 Compare May 28, 2026 20:59
@macroscopeapp macroscopeapp Bot dismissed their stale review May 28, 2026 20:59

Dismissing prior approval to re-evaluate 7323b05

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes May 28, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@macroscopeapp macroscopeapp Bot dismissed their stale review May 28, 2026 21:42

Dismissing prior approval to re-evaluate b4ef2d4

Co-authored-by: codex <codex@users.noreply.github.com>
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels May 28, 2026
@juliusmarminge juliusmarminge changed the title Migrate repository TypeScript catalog to 6.0.3 Migrate TypeScript checks to Effect TSGo May 28, 2026
juliusmarminge and others added 4 commits May 28, 2026 14:53
Update native preview to 7.0.0-dev.20260527.2 and replace UUID-only generator wrappers with Effect combinators.

Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes May 28, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels May 28, 2026
@macroscopeapp macroscopeapp Bot dismissed their stale review May 28, 2026 22:42

Dismissing prior approval to re-evaluate 9791111

juliusmarminge and others added 2 commits May 28, 2026 15:51
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge juliusmarminge merged commit 6b3050e into main May 28, 2026
12 checks passed
@juliusmarminge juliusmarminge deleted the codex/typescript-6-base branch May 28, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant