Skip to content

fix(ingestion): accumulate heritage records unconditionally in worker path#1955

Closed
hugogu wants to merge 2 commits into
abhigyanpatwari:mainfrom
hugogu:feature/extends
Closed

fix(ingestion): accumulate heritage records unconditionally in worker path#1955
hugogu wants to merge 2 commits into
abhigyanpatwari:mainfrom
hugogu:feature/extends

Conversation

@hugogu

@hugogu hugogu commented May 31, 2026

Copy link
Copy Markdown
Contributor

Summary

shouldAccumulate() was incorrectly skipping EXTENDS/IMPLEMENTS heritage
records for all registry-primary languages (C#, TypeScript, Python, Go,
etc.) in the worker-pool chunk loop. This caused ALL class inheritance
and interface implementation edges to be silently dropped in production
runs where the worker pool is engaged (repos with ≥15 files).

The filter was designed for CALL and IMPORT records that are handled by
the scope-resolution DAG for registry-primary languages. EXTENDS/IMPLEMENTS
are processed exclusively by processHeritageFromExtracted — the registry-
primary flag is irrelevant to heritage edge emission.

After the fix, it shows orange lines (Extends)

image

Motivation / context

Close #1951

Areas touched

  • gitnexus/ (CLI / core / MCP server)
  • gitnexus-web/ (Vite / React UI)
  • .github/ (workflows, actions)
  • eval/ or other tooling
  • Docs / agent config only (AGENTS.md, CLAUDE.md, .cursor/, llms.txt, etc.)

Scope & constraints

In scope

Explicitly out of scope / not done here

Implementation notes

Testing & verification

  • cd gitnexus && npm test
  • cd gitnexus && npm run test:integration (if core/indexing/MCP paths changed)
  • cd gitnexus && npx tsc --noEmit
  • cd gitnexus-web && npm test (if web changed)
  • cd gitnexus-web && npx tsc -b --noEmit (if web changed)
  • Manual / Playwright E2E (note environment — see gitnexus-web/e2e/)

Risk & rollout

Checklist

  • PR body meets repo minimum length (workflow may label short descriptions)
  • If AGENTS.md / overlays changed: headers, scope block, and changelog updated per project conventions
  • No secrets, tokens, or machine-specific paths committed

hugogu and others added 2 commits May 31, 2026 23:06
…e parents

resolveHeritageId was falling back to generateId(label, name) when
ctx.resolve() found no candidates, producing IDs like "Class:ClassName".
Actual node IDs use the format "Class:filePath:ClassName", so every
EXTENDS/IMPLEMENTS edge whose parent class lived in the same file was
silently dropped by lbug's referential-integrity check.

Fix: when no explicit fallbackKey is provided (parent class lookups),
substitute filePath + ':' + name so the generated ID matches the node
ID format and same-file inheritance edges survive import.

Child class lookups (which always supply an explicit fallbackKey) are
unaffected. The ambiguous-global branch that deliberately refuses to
pick is also left unchanged.

Adds a regression test that asserts the targetId is file-qualified for
an unresolved same-file parent class.

Co-authored-by: Claude <noreply@anthropic.com>
AI-model: claude-sonnet-4-6
… path

shouldAccumulate() was incorrectly skipping EXTENDS/IMPLEMENTS heritage
records for all registry-primary languages (C#, TypeScript, Python, Go,
etc.) in the worker-pool chunk loop. This caused ALL class inheritance
and interface implementation edges to be silently dropped in production
runs where the worker pool is engaged (repos with ≥15 files).

The filter was designed for CALL and IMPORT records that are handled by
the scope-resolution DAG for registry-primary languages. EXTENDS/IMPLEMENTS
are processed exclusively by processHeritageFromExtracted — the registry-
primary flag is irrelevant to heritage edge emission.

Sequential-mode runs (small test fixtures, --workers 0) were unaffected
because they call processHeritage() directly, bypassing shouldAccumulate.
This made the bug invisible in all unit/integration tests.

Fix: push heritage items unconditionally, without shouldAccumulate.
Adds a worker vs sequential parity test for EXTENDS edges (abhigyanpatwari#1951).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented May 31, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

CI Report

All checks passed

Pipeline Status

Stage Status Details
✅ Typecheck success tsc --noEmit
✅ Tests success unit tests, 3 platforms
✅ E2E success gitnexus-web changes only

Test Results

Tests Passed Failed Skipped Duration
10505 10496 0 9 728s

✅ All 10496 tests passed

9 test(s) skipped — expand for details
  • COBOL pipeline benchmark > scales with file count
  • C# pipeline benchmark > scales with file count — namespaces spread across the solution
  • C# pipeline benchmark > scales with file count — all types in one (global) namespace bucket
  • Go pipeline benchmark > scales with file count (workers enabled)
  • Go pipeline benchmark — worker pool (issue Worker idle timeout kills long Go scope extraction and surfaces as Napi::Error during analyze #1848) > does not quarantine the large generated Go file on sub-batch idle timeout
  • PHP pipeline benchmark > scales with file count (workers enabled)
  • Ruby pipeline benchmark > scales with file count (workers enabled)
  • Rust pipeline benchmark > scales with file count (workers enabled)
  • buildTypeEnv > known limitations (documented skip tests) > Ruby block parameter: users.each { |user| } — closure param inference, different feature

Code Coverage

Tests

Metric Coverage Covered Base Delta Status
Statements 80.25% 36822/45882 79.84% 📈 +0.4 🟢 ████████████████░░░░
Branches 68.83% 23454/34072 68.5% 📈 +0.3 🟢 █████████████░░░░░░░
Functions 85.31% 3812/4468 84.94% 📈 +0.4 🟢 █████████████████░░░
Lines 83.8% 33151/39558 83.36% 📈 +0.4 🟢 ████████████████░░░░

📋 View full run · Generated by CI

@magyargergo

Copy link
Copy Markdown
Collaborator

Superseded by #1956

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.

Extends & Implements Edges are missing

2 participants