Skip to content

[phase2][bug] selectors-test-bound-in-each-language: polyglot overlay anchor never matches — spec passing with wrong assertion #17

Description

@Anand-rahul

Bug

tests/e2e/specs/selectors/selectors-test-bound-in-each-language.yaml has been passing with a trivially-weak assertion that does not verify what the spec claims.

Root Cause

The polyglot-repo-go-ts-py fixture's overlay uses:

anchor qualified_name "CheckoutValidator.validate"
  • No package prefix
  • Lowercase validate

But the Go tree-sitter extractor produces checkout.CheckoutValidator.Validate (package prefix, uppercase V). The qualified_name anchor never matches for Go. The selector consistently resolves to "outcome":"unresolved".

The spec was passing only because its single assertion was contains: "CheckoutValidator" — which matches the selector name echoed in the response envelope regardless of whether binding succeeded.

Evidence

Running the spec with strengthened assertions:

✗ stdout contains '"outcome":"bound"'    — got "outcome":"unresolved"
✗ stdout contains '"language_id":"go"'  — got (unresolved, no matches)

Fix Needed

The PolyglotRepoGoTSPy overlay must use qualified names that match actual extractor output:

  • Go tree-sitter: checkout.CheckoutValidator.Validate (package.Type.Method)
  • TypeScript tree-sitter: CheckoutValidator.validate (class.method, lowercase)
  • Python tree-sitter: CheckoutValidator.validate (class.method, lowercase)

Or use separate per-language selectors, or a path_glob primary with per-language qualified_name anchors as fallback rungs.

The spec currently has a TODO comment explaining the bug and uses the weak assertion pending this fix.

Impact

The spec description says "resolves independently in Go, TS, and Python repos when those toolchains are present" — but it never binds, giving false confidence in multi-language selector resolution.

References

  • tests/e2e/helpers/repos.goPolyglotRepoGoTSPy, overlay anchor definition
  • tests/e2e/specs/selectors/selectors-test-bound-in-each-language.yaml
  • internal/semantic_overlay/anchors/qualified_name.go

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