Skip to content

fix(detector): anchor nodes on 5 remaining detectors#140

Merged
aksOps merged 1 commit into
mainfrom
fix/detector-phantom-edge-anchors
May 13, 2026
Merged

fix(detector): anchor nodes on 5 remaining detectors#140
aksOps merged 1 commit into
mainfrom
fix/detector-phantom-edge-anchors

Conversation

@aksOps
Copy link
Copy Markdown
Contributor

@aksOps aksOps commented May 13, 2026

Summary

  • Apply phantom-edge anchor helpers (Phase 4 pattern) to: bicep, dockerfile, powershell, bash, proto/structure
  • Each detector now emits anchor CodeNodes for file + external module endpoints, so depends_on/imports/calls edges survive Snapshot's phantom-drop filter
  • Adds 5 survives-snapshot tests (one per detector) asserting MODULE + EXTERNAL anchor nodes and the relevant edge kind are present

Per-detector changes

  • iac/bicep.go — 1 anchor pair on module depends_on edge
  • iac/dockerfile.go — 1 anchor pair on FROM depends_on edge
  • script/shell/bash.go — 2 anchor pairs: source imports + tool calls
  • script/shell/powershell.go — 1 anchor pair on Import-Module / dot-source imports
  • proto/structure.go — 1 anchor pair on proto import edge

Test plan

  • go test ./internal/detector/iac/... -count=1 passes (14 tests)
  • go test ./internal/detector/script/... ./internal/detector/proto/... -count=1 passes (10 tests)
  • go test ./internal/detector/... -count=1 passes (377 tests)
  • go test ./... -count=1 passes (833 tests)
  • fixture-multi-lang phantom drop count: 4 (fixture has no bicep/dockerfile/shell/proto files; drop count reflects pre-existing Java/Python/TS phantom edges not in scope)

🤖 Generated with Claude Code

Five remaining detectors emitted file-path → external-name edges
without anchor CodeNodes; Snapshot's phantom filter dropped every
edge. Apply base.EnsureFileAnchor + base.EnsureExternalAnchor
(the pattern from Phase 4 TS/Python/Rust/C++).

Detectors updated:
- iac/bicep.go          — 1 anchor pair (module depends_on)
- iac/dockerfile.go     — 1 anchor pair (FROM depends_on)
- script/shell/bash.go  — 2 anchor pairs (source imports + tool calls)
- script/shell/powershell.go — 1 anchor pair (Import-Module + dot-source)
- proto/structure.go    — 1 anchor pair (proto import)

Each gets a survives-snapshot test asserting MODULE + EXTERNAL anchor
nodes and the relevant edge kind are present in the detector result.

Smoke: fixture-multi-lang phantom drop count = 4 (unchanged; fixture
contains no bicep/dockerfile/shell/proto files, so these detectors
don't fire on it — drop count reflects pre-existing Java/Python/TS
phantom edges not in scope for this fix).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aksOps aksOps merged commit 531e089 into main May 13, 2026
13 checks passed
@aksOps aksOps deleted the fix/detector-phantom-edge-anchors branch May 13, 2026 10:08
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