fix(builder): incremental rebuild EISDIR, edge parity, dev tarball, native version by carlos-alm · Pull Request #241 · optave/ops-codegraph-tool · GitHub
Skip to content

fix(builder): incremental rebuild EISDIR, edge parity, dev tarball, native version#241

Merged
carlos-alm merged 8 commits into
mainfrom
fix/dogfood-bugs-235-236-237
Mar 2, 2026
Merged

fix(builder): incremental rebuild EISDIR, edge parity, dev tarball, native version#241
carlos-alm merged 8 commits into
mainfrom
fix/dogfood-bugs-235-236-237

Conversation

@carlos-alm

Copy link
Copy Markdown
Contributor

Summary

Fixes four issues found during v2.5.35-dev dogfooding:

Test plan

  • New incremental-parity.test.js — full build vs incremental build produces identical nodes and edges (barrel-project fixture)
  • All 1063 existing tests pass
  • --strip flag verified: removes platform deps, keeps other optional deps

Closes #235, closes #236, closes #237

…ld docs

- Add node/edge count drift detection after incremental builds (>20% warns
  to use --no-incremental), persisting counts in build_meta
- Improve complexity command: when data is missing but graph exists, suggest
  --no-incremental instead of implying no graph exists
- Add @huggingface/transformers as devDependency so embedding benchmarks
  work out of the box
- Document dev build tarball installation in README (npm install <url> fails
  for optional platform deps)

Impact: 3 functions changed, 5 affected
…provements

Impact: 1 functions changed, 1 affected
- Add build.driftThreshold to config defaults (0.2) so the 20%
  incremental build drift threshold is user-configurable
- Include actual drift percentages and threshold in warning message
  for easier debugging
- Regenerate package-lock.json to include @huggingface/transformers
  devDependency (fixes License Compliance Scan CI failure)

Impact: 1 functions changed, 1 affected
…ative version

- filter directory nodes from reverse-deps query to prevent EISDIR (#235)
- load unchanged barrel files into reexportMap so barrel-resolved edges
  aren't dropped during incremental rebuilds (#236)
- add --strip flag to sync-native-versions.js removing platform
  optionalDependencies in dev builds, fixing npm install failures (#237)
- sync Cargo.toml version with package.json and automate via version script
- add barrel-project fixture and incremental-parity test

Impact: 4 functions changed, 1 affected
@claude

claude Bot commented Mar 2, 2026

Copy link
Copy Markdown

@carlos-alm carlos-alm merged commit 6b5ff27 into main Mar 2, 2026
40 checks passed
@carlos-alm carlos-alm deleted the fix/dogfood-bugs-235-236-237 branch March 2, 2026 11:19
@greptile-apps

greptile-apps Bot commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR comprehensively addresses four dogfooding issues with well-structured fixes:

The implementation includes comprehensive testing with a new incremental-parity.test.js that verifies full and incremental builds produce identical results using a barrel-file fixture. The PR also adds drift detection that warns when incremental builds diverge significantly from previous node/edge counts (configurable via driftThreshold).

All 1063 existing tests pass, and the changes integrate cleanly with the existing codebase architecture.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Well-tested fixes for specific issues with comprehensive test coverage (including new incremental-parity test), all existing tests passing, and clean architectural integration. The only minor concern is an undocumented dependency addition.
  • No files require special attention

Important Files Changed

Filename Overview
src/builder.js Fixes EISDIR warning by filtering directory nodes, resolves edge parity by loading barrel files during incremental builds, adds drift detection
scripts/sync-native-versions.js Adds --strip flag for dev builds and automates Cargo.toml version syncing
tests/integration/incremental-parity.test.js Comprehensive test verifying incremental builds produce identical results to full builds using barrel file fixture
crates/codegraph-core/Cargo.toml Version synced from 0.1.0 to 2.6.0 to match package.json
src/config.js Added configurable driftThreshold default (0.2) for incremental build verification
.github/workflows/publish.yml Added --strip flag to sync-native-versions.js call for dev build publishing
package.json Added @huggingface/transformers to devDependencies (not mentioned in PR description)

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Start[Start Incremental Build] --> CheckBuild{Full Build?}
    CheckBuild -->|Yes| ParseAll[Parse All Files]
    CheckBuild -->|No| FindChanged[Find Changed Files]
    
    FindChanged --> ReverseDeps[Query Reverse Dependencies]
    ReverseDeps --> FilterDirs[Filter Directory Nodes<br/>Fix #235]
    FilterDirs --> ParseChanged[Parse Changed + Reverse Dep Files]
    
    ParseChanged --> LoadBarrels[Load Unchanged Barrel Files<br/>Fix #236]
    LoadBarrels --> BuildReexportMap[Build reexportMap]
    
    ParseAll --> BuildEdges[Build Edges Loop]
    BuildReexportMap --> BuildEdges
    
    BuildEdges --> SkipBarrelOnly{File in<br/>barrelOnlyFiles?}
    SkipBarrelOnly -->|Yes| Skip[Skip - Edges Already in DB]
    SkipBarrelOnly -->|No| CreateEdges[Create Import/Call Edges]
    
    Skip --> NextFile{More Files?}
    CreateEdges --> NextFile
    NextFile -->|Yes| BuildEdges
    NextFile -->|No| DriftCheck{Incremental?}
    
    DriftCheck -->|Yes| VerifyDrift[Check Node/Edge Drift<br/>vs Previous Counts]
    DriftCheck -->|No| SaveMetadata[Save Metadata]
    
    VerifyDrift --> DriftThreshold{Drift ><br/>threshold?}
    DriftThreshold -->|Yes| Warn[Warn: Rebuild Recommended]
    DriftThreshold -->|No| SaveMetadata
    Warn --> SaveMetadata
    
    SaveMetadata --> StoreCount[Store node_count,<br/>edge_count in metadata]
    StoreCount --> End[Build Complete]
Loading

Last reviewed commit: 1216acc

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

14 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread package.json

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why was @huggingface/transformers added to devDependencies? This change isn't mentioned in the PR description. If needed for testing, consider adding a note in the PR description.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

carlos-alm added a commit that referenced this pull request Mar 2, 2026
* docs: add dogfood report for v2.5.35-dev.26434e2

* docs: move dogfood report to correct path

* docs: remove report from incorrect worktree path

* docs: move v2.5.0 dogfood report to generated/dogfood/

* fix: incremental build verification, complexity warnings, and dev build docs

- Add node/edge count drift detection after incremental builds (>20% warns
  to use --no-incremental), persisting counts in build_meta
- Improve complexity command: when data is missing but graph exists, suggest
  --no-incremental instead of implying no graph exists
- Add @huggingface/transformers as devDependency so embedding benchmarks
  work out of the box
- Document dev build tarball installation in README (npm install <url> fails
  for optional platform deps)

Impact: 3 functions changed, 5 affected

* fix: configurable drift threshold, drift logging, and lock file sync

- Add build.driftThreshold to config defaults (0.2) so the 20%
  incremental build drift threshold is user-configurable
- Include actual drift percentages and threshold in warning message
  for easier debugging
- Regenerate package-lock.json to include @huggingface/transformers
  devDependency (fixes License Compliance Scan CI failure)

Impact: 1 functions changed, 1 affected

* fix(builder): incremental rebuild EISDIR, edge parity, dev tarball, native version

- filter directory nodes from reverse-deps query to prevent EISDIR (#235)
- load unchanged barrel files into reexportMap so barrel-resolved edges
  aren't dropped during incremental rebuilds (#236)
- add --strip flag to sync-native-versions.js removing platform
  optionalDependencies in dev builds, fixing npm install failures (#237)
- sync Cargo.toml version with package.json and automate via version script
- add barrel-project fixture and incremental-parity test

Impact: 4 functions changed, 1 affected

* docs: update 2.6.0 changelog with merged PRs #233 #239 #240 #241
Zeeeepa pushed a commit to Zeeeepa/codegraph that referenced this pull request Jun 22, 2026
…ative version (optave#241)

* docs: add dogfood report for v2.5.35-dev.2cf11ec

* docs: move dogfood report to correct path

* docs: remove report from incorrect worktree path

* docs: move v2.5.0 dogfood report to generated/dogfood/

* fix: incremental build verification, complexity warnings, and dev build docs

- Add node/edge count drift detection after incremental builds (>20% warns
  to use --no-incremental), persisting counts in build_meta
- Improve complexity command: when data is missing but graph exists, suggest
  --no-incremental instead of implying no graph exists
- Add @huggingface/transformers as devDependency so embedding benchmarks
  work out of the box
- Document dev build tarball installation in README (npm install <url> fails
  for optional platform deps)

Impact: 3 functions changed, 5 affected

* fix: configurable drift threshold, drift logging, and lock file sync

- Add build.driftThreshold to config defaults (0.2) so the 20%
  incremental build drift threshold is user-configurable
- Include actual drift percentages and threshold in warning message
  for easier debugging
- Regenerate package-lock.json to include @huggingface/transformers
  devDependency (fixes License Compliance Scan CI failure)

Impact: 1 functions changed, 1 affected

* fix(builder): incremental rebuild EISDIR, edge parity, dev tarball, native version

- filter directory nodes from reverse-deps query to prevent EISDIR (optave#235)
- load unchanged barrel files into reexportMap so barrel-resolved edges
  aren't dropped during incremental rebuilds (optave#236)
- add --strip flag to sync-native-versions.js removing platform
  optionalDependencies in dev builds, fixing npm install failures (optave#237)
- sync Cargo.toml version with package.json and automate via version script
- add barrel-project fixture and incremental-parity test

Impact: 4 functions changed, 1 affected
Zeeeepa pushed a commit to Zeeeepa/codegraph that referenced this pull request Jun 22, 2026
* docs: add dogfood report for v2.5.35-dev.2cf11ec

* docs: move dogfood report to correct path

* docs: remove report from incorrect worktree path

* docs: move v2.5.0 dogfood report to generated/dogfood/

* fix: incremental build verification, complexity warnings, and dev build docs

- Add node/edge count drift detection after incremental builds (>20% warns
  to use --no-incremental), persisting counts in build_meta
- Improve complexity command: when data is missing but graph exists, suggest
  --no-incremental instead of implying no graph exists
- Add @huggingface/transformers as devDependency so embedding benchmarks
  work out of the box
- Document dev build tarball installation in README (npm install <url> fails
  for optional platform deps)

Impact: 3 functions changed, 5 affected

* fix: configurable drift threshold, drift logging, and lock file sync

- Add build.driftThreshold to config defaults (0.2) so the 20%
  incremental build drift threshold is user-configurable
- Include actual drift percentages and threshold in warning message
  for easier debugging
- Regenerate package-lock.json to include @huggingface/transformers
  devDependency (fixes License Compliance Scan CI failure)

Impact: 1 functions changed, 1 affected

* fix(builder): incremental rebuild EISDIR, edge parity, dev tarball, native version

- filter directory nodes from reverse-deps query to prevent EISDIR (optave#235)
- load unchanged barrel files into reexportMap so barrel-resolved edges
  aren't dropped during incremental rebuilds (optave#236)
- add --strip flag to sync-native-versions.js removing platform
  optionalDependencies in dev builds, fixing npm install failures (optave#237)
- sync Cargo.toml version with package.json and automate via version script
- add barrel-project fixture and incremental-parity test

Impact: 4 functions changed, 1 affected

* docs: update 2.6.0 changelog with merged PRs optave#233 optave#239 optave#240 optave#241
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant