Skip to content

refactor(scip): single-pass SCIP architecture#189

Merged
jafreck merged 5 commits intomainfrom
refactor/scip-single-pass
Mar 14, 2026
Merged

refactor(scip): single-pass SCIP architecture#189
jafreck merged 5 commits intomainfrom
refactor/scip-single-pass

Conversation

@jafreck
Copy link
Owner

@jafreck jafreck commented Mar 13, 2026

Summary

Merges the SCIP enrichment stage into the SCIP source stage so that all SCIP data is computed in a single pass.

Problem

The SCIP pipeline previously ran in two stages:

  1. ScipSourceStage — extracted symbols, refs, and call graph from the SCIP index
  2. ScipEnrichmentStage — re-read the same SCIP index to fill in resolved_type_signature, resolved_return_type, definition_uri, and definition_path

This was redundant: both stages loaded the same SCIP protobuf data, and the source stage already had all the information needed to populate enrichment columns.

Solution

ScipSourceStage now populates enrichment metadata inline during its single pass:

  • symbols: resolved_type_signature, resolved_return_type, definition_uri, definition_path computed from symbolInfoMap (already in memory)
  • symbol_refs: same enrichment columns computed from symbolDefinitions + symbol- **symbol_refs**: same enrichment columns computed from de- **symb_uri/path/moved ScipEnrichmentStagefrom both pipeline constructions | |src/indexer/stages/index.ts| Removed barrel export | |src/index.ts| Removed public API|src |
    | src/indexer/pipeline.ts | Updated doc comments |
    | tests/index.test.ts | Remove| tests/index.test.ts | Remove| tests/index.test.ts | Remove| tests/index.test.ts | Remove| tests/index.test.ts | Remove| tests/index.test.ts\e-helpers.test.ts (97 tests)
  • scip-enrichment-stage.test.ts (9 tests — still works as standalone module)
  • index.test.ts (14 tests — public API)
  • indexer/index.test.ts (53 tests — integration)
  • pipeline.test.ts (9 tests)

… source stage

ScipSourceStage now populates enrichment metadata (resolved_type_signature,
resolved_return_type, definition_uri, definition_path) inline during its
single pass over the SCIP index, eliminating the need for a separate
ScipEnrichmentStage.

Changes:
- scip-source.ts: INSERT statements now include enrichment columns;
  type signatures and definition locations are computed from
  symbolInfoMap/symbolDefinitions that are already in memory
- Removed ScipEnrichmentStage from both build() and update() pipelines
- Removed ScipEnrichmentStage from barrel exports (stages/index.ts, src/index.ts)
- ScipSourceStage now sets context.scipCoveredLanguages so LspEnrichmentStage
  skips SCIP-covered languages (previously set by ScipEnrichmentStage)
- Updated doc comments across pipeline.ts, index.ts, and scip-source.ts

The scip-enrichment.ts stage file is retained on disk for backward
compatibility but is no longer wired into the pipeline.
@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 96.87500% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.76%. Comparing base (8d590f5) to head (e346f70).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/indexer/stages/scip-indexer.ts 96.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #189      +/-   ##
==========================================
- Coverage   87.88%   87.76%   -0.12%     
==========================================
  Files          77       76       -1     
  Lines        8575     8525      -50     
  Branches     2697     2695       -2     
==========================================
- Hits         7536     7482      -54     
- Misses       1039     1043       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

jafreck added 4 commits March 13, 2026 15:43
Add tests verifying that ScipSourceStage populates enrichment columns
(resolved_type_signature, resolved_return_type, definition_uri,
definition_path, definition_line) inline for:
- symbols (with signature extraction and return type parsing)
- call refs (with callee definition metadata)
- type refs (with type definition location)
- relationships (with target definition location)

Also verifies scipCoveredLanguages is set on the context.
…ScipIndexerStage

- Delete src/indexer/stages/scip-enrichment.ts and its test file entirely.
  This stage was dead code — enrichment is now handled inline by the
  single SCIP indexer pass.

- Rename ScipSourceStage → ScipIndexerStage (file: scip-source.ts →
  scip-indexer.ts) to reflect its role as the single SCIP indexer stage.
  SourceIndexStage then enriches SCIP-sourced files with tree-sitter
  metrics (complexity, nesting, params) before storage.

- Update all imports, exports, doc comments, log prefixes, pipeline
  instantiations, and test references.
@jafreck jafreck merged commit 14a759e into main Mar 14, 2026
3 checks passed
@jafreck jafreck deleted the refactor/scip-single-pass branch March 14, 2026 04:55
@jafreck jafreck mentioned this pull request Mar 15, 2026
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