From c84ab59b7b615bb94ca337d0abc66c1c87271b3d Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Tue, 16 Jun 2026 15:38:26 +0000 Subject: [PATCH] fix: isolate sentinel-constant test + disable js-lint Two CI failures fixed: 1. PHPUnit constant-scoping bleed: test_p0_executor_path_sentinel_key_does_not_ leak defines PRV_OPENROUTER_API_KEY as a process-scoped PHP constant. Running after CaptureWriter (alphabetically earlier), KeyStoreTest's resolver tests saw the canary value instead of empty/option. Fix: @runInSeparateProcess + @preserveGlobalState disabled so the constant is confined to its own forked PHP process. 2. JS lint job failure: has_js: true caused the reusable CI's lint-js job to attempt npm ci, but pr-vision has no package.json. Fixed: has_js: false. Agent-Session: claude/adopt-ci-20260616 --- .github/workflows/ci.yml | 2 +- tests/unit/CaptureWriterTest.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b037ab..c4d0954 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,6 @@ jobs: uses: peptiderepo/peptide-e2e/.github/workflows/ci.yml@main with: tests: stubs - has_js: true + has_js: false line_limit_paths: includes secrets: inherit diff --git a/tests/unit/CaptureWriterTest.php b/tests/unit/CaptureWriterTest.php index 6ca29e3..9a039b5 100644 --- a/tests/unit/CaptureWriterTest.php +++ b/tests/unit/CaptureWriterTest.php @@ -122,6 +122,14 @@ class CaptureWriterTest extends TestCase { // ── Test 4 (P0 SECURITY — executor path): sentinel must not leak ────── + /** + * Defines PRV_OPENROUTER_API_KEY as a process-scoped PHP constant. + * Must run in a separate process to prevent that constant from bleeding + * into sibling test classes (e.g. KeyStoreTest) within the same PHPUnit run. + * + * @runInSeparateProcess + * @preserveGlobalState disabled + */ public function test_p0_executor_path_sentinel_key_does_not_leak(): void { if ( ! defined( 'PRV_OPENROUTER_API_KEY' ) ) { define( 'PRV_OPENROUTER_API_KEY', 'sk-or-TEST-LEAK-CANARY' );