Skip to content

feat(sync): link and detach prompt resources - #819

Merged
ctawiah merged 1 commit into
mainfrom
ctawiah/AIC-3445/prompt-link-detach
Sep 29, 2026
Merged

ctawiah merged 1 commit into
mainfrom
ctawiah/AIC-3445/prompt-link-detach

Conversation

@ctawiah

@ctawiah ctawiah commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Context

After a workspace exists, users need to connect prompts that already live elsewhere in the repository and stop tracking resources without mutating LaunchDarkly. This change contains those two lifecycle workflows.

What changes

  • Links a repository prompt through the plain-markdown adapter.
  • Asks only for destination metadata that cannot be derived from the source file.
  • Creates the corresponding .launchdarkly wrapper.
  • Detaches selected wrappers and manifest entries while leaving LaunchDarkly and referenced source files unchanged.

Review focus

  • Does linking preserve the external file as the content source?
  • Are existing server and local variation keys protected from overwrite?
  • Does detach remove only sync-owned state?

Verification

  • go test ./internal/sync/...
  • git diff --check

Related changes

Review the stack in this order:

  1. Sync foundations
  2. Prompt reference workspaces
  3. Prompt sync manifests
  4. Local prompt workspaces
  5. Bootstrap prompt workspaces
  6. Link and detach prompt resources
  7. Prompt reconciliation
  8. Prompt sync orchestration
  9. Prompt sync command

Note

Overview
Adds link and detach workflows for prompt sync: connect an existing repo file to a LaunchDarkly variation via a local wrapper, or drop local tracking without touching LaunchDarkly or referenced sources.

Link (internal/sync/link) walks an interactive flow (project → config → model config, plus any missing key/name/content), parses the source through the plain-markdown adapter, validates destination (mode match, no duplicate server/local keys), then writes a .launchdarkly wrapper that points at the external file. Empty prompts can be filled only after validation; failed wrapper creation rolls the source file back. Create exposes the same path with a pre-selected destination for tests/CLI.

Detach (internal/sync/detach) lists the union of manifest entries and on-disk wrappers, multi-selects resources in the terminal, updates the manifest first, deletes local variation wrappers when present, and restores the manifest if deletion fails. Referenced prompt files are left intact.

synclocal.ReplaceFileAtomically reuses the existing staged-rename + content-snapshot check so link (and similar callers) cannot clobber a file that changed after read.

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

Comment thread internal/sync/link/link.go Outdated
Comment thread internal/sync/link/link.go Outdated

@nieblara nieblara left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NICE!

@ctawiah
ctawiah force-pushed the ctawiah/AIC-3445/prompt-link-detach branch 2 times, most recently from 2150c82 to cf2b5fa Compare September 28, 2026 21:38
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3445/prompt-link-detach branch from cf2b5fa to 6f5836a Compare September 28, 2026 21:44
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3445/prompt-link-detach branch 3 times, most recently from f252623 to c369444 Compare September 29, 2026 00:04
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3445/prompt-link-detach branch from c369444 to 685cd3a Compare September 29, 2026 00:10

@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 685cd3a. Configure here.

Comment thread internal/sync/link/link.go
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3445/prompt-link-detach branch from 685cd3a to cb9066b Compare September 29, 2026 00:17
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3445/prompt-link-detach branch 2 times, most recently from e5ffa88 to f636284 Compare September 29, 2026 00:30
Base automatically changed from ctawiah/AIC-3445/prompt-workspace-management to main September 29, 2026 00:32
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3445/prompt-link-detach branch from f636284 to 9c4b6b2 Compare September 29, 2026 00:32
@ctawiah
ctawiah merged commit dfd82b2 into main Sep 29, 2026
10 checks passed
@ctawiah
ctawiah deleted the ctawiah/AIC-3445/prompt-link-detach branch September 29, 2026 00:38
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