Skip to content

Fix: codemaps to index nested repo worktree sources - #913

Merged
baron merged 1 commit into
repoprompt:mainfrom
w-winter:fix/nested-repo-codemaps-v2
Aug 31, 2026
Merged

Fix: codemaps to index nested repo worktree sources#913
baron merged 1 commit into
repoprompt:mainfrom
w-winter:fix/nested-repo-codemaps-v2

Conversation

@w-winter

@w-winter w-winter commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Fixes #886. A workspace root containing nested Git repos could leave background codemap (CM) indexing stuck retrying the same catalog page indefinitely.

The likely regression came from the content-addressed CM source-acquisition path (#314). Nested .git detection correctly prevented the outer repo's blob identity from authorizing those files, but classified them as repo-unavailable instead of using the existing validated-worktree path. The graph treated that stable condition as transient, discarded the completed page, and retried the same cursor.

Instead of excluding nested source this patch restores CM eligibility for every supported file admitted by the workspace catalog. Nested files are built from their current fingerprint-validated worktree bytes and normal ignore policy is unchanged.

Summary

  • Continue descriptor-safe traversal beyond nested .git directory and pointer-file markers
  • Preserve the requested leaf fingerprint instead of the repo marker fingerprint
  • Route regular nested source through the existing validated-worktree CM path
  • Prevent outer Git blobs, attributes, status, and path-local metadata from becoming authoritative after a nested boundary
  • Preserve existing missing, symlink, nonregular, and probe-failure outcomes
  • Complete graph indexing without boundary-driven retries or terminal exclusions

Implementation Notes

  • GitBlobIdentityService remains the sole source-provenance classifier
  • The graph index, workspace catalog, root topology, ignore handling, and UI are unchanged
  • No nested Git commands, repo lifecycle, retry mechanism, compatibility path, or new source-acquisition path was added
  • Outer index entries remain available as non-authoritative evidence that the nested boundary takes precedence

Review Approach

  • The patch received one focused maintainability review and complete-patch correctness reviews tethered to the originating issue's scope
  • Findings around nested-owned Git metadata and retaining boundary state across terminal leaf outcomes were fixed with focused regressions

Validation

Passed locally:

  • make dev-test FILTER=GitBlobIdentityServiceTests
  • make dev-test FILTER=CodemapAutomaticSelectionGraphNativeTests
  • make dev-lint
  • make dev-swift-build PRODUCT=RepoPrompt
  • PR-ready preflight, including the matching path-selected heavyweight lanes
  • Commit and push safety preflights, including staged-index and outgoing-range secret scans

I also validated the full flow in the Debug app with a real workspace root containing nested Git repos. Once the repos were admitted by the workspace's existing ignore policy, they remained visible through the parent root and agents could retrieve their CMs while the parent graph completed normally.

@baron baron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact PR head ad0112a against freshly fetched origin/main 64b49fb via synthetic merge d5c54f172f59634734008ba96e20a663a7b4ab59.

No actionable P0-P3 findings. Focused validation passed on the synthetic merge:

  • GitBlobIdentityServiceTests (1 test, 0 failures)
  • CodemapAutomaticSelectionGraphNativeTests (1 test, 0 failures)

Hosted raw-head checks are green. Validation limits: no separate full suite, lint, product build, or live-app validation was run on the synthetic merge.

@baron
baron merged commit 03266e8 into repoprompt:main Aug 31, 2026
10 checks passed
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.

Codemap indexing retries forever when a workspace root contains nested Git repositories

2 participants