Skip to content

fix(ci): restore the release commit and push hook baseline - #204

Open
nullStack65 wants to merge 2 commits into
release/native-0.1.10from
fix/release-hook-baseline
Open

nullStack65 wants to merge 2 commits into
release/native-0.1.10from
fix/release-hook-baseline

Conversation

@nullStack65

@nullStack65 nullStack65 commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

On release/native-0.1.10 (dfc5038) the git hooks fail before any change is made, so no code commit can land without --no-verify, and one pre-push test writes into the repository being pushed:

  • Pre-commit Knip reports eight unused exports, added by the event subscription (feat(server): fine-grained event subscriptions #165) and delegation nudge (feat(server): nudge a thread to delegate once it does the work itself #149) work.
  • Pre-push typecheck fails on scripts/scenarios/acp-refresh-keeps-deleted-session-removed.e2e.ts. The upstream sync (sync: Antigravity and ACP fixes from upstream (2026-11-20) #154) imports rpcClient from scenarios/t3.ts, but the fork's t3.ts never exported it.
  • Pre-push test AgentContextBudget.test.ts measures the MCP tool list at 61,917 bytes against a committed 61,564.
  • Pre-push tests that use replay fixtures (OrchestratorMcpService.test.ts) fail, and do damage. Git exports GIT_DIR to hooks, so the fixture's git init, config, add and commit ran against the pushing worktree, not its temp directory. Each run committed an initial commit onto the branch being pushed and wrote the T3 Code Test identity into the shared repository config.

The four Knip file findings that blocked this work earlier (mirror-play-apk.cjs, verify-built-boot.ts, resolve-nightly-release.ts, smoke-cli-archive.ts) were already fixed as entry points by #186.

Fix

  1. Seven exports are used only inside their own module: layerEventsToolkit, isScheduledFreshRun in contextBoundary.ts, and canonicalAuthor, authorIgnored, normalizePullRequestUrl, normalizeDelivery and minutesInZone. Each one drops its export. None is a missing Knip entry point; nothing imports them from outside.
  2. The client wrapper setThreadDelegationNudge and its input type have no caller anywhere, so they are removed. The server thread.delegation-nudge.set command and its MCP tool are unchanged.
  3. The fork's rpcClient scenario helper is identical to upstream's exported one. It moves from mention-finds-older-linked-thread.e2e.ts into scenarios/t3.ts, where upstream keeps it, and both scenarios import it.
  4. agentContextBudget.json takes the measured mcpToolListJsonBytes. No model-facing text changes, so no eval run applies.
  5. The replay fixture (packages/provider-testing/src/replayWorkspace.ts) unsets the inherited repository selectors (GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE and related), as the server's VcsProcess already does for its own git calls.

Checks

  • Pre-commit hook passes: format, lint, knip:check 3/3.
  • Pre-push check:changed passes: format, lint, Knip 2/2, GraphQL, typecheck (9 packages), tests (5 files).
  • On the bare base, under the repo's Node 26.13.1, the same budget test fails with the same numbers.
  • With GIT_DIR pointed at an empty decoy repository, OrchestratorMcpService.test.ts passes 91/91 and the decoy stays empty. Without the fix, the same run fails 2 tests and commits onto the branch.

This unblocks the failed-thread watcher wake (CLO-1066), whose PR is stacked on this commit.

Deploy: none

Model: claude-opus-5-5
Task: CLO-1066

🤖 Generated with Claude Code

On release/native-0.1.10 the pre-commit hook fails on eight unused exports
and the pre-push check fails on a scenario typecheck error and a stale agent
context budget, so no code change can land without bypassing the hooks.

Seven unused exports are used only inside their own module and lose their
export. The client setThreadDelegationNudge wrapper has no caller and goes;
the server command and its MCP tool stay. The upstream ACP refresh scenario
imports rpcClient from scenarios/t3.ts, so the fork's identical helper moves
there as upstream has it. The MCP tool list budget takes the measured size
after the event subscription and delegation nudge tools landed.

Model: claude-opus-5-5
Task: CLO-1066
Agent: claude-code
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Git exports GIT_DIR to hooks. Under pre-push, the replay workspace
fixture inherited it, so its git init, config, add and commit ran
against the pushing worktree: it committed "initial" onto the branch
being pushed and wrote the test identity into the shared repository
config. Unset the inherited repository selectors, as the server's
VcsProcess already does for its own git calls.

Model: claude-opus-5-5
Task: CLO-1066
Agent: claude-code
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nullStack65

Copy link
Copy Markdown
Owner Author

RESULT

RESULT — Independent bot review of #204 (release hook baseline and test-helper git identity leak): needs-fix

Automated reviewer: Claude (Opus 5.5) in a fresh read-only context, using an isolated clone and never the shared checkout. Dispatched by PR Reviewer, who audited the evidence and spot-checked the findings in the code. This is a bot review, not human approval. Base release/native-0.1.10 at dfc50380, reviewed head 7941765bfe7733d502567e421a4e230b60fd22fc. The merge also waits for the release freeze to lift (Nov 25 22:00 UTC).

The replayWorkspace fix works. It sets six GIT_* variables to undefined with extendEnv: true, and Effect removes undefined keys. That covers what git hooks actually export. The hook baseline restore is correct and in scope. The hooks themselves are unchanged. The unexported functions, the setThreadDelegationNudge removal, the context-budget update and the rpcClient move are each justified, with no scope creep.

Important

  1. R204-1. The same leaking helper is still unfixed. apps/server/src/orchestration-v2/testkit/ThreadFork.integration.test.ts:79 runs ChildProcess.make("git", args, { cwd }) with no env scrub, then sets user.name "T3 Code Test" and commits "initial" (:92-97). This was reproduced at the head: with GIT_DIR pointing at a scratch repo, the scratch config got the T3 identity and a new commit. The repair rule asks for every in-scope instance of the pattern to be fixed together.
  2. R204-2 (existed before this PR, same class). About ten other test helpers spawn git with the inherited environment and write identity, commits or refs. Examples: scripts/fork-drift-receipt.test.mjs, which also creates refs/heads/release and upstream, fork-sync-plan.test.mjs, mobile checkout-new-task-branch.test.ts, worktreeCheckoutCache.test.ts, GitManager.test.ts, cli/thread.test.ts and CodexAdapterV2.test.ts. This was reproduced for fork-drift-receipt under GIT_DIR. -C <dir> does not protect against this. The smaller and complete fix: one unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_COMMON_DIR in .vite-hooks/pre-push before check:changed, optionally plus the same in apps/server/src/testUtils/gitConfig.setup.ts.

Nits

  • R204-3. There is no regression test. Reverting the env fix leaves the normal suite green, and in the non-bare case the suite passes while still writing to the scratch repo.
  • R204-4. The scrub is a denylist of 6 of git's 16 local env vars. That is enough for what hooks export, but scripts/check-changed.test.ts:251 already drops every GIT_*, which is simpler.
  • R204-5 (not caused by this PR). ThreadStop.test.ts "Force stop keeps only … switched provider instance" fails identically at the base and at the head.

Evidence. Node 26.13.1. Dependencies were installed with --ignore-scripts, because prepare writes hook config into .git/config. A leak probe with GIT_DIR/GIT_INDEX_FILE pointed at scratch bare and non-bare repos showed no change at the head, and all three mutations were caught by the probe. AgentContextBudget passed 2/2 at the head and failed 1 at the base. Typecheck passed for scripts, provider-testing and client-runtime. The review checkout's config, status, log and refs were identical before and after. Not verified: the full server suite and typecheck, the pre-push hook end to end, Windows env-name case, and whether ThreadFork ran in the original incident.

{"reviewed_head":"7941765bfe7733d502567e421a4e230b60fd22fc","reviewer":"claude-opus-5-5 (PR Reviewer dispatch)","findings":[
{"id":"R204-1","severity":"important","summary":"ThreadFork.integration.test.ts runGit still inherits GIT_DIR and writes T3 Code Test identity","outcome":"open","rechecked_head":null},
{"id":"R204-2","severity":"important","summary":"~10 other test git helpers leak via inherited GIT_DIR; fix at pre-push hook layer","outcome":"open","rechecked_head":null},
{"id":"R204-3","severity":"nit","summary":"No regression test for the env scrub","outcome":"open","rechecked_head":null},
{"id":"R204-4","severity":"nit","summary":"Partial GIT_* denylist; drop-all pattern exists","outcome":"open","rechecked_head":null},
{"id":"R204-5","severity":"nit","summary":"Pre-existing ThreadStop test failure at base and head","outcome":"open","rechecked_head":null}]}

This branch has not been deployed

No deployments
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.

2 participants