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.go — ConfidencePathGlob = 0.55, confidence table
internal/semantic_overlay/overlay.go — ResolutionMatch struct (no language_id)
internal/semantic_overlay/resolve.go — ladder logic (anchors applied additively, not as intersection)
Two Behaviours Surprising to Spec Authors
1.
path_globdoes not exclude entities — it adds confidencepath_globhasConfidencePathGlob = 0.55and the comment "below reanchored alone" (seeinternal/semantic_overlay/anchors/anchors.go). When a selector combinesanchor qualified_name Xwithanchor path_glob "wrong/**", thequalified_nameanchor alone (confidence 0.95) already exceeds theboundthreshold. Thepath_globanchor 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 inservices/), becausequalified_namealready bound it.path_globis 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.
ResolutionMatchdoes not carrylanguage_idselectors test --jsonemits:{"envelope":{"selector_id":"...","outcome":"bound","matches":[{"entity_id":"...","qualified_name":"...","confidence":0.95,"via_anchor":"qualified_name"}],...}}ResolutionMatchfields (seeinternal/semantic_overlay/overlay.go):entity_idqualified_nameconfidencevia_anchorThere is no
language_idfield. Specs assertingcontains: '"language_id":"go"'onselectors testoutput will always fail. Usequalified_namevalue assertions to confirm which entity was matched.Note:
anchors.Match(insideAnchorTracefor--explainoutput) does carrylanguage_id. But the top-levelselectors testenvelope usesResolutionMatch, notanchors.Match.Fix Applied on
impl/phase2path-glob-does-not-match-outside-glob.yaml:language_idassertions; replaced withqualified_namevalue assertionswrong_path_glob_does_not_bind_go_entity): removed — tested non-existent exclusion behaviourReferences
internal/semantic_overlay/anchors/anchors.go—ConfidencePathGlob = 0.55, confidence tableinternal/semantic_overlay/overlay.go—ResolutionMatchstruct (nolanguage_id)internal/semantic_overlay/resolve.go— ladder logic (anchors applied additively, not as intersection)