Skip to content

feat(frameworks): wire stage-5 import/SCIP detection into the profile phase#267

Merged
theagenticguy merged 1 commit into
mainfrom
feat/framework-stage5-imports
Jun 30, 2026
Merged

feat(frameworks): wire stage-5 import/SCIP detection into the profile phase#267
theagenticguy merged 1 commit into
mainfrom
feat/framework-stage5-imports

Conversation

@theagenticguy

Copy link
Copy Markdown
Owner

Summary

Wires framework-detection stage 5 (import/SCIP) into production — the last deferred detection stage. detectFromImports (frameworks from IMPORTS edges to external-module stubs) shipped tested but reached nothing, because the profile phase ran at deps: [scan], before the parse phase emits those edges.

The DAG-ordering decision

profile now depends on [scan, parse]. parse deps [scan, structure], neither of which depends on profileno cycle. The parse phase emits the external-stub IMPORTS edges stage 5 reads, so they exist by detection time — no need to wait for crossFile (which only resolves in-repo import edges). Profile's consumers (dependencies/repo-node/scip-index) only read its output and are unaffected by it running later.

Wiring

  • profile passes ctx.graph as importGraph to detectFrameworksDetailed; KnowledgeGraph structurally satisfies the stage's edges()/getNode() reader.
  • FrameworkDetectionInput + FrameworkDetectorInput gain optional importGraph; the dispatcher runs detectFromImports once, groups by framework, merges as stage-5 evidence.
  • A deterministic import (scip-resolved, confidence 1.0) creates a detection on its own — an import fastapi is as authoritative as a manifest dep (inferConfidence treats it as deterministic). A heuristic import only corroborates a hit from another stage.
  • Legacy callers that omit importGraph are a no-op.

Tests / validation

  • 4 new detector stage-5 cases: deterministic-creates, heuristic-doesn't-create, heuristic-corroborates-a-manifest-hit, omitted-no-op.
  • Orchestrator phase-order test updated for the new topological order (profile + dependents now follow parse/complexity/orm) — captured from a real run, not hand-derived.
  • frameworks 96 + ingestion 638 green; full workspace 0 failures; biome ci + typecheck clean.

Honest e2e note

A live analyze couldn't exercise stage 5 in my sandbox (the WASM parse emits no external-import stubs without the scip indexers installed). Covered at the unit level with an ImportStageGraph fixture; the wiring path runs on real indexers in CI's matrix.

This closes the last framework-detection stage and the last item from the M-W-F roadmap follow-ups.

🤖 Generated with Claude Code

… phase

Stage 5 (imports.ts: detect frameworks from IMPORTS edges to external-module
stubs) shipped as a tested standalone module but reached no detection — the
profile phase ran at deps:[scan], before the parse phase emits IMPORTS edges,
so there was no graph to read.

The DAG-ordering decision: profile now deps [scan, parse]. parse deps
[scan, structure] and neither deps profile, so no cycle; profile's own
consumers (dependencies / repo-node / scip-index) only read its output and are
unaffected by it running later. The parse phase emits the external-stub IMPORTS
edges stage 5 needs (parse.ts), so they're present by detection time — no need
to wait for crossFile (which only resolves the in-repo IMPORTS edges).

Wiring:
- profile passes ctx.graph as `importGraph` to detectFrameworksDetailed;
  KnowledgeGraph structurally satisfies the stage's edges()/getNode() reader.
- FrameworkDetectionInput + FrameworkDetectorInput gain optional `importGraph`;
  the dispatcher runs detectFromImports once, groups by framework, and merges
  as stage-5 evidence. A `deterministic` (scip-resolved, confidence 1.0) import
  CREATES a detection on its own — an `import fastapi` is as authoritative as a
  manifest dep, and inferConfidence treats it as deterministic; a `heuristic`
  import only corroborates a hit from another stage.
- Legacy callers that omit `importGraph` are unaffected (no-op).

Updated the orchestrator phase-order test for the new topological order
(profile + its dependents now follow parse/complexity/orm) — captured from a
real run, not hand-derived.

Tests: 4 new detector stage-5 cases (deterministic-creates, heuristic-doesn't,
heuristic-corroborates, omitted-no-op). frameworks 96 + ingestion 638 green;
full workspace 0 fail; biome ci + typecheck clean.

Note: like the symbol-enrichment work, a live-analyze e2e of stage 5 wasn't
possible in this sandbox (WASM parse emits no external-import stubs without the
scip indexers); covered at the unit level with an ImportStageGraph fixture.
@theagenticguy theagenticguy merged commit 6b4d122 into main Jun 30, 2026
38 checks passed
@theagenticguy theagenticguy deleted the feat/framework-stage5-imports branch June 30, 2026 03:32
@github-actions github-actions Bot mentioned this pull request Jun 30, 2026
theagenticguy pushed a commit that referenced this pull request Jun 30, 2026
🤖 Automated release via release-please
---


<details><summary>root: 0.10.5</summary>

##
[0.10.5](root-v0.10.4...root-v0.10.5)
(2026-06-30)


### Features

* **eval:** pack --variance-probe — measure the variance an OCH pack
removes (Move 2)
([#269](#269))
([278702a](278702a))
* **frameworks:** wire stage-5 import/SCIP detection into the profile
phase ([#267](#267))
([6b4d122](6b4d122))
* **pack:** codehub replay — decision-equivalence structural check (Move
6) ([#270](#270))
([f97b417](f97b417))
</details>

<details><summary>cli: 0.10.5</summary>

##
[0.10.5](cli-v0.10.4...cli-v0.10.5)
(2026-06-30)


### Features

* **eval:** pack --variance-probe — measure the variance an OCH pack
removes (Move 2)
([#269](#269))
([278702a](278702a))
* **pack:** codehub replay — decision-equivalence structural check (Move
6) ([#270](#270))
([f97b417](f97b417))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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