An extensionless script with a #!/usr/bin/env ruby shebang is indexed as text only, because every language claim is path-based #298
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#298
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From the Ruby dogfood behind #294 (§3.3 of the report):
bin/zammad-mcp-serveris the project's entry point, a Ruby script with no extension. It is indexed as TEXT — symbol-blind — soproject_overview's entry-point list was empty and nothing it calls is reachable from it.index_coveragereports this correctly, so it is disclosed; it is not a lie, it is a gap.Why it is not a one-line fix
Every language claim in this index is decided by PATH, by design:
code_index_package::builtin::BUILTIN_CLAIMSis a static extension/filename table, andbuiltin_claim_parityrequires it to equal whatall_plugins().find(|p| p.detect(path))answers.LanguagePlugin::detect(path, head)takes the file's first bytes, but the indexer calls it asp.detect(path, &[])(crates/indexer/src/index.rs), and no plugin readsheadtoday.[claims.include] extensions = [...]); the package ABI has no way to claim by content.A shebang-sniffed claim makes a file's LANGUAGE depend on its CONTENT. That has consequences the path model never had to face:
codefile becomestext; the watcher,reclassified, generation identity and every symbol id in it are involved.package.claim_conflicts_builtin) is keyed on paths; a content claim needs a precedence story against a package that claims the same extensionless name.index_coverage(path)names "the rule that decided it"; a content rule needs its own, stable reason code.#!/usr/bin/env python3,node,phpandrubyare the same fact; it should be one table inlang_profile(interpreter name -> profile), read throughprofile_name, not per-plugindetectbodies.What would close it
ruby,python/python3,node,php, …) mapping the interpreter to a profile, consulted ONLY for a file that no path rule claims and that has no extension.index_coveragecan say why.reclassifiedpath does, with a test that removing the shebang takes the file back totextand drops its symbols.Related: #294, #297.