Repository navigation
test(hooks): isolate reconcile scope fixture - #1264
Conversation
No other confident findings in the supplied diff. |
|
Addressed in the PR description. Slai Agent Runtime performed the isolated real-CLI verification after building:
It exited successfully; the expected hook configuration and generated files were verified, and the temporary fixture was removed. The account owner reviewed and authorized this contribution. |
|
No new findings in the specified diff. Resolved: The earlier [P1 blocking] Missing real-CLI verification record finding is fixed. The updated description documents a successful run of the built CLI in an isolated Git repository and verifies the generated configuration and all six expected hook entries. This satisfies the representative real-CLI requirement. Review was read-only; I did not run, build, or install anything from the PR. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
What was checked. I checked 1003e9b on macOS (Git 2.56.0, Node 24) in a clean clone. On main, the "fires inside the project" test writes all six hook.teamai-* entries into the checkout's own .git/config. On this branch it writes none. The built CLI behaves the same on main and on this branch when run from a symlinked directory. init, git worktree add and uninstall exit 0 with the same hook results. The doctor git-hook check passes on both, with identical output.
[P2 non-blocking] src/git-hook.ts:228 and src/git-hook.ts:269. The test fix does not need this change. The updated test passes against main's src/git-hook.ts. The change also has no test. The description says it is for linked worktrees, but Git returns absolute paths there, so the base directory is ignored. The case it actually fixes is a repoDir that reaches a repository subdirectory through a symlink. Please either drop it from this PR, or describe that case and add a focused test through installGitHook or gitHookStatus.
[P3 nit] src/__tests__/hooks-reconcile-scope.test.ts:1380. The before/after comparison still passes when the checkout already has the six hook.teamai-* entries. With the fixture's git init removed, the test fails on a clean config but passes on a populated one. An assertion on the fixture's own hook with gitHookStatus(root) would show the hook went where intended, whatever state the checkout is in.
Not checked. I did not run on Windows, where realpath can spell drive and UNC paths differently. I did not run a real Git older than 2.54; the script-hook path ran through a version shim. I did not run on Linux.
|
No new findings in the specified diff. The changes are tests-only, isolating the fixtures in Git repositories and checking that reconciliation leaves the checkout’s TeamAI hook configuration unchanged. Resolved: The earlier [P1 blocking] Missing real-CLI verification record finding remains resolved. The description documents a successful built-CLI run and verification of the generated configuration and six hook entries. The current tests-only diff does not require an additional e2e record. Review was read-only; I did not run, build, or install anything from the PR. |
|
Addressed the collaborator's non-blocking review notes in 17feef5:
Slai Agent Runtime reran the focused real-shell test, typecheck, lint, and build; details are in the PR description. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
This re-reviews 17feef5 against the approval of 1003e9b. Both notes are resolved. The realpath edit is gone and src/git-hook.ts matches main. The fixture asserts gitHookStatus(root) is { installed: true }. Versus main, the only change is the test file. Runtime behavior is unchanged, and the real-CLI record already in the PR body is enough. npm test -- src/__tests__/hooks-reconcile-scope.test.ts exited 0 in a fresh clone, 86 tests passed.
Summary
hook.teamai-*configuration remains unchangedValidation
PATHincludingC:\Program Files\Git\bin:node node_modules/vitest/vitest.mjs run src/__tests__/hooks-reconcile-scope.test.ts --testNamePattern='fires inside the project'npm run typechecknpm run lintnpm run buildgit diff --check upstream/mainThe focused real-shell test exercises the gate from fixture directories under
node_modules, verifies it runs inside the fixture and is a no-op outside it, and verifies both that the fixture has the TeamAI Git hooks and that no TeamAI Git-hook entries are added to the contributor checkout.Real CLI verification
Using the built
dist/cli.js, I created an isolated temporary Git repository with a fixture-only generic Git remote and ran:node dist/cli.js init --self --provider git --agent codebuddy --forceThe command exited 0. It created
.teamai/teamai.yamland.codebuddy/settings.json, and local Git config contained all six expectedhook.teamai-{post-checkout,post-merge,post-rewrite}.{command,event}entries. The fixture was removed afterward. The deliberately unreachable fixture remote produced only the expected non-blocking member-registration warning; no remote push occurred.Slai Agent Runtime assisted with investigation, implementation, and testing. The account owner reviewed and authorized this contribution.