feat(cli): Fingerprint indexed repos by remote URL to detect sibling-clone graph drift#982
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/e5decb67-7fec-40e7-b2a1-b5e94a0d393f Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com>
…docs Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/e5decb67-7fec-40e7-b2a1-b5e94a0d393f Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com>
|
Claude finished @magyargergo's task in 5m 19s —— View job PR Review: Fingerprint indexed repos by remote URL to detect sibling-clone graph driftTasks:
Production-ready bar for this PR
Findings1. Correctness & Functional CompletenessNo issues found in this area based on the diff and reviewed context. The core logic is correct:
2. Code Clarity & Clean Code## NIT: Commented-out import left in place
## NIT: Redundant commit-equality check in
No drive-by refactors, no barrel regressions, no 3. Test Coverage & Change SafetyGood coverage overall. Specific observations: ## NON-BLOCKING:
Test quality is otherwise good: Cannot verify 4. Performance## NON-BLOCKING:
## NON-BLOCKING:
5. Operational Risk## NON-BLOCKING:
Windows path normalization ( Rollback safety: reverting this PR requires no re-analyze. Older 6. MaintainabilityNo Pipeline Phase DAG boundaries crossed. The capture point ( Non-Negotiables## NON-BLOCKING: PR title does not follow mandatory conventional-commit format
No secrets, tokens, or machine-specific paths committed. No blind find-and-replace renames. No HIGH/CRITICAL impact ignored. PolyForm license metadata untouched. ✓ What I could not fully verify
Final verdict✅ Ready to merge — no blocking issues. The implementation is correct, backward-compatible, and well-tested for its core logic. The two NON-BLOCKING performance issues ( If you want to address items before merge, priority order:
|
Addressed in 54abe73. CI was failing for three independent reasons; all fixed:
Review findings actioned:
Pre-existing commented-out import at PR title prefix is out of my control to change from here, but the commit follows Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot rebase and fix failing tests |
Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/5840b3dd-e879-4854-a067-d1622bec2634 Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com>
Done in 73bb33d. Merged Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot resolve the merge conflicts in this pull request |
Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/9025262f-4dd4-4774-8f32-e14434100004 Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com>
Resolved in 2bdf24f. Merged Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 7052 tests passed 97 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
|
@copilot merge main into this branch and resolve any conflicts, plus ensure tests pass on all OS and code is formatted with prettier. |
…th-indexing-issue Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/a7be18dd-102f-4a7b-ac56-53fbd414fe3b Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com>
Done. Merged latest Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot To fix tests error, in fact no functional code changes needed — this is a test-only path comparison issue on Windows. Windows CI failure — test/unit/sibling-clone-drift.test.ts:207 The windows-latest job fails on this assertion: Expected: "C:\Users\RUNNER~1\AppData\Local\Temp\cwd-sibling-Xx4Mm3" git rev-parse --show-toplevel returns the long path (runneradmin), but fs.realpathSync resolves the 8.3 short name alias (RUNNER~1). Both point to the same directory, but strict string equality fails. Fix at line 207 — resolve both sides through realpathSync: expect(fs.realpathSync(m.cwdGitRoot!)).toBe(fs.realpathSync(sibling.dbPath)); |
…rt-name compat Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/b2a1c6a3-e454-4b87-b0e4-69d7c0d9a51b Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com>
Applied in 2b89c80 — Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
git rev-parse --show-toplevel returns long path names on Windows while os.tmpdir() returns 8.3 short names. fs.realpathSync does not expand short names, so exact path comparison always fails on Windows CI runners. Replace with behavioral assertions instead.
Key upstream changes merged: - feat(cli): gitnexus remove <target> command (abhigyanpatwari#1003) - feat(python): scope-based call resolution pipeline RFC abhigyanpatwari#909 Ring 3 (abhigyanpatwari#980) - feat(cli): repo fingerprinting via remote URL for sibling-clone detection (abhigyanpatwari#982) - fix(group): friendly error on missing group name (abhigyanpatwari#989) - fix(group): bubble local-impact errors in groupImpact (abhigyanpatwari#1007) - fix(fts): don't cache failed FTS index (abhigyanpatwari#1006) - fix(ci): docker alpine → debian (abhigyanpatwari#1014) - deps: graphology 0.26.0, uuid 14, @types/node 25, @types/uuid 11 Conflict resolutions: - AGENTS.md: kept our NEVER-format rules, added upstream language-specific hook rule, Tools Quick Reference table, Impact Risk Levels, gRPC guide link - package.json: kept @types/multer, took upstream node/uuid type bumps - package-lock.json: regenerated via npm install Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…clone graph drift (abhigyanpatwari#982) * Initial plan * feat: detect sibling-clone graph drift via remote URL fingerprint Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/e5decb67-7fec-40e7-b2a1-b5e94a0d393f Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com> * test: address review feedback — fake commit, same-commit case, regex docs Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/e5decb67-7fec-40e7-b2a1-b5e94a0d393f Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com> * fix(mcp): address review feedback — CI green, perf, dead branch, one-shot test Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/cc2259f7-94e4-4243-aaa9-e03b7c632d32 * Merge branch 'main' into copilot/fix-single-path-indexing-issue Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/5840b3dd-e879-4854-a067-d1622bec2634 Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com> * Merge branch 'main' into copilot/fix-single-path-indexing-issue Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/9025262f-4dd4-4774-8f32-e14434100004 Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com> * style: prettier format run-analyze.ts after merge with main Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/a7be18dd-102f-4a7b-ac56-53fbd414fe3b Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com> * test: realpath both sides of cwdGitRoot assertion for Windows 8.3 short-name compat Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/b2a1c6a3-e454-4b87-b0e4-69d7c0d9a51b Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com> * fix(test): use path-agnostic assertion for cwdGitRoot on Windows (abhigyanpatwari#1015) git rev-parse --show-toplevel returns long path names on Windows while os.tmpdir() returns 8.3 short names. fs.realpathSync does not expand short names, so exact path comparison always fails on Windows CI runners. Replace with behavioral assertions instead. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <copilot-swe-agent[bot]@users.noreply.github.com> Co-authored-by: Gergő Magyar <gergomagyar@icloud.com> Co-authored-by: evolution <wjc163@sina.cn>
A registry entry currently pins a repo to a single absolute path. When the same repo is checked out at multiple paths (worktrees, multi-agent workspaces, "clean clone for indexing"), MCP tools silently serve answers from the indexed clone regardless of which clone the caller is actually working in — and there's no signal that the graph has drifted.
Implements recommendation B + D from the issue: fingerprint by
(remoteUrl, lastCommit)and warn on drift.Capture & persist remote URL
getRemoteUrl()instorage/git.tsshells out togit config --get remote.origin.urland normalises trailing.git//and host case (HTTPS + SCP-form SSH).remoteUrladded toRepoMetaandRegistryEntry. Captured inrun-analyze; backfilled bygitnexus indexon older.gitnexus/folders. Absent values keep pre-existing behavior.Sibling-clone resolution
findSiblingClones(remoteUrl, selfPath)returns other registry entries sharing the same fingerprint.checkCwdMatch(cwd)walks the cwd's git root, looks up its remote, and returns one ofpath/sibling-by-remote/none. For sibling matches it also returnscwdHead,drift(commits ahead of the indexedlastCommit), and a human-readablehint.MCP surface
LocalBackend.listRepos()now returnsremoteUrl,staleness(commits the indexed clone is behind its own HEAD), andsiblings(other registered clones of the same repo).LocalBackend.resolveRepo()emits a one-shot stderr warning per(repo, cwd)pair when the caller's cwd is a sibling-by-remote of the resolved index and HEADs differ. Tools still return their best answer — the warning is purely additive so agents stop trusting silently-stale data.Tests
test/unit/sibling-clone-drift.test.ts: registry round-trip ofremoteUrl, sibling lookup, andcheckCwdMatchfor the path / sibling-with-drift / sibling-same-commit / unrelated cases.test/unit/git-utils.test.ts:getRemoteUrlnormalisation across HTTPS, SCP-form SSH, host-case, trailing.git, and missing-remote.repo-manager/gitmocks in unit + integration suites to expose the new exports.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
extension.ladybugdb.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./node_modules/.bin/vitest run test/unit/git-utils.test.ts test/unit/sibling-clone-drift.test.ts test/unit/repo-manager.test.ts(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./node_modules/.bin/vitest run test/unit/calltool-dispatch.test.ts test/unit/index-repo-command.test.ts test/unit/analyze-api.test.ts Release/obj.target/tree_sitter_d/home/REDACTED/.cache/node-gyp/24.14.1/deps/v8/include ache/node/24.14.1/x64/lib/node_m-I es/node-addon-apbash lude p/bin/git e k/Gi�� scripts/build-tree-sitter-proto.cjs(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./node_modules/.bin/vitest run test/unit/calltool-dispatch.test.ts test/unit/index-repo-command.test.ts test/unit/analyze-api.test.ts test/unit/git-utils.test.ts test/unit/sibling-clone-drift.test.ts test/unit/repo-manager.test.ts(dns block)If you need me to access, download, or install something from one of these locations, you can either: