Skip to content

improvement(workflow-code): source check type-checks with the pinned TypeScript - #10345

Merged
waleedlatif1 merged 9 commits into
stagingfrom
improvement/workflow-code-check-types
Nov 23, 2026
Merged

waleedlatif1 merged 9 commits into
stagingfrom
improvement/workflow-code-check-types

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • sim workflows source check and sim workspaces source check type-check the directory after the compile, with the TypeScript release the declarations are built for (7.0.2). The edit loop is now check && apply --yes with no separate bunx -p typescript@… tsc step
  • Each type error is an E_TYPE finding (file, line, column, frame, TSnnnn: … message) in the display output, the --output json document and GitHub Actions annotations; checked lists what ran (["compile", "types"])
  • On by default, --no-types skips it. Warm cost is ~40-80 ms over the compile alone; the first check installs the release once with npm into ~/.sim/cache/typescript/<version> (~1.7-3.2 s cold)
  • Offline (or no npm) before that install: W_TYPES_UNCHECKED warning, and the check passes or fails on the compile alone. npm and tsc run without the Sim API key; embedded runs skip the type check
  • Left out: a type error on a line the compile already reports an error on, and one in a file still as the last get or apply wrote it (printed source the server accepted; the workspace SDK can lack a block type a stored workflow holds)
  • A workspace directory whose get could not list resources now regenerates .sim/sdk/workspace.d.ts from its declarations on check, so a new tables/<key>.ts and table('<key>') type-check in the same run
  • E_TYPE / W_TYPES_UNCHECKED registered in the diagnostic codes; primer, group help, .sim/AGENTS.md guides, check help, docs pages and SDK README drop the separate tsc step; typecheckCommand replaced by SOURCE_TYPESCRIPT_VERSION

Type of Change

  • Improvement

Testing

  • New tests in workspace-source-get.test.ts (new table typed with and without a resource listing, type error at file/line + annotation, dedupe against compile errors, workflow-folder scope, offline install fallback, npm env without SIM_API_KEY, --no-types) and workflow-source-get.test.ts (standalone workflow directory); each proven red by reverting its guard
  • Gate: tsc for every touched workspace, package suites (sim-cli 1132, workflow-code 789, workspace-code 164, workflow-sdk 53), apps/sim units, realtime units, integration (mig + push), realtime integration, goldens, check:audits, check:test-types, check:migrations, docs compatibility, lint, root type-check, test:scripts, block-registry check
  • bun run generate (openapi, cli-api, cli-docs, workflow-code-docs)

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 23, 2026 9:46pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues remain.

Summary

Both source check commands now run the pinned TypeScript release after compiling and report type errors alongside compile findings.

  • Workflow and workspace source checks now type-check after compiling.
  • Workspace checks refresh generated types from the declarations on disk.

Reviews (5) · Last reviewed commit: "fix(workflow-code): a check removes work..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 36 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 37 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

…TypeScript

check runs TypeScript 7.0.2 over the directory's tsconfig.json after the compile and reports each
error as E_TYPE (JSON, display and GitHub annotations), so the edit loop is check && apply --yes
with no separate tsc step. The release installs once with npm into ~/.sim/cache/typescript; offline
before that, check warns W_TYPES_UNCHECKED and decides on the compile alone. --no-types skips it.
Type errors on a line the compile already flags, or in a file as the last get or apply wrote it,
are left out.

A workspace directory whose get could not list resources now regenerates workspace.d.ts from its
declarations on check, so a new tables/<key>.ts is typed in the same check.
One unavailable path builds W_TYPES_UNCHECKED, reportCheck merges the type check's findings,
files are read once and concurrently, and npm and tsc run without the Sim API key.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 37 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 force-pushed the improvement/workflow-code-check-types branch from 7062c65 to 03fc900 Compare November 23, 2026 21:27
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 37 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 37 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 0e0d09c into staging Nov 23, 2026
155 of 158 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 98af5492 Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant