Skip to content

Commit 8dbe1b2

Browse files
committed
docs(release-policy): sandbox packaging contract (P0-2)
Documents the three rules that keep ignored / sensitive files out of e2b + nightly tarballs (tracked-only + denylist + gitleaks) and points at the regression tests that lock them in.
1 parent 90701a5 commit 8dbe1b2

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

docs/release-policy.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,37 @@ post results (or open an issue on failure) for engineering follow-up.
5454
| Cross-platform install (Windows / macOS) | `.github/workflows/cross-platform.yml` | Weekly Monday 03:00 UTC | Slow runners (~15 min) and rarely catches anything new. Weekly is enough for Tier-2 platforms. |
5555
| Live integration tests (real APIs) | `.github/workflows/nightly.yml` | Daily 02:00 UTC | Hits external APIs (Anthropic, OpenAI, GitHub, etc.). Real spend, real rate limits — cannot be on every PR. |
5656

57+
## Sandbox packaging never ships ignored files
58+
59+
Every tarball that leaves a developer's laptop for an external sandbox
60+
(e2b, nightly-local, or any future runner) is built by
61+
`scripts/e2b/lib/packing.py:pack_directory`. That single entry point
62+
enforces three rules:
63+
64+
1. **Only git-tracked files.** `_list_tracked_files` calls
65+
`git ls-files`, so anything in `.gitignore` (`.env`, local
66+
`experience/`, `evidence/`, ad-hoc scratch) is invisible to the
67+
tarball — even if it sits next to a tracked file.
68+
2. **Hard denylist on top.** `_DENIED_PATTERNS` blocks `.env*`,
69+
`*.key`, `*.pem`, `experience/`, `evidence/`,
70+
`tests/integration/sessions/` regardless of git state. If a developer
71+
force-adds `.env` (`git add -f .env`), packing still drops it.
72+
3. **Pre-pack secret scan.** `_run_secret_scan` runs
73+
`gitleaks detect --no-git` over the source tree before opening the
74+
tarball. Any leak detected raises `RuntimeError` and aborts packing
75+
before bytes hit disk. Gitleaks honors the repo-root
76+
`.gitleaks.toml`.
77+
78+
Existing callers (`scripts/e2b/run_validation.py`,
79+
`scripts/nightly-local.sh`) all route through `pack_directory`. Any new
80+
sandbox-upload path MUST do the same; never call `tarfile.open` or
81+
`tar -czf` directly on the repo root.
82+
83+
Regression coverage lives in `tests/scripts/test_e2b_packing.py`:
84+
`test_pack_includes_only_tracked_files`,
85+
`test_pack_excludes_denylist_even_if_tracked`, and
86+
`test_pack_aborts_on_secret`.
87+
5788
## How to change this policy
5889

5990
1. Edit this file.

0 commit comments

Comments
 (0)