link add on a project without a config file disables every language: the file it creates carries an explicit empty enabled list #585
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#585
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?
Found by the release lead while linking a worktree, 2026-11-13; reproduced on the released v0.41.52 (
7fc7fb20) in a scratch project.Reproduction
phad no.code-index.toml.link addcreates one from the full template, and the template contains[languages] enabled = []. Anenabledkey in.code-index.tomlis an explicit decision that wins over the automatic one, so every language of the project becomesNOT INDEXED. The command printed only "added link …". The next one-shot query answeredproject_not_available.On a real checkout this took all seven languages (1,106 source files) out of the index with one
link add.Expected
.code-index.tomlfor another purpose must not record a language decision. The file it writes carries noenabledkey (or the automatic decision is carried over as what it is), andlanguages listshows the same enabled set before and after.initandlanguages enableare the two that are meant to decide.Also seen in the same step
link add <name> <path>for a path that is a worktree of the same repository recordsrelationship = "dependency"and warns that the roots are nested. A linked worktree of the same repository then takes part in name fan-out and returns every hit twice. The relationship should beworktreewhen the target is a worktree of the primary's repository (or the command should say which value to pass).link removeprints "withdrew the approval for link:" and nothing about the entry it removed from the file.Acceptance
languages listoutput afterlink addand afterlink remove; mutation run..code-index.toml: none but the two deciding commands can produce anenabledkey.Fixed on the next-train branch (lane r35, merged locally as
2d8ba04d; not released yet).Cause.
link addseeds a missing.code-index.tomlfrom the shared template, and the template containedenabled = [].Change.
enabledcommented out.initwrites its detected list explicitly;languages enablerecords an explicit list as before. A file without the key means the same as no file: the automatic decision in.code-index/languages.tomlstays in force.initandlanguages enablemay produce the key; a new writer that is not registered in the test fails it.link addwithout--relationshiprecordsworktreewhen the target is another checkout of the primary's Git repository,dependencyotherwise; an explicit--relationshipwins. The nested-roots warning no longer fires for nested checkouts, which the outer index does not walk anyway.link removeprints the entry it removed (name, path, relationship, file).docs/configuration.md,docs/operations.mdand the template comments say the same.The
project_not_availableanswer in the report came from the empty language list: the primary's activation failed its gate because no language contributed anything. The linked project was not the cause. The refusal does not say that; left as it is here, it belongs to the refusal wording work in #521.Checked by the lead: the production diff read through
changed_symbolswith hunks; the CLI suite, formatting and clippy pass; mutation "a new function that calls a manifest sink" fails the inventory test. The worker ran the other mutations (template key restored, inference removed, explicit relationship ignored, removal line) and reported each red. I replaced the worker's parser-based inventory with a line scan that finds the same twelve call sites, to keep a parser dependency out of the CLI crate.Workaround on v0.41.52: after
link addon a project that had no.code-index.toml, delete the lineenabled = []from the new file and checkcode-index languages list.Released in v0.41.53 (
59b8bc3d); verified on the installed binaries.link addno longer creates a configuration withenabled = [], so the automatic language decision is preserved. It infersrelationship = "worktree"for another checkout of the same repository, andlink removeprints the removed entry.Verified on the installed release:
585_precondition: no configuration file exists beforelink add. PASS: no .code-index.toml before link add585_no_enabled_key: the created file has no uncommentedenabledkey. PASS: no uncommented enabled key585_worktree_inferred: the same-repository checkout is recorded as a worktree. PASS: relationship = "worktree"585_languages_unchanged: the Rust language decision is unchanged. PASS: rust yes auto585_remove_prints: removal prints the removed link. PASS: removed link 'wt' (worktree)