Skip to content

feat(sync): prepare repository source links - #997

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

ctawiah merged 1 commit into
mainfrom
ctawiah/sync-link-preparation-3bbf

Conversation

@ctawiah

@ctawiah ctawiah commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Context

Link needs a step that validates everything and writes nothing, so that the command can show a preview first.

What changes

  • Add the link package. Prepare validates the target, the source path, the format, the mapping, and the compiled projection.
  • Write publishes the descriptor only after the review.

Design notes

  • Prepare reads only the named file and its static dependencies.

Review focus

  • Can Prepare write any file?

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. feat(sync): detach descriptor-backed sources #1003: descriptor detach
  10. This PR: 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
Adds internal/sync/link, a two-phase workflow for linking repository source files to LaunchDarkly descriptor refs: Prepare validates the target, builds the reference, compiles the source, and renders descriptor bytes without writing, and Write / Rollback handle publish and undo after review.

Prepare snapshots any existing descriptor and, on relink, carries forward tools and skills from the current file so relinking file/select/map does not drop attachments. Write publishes via WriteDescriptorFrom only if on-disk state still matches the snapshot (ErrorStateChanged when another writer wins). Rollback restores the prior descriptor or removes a new one only when this process actually wrote, so refused or skipped writes do not clobber a concurrent link.

Tests cover preview-without-write, concurrent-write refusal, rollback semantics, and tools/skills preservation.

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

@ctawiah
ctawiah added this pull request to stack #1000 October 30, 2026 20:15
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from 78b0f58 to 9230dea Compare October 31, 2026 00:06
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from 9230dea to cdcb879 Compare November 2, 2026 02:26
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from cdcb879 to ee718fe Compare November 2, 2026 02:50
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from ee718fe to cfda53b Compare November 3, 2026 00:29
Base automatically changed from ctawiah/sync-descriptor-detach-3bbf to main November 3, 2026 00:29
@ctawiah
ctawiah removed this pull request from stack #1000 November 3, 2026 00:32
@ctawiah
ctawiah changed the base branch from main to ctawiah/sync-descriptor-detach-3bbf November 3, 2026 00:33
@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-link-preparation-3bbf branch from cfda53b to 96dc97f Compare November 4, 2026 19:46
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch 2 times, most recently from 61e1d38 to d7fc6f9 Compare November 4, 2026 22:26
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from 76bcff6 to a7757b8 Compare November 6, 2026 14:46
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from a7757b8 to aaab795 Compare November 6, 2026 15:19
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from aaab795 to 5e1b35e Compare November 6, 2026 15:48
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from 5e1b35e to 9ecf927 Compare November 6, 2026 16:15
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from 9ecf927 to 91222c5 Compare November 6, 2026 16:47
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from 91222c5 to a0f9e3d Compare November 6, 2026 17:13
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from a0f9e3d to 35b148d Compare November 6, 2026 17:39
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from 35b148d to 6b088f4 Compare November 6, 2026 18:02
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from 6b088f4 to ee08810 Compare November 6, 2026 18:30
@ctawiah
ctawiah force-pushed the ctawiah/sync-link-preparation-3bbf branch from ee08810 to 0e8bf55 Compare November 6, 2026 19:09

@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/link/link.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/link/link.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/link/link.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/link/link.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/link/link.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 64ba2d4. Configure here.

Comment thread internal/sync/link/link.go Resolved
Add the link package. Prepare validates the target, the source path, the format, the mapping, and the compiled projection without a write. Write publishes the descriptor after the review.

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