fix(cli): fail closed when --isolate-app cannot be honored - #403
Merged
Conversation
--isolate-app previously failed open: with no --app, or with --app pointing at a bare module (no ':variable'), the CLI only warned and fell back to the shared global registry while still returning rc==0. A user who explicitly asked for isolation silently got a non-isolated spec with a success exit code — a correctness/security footgun. Now such runs exit 1 with a clear message stating why isolation could not be honored. --app 'module:variable' still isolates as before, and runs without --isolate-app are unchanged. Updates the existing fallback test to the fail-closed contract and adds regression coverage. Closes #391
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.
Summary
--isolate-apppreviously failed open: with no--app, or with--app module(bare module, no:variable), the CLI only warned (or was silent) and fell back to the global registry while still returningrc==0. A user who explicitly requested isolation silently received a non-isolated spec with a success exit code.Semantics
--isolate-app+ no--app→ exit 1.--isolate-app+--app module(no:variable) → exit 1.--app module:variable→ isolate as before.--isolate-app→ unchanged behavior.Changes
cli.py handle_generate: add an early guard for missing--app, and replace the module-only "ignored + fallback" note with a fail-closed error +return 1.TestCliIsolateApp(which encoded the oldrc==0fallback contract) to assert fail-closed.TestIsolateAppFailClosedregression tests covering both the no---appand bare-module paths.Validation
make check-allgreen (tests + lint + typecheck + security), coverage ≥95%.Closes #391