Repository navigation
test(#1164): MCP sequant_status tests use a test-owned state file and make no GitHub calls - #1205
Merged
Merged
Conversation
… the hermetic gate
…so a killed run is recovered next time Entire-Checkpoint: 4b4966e7be81
…d run (CI sets FORCE_COLOR) Entire-Checkpoint: f5c010c6588f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1164. The three MCP test files that call
sequant_statusno longer read or rewrite the checkout's real.sequant/state.json, and they no longer make GitHub calls.registerStatusTool(server, { statePath })andcreateServer(version, context, { status: { statePath } }).servepasses nothing, so the tool still buildsnew StateManager()on the default path and still reconciles.src/mcp/server.test.tsandmcp-serve-async-refactor.integration.test.ts: each server reads a state file in a fresh temp dir.mcp-e2e.integration.test.ts: the stdio and SSE server subprocesses getSEQUANT_PROJECT_DIR=TEST_DIR.servealready changes into that dir, so no new production knob was needed.src/lib/test-state-hermetic.test.ts:dist/is not rebuilt under the parent suite), and asserts the checksum is unchanged and the child suite is green with 3 of 3 files.state.json.hermetic-gate-backup). A run killed before itsfinallyblock is recovered at the start of the next run. I tested that by planting a leftover backup: the gate restored it.Acceptance criteria
npx vitest run src/lib/test-state-hermetic.test.ts: 1 passed.npx vitest run src/mcp/server.test.ts: the new case seeds issue 42 in a temp state and gets backstatus: "not_started",title: "Seeded title"; the stubbed GitHub lookup is asserted to be called once, with([42], []).status.test.ts, run withgh's directory removed from PATH (command -v ghexit 1): 4 files, 38 tests passed. The run passing is weak evidence on its own, becauseGitHubProviderswallows errors. What rules out GitHub calls: reconcile returns early on an empty tracked set, the e2e server runs in an emptyTEST_DIR, and the issue-42 stub is asserted.npx vitest run src/mcp/tools/status.test.ts: 2 passed. With no override, the StateManager getsstatePathundefined, which resolves to the defaultSTATE_FILE_PATH, and reconcile runs on that same instance.testjob.Mutation records
Mutation-verified: AC-1 — removed the statePath override from mcp-serve-async-refactor's createServer call ({ status: {} }); src/lib/test-state-hermetic.test.ts failed ("state.json changed … lastSynced rewritten"); restored.
Mutation-verified: AC-2 — removed the statePath override from server.test.ts's createServer call ({ status: {} }); the issue-42 case failed; restored.
Mutation-verified: AC-4 — status.ts defaulted statePath to ".sequant/other-state.json" when no override is given; src/mcp/tools/status.test.ts failed; restored.
Notes for review
unitproject, depending on machine load. If the e2e file flakes inside the child run, the gate reports "child suite failed (not a hermeticity finding)" instead of a hermeticity failure.gh, at load average 16–18, had 3 failures in 1 file and its output was not captured. Every run since has been green, including mine above after mergingmain. If CI shows the same thing, that failure is real.Test plan
maintest+canary🤖 Generated with Claude Code