Re-granting derived_names on an already-enabled package does not reindex, so the files stay at 0 symbols #104
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#104
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 and left open deliberately by the #103 fix, under "keep this change small". It is a real gap and it is the immediate follow-up.
The defect
derived_namesis not a field ondirty::PackageActivation. So when an operator changes only that answer on a package that is already enabled,dirty_domainsees no change, the domain comes back empty, and nothing is reparsed.Concretely:
The operator has answered yes, the record says yes, the runtime policy says yes — and the index still shows the refusal until something unrelated touches the file.
Why the acceptance path did not catch it
First-time enable is fine, and that is the path #103's e2e drives: the containers move, which yields
Cause::ExtractionIdentity, which reparses. Only the change of an existing answer is silent. This is the ordinary shape of a state-transition gap — the fixture starts from nothing, so the transition that matters is never exercised.The fix
derived_namestodirty::PackageActivation;CauseatWork::Reparse— notWork::Reresolve.Cause::Capabilityis a Reresolve and would not re-run the extractor, and the extractor is exactly what has to run again: the facts themselves change, not their resolution.The test that must go red
Not "enable with the grant and see symbols" — that passes today via
ExtractionIdentity. It must be the transition: enable without, assert the refusal is recorded, re-enable with, and assert the file carries symbols without any file having been touched. The mutation is dropping the new field fromPackageActivation— the test must go red on that alone.Related
Follow-up to #103. Blocks nothing in #84 (whose acceptance is a first-time enable), but it is an operator-visible correctness defect in a shipped path.
plugin_addtool cannot grantderived_names, so an agent can never add a package that needs it #106Triage 2026-09-06: CLOSING. The grant is a compared fact on the dirty domain, it raises
Reparserather thanReresolve, and the transition test exists with its mutation ledger written out.Verified against master and by re-running the suite myself.
Against the stated criterion
pub derived_names: boolonPackageActivation—crates/indexer/src/dirty.rs:314(struct at:236), with a doc block naming this issue and explaining the Reparse-vs-Reresolve axis.Cause::DerivedNames—dirty.rs:901; module doc at:104-118("AND WHY #104'sderived_namesGRANT IS NEITHER"). AReresolvewould have left the files at 0 symbols, which is the defect.KeyFacts::derived_names_answer_moved—dirty.rs:731, called at:1135.approval::effective_grant—crates/indexer/src/approval.rs:3205-3212.The mutation that matters was run
crates/indexer/tests/dirty_domain.rs:149-215records M19: delete thekey_factsinsert and the exact #104 defect is restored — RED. Plus M20/M22/M23/M24 with a deliberate two-mutation control. That is the difference between "a test exists" and "a test that can fail".Runs (exit 0)
incl.
re_answering_derived_names_on_a_standing_container_reparses_only_its_files.The second is the one that grades the issue's actual scenario end to end: without touching a file, which is the clause that makes it a real regression test rather than a reindex-everything smoke.
Residual
None.
🤖 Triage lane, 2026-09-06, master
45cf6e4