Repository navigation
fix(watch-pr): keep runtime deps outside plugin cache and settle on repos with no CI - #314
Conversation
Merge Protections🟢 All 2 merge protections satisfied — ready to merge. Show 2 satisfied protections🟢 Queue ready pull requestsAutomatically queue non-draft pull requests targeting main after verify and live-gate pass on the head and every review thread is resolved.
🟢 🚦 Auto-queueWhen all merge protections are satisfied and these conditions match, this pull request will be queued automatically.
|
Live evidence: Open Pstack
|
Live evidence: Open Pstack
|
🛑 11 blocking findings🔴 Critical · A workspace 🔴 High · The watch-pr gate can pass without loading the installed skill 🔴 High · A shared cache can supply executable code to watch-pr 🔴 High · Missing required checks can be reported as merge-ready 🔴 High · The live gate certifies a production-only cache even with dev dependencies present 🟡 Medium · A push between reads can confirm the wrong head 🟡 Medium · The live recipe certifies an unchanged plugin after checking one path 🟡 Medium · A null rollup on a later page erases checks already read 🟡 Medium · A successful no-check read spends the query-error budget 🟡 Medium · A pending rollup seen during the same poll is ignored 🟡 Medium · Correctly shell-quoted install paths can fail the live gate WalkthroughThis PR fixes two watch-pr problems. First, the dependency bootstrap no longer runs
Advisories (1)
Since the last review
Repair promptRead the
Details
First review of this pull request. @unfret review · @unfret status · @unfret help |
Live evidence: Open Pstack
|
✅ Merged into
|
There was a problem hiding this comment.
🛑 11 blocking findings
🔴 Critical · A workspace .env can redirect watch-pr to untrusted executable code
🔴 High · The watch-pr gate can pass without loading the installed skill
🔴 High · A shared cache can supply executable code to watch-pr
🔴 High · Missing required checks can be reported as merge-ready
🔴 High · The live gate certifies a production-only cache even with dev dependencies present
🟡 Medium · A push between reads can confirm the wrong head
🟡 Medium · The live recipe certifies an unchanged plugin after checking one path
🟡 Medium · A null rollup on a later page erases checks already read
🟡 Medium · A successful no-check read spends the query-error budget
🟡 Medium · A pending rollup seen during the same poll is ignored
🟡 Medium · Correctly shell-quoted install paths can fail the live gate
Check
Closes #293
Closes #296
Started from davidrobertson's PR #294 (preserving original commits
80a734eand27d7dd1).Summary
plugins/pstack/skills/poteto-mode/scripts/ ├── bootstrap.ts │ - bun install --frozen-lockfile inside plugin directory (created node_modules/.bin/tsc symlink) │ + bun install --frozen-lockfile --production into hashed user cache (XDG_CACHE_HOME / LOCALAPPDATA / ~/.cache) │ + atomic staging + Bun.plugin commander loader in-process (no re-spawn, no plugin mutation) └── watch-pr/ ├── types.ts, github.ts: distinguish null GraphQL statusCheckRollup ({ kind: "no-rollup" }) from unreadable contexts ├── policy.ts: --status-only settles immediately as no-checks; watch modes confirm once after one backoff └── render.ts: show "✅ no checks" when ci.source === "no-checks" .claude/skills/verify-open-pstack/ └── features/recipes.ts, scripts/core.ts: add shipped-tools:watch-pr (runs installed watch-pr --help, verifies plugin unmutated + production-only cache, then runs startupHook in the same Codex install)Evidence
watch-prrun installed dev and runtime dependencies into the installed plugin directory, creatingnode_modules/.bin/tscand breaking Codex plugin hook trust.After (fix(pstack): keep runtime dependency installs out of plugin directory #293): Dependencies install with
--productioninto<cache>/open-pstack/poteto-mode-tools/<hash>/(onlycommander, notypescriptor.binsymlinks); plugin directory stays untouched. Verified bybootstrap.test.ts(7 focused cases including cold start, concurrent starts, cache invalidation, relativeXDG_CACHE_HOME, and incomplete cache).bun plugins/pstack/skills/poteto-mode/scripts/watch-pr/watch-pr --owner octocat --repo Hello-World --pr 11832 --status-only --max-query-errors 1 --prettyexited 7 (BLOCKER: status-query ... GraphQL rollup was empty).After (watch-pr treats a repo with no CI as a retryable error and never settles #296): Same command exits 0 and prints
| #11832 | ✅ no checks | ✅ | ✅ |. Watch mode (--max-query-errors 2) emits one confirmingRETRY(reading again to confirm) after 60s and settles asREADY(mergeStateStatus=CLEAN). Covered by fake-ghandpolicy.test.tstests.Merge Danger
Door: two-way. Reverting restores the prior
bootstrap.ts,watch-prrollup handling, and verifier recipes. Existing plugin installations polluted by the old bootstrap recover on upgrade to a fresh versioned plugin cache directory or reinstall.Blast Radius: narrow. Touches
watch-prbootstrap and check-rollup classification plus the newshipped-tools:watch-prverifier feature.Acceptance criteria
watch-prinstalls production dependencies in a per-user cache outside the plugin, loadscommanderin-process, leaves nonode_modulesin the plugin tree, and Codex startup hook still loads — verified inbootstrap.test.tsandcodex:shipped-tools:watch-pr.watch-prsettles on repos with no CI): Null GraphQLstatusCheckRollupmaps to{ source: "no-checks", checks: [] };--status-onlyexits 0 immediately (✅ no checks); watch modes do one confirming re-read before settling; real query failures stay retryable — verified ingithub.test.ts,policy.test.ts, and local CLI proof onoctocat/Hello-World#11832.Gate results
Run on head
c473ae1c023cc633742a942f772ae9f0e4508e33:env -u FORCE_COLOR bun run test: exit 0 (520 pass, 0 fail;#304fixes theFORCE_COLOR=1test flake in PR fix(runner): Claude sandbox failure detection, settings.json env fallback, and FORCE_COLOR test fix #313)bun run typecheck: exit 0 (tsc --noEmit)bun run static: exit 0 (219 verifier tests pass, 0 fail)claude plugin validate plugins/pstack: exit 0Planned live gate (4 sessions, run from candidate head on
pro14):--self-test --feature codex:shipped-tools:watch-prNot verified
GH_CONFIG_DIRwith no GitHub credentials; verified via local CLI run against open PRoctocat/Hello-World#11832plus fake-ghandpolicy.test.tsunit tests.%LOCALAPPDATA%): verified by unit tests, not run on a Windows host.