feat(agent-isolation): add Python packaging and pytest test harness#339
Merged
Conversation
Convert tools/agent-isolation/ to a uv Python project by adding pyproject.toml (hatchling build, pytest dev dependency) and a test suite under tests/ that exercises the three core shell scripts: - test_claude_iso.py: verifies env-var stripping (AWS_*, GH_TOKEN, ANTHROPIC_API_KEY, etc. are absent after exec env -i), passthrough of whitelisted vars (HOME, PATH, USER, SHELL, LANG), CLAUDE_ISO_ALLOW explicit injection, and the missing-claude-exits-127 path. - test_sandbox_add_project_root.py: verifies file creation, allowRead / allowWrite content, idempotency, merge with existing content, dry-run (no-write, preview output), non-git-dir graceful exit, and missing-jq graceful exit. - test_sandbox_bypass_warn.py: verifies exit-0 for normal payloads, exit-1 + banner for dangerouslyDisableSandbox:true (with command and description shown), and the grep pattern robustness (whitespace variants, false value, unrelated boolean field). Generated-by: Claude (Opus 4.7)
Member
|
Cool - but we need to add it to test matrix in CI as well :) |
Member
Author
|
Done |
potiuk
approved these changes
May 27, 2026
4 tasks
potiuk
added a commit
that referenced
this pull request
May 27, 2026
Branch protection on `main` cannot use patterns for required status check names — GitHub's classic branch-protection and rulesets APIs both require exact-match `context` strings, so each entry in the `pytest` matrix in `tests.yml` previously needed its own line in `.asf.yaml`. That coupling caused two known issues: - PR #340 renames `pytest (skill-validator)` → `pytest (skill-and-tool-validator)` and cannot merge, because branch protection on `main` still requires the old context name (which no longer runs in CI after the rename). - The `pytest (agent-isolation)` matrix entry added in #339 was never added to `.asf.yaml` and is silently not gated. Add a `tests-ok` umbrella job in `tests.yml` that `needs:` the `pytest` matrix and fails unless every matrix entry succeeded. Replace all `pytest (...)` entries in `.asf.yaml` with the single `tests-ok` context. Adding, renaming, or removing matrix entries no longer touches `.asf.yaml`. Follow-up for #340: drop the `.asf.yaml` hunk (the line is gone on `main`) and rebase. Generated-by: Claude Code (Opus 4.7)
15 tasks
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
Convert tools/agent-isolation/ to a uv Python project by adding pyproject.toml (hatchling build, pytest dev dependency) and a test suite under tests/ that exercises the three core shell scripts:
Generated-by: Claude (Opus 4.7)
Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
prek run --all-filespassesuv run pytest/ruff check/mypypasses(
PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)(a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)