Skip to content

[clarification] path_glob is additive scoring (0.55), not an exclusion filter; language_id absent from selectors test JSON #22

Description

@Anand-rahul

Two Behaviours Surprising to Spec Authors

1. path_glob does not exclude entities — it adds confidence

path_glob has ConfidencePathGlob = 0.55 and the comment "below reanchored alone" (see internal/semantic_overlay/anchors/anchors.go). When a selector combines anchor qualified_name X with anchor path_glob "wrong/**", the qualified_name anchor alone (confidence 0.95) already exceeds the bound threshold. The path_glob anchor returning 0 matches does not prevent binding.

Observed: A selector with qualified_name "checkout.CheckoutValidator.Validate" + path_glob "web/**" returns "outcome":"bound" for the Go entity (whose file is in services/), because qualified_name already bound it.

path_glob is a scoring supplement, not a constraint. It disambiguates when two entities share the same qualified name in different directories. It cannot exclude an entity already bound by another anchor.

2. ResolutionMatch does not carry language_id

selectors test --json emits:

{"envelope":{"selector_id":"...","outcome":"bound","matches":[{"entity_id":"...","qualified_name":"...","confidence":0.95,"via_anchor":"qualified_name"}],...}}

ResolutionMatch fields (see internal/semantic_overlay/overlay.go):

  • entity_id
  • qualified_name
  • confidence
  • via_anchor

There is no language_id field. Specs asserting contains: '"language_id":"go"' on selectors test output will always fail. Use qualified_name value assertions to confirm which entity was matched.

Note: anchors.Match (inside AnchorTrace for --explain output) does carry language_id. But the top-level selectors test envelope uses ResolutionMatch, not anchors.Match.

Fix Applied on impl/phase2

path-glob-does-not-match-outside-glob.yaml:

  • Steps 1 and 2: removed language_id assertions; replaced with qualified_name value assertions
  • Step 3 (wrong_path_glob_does_not_bind_go_entity): removed — tested non-existent exclusion behaviour
  • Description updated to document additive scoring behaviour accurately

References

  • internal/semantic_overlay/anchors/anchors.goConfidencePathGlob = 0.55, confidence table
  • internal/semantic_overlay/overlay.goResolutionMatch struct (no language_id)
  • internal/semantic_overlay/resolve.go — ladder logic (anchors applied additively, not as intersection)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions