docs: record CodeGraph worktree discovery - #157
Conversation
…-storage feat: add repository storage layout
…-semantic-overlay feat: add semantic worktree overlay backend
…-codegraph-provider feat: add CodeGraph structural provider
…-structural-overlay feat: add structural overlay merge rules
…-retrieval-fusion feat: add retrieval fusion helper
…-progressive-context feat: add progressive context budgets
…-doctor feat: add worktree doctor report
…-benchmark-harness feat: add worktree overlay benchmark
rajkumarsakthivel
left a comment
There was a problem hiding this comment.
Review
Thanks for the work here. The architecture is clean (git identity -> storage layout -> overlay backend -> fusion -> MCP) and the test coverage for the new modules is solid. This is a meaningful feature addition.
A few things to address before merging:
Scope and labeling
This PR adds ~2960 lines of new feature code across 37 files (new modules, MCP server changes, CLI commands, config additions). The title says docs: but this is a feat: PR. Please relabel so the changelog and release notes reflect what actually shipped.
Code concerns
-
WorktreeOverlayBackenddoesn't implementStorageBackendformally. The codebase usesgetattrchecks forcount_chunks,needs_overlay_index, etc. throughoutcli.pyandmcp_server.py. IfStorageBackendgains a new required method, this will silently break. Consider subclassing or a protocol. -
Private attribute access.
_count_chunksfalls back tobackend._vector_store.count(). This pattern is duplicated in multiple files. Should be a proper interface method onStorageBackend. -
No file size or type filtering.
_source_for_worktree_pathreads entire files into memory for every modified/added path on eachcontext_searchcall. Large binary or generated files would be read and scanned with no guard. -
Blocking subprocess in async context.
CodeGraphClient._run_jsonand git helpers use synchronoussubprocess.runbut are called from async code paths. This blocks the event loop. Considerasyncio.create_subprocess_execorrun_in_executor. -
Token estimation.
_structural_token_countuseslen(text) / 3.3as a heuristic. The existing codebase has proper token counting. Using a different method here creates inconsistency. -
Absolute paths in discovery doc.
docs/codegraph-worktree-integration-discovery.mdreferences/home/joe/Webstorm_Projects/codegraph/.... Please remove machine-specific paths.
What's good
- Backward compatible:
structural_providerdefaults to"off", existing users see no behavior change - Clean module separation with proper
__init__.pyexports - Good test coverage for overlay backend, fusion, merge, codegraph provider, and budgeting
- The layered architecture makes sense
Worth pursuing, just needs the above addressed first.
Stage 0 for the CodeGraph worktree-aware integration plan.\n\nChanges:\n- Documents current CCE path-based storage identity.\n- Documents CodeGraph worktree mismatch behavior and machine-readable surfaces.\n- Records selected Git base-ref strategy and MVP limitations.\n\nStack note:\n- Upstream push permission is denied for joe-crick, so later stacked stages are open in the fork with bases chained branch-to-branch: joe-crick#1 through https://github.com/joe-crick/code-context-engine/pull/9.\n\nChecks:\n- uv run python -m pytest -o addopts='' tests/test_project_storage_dir.py tests/integration/test_git_context.py