Commit cd9a08f
fix: unblock sandboxed worktree setup, stop E2E dirtying the tree, guard pushes server-side (#635)
* fix: unblock sandboxed worktree setup, stop E2E dirtying the tree, guard pushes server-side
Three environment problems, each with a measured cause.
1. `worktree-setup.sh` could not install Playwright browsers under the
sandbox. Writes are `allowOnly` and the browser cache is not in it:
mkdir ~/Library/Caches/ms-playwright/probe -> Operation not permitted
Probing further turned up a second blocked cache with the same shape:
`~/.npm/_cacache`, which breaks every `npm install`/`npm ci`. Neither
failure names the sandbox — npm blames "root-owned files" and sends you
to `sudo`, and the Playwright step is bounded by a timeout that blames
a slow download. Both caches are now in `allowWrite`, both are probed by
`verify-sandbox.sh`, and both scripts say what the error actually means.
2. `e2e/ci-wizard-settings.json` was tracked but is pure runtime scratch:
`run-e2e.sh` and all 14 wizard steps in `ci.yml` truncate it to `{}`
before mounting it, so nothing ever read the committed content, while
the container wrote the wizard's result back through the read-write
mount. Untracked and gitignored; no consumer changes. The real
`ci-bess-settings*.json` fixtures still write back — documented, not
changed.
3. `git push` no longer prompts. The blanket ask existed because prefix
globbing cannot reach a marker at an arbitrary argument position, but
that was compensating for having no guard at the layer that can see a
ref update. Four GitHub rulesets now refuse those spellings server-side
(main, beta-release-*, all tags, and beta's default branch), all with
empty bypass lists — load-bearing, since local pushes authenticate as
the owner, not as bess-agent. Feature branches stay unprotected on
purpose. `quality-check.sh` pins push in MUST_NOT_BE_GUARDED so the
prompt cannot be reinstated out of caution.
Sandbox settings are captured once at session start, so the allowWrite
change takes effect in a fresh session; `verify-sandbox.sh` confirms it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016tGBHZEAfKzP9qoJU4NdNY
* docs: correct the `git push -u` advice — it cannot set upstream under the sandbox
The previous bullet recommended `git push -u` as the way to record an
upstream after `checkout -b --no-track`. It cannot: `-u` writes
`.git/config`, which the same denial covers. Measured while pushing this
branch — the ref lands and the command then reports "unable to write
upstream branch configuration", which reads as a failed push and is not one.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016tGBHZEAfKzP9qoJU4NdNY
* docs: stop calling the Playwright hang "the #556 hang"
#556 is a CLOSED issue about caching worktree dependencies -- the work
during which the hang was first observed, not a ticket tracking it. The
existing comments in worktree-setup.sh say that correctly ("observed
while working #556"); the shorthand added in the previous commit did not,
and pointed readers at an unrelated closed issue.
Replaces it with the measurement instead: 1.59.1 stalls at exactly 84
files with the 173MB zip already downloaded and the extractor idle at 0%
CPU, while 1.62.1 completes on the same machine. It is extraction, not
the network, and there is no issue open for it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016tGBHZEAfKzP9qoJU4NdNY
* fix: address code review — probe failures that reported SKIP, and a false protection claim
Five findings from /code-review on this PR, plus one from #637's review that
belongs in this file.
verify-sandbox.sh
- Both new cache probes printed SKIP, counting NO failure, when the cache
directory could not be created -- which under the sandbox is precisely the
blocked condition being tested. A fresh machine exited 0 reporting the
config safe while npm and Playwright were both about to fail. "Cannot be
created" is now folded into the same check() and FAILS.
- PLAYWRIGHT_BROWSERS_PATH=0 is Playwright's documented sentinel for "no
shared cache", not a path. Treating it as one ran `mkdir -p 0` inside the
repo and reported a PASS that measured nothing. Now skipped explicitly.
quality-check.sh / CLAUDE.md
- The comment claimed GitHub refuses `git push origin --delete release-X.Y`.
It does not: the live rulesets cover ~DEFAULT_BRANCH, beta-release-* and
tags only, so `release-X.Y` -- the stable hotfix branch the release skill
pushes and tags -- is unguarded at BOTH layers. Documented as a known
residual with the fix named (a release-* ruleset, not an ask rule) rather
than left as a false claim. Creating that ruleset needs approval, so it is
not done here.
- The feature-branch residual was justified as "damage bounded to a branch
nobody has merged". That does not survive this repo's own conventions:
~20 worktrees push in parallel as the SAME identity, so a misaimed --force
destroys another agent's commits and closes its PR, and the reflog that
would recover it is in a different worktree. Still accepted, now for the
real reason.
worktree-setup.sh
- Sharing compared the two LOCKFILES but never checked that the tree being
shared was installed from the lockfile beside it. A dependency bump merged
to main updates main's package-lock.json and not its node_modules, so every
new worktree would share a tree built from the old lockfile while this
script reported success -- which is how the Playwright bump (#637) would
have silently reintroduced the very install hang it fixes. Adds
install_matches_lockfile(), comparing package-lock.json against
node_modules/.package-lock.json.
Optional deps are excluded: npm legitimately omits them, and counting that
as staleness made a freshly installed e2e tree report STALE over `fsevents`
alone -- which would push every worktree through a full install, the exact
cost the sharing exists to avoid.
Verified against real trees: main/e2e MATCHES, bump worktree MATCHES, and a
simulated post-#637 state (1.62.1 lockfile beside a 1.59.1 install)
correctly reports STALE. It also flags main/frontend as genuinely stale --
84 real version mismatches, so that one wants an `npm ci`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016tGBHZEAfKzP9qoJU4NdNY
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 5bd9e9d commit cd9a08f
8 files changed
Lines changed: 431 additions & 159 deletions
File tree
- .claude
- skills/verify
- e2e
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
Large diffs are not rendered by default.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
181 | 209 | | |
182 | 210 | | |
183 | 211 | | |
| |||
191 | 219 | | |
192 | 220 | | |
193 | 221 | | |
194 | | - | |
195 | 222 | | |
196 | 223 | | |
197 | 224 | | |
| |||
241 | 268 | | |
242 | 269 | | |
243 | 270 | | |
244 | | - | |
245 | | - | |
246 | 271 | | |
247 | 272 | | |
248 | 273 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | 274 | | |
257 | 275 | | |
258 | 276 | | |
| |||
308 | 326 | | |
309 | 327 | | |
310 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
311 | 358 | | |
312 | 359 | | |
313 | 360 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
181 | 255 | | |
182 | 256 | | |
183 | 257 | | |
| |||
0 commit comments