Skip to content

fix(sync): enforce literal owned path boundaries - #49

Open
raphaelnz wants to merge 2 commits into
negoro26:mainfrom
raphaelnz:fix/owned-path-boundaries
Open

raphaelnz wants to merge 2 commits into
negoro26:mainfrom
raphaelnz:fix/owned-path-boundaries

Conversation

@raphaelnz

Copy link
Copy Markdown
Contributor

Why

Protect local edits when maintainers sync upstream. The dirty-tree guard currently exempts paths that share an owned path's prefix, even though the build does not preserve those siblings.

Closes #44.

What changed

  • Read NUL-delimited Git status records and compare literal owned paths with directory boundaries.
  • Check both sides of renames and retain failure behavior when Git status fails.
  • Add isolated sync regression cases, run them in CI, and document the ownership boundary.

Scope

  • Covers local-change detection before the skill and agent trees are replaced.
  • Does not change sync recovery, release versions, or upstream target selection.

Blast Radius

Sync now rejects dirty nonowned siblings instead of deleting them. Edits within owned paths remain allowed and preserved.

Verification

  • A real sync to a synthetic commit based on canonical upstream rejected an untracked prefix sibling with exit 1 and preserved its bytes and the pin.
  • A successful sync preserved an owned edit, installed new upstream content, and advanced the pin.
  • The new regression script fails against the unfixed guard and passes all 14 cases after the fix. Shell syntax checks and the full port gate also pass.

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.

Sync silently deletes non-owned uncommitted siblings matched by the owned-path prefix

1 participant