fix(doctor): report foreign-installation skill packages as info, not update-nag#411
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Doctor's orphan classifier prescribed `tracedecay update` for every
inactive materialized skill package, but update/remove refuses to delete
a project-scope package this installation did not author (a committed
manifest with a different `materialized_by`, or a legacy manifest with
none). The result was a permanent warning nag for a remediation that
never runs.
Route doctor and the remove path through one shared predicate,
`package_is_foreign_to_installation`, so they classify identically by
construction. Foreign packages now surface as a new `SkillDrift::
ForeignOrphan` rendered at info severity ("project skill from another
installation; leave in place, or delete the directory manually"),
never incrementing the warning count and never naming `update`.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
717b856 to
3535097
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
tracedecay doctor's managed-skill materialization check classified every inactive materialized package in a project scope asOrphanand told the user to runtracedecay updateto remove it. But the update/remove path (remove_materialized_skill→may_remove_owned) already refuses to delete a project-scope package this installation did not author — a package committed by another installation (manifestmaterialized_bydiffers) or a legacy manifest with nomaterialized_byat all. So doctor emitted a permanent warning nag prescribing a remediation that never runs.Concretely, in this repo the committed
.claude/.codexskillsautomation-run-reviewandscheduler-review(manifests withmaterialized_by: null) were reported as two warnings each cycle, telling the user to run anupdatethat would skip them as foreign.Fix
Route doctor and the remove path through one shared predicate,
package_is_foreign_to_installation, so they classify identically by construction and doctor can never again prescribe an actionupdaterefuses to perform.may_remove_ownedis now defined as its negation.SkillDrift::ForeignOrphanvariant, rendered at info severity (DoctorCounters::info) — indented, no!marker, does not increment the warning count, never namestracedecay update. Message: "'' project skill from another installation; leave in place, or delete the directory manually if unwanted ()".Orphanwith theupdateremediation (correct — update removes them).skill_drift_report(scope_desc, finding) -> (DriftLevel, String)classifier so severity/message is unit-testable.Behavior of
reconcile_scope/remove_materialized_skillis unchanged; this only aligns doctor's reporting with their existing protection.Tests
doctor_reports_foreign_installation_package_as_foreign_orphan— committed package authored by another installation → exactly oneForeignOrphan, noOrphan, andremove_materialized_skillagrees withSkippedForeign.doctor_reports_legacy_manifestless_author_as_foreign_orphan— legacy manifest withmaterialized_bystripped, and missing-manifest case →ForeignOrphan.doctor_reports_own_inactive_skill_as_plain_orphan— self-authored inactive package staysOrphan.foreign_orphan_renders_as_info_without_update_remediationandplain_orphan_still_warns_with_update_remediationon the pure classifier.doctor_scopecall sites updated with the installation-id arg.Verification
cargo fmt --check,cargo clippy --workspace --all-targets --locked -- -D warnings— clean.cargo nextest run --test agent_suite --no-fail-fast— 501 passed.tracedecay doctoragainst this repo now emits the four packages ({automation-run-review,scheduler-review}×.claude/.codex) as info-level lines, no warning-count increment, noupdateprescription.🤖 Generated with Claude Code