gstack/test/helpers
Garry Tan bdcf2504ae test: tier-1 live-fire E2E for context-save + context-restore
8 periodic-tier E2E tests that spawn claude -p with the Skill tool
enabled and the skill installed in .claude/skills/. These exercise
the ROUTING path — the actual thing that broke with /checkpoint.
Prior tests hand-fed the Save section as a prompt; these invoke the
slash-command for real and verify the Skill tool was called.

Tests (~$0.20-$0.40 each, ~$2 total per run):

1. context-save-routing
   Prompts "/context-save wintermute progress". Asserts the Skill
   tool was invoked with skill:"context-save" AND a file landed in
   the checkpoints dir. Guards against future upstream collisions
   (if Claude Code ships /context-save as a built-in, this fails).

2. context-save-then-restore-roundtrip
   Two slash commands in one session: /context-save <marker>, then
   /context-restore. Asserts both Skill invocations happened AND
   restore output contains the magic marker from the save.

3. context-restore-fragment-match
   Seeds three saves (alpha, middle-payments, omega). Runs
   /context-restore payments. Asserts the payments file loaded and
   the other two did NOT leak into output. Proves fragment-matching
   works (previously untested — we only tested "newest" default).

4. context-restore-empty-state
   No saves seeded. /context-restore should produce a graceful
   "no saved contexts yet"-style message, not crash or list cwd.

5. context-restore-list-delegates
   /context-restore list should redirect to /context-save list
   (our explicit design: list lives on the save side). Asserts
   the output mentions "context-save list".

6. context-restore-legacy-compat
   Seeds a pre-rename save file (old /checkpoint format) in the
   checkpoints/ dir. Runs /context-restore. Asserts the legacy
   content loads cleanly. Proves the storage-path stability
   promise (users' old saves still work).

7. context-save-list-current-branch
   Seeds saves on 3 branches (main, feat/alpha, feat/beta).
   Current branch is main. Asserts list shows main, hides others.

8. context-save-list-all-branches
   Same seed. /context-save list --all. Asserts all 3 branches
   show up in output.

touchfiles.ts: all 8 registered in both E2E_TOUCHFILES and E2E_TIERS
as 'periodic'. Touchfile deps scoped per-test (save-only tests don't
run when only context-restore changes, etc.).

Coverage jump: smoke-test level (~5/10) → truly E2E (~9.5/10) for the
context-skills surface area. Combined with the 21 Tier-2 hardening
tests (free, 142ms) from the prior commit, every non-trivial code
path has either a live-fire assertion or a bash-level unit test.
2026-04-19 05:41:49 +08:00
..
codex-session-runner.ts fix: enforce Codex 1024-char description limit + auto-heal stale installs (v0.11.9.0) (#391) 2026-03-23 08:44:08 -07:00
e2e-helpers.ts feat: remove trigger guard + proactive opt-out prompt (#457) 2026-03-24 18:07:36 -07:00
eval-store.test.ts feat: QA restructure, browser ref staleness, eval efficiency metrics (v0.4.0) (#83) 2026-03-15 23:55:39 -05:00
eval-store.ts feat: worktree isolation for E2E tests + infrastructure elegance (v0.11.12.0) (#425) 2026-03-23 23:05:22 -07:00
gemini-session-runner.test.ts feat: Gemini CLI E2E tests (v0.9.2.0) (#252) 2026-03-20 08:30:09 -07:00
gemini-session-runner.ts feat: Gemini CLI E2E tests (v0.9.2.0) (#252) 2026-03-20 08:30:09 -07:00
llm-judge.ts feat: 3-tier eval suite with planted-bug outcome testing (EVALS=1) 2026-03-14 01:17:36 -05:00
observability.test.ts fix: never clean up observability artifacts — partial file persists after finalize 2026-03-14 12:37:38 -05:00
session-runner.test.ts feat: stream-json NDJSON parser for real-time E2E progress 2026-03-14 03:49:36 -05:00
session-runner.ts feat: content security — 4-layer prompt injection defense for pair-agent (#815) 2026-04-06 14:41:06 -07:00
skill-parser.ts feat: content security — 4-layer prompt injection defense for pair-agent (#815) 2026-04-06 14:41:06 -07:00
touchfiles.ts test: tier-1 live-fire E2E for context-save + context-restore 2026-04-19 05:41:49 +08:00