Ad-hoc project attach: project="<absolute dir>" indexes a foreign directory once, read-only, no state written into it (zero-fallback) #559
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.
Blocks
Reference
h-dv/code-index#559
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?
Part of the zero-fallback epic (#555). Cause 2: code outside the configured projects is unreachable.
Observed
Checking a corpus copy (
~/.cache/cosi-corpus/cs-dapper, a bind-diff staging dir) meantcode-index query --root <dir>in the shell: cold 5–60 s, JSON on stdout, no reuse across calls.sed -n 225,235pwon. Workers verifying binds in foreign checkouts did the same.Proposal
project: "<absolute directory>"on any tool attaches that directory as an ad-hoc read-only project for the session:relationship: ad_hocwith its root;Optionally an explicit
attach_project(path)for clients that want to pre-warm. The first call answerswarming_upwith a retry hint rather than blocking.Acceptance
search_symbols(project="/tmp/x")warms then answers. A second call reuses the daemon. No.code-index/is created inside/tmp/x.Second independent report (codex-531, #531 bind audit): the staged corpus sources under the bind-diff output (
before/<repo>/source/) cannot be read or navigated through the MCP instrument. The worker had to usecode-index query --rootin the shell or plain reads. The measured fallback classifier (#556) puts these in itsforeignclass: the lead had 2 such fallbacks in the baseline session, and the #531 audit adds more.code-index queryCLI drops content items with response_format=text #561More field evidence from codex-531's #531 corpus audit (dogfood D5–D10, D13):
path_outside_known_roots, which is exactly this issue.code-index query --dbper window, took 36 subprocess calls and 103 s to read 184 source windows. That is measurable, but expensive.queryon an existing explicit DB entered automatic plugin enablement (plugin_mutation_busy) and then answeredsymbol_not_found. Concurrent read-only queries contend as plugin writers.database disk image is malformed(the copy probably lacked its WAL). The original stays readable.query --no-daemon --db Xwarned that a registered daemon of a different build would answer, then fell back. With nocode-index-mcpnext to it, it also used a helper of a different build (answer_provenance.build).For this issue's design: an ad-hoc or explicit-DB read must be read-only and snapshot-consistent (WAL included), must never trigger activation or plugin mutation, must never attach to a daemon of a different build or root, and must report only the build that actually answered.