Skip to content

Standardize exit codes, use SimpleAPI for inlining, add --no-solve flag#696

Merged
shigoel merged 6 commits intomainfrom
shilpi/main-api
Mar 27, 2026
Merged

Standardize exit codes, use SimpleAPI for inlining, add --no-solve flag#696
shigoel merged 6 commits intomainfrom
shilpi/main-api

Conversation

@shigoel
Copy link
Copy Markdown
Contributor

@shigoel shigoel commented Mar 27, 2026

Summary

  • Introduce ExitCode namespace with documented exit code constants and a common scheme across all strata subcommands (1=user error, 2=failures found, 3=internal error, 4=known limitation)

  • Use Core.inlineProcedures from SimpleAPI in pyAnalyzeLaurelCommand and pyAnalyzeToGotoCommand instead of calling lower-level Core.Transform.runProgram directly

  • Add --no-solve flag to pyAnalyzeLaurel that generates SMT-Lib files without invoking the solver (requires --vc-directory or--keep-all-files)

  • Add skipSolver field to VerifyOptions and wire through dischargeObligation

  • Rename alwaysRunSMTalwaysGenerateSMT for clarity

  • Document all VerifyOptions fields with grouping comments

  • Replace all panic! calls with proper exitInternalError (exit code 3)

  • Swap exit codes 2↔3 to group user-actionable codes (1,2) and tool-side codes (3,4)

NEXT UP

Continue migrating StrataMain commands to use SimpleAPI — deduplicate the shared Laurel text-file parsing across 4 commands and add Laurel verification and Python direct-pipeline functions to SimpleAPI.

🤖 Generated with Claude Code

shigoel and others added 3 commits March 27, 2026 14:53
…flag

- Introduce ExitCode namespace with documented exit code constants
  (1=user error, 2=failures found, 3=internal error, 4=known limitation)
- Add general exit helpers: exitUserError, exitFailuresFound,
  exitInternalError, exitKnownLimitation
- Replace all panic! calls with exitInternalError for proper exit codes
- Use Core.inlineProcedures from SimpleAPI in pyAnalyzeLaurelCommand
  and pyAnalyzeToGotoCommand instead of direct Core.Transform calls
- Add --check-only flag to pyAnalyzeLaurel for SMT-only generation
- Swap exit codes 2↔3 to group user-actionable (1,2) and tool-side (3,4)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add `skipSolver` field to VerifyOptions and wire it through
  dischargeObligation to write SMT-Lib files without invoking the
  solver (returns unknown for all VCs)
- Add `--no-solve` flag to pyAnalyzeLaurel that sets both
  `skipSolver` and `alwaysGenerateSMT` so all VCs get SMT files
- Validate that --no-solve requires --vc-directory or --keep-all-files
- Rename `alwaysRunSMT` to `alwaysGenerateSMT` for clarity
- Document all VerifyOptions fields with grouping comments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shigoel shigoel changed the title Standardize exit codes, use SimpleAPI for inlining, add --check-only flag Standardize exit codes, use SimpleAPI for inlining, add --no-solve flag Mar 27, 2026
The explicit @dischargeObligation call needs the skipSolver argument
passed positionally since default parameters don't apply with @.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shigoel shigoel marked this pull request as ready for review March 27, 2026 20:54
@shigoel shigoel requested a review from a team March 27, 2026 20:54
shigoel and others added 2 commits March 27, 2026 16:00
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shigoel shigoel added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit b64a765 Mar 27, 2026
15 checks passed
@shigoel shigoel deleted the shilpi/main-api branch March 27, 2026 21:41
olivier-aws pushed a commit that referenced this pull request Mar 30, 2026
…ag (#696)

## Summary

- Introduce `ExitCode` namespace with documented exit code constants and
a common scheme across all `strata` subcommands (1=user error,
2=failures found, 3=internal error, 4=known limitation)

- Use `Core.inlineProcedures` from SimpleAPI in `pyAnalyzeLaurelCommand`
and `pyAnalyzeToGotoCommand` instead of calling lower-level
`Core.Transform.runProgram` directly

- Add `--no-solve` flag to `pyAnalyzeLaurel` that generates SMT-Lib
files without invoking the solver (requires `--vc-directory`
or`--keep-all-files`)

- Add `skipSolver` field to `VerifyOptions` and wire through
`dischargeObligation`

- Rename `alwaysRunSMT` → `alwaysGenerateSMT` for clarity

- Document all `VerifyOptions` fields with grouping comments

- Replace all `panic!` calls with proper `exitInternalError` (exit code
3)

- Swap exit codes 2↔3 to group user-actionable codes (1,2) and tool-side
codes (3,4)

## NEXT UP
Continue migrating StrataMain commands to use SimpleAPI — deduplicate
the shared Laurel text-file parsing across 4 commands and add Laurel
verification and Python direct-pipeline functions to SimpleAPI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

3 participants