Repository navigation
CLI: commands and output for scripts and coding agents - #4173
Merged
Merged
Conversation
- Set process.exitCode = 1 on all error paths (run, parse, print-ir)
so scripts and CI can detect failures
- Output errors to stderr instead of stdout for proper stream separation
- Add error type classification matching the UI ("Compile Error",
"Runtime Error") with colored headers
- Iterate individual errors from SqErrorList for better multi-error display
- Fix playground command: add missing `open` import
- Add top-level .catch() in index.ts for unhandled errors
- Wrap file-not-found errors in getLinker with user-friendly messages
- Add printError method to CliPrinter for stderr output
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add 28 tests covering all error paths: parse errors, runtime errors, compile errors, file-not-found, invalid imports, conflicting flags - Test exit codes (1 on error, 0 on success) for run, parse, print-ir - Test that errors go to stderr and success output goes to stdout - Test error type classification headers (Compile Error, Runtime Error) - Test stack traces are included in runtime errors - Update cliHelpers.ts to capture process.exitCode (not just Commander errors) - Fix file-not-found in loadSrc to use program.error() for clean output Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tified-uncertainty/squiggle into cli-agent-tools * 'squiggle-cli-error-handling' of https://github.com/quantified-uncertainty/squiggle: Add comprehensive CLI error handling tests Improve Squiggle CLI error handling and reporting
sqValueToJson converts values to compact JSON (distributions summarized as mean/stdev/percentiles). Hints and warnings are deterministic ports of the Squiggle AI heuristics. Registry exposes documentation for all functions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Errors include structured locations, stack frames and hints. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ngeset Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 7faea20 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
CodeQL flagged three js/polynomial-redos patterns in hints.ts. Strip strings and line comments in a single pass, remove inline block comments with indexOf, and check the "bare expression" parse error without `.*`. An unterminated string now extends to the end of the line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
getErrorHints takes { message, line }; the test type-checked only under
Jest, so tsc -b (and the Vercel builds) failed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/\w\s*:\s*[A-Z]/ matches the same strings as /\w+\s*:\s*[A-Z]/ without retrying every suffix of a long word. Addresses CodeQL js/polynomial-redos. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 19, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of four PRs that land the Squiggle Studio / relative values work. Merge order: this one, then relative values + Hub, then the Claude Code plugin, then Studio.
What
Makes the
squiggleCLI usable by scripts and coding agents.run --json(values as compact JSON, with distributions summarized),--seed,--sample-count,--watch. Errors include structured locations, stack frames and hints.checkcommand: parse/compile/run without printing output, with warnings.docscommand: offline builtin documentation.playground --print-url, agent-friendly help text, README, changeset.sqValueToJson, error hints and code warnings (deterministic ports of the Squiggle AI heuristics).Two small follow-ups to the CLI colors (only emit ANSI colors for TTYs; decide on colors in the entry point rather than at import time, because
colors.tsships in browser bundles) are in the Studio PR, since they sit on top of the integration branch.🤖 Generated with Claude Code