From b13fa25eaf04b82456a068739f1d32f04a7b2e88 Mon Sep 17 00:00:00 2001 From: Test Date: Sat, 29 Aug 2026 15:40:33 +0000 Subject: [PATCH] =?UTF-8?q?fix(test):=20context-restore=20gets=20a=20priva?= =?UTF-8?q?te=20home=20=E2=80=94=20the=20REAL=20root=20cause=20was=20fixtu?= =?UTF-8?q?re=20sharing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The evidence-based assertion fix was treating a symptom. The slice artifact's embedded transcript showed the CI agent restoring 20260829-context-save-skill-test.md — the checkpoint the SIBLING context-save test wrote into the SHARED gstackHome checkpoints dir, which by filename-prefix ordering genuinely IS the newest. The agent behaved CORRECTLY; the test's fixture set was open to concurrent sibling writes, and bun --concurrent ordering differs between CI (save finished first) and local (restore listed first) — the entire local-green/CI-red split explained. The restore test now uses its own .gstack-restore-home (the whole home moves, not just the handed path — an agent deriving the dir from GSTACK_HOME/projects/ must land in the closed set too). Full file 4/4 paid green with all evidence flags firing. Also: the on-failure shard-log artifact glob uploaded nothing — the Fix-bun-temp step points TMPDIR at /home/runner/.cache, so the spool lands there, not /tmp. Both eval workflows now glob both locations (this gap is why diagnosing THIS failure required digging transcripts out of the slice-results artifact). Co-Authored-By: Claude Fable 5 --- .github/workflows/evals-periodic.yml | 7 ++++++- .github/workflows/evals.yml | 7 ++++++- test/skill-e2e-session-intelligence.test.ts | 14 ++++++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/evals-periodic.yml b/.github/workflows/evals-periodic.yml index 9c168f01d..c7b4f1ef2 100644 --- a/.github/workflows/evals-periodic.yml +++ b/.github/workflows/evals-periodic.yml @@ -239,7 +239,12 @@ jobs: uses: actions/upload-artifact@v7 with: name: paid-slice-${{ matrix.slice }}-logs - path: /tmp/gstack-paid-shard-*.log + # The Fix-bun-temp step points TMPDIR at /home/runner/.cache, so the + # runner's spool lands THERE, not /tmp — the original /tmp glob + # uploaded nothing and a red slice's diagnostics were unreachable. + path: | + /home/runner/.cache/gstack-paid-shard-*.log + /tmp/gstack-paid-shard-*.log if-no-files-found: ignore retention-days: 30 diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml index f79612631..897e90ca4 100644 --- a/.github/workflows/evals.yml +++ b/.github/workflows/evals.yml @@ -675,7 +675,12 @@ jobs: uses: actions/upload-artifact@v7 with: name: paid-slice-${{ matrix.slice }}-logs - path: /tmp/gstack-paid-shard-*.log + # The Fix-bun-temp step points TMPDIR at /home/runner/.cache, so the + # runner's spool lands THERE, not /tmp — the original /tmp glob + # uploaded nothing and a red slice's diagnostics were unreachable. + path: | + /home/runner/.cache/gstack-paid-shard-*.log + /tmp/gstack-paid-shard-*.log if-no-files-found: ignore retention-days: 30 diff --git a/test/skill-e2e-session-intelligence.test.ts b/test/skill-e2e-session-intelligence.test.ts index c79fceaab..ae8bb50f8 100644 --- a/test/skill-e2e-session-intelligence.test.ts +++ b/test/skill-e2e-session-intelligence.test.ts @@ -274,7 +274,17 @@ IMPORTANT: // claude -p. Verify the agent identifies the newer file (by filename prefix) // and presents its content, regardless of the current branch. testConcurrentIfSelected('context-restore-loads-latest', async () => { - const projectDir = path.join(gstackHome, 'projects', slug); + // PRIVATE home for this test: the suite runs concurrently, and the shared + // gstackHome's checkpoints dir also receives the context-save test's + // freshly-written checkpoint (a 2026-08-29 filename prefix — always the + // "newest"). In CI, save completed before this test's agent listed the + // dir, so the agent CORRECTLY restored the sibling's checkpoint and the + // assertions failed; locally the ordering happened to run restore first. + // An isolated home makes the fixture set closed regardless of ordering + // (the agent may derive the dir from GSTACK_HOME/projects/, so the + // whole home moves, not just the checkpoint path we hand it). + const restoreHome = path.join(workDir, '.gstack-restore-home'); + const projectDir = path.join(restoreHome, 'projects', slug); const checkpointDir = path.join(projectDir, 'checkpoints'); fs.mkdirSync(checkpointDir, { recursive: true }); @@ -333,7 +343,7 @@ This is the newest saved context. Cross-branch restore should load THIS file. ${restoreSection.slice(0, 2500)} IMPORTANT: -- Use GSTACK_HOME="${gstackHome}" as an environment variable when running bin scripts. +- Use GSTACK_HOME="${restoreHome}" as an environment variable when running bin scripts. - The bin scripts are at ./bin/ (relative to this directory), not at ~/.claude/skills/gstack/bin/. - Look in ${checkpointDir} for saved context files. - Current branch is "main" — do NOT filter by current branch. Load across all branches.