read_code: a caller-typed missing path range falsely claims the file exists in the index #469
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#469
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?
Dogfooded with the official v0.41.20 binaries and a healthy indexed checkout.
read_code("crates/guest/svelte/src/gen-kinds.rs:1-30")returnsfile_not_readablewith the affirmative hint “The file exists in the index but couldn't be read from disk”. That file does not exist:index_coveragereturnspath_not_found, andlist_filesfor the exact path returns an empty population. This was a caller-typed path typo, not a deleted indexed file.server.rscurrently selects its missing-file hint withwhole_file, although the nearbyspan_from_indexflag already distinguishes an index-derived symbol target from an arbitrary caller-supplied path. Adding:1-30must not turn an unknown path into proof of indexed existence. Preserve the existing refusal and root-routing disclosure; select the stale-index explanation only when the path genuinely came from an indexed symbol. Verify bare-path and path-range typo controls alongside indexed-symbol deletion and ignored-file refusal. This is a diagnostic correctness issue; no source was served or exclusion bypassed.The fix is included in PR#468's combined final head23a9d61c. The new path-range regression fails the old condition. The repaired snapshot and daemon legs pass; a separate indexed-symbol deletion control retains the genuine stale-source explanation. Making every missing-file hint neutral fails that control, and exact restoration passes all four routing tests. Source-listing/trust suites and strict MCP Clippy pass. Final-head CI is running; this is not yet merged or released.
Verified on the actual published 0.41.21 MCP binary: missing.js and missing.js:1-5 return the same neutral file_not_readable hint with list_files/index_coverage guidance; neither asserts indexed existence. An indexed symbol whose source is deleted after snapshot initialization still returns the specific stale-index hint. Receipt: /tmp/cosi-04121-missing-path-proof/report.json.