Skip to content

feat(sync): detach descriptor-backed sources - #1003

Merged
ctawiah merged 1 commit into
mainfrom
ctawiah/sync-descriptor-detach-3bbf
Nov 10, 2026
Merged

ctawiah merged 1 commit into
mainfrom
ctawiah/sync-descriptor-detach-3bbf

Conversation

@ctawiah

@ctawiah ctawiah commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Context

Detach must remove the descriptor state of a linked resource without touching the repository source.

What changes

  • Delete the descriptor when it defines the selected resource.
  • Keep the managed-file detach behavior.
  • Leave the repository source unchanged.

Design notes

  • Deletion uses the existing staged rollback path.

Review focus

  • Can detach delete or edit a repository source?

Verification

  • make build
  • go test ./...
  • golangci-lint run ./...

Related changes

  1. refactor(sync): remove Phase 1 source references #1005: Phase 1 reference removal
  2. feat(sync): add projection and problem core #987: projection and problem core
  3. feat(sync): add the adapter core and the Markdown adapter #988: adapter core and Markdown
  4. feat(sync): add the structured document adapters #989: structured adapters
  5. feat(sync): add the Python adapter #991: Python adapter
  6. feat(sync): add the TypeScript and JavaScript adapters #992: TypeScript and JavaScript adapters
  7. feat(sync): add source descriptor storage #993: descriptor storage
  8. feat(sync): compile and publish repository sources #994: compile and publish
  9. This PR: descriptor detach
  10. feat(sync): prepare repository source links #997: link preparation
  11. feat(sync): integrate repository sources with planning and link #995: planning and link
  12. feat(sync): add the link commands #998: link commands

🤖 Generated with Claude Code


Note

Overview
Detach now treats descriptor-linked variations and attachments like first-class synced resources: it removes sync-owned descriptors and sync.lock entries while leaving repository source files untouched.

Confirmation output is richer. Instead of a single “local changes will be lost” flag, detach compares managed files to their lock fingerprint and linked resources to both reference digest and projection fingerprint, surfacing “unsynced changes” when mapping, relationships, or projected content no longer match the baseline.

Discovery and cleanup cover .ref.yaml / descriptor paths as well as managed files. Symlinks sitting on managed paths are ignored as definitions for change warnings and resource listing, but are still removed when detaching. SyncedAttachment gains a Fingerprint() helper aligned with how locks record linked vs managed attachments.

Reviewed by Cursor Bugbot for commit 2613913. Bugbot is set up for automated code reviews on this repo. Configure here.

@ctawiah
ctawiah added this pull request to stack #1004 November 3, 2026 00:34
@ctawiah
ctawiah removed this pull request from stack #1004 November 3, 2026 00:53
@ctawiah
ctawiah added this pull request to stack #1006 November 3, 2026 00:53
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from 9db0949 to d1a3812 Compare November 4, 2026 19:46
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch 2 times, most recently from 1d4fbc5 to fbed979 Compare November 4, 2026 22:26
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from fbed979 to 63dfb5e Compare November 4, 2026 22:52
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from 63dfb5e to d9b2422 Compare November 4, 2026 23:57
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch 2 times, most recently from bbf39d2 to fe4e505 Compare November 5, 2026 01:01
@ctawiah
ctawiah marked this pull request as ready for review November 5, 2026 13:35
@ctawiah
ctawiah requested a review from a team as a code owner November 5, 2026 13:35
@ctawiah
ctawiah requested review from ld-ahartmann and removed request for a team November 5, 2026 13:35
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from 7b1ba80 to 56eb4e2 Compare November 6, 2026 16:47
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from 56eb4e2 to 82b1505 Compare November 6, 2026 17:12
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from 82b1505 to d72cb06 Compare November 6, 2026 17:39
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from d72cb06 to 57d8b84 Compare November 6, 2026 18:02
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from 57d8b84 to d9c4e91 Compare November 6, 2026 18:30
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from d9c4e91 to 2bbcfc5 Compare November 6, 2026 19:08
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from 2bbcfc5 to 1527012 Compare November 6, 2026 19:51
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from 1527012 to fc0bcf6 Compare November 6, 2026 20:19
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from fc0bcf6 to 590d4f5 Compare November 6, 2026 20:46
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from 590d4f5 to 65a2ef8 Compare November 6, 2026 21:11
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from 65a2ef8 to b25e493 Compare November 6, 2026 21:49
@ctawiah
ctawiah force-pushed the ctawiah/sync-descriptor-detach-3bbf branch from b25e493 to 3a7e9cb Compare November 6, 2026 22:13

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread internal/sync/detach/detach.go Resolved

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread internal/sync/detach/detach.go Resolved

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread internal/sync/detach/detach.go Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f1ff089. Configure here.

Comment thread internal/sync/detach/detach.go Resolved
Detach removes the descriptor and the lock row of a linked resource. It never edits or deletes the repository source.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

2 participants