Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

test: run git_fetch_ref recovery projection contract in CI (#401) - #522

Merged
james3014-nexus-agent[bot] merged 2 commits into
mainfrom
test/issue-401-fetch-ref-projection-ci
Oct 16, 2026
Merged

james3014-nexus-agent[bot] merged 2 commits into
mainfrom
test/issue-401-fetch-ref-projection-ci

Conversation

@james3014-nexus-agent

Copy link
Copy Markdown

Refs #401 (source/CI half; the live ChatGPT caller dogfood stays open on the Issue)

Summary

The #401 invariant is that git_fetch_ref must be callable on every surface that can emit GIT_BASE_REF_NOT_LOCAL. The source fix already shipped (git_fetch_ref is in both DIRECT_CODING_TOOL_NAMES and DIRECT_DISPATCH_TOOL_NAMES). Its contract test, however, lives in src/server.test.ts, which is excluded from npm test (DS-1-F6, needs the codex CLI), so CI never checked it.

This PR adds src/tool-projection-recovery.test.ts to the npm test chain. The test:

  • builds the MCP server in-memory for every ToolMode. The mode table is typed as Record<ToolMode, true>, so adding a mode fails compilation until the table is updated;
  • asserts that git_fetch_ref is listed whenever open_workspace is listed, and whenever the instructions mention GIT_BASE_REF_NOT_LOCAL;
  • asserts that the GIT_BASE_REF_NOT_LOCAL error text in src/git-worktrees.ts still names git_fetch_ref.

No production code changes.

Evidence

  • npx tsx src/tool-projection-recovery.test.ts: 5/5 pass.
  • Mutation check: removing "git_fetch_ref" from DIRECT_DISPATCH_TOOL_NAMES makes exactly the dispatch case fail (4 pass, 1 fail). The mutation was reverted.
  • node scripts/check-test-chain.mjs: 131 chained, 7 excluded, 138 total.

🤖 Generated with Claude Code

@james3014-nexus-agent

Copy link
Copy Markdown
Author

Review record — head 6824a3ef019d6f0d94b752807d6938553bad39ad

Independent Claude review (Claude Opus 5.5, bundle-M2-cutover lead; the implementation was done by a separate Sonnet agent): ACCEPT at 6824a3e.

  • Test-only change: adds src/tool-projection-recovery.test.ts to the npm test chain. No production code changes.
  • Covers every ToolMode through a Record<ToolMode, true> table, so adding a mode is a compile error until the table is updated. It asserts git_fetch_ref is listed whenever open_workspace is, and whenever the instructions mention GIT_BASE_REF_NOT_LOCAL. It also asserts the GIT_BASE_REF_NOT_LOCAL error text in src/git-worktrees.ts names git_fetch_ref.
  • Mutation check (run by the reviewer): removing "git_fetch_ref" from DIRECT_DISPATCH_TOOL_NAMES makes exactly the dispatch case fail (4 pass / 1 fail). Reverted afterwards.
  • npx tsx src/tool-projection-recovery.test.ts 5/5; check-test-chain OK; typecheck clean.

Cross-model review: not run. This is a low-risk, test-only PR, and the high-risk cross-model rule does not apply.

  • Verdict: ACCEPT at 6824a3e
  • Delta since review: none (head unchanged; it includes the merge of origin/main 67907f2, which made no change to PR paths).

@james3014-nexus-agent
james3014-nexus-agent Bot merged commit 6edde4d into main Oct 16, 2026
13 of 14 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant