fix(test): context-restore gets a private home — the REAL root cause was fixture sharing

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/<slug> 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 <noreply@anthropic.com>
This commit is contained in:
Test
2026-08-29 15:40:33 +00:00
co-authored by Claude Fable 5
parent 8f81c6a671
commit b13fa25eaf
3 changed files with 24 additions and 4 deletions
+12 -2
View File
@@ -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/<slug>, 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.