Skip to content

Discover registered Worktrees with generation-safe identity - #35

Merged
codeacme17 merged 5 commits into
devfrom
feat/discover-registered-worktrees-6
Aug 29, 2026
Merged

codeacme17 merged 5 commits into
devfrom
feat/discover-registered-worktrees-6

Conversation

@codeacme17

Copy link
Copy Markdown
Owner

Closes #6.

Dependency state

Blocked on #5. Keep this PR in draft and do not merge until the protocol and security issue is closed.

Summary

  • resolve the Current Project through system Git to its canonical common Git directory
  • use git worktree list --porcelain -z as the authoritative Main and linked Worktree inventory
  • preserve raw path bytes while exposing safe display paths and canonical UTF-8 paths when available
  • classify attached, detached, Initial, locked, missing, prunable, broken, and redirected registrations truthfully
  • issue opaque Repository and Worktree generation identities and invalidate them across replacement, removal, recreation, and movement
  • fail closed on Repository replacement, Worktree admin redirection, duplicate admin identities, and close-versus-snapshot races
  • sanitize inherited Git environment variables and keep Git process construction inside Repository Engine

Scope

This PR implements Repository and Worktree discovery through the Repository Session seam. It does not add status refresh, watchers, mutation lanes, or protocol endpoint wiring.

Out of scope

No known pre-existing defects were found in the touched discovery paths.

Verification

  • 87 tests across 20 test files
  • 20 focused Repository discovery and parser tests using real temporary Git repositories
  • npm run typecheck
  • npm run lint
  • npm run build
  • npm run format:check
  • independent Standards and Spec reviews: no findings

PR preflight was skipped at user request.

@codeacme17
codeacme17 marked this pull request as ready for review August 29, 2026 17:49
@codeacme17
codeacme17 merged commit 0a16f88 into dev Aug 29, 2026
1 check 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.

Discover registered Worktrees with generation-safe identity

1 participant