Skip to content

fix(#1086): scrub SEQUANT_* env in the vitest global setup - #1113

Merged
admarble merged 2 commits into
mainfrom
feature/1086-bug-test-suite-isn-t-hermetic-against-the-sequant-
Sep 20, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/1086-bug-test-suite-isn-t-hermetic-against-the-sequant-

Conversation

@admarble

@admarble admarble commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Acceptance criteria

  • AC-1: the combined-env command over the three named files passes — 3 files, 106 tests. This session's real phase env (7 vars, incl. SEQUANT_PROJECT_DIR) was also green.
  • AC-2: grep -n 'SEQUANT_' vitest.config.ts vitest.global-setup.ts gives one match, the startsWith line.
  • AC-3: templates.test.ts (sets SEQUANT_TEMPLATES_DIR) and batch-executor.test.ts (sets/restores SEQUANT_ORCHESTRATOR) pass with the scrub: 153 tests. No test edits needed.
  • AC-4: Mutation-verified: AC-4 — deleted the SEQUANT_ prefix scrub loop in vitest.global-setup.ts; src/commands/tests/prompt-wait.test.ts > sequant prompt --wait (bug(#383): relay messages silently lost — no outbox, phase ends, watch keeps tailing dead session #645, Gap 4) > returns 0 and prints the reply when one arrives within the window failed (3 tests failed across the 3 files); restored.
  • AC-5: measured with the scrub removed, in the worktree, on the three AC-1 files (results below).

AC-5 record (scrub removed, all other SEQUANT_* unset)

Env Result
all six AC-1 vars 3 failed: prompt-wait reply case, batch-executor onProgress is undefined, relay-hook AC-7
SEQUANT_ORCHESTRATOR=sequant-run alone 1 failed: batch-executor onProgress is undefined (matches withActivityHook reading only ORCHESTRATOR)
SEQUANT_WORKTREE=$PWD alone 1 failed: prompt-wait reply case

So both single vars do reproduce here, but the attribution is the reverse of the issue table: ORCHESTRATOR breaks batch-executor, WORKTREE breaks prompt-wait. This differs from the Phase 0 runs (1 passed each) and I did not find why; an earlier zsh attempt of mine leaked the ambient vars, so only these bash-scripted numbers are trusted.

No full npm test run, per the runner rules. Lint passes.

Closes #1086

🤖 Generated with Claude Code

Runner verification (guard-2026-09 wave 1, 2026-09-20)

  • qa verdict: AC_MET_BUT_NOT_A_PLUS. Gaps are suggestions (a regression test for the scrub, a comment warning); AC-4 mutation record present and classifier-valid.
  • Runner ran the exact AC-1 command in the worktree: with the scrub 3 files / 106 tests pass under the orchestrator env; with the scrub deleted exactly one test per file fails (prompt-wait, batch-executor, relay-hook). Restored.
  • Runner fix: added the missing [Unreleased] changelog entry (197bf52d).
  • Full npm test from a clean shell on this branch: 322 files, 6549 passed, 1 expected fail, 3 skipped, 377 s. Merge this PR first: it makes the suite hermetic for every other phase agent.

@admarble
admarble merged commit a07e1ac into main Sep 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(test): suite isn't hermetic against the SEQUANT_* env phases inject — exec sees red tests it didn't cause and opens no PR

1 participant