Skip to content

Review fixes for incremental indexing PR #592#1144

Closed
azeemshaik025 wants to merge 3 commits into
abhigyanpatwari:mainfrom
azeemshaik025:codex/pr592-review-fixes
Closed

Review fixes for incremental indexing PR #592#1144
azeemshaik025 wants to merge 3 commits into
abhigyanpatwari:mainfrom
azeemshaik025:codex/pr592-review-fixes

Conversation

@azeemshaik025

Copy link
Copy Markdown

Companion PR for #592.

I could not push the fix directly to the contributor fork branch even though the PR metadata allows maintainer edits: GitHub denied write access to zenprocess/GitNexus for azeemshaik025. This branch is based on the PR #592 head and adds the review-fix commit on top.

Changes in the added fix commit:

  • Avoid mutating the analysis pipeline result through (pipelineResult as any).fileHashes; keep the merged hash map separate for metadata persistence.
  • Add focused unit tests for diffFileHashes covering no previous hashes, mixed changed/unchanged/removed files, and no-op hashes.
  • Document GITNEXUS_INCREMENTAL in the Dockerfile near the entrypoint wiring.

Reviewer item note:

  • The reported deleteNodesForFile export/import issue appears already resolved on the checked-out PR feat: add --incremental flag to analyze command #592 branch; deleteNodesForFile is exported from gitnexus/src/core/lbug/lbug-adapter.ts, so I left that path unchanged.

Validation:

  • npm test -- test/unit/file-hasher.test.ts
  • npx tsc --noEmit

Guardrail note:

  • npx gitnexus detect-changes -s staged is unavailable on this older PR branch; the CLI returns unknown command 'detect-changes'.

Test and others added 3 commits March 30, 2026 23:07
Computes per-file SHA-256 hashes during indexing and stores them in meta.json.
On subsequent runs with --incremental, only files with changed hashes are
re-parsed. Structure scanning and graph phases still run fully to ensure
correct community/process detection.

For large repos (60K+ symbols), this reduces re-index time from ~30s to ~2-5s
when only a few files changed between sessions.

New files:
- src/storage/file-hasher.ts: computeFileHashes() and diffFileHashes()

Modified:
- src/cli/index.ts: Register -i/--incremental CLI flag
- src/cli/analyze.ts: Forward incremental option to runFullAnalysis
- src/core/run-analyze.ts: Load previous hashes, pass to pipeline, save new hashes,
  incremental LadybugDB merge (delete stale nodes instead of wipe-and-recreate)
- src/core/ingestion/pipeline.ts: Accept previousFileHashes, filter parse phase
  to changed files only, return fileHashes in result
- src/types/pipeline.ts: Add fileHashes to PipelineResult
- src/storage/repo-manager.ts: Add fileHashes to RepoMeta
Two-stage build: builder installs deps + compiles, slim image has
only git + gitnexus CLI. Entrypoint indexes all repos in /data/repos/
and starts the eval-server on port 3456.

Supports GITNEXUS_INCREMENTAL=1 env var to enable --incremental
on container restart (skips unchanged files).
@vercel

vercel Bot commented Apr 28, 2026

Copy link
Copy Markdown

@azeemshaik025 is attempting to deploy a commit to the NexusCore Team on Vercel.

A member of the Team first needs to authorize it.

@azeemshaik025

Copy link
Copy Markdown
Author

Closing this PR so I can recreate it from the same fix commit with a non-codex branch name.

@azeemshaik025 azeemshaik025 deleted the codex/pr592-review-fixes branch April 28, 2026 06:22
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.

1 participant