Skip to content

feat(build): distinguish exit codes by severity (0=ok, 1=error, 2=waring#3212

Closed
LittleLemonDrop wants to merge 14 commits into
tscircuit:mainfrom
LittleLemonDrop:exit-code-distinction
Closed

feat(build): distinguish exit codes by severity (0=ok, 1=error, 2=waring#3212
LittleLemonDrop wants to merge 14 commits into
tscircuit:mainfrom
LittleLemonDrop:exit-code-distinction

Conversation

@LittleLemonDrop

Copy link
Copy Markdown

Summary

Previously, tsci build always exited with code 0, even when circuits had
errors or warnings. This made it impossible for CI/CD pipelines and automated
agents to detect build quality from the exit code alone.

Changes

This PR introduces proper exit code conventions for tsci build:

  • Exit code 0: Build succeeded with no issues
  • Exit code 1: Build failed with errors (unrecoverable)
  • Exit code 2: Build succeeded but with warnings (recoverable, actionable)

This allows CLI consumers (scripts, CI/CD, AI agents) to determine build
quality without parsing stdout, and to fail early on errors while still
flagging warnings as actionable.

Implementation

Three files modified:

  • cli/build/build-file.ts: Added hasWarnings field to BuildFileOutcome
  • cli/build/register.ts: Track warnings, branch exit logic by severity
  • cli/build/utils/exit-build.ts: Color-coded messages per exit code

Closes #2292

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This PR was closed because it has been inactive for 1 day since being marked as stale.

@github-actions github-actions Bot closed this Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tsci build should distinguish error exit codes from warning exit codes for agent automation

1 participant