Skip to content

docs: record CodeGraph worktree discovery - #157

Open
joe-crick wants to merge 18 commits into
elara-labs:mainfrom
joe-crick:codex/codegraph-worktree-stage-0-discovery
Open

docs: record CodeGraph worktree discovery#157
joe-crick wants to merge 18 commits into
elara-labs:mainfrom
joe-crick:codex/codegraph-worktree-stage-0-discovery

Conversation

@joe-crick

@joe-crick joe-crick commented Aug 12, 2026

Copy link
Copy Markdown

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

Joe Crick and others added 17 commits August 12, 2026 15:31
…-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 rajkumarsakthivel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

  1. WorktreeOverlayBackend doesn't implement StorageBackend formally. The codebase uses getattr checks for count_chunks, needs_overlay_index, etc. throughout cli.py and mcp_server.py. If StorageBackend gains a new required method, this will silently break. Consider subclassing or a protocol.

  2. Private attribute access. _count_chunks falls back to backend._vector_store.count(). This pattern is duplicated in multiple files. Should be a proper interface method on StorageBackend.

  3. No file size or type filtering. _source_for_worktree_path reads entire files into memory for every modified/added path on each context_search call. Large binary or generated files would be read and scanned with no guard.

  4. Blocking subprocess in async context. CodeGraphClient._run_json and git helpers use synchronous subprocess.run but are called from async code paths. This blocks the event loop. Consider asyncio.create_subprocess_exec or run_in_executor.

  5. Token estimation. _structural_token_count uses len(text) / 3.3 as a heuristic. The existing codebase has proper token counting. Using a different method here creates inconsistency.

  6. Absolute paths in discovery doc. docs/codegraph-worktree-integration-discovery.md references /home/joe/Webstorm_Projects/codegraph/.... Please remove machine-specific paths.

What's good

  • Backward compatible: structural_provider defaults to "off", existing users see no behavior change
  • Clean module separation with proper __init__.py exports
  • 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.

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.

2 participants