Skip to content

fix(cli): fail closed when --isolate-app cannot be honored - #403

Merged
yeongseon merged 1 commit into
mainfrom
fix/391-isolate-fail-closed
Aug 10, 2026
Merged

fix(cli): fail closed when --isolate-app cannot be honored#403
yeongseon merged 1 commit into
mainfrom
fix/391-isolate-fail-closed

Conversation

@yeongseon

Copy link
Copy Markdown
Owner

Summary

  • --isolate-app previously 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 returning rc==0. A user who explicitly requested isolation silently received a non-isolated spec with a success exit code.
  • Now these runs exit 1 with a clear message explaining why isolation could not be honored.

Semantics

  • --isolate-app + no --app → exit 1.
  • --isolate-app + --app module (no :variable) → exit 1.
  • --app module:variable → isolate as before.
  • No --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.
  • Update TestCliIsolateApp (which encoded the old rc==0 fallback contract) to assert fail-closed.
  • Add TestIsolateAppFailClosed regression tests covering both the no---app and bare-module paths.

Validation

  • make check-all green (tests + lint + typecheck + security), coverage ≥95%.

Closes #391

--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
@yeongseon
yeongseon merged commit b548411 into main Aug 10, 2026
16 checks passed
@yeongseon
yeongseon deleted the fix/391-isolate-fail-closed branch August 10, 2026 13:39
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.

fix(cli): fail closed when --isolate-app cannot be honored

2 participants