Skip to content

fix(deps): protect owned destination files - #45

Merged
jbeda merged 1 commit into
mainfrom
fix/deps-owned-target-guard
Sep 23, 2026
Merged

jbeda merged 1 commit into
mainfrom
fix/deps-owned-target-guard

Conversation

@jbeda

@jbeda jbeda commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Problem

deps import guarded its destination using the broad provenance-prefix classifier. A locally owned model with an unknown reserved-prefix comment such as # modelith-note: ... was therefore treated as a malformed vendored copy and could be overwritten.

Fix

Replacement now requires the existing provenance header to identify an origin and path for the same source. A malformed header that still identifies that source remains repairable. An unidentified header blocks import and directs the user to choose another directory or deliberately move/delete the existing file.

Verification

  • Regression test proves the original file remains byte-identical after the refused import.
  • task check passes.

Found while auditing the merged vendoring slice; the behavior existed in slice 2 rather than being introduced by the later refresh work.

Signed-off-by: Joe Beda <joe@stacklok.com>
@jbeda
jbeda marked this pull request as ready for review September 23, 2026 21:15
@jbeda
jbeda merged commit ba152a0 into main Sep 23, 2026
2 checks passed
@jbeda
jbeda deleted the fix/deps-owned-target-guard branch September 23, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant