Skip to content

feat(sync): reconcile prompt variation changes - #813

Merged
ctawiah merged 1 commit into
mainfrom
ctawiah/AIC-3446/prompt-reconciliation
Sep 29, 2026
Merged

ctawiah merged 1 commit into
mainfrom
ctawiah/AIC-3446/prompt-reconciliation

Conversation

@ctawiah

@ctawiah ctawiah commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Context

The manifest records the last state accepted locally and in LaunchDarkly. Comparing that baseline with both current sides lets sync distinguish a local edit, server edit, deletion, and true conflict without adding a backend sync endpoint.

What changes

  • Plans deterministic create, update, archive, pull, delete, manifest, conflict, and error actions.
  • Renders structured plaintext, Markdown, and JSON review output.
  • Revalidates local and server fingerprints immediately before mutation.
  • Applies server writes through existing variation APIs and local writes through the workspace store.
  • Advances the manifest only for successful outcomes.
support/default
  Action: Update LaunchDarkly from the local file

Review focus

  • Does every three-way state choose the expected action?
  • Can an action write after either side has changed?
  • Does partial success advance only resources that converged?

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 internal/sync/prompt, the core library for reconciling prompt variations between local files, LaunchDarkly, and the sync manifest.

Planning compares manifest baseline fingerprints to current local and server state and picks deterministic actions (push, pull, create, archive, delete, manifest bookkeeping, conflict, or error). First-sync and upsert behavior are handled separately from tracked three-way merges.

Review output renders plans and post-sync outcomes as plaintext, Markdown, or JSON, including colored unified diffs (side-by-side on wide terminals) via go-difflib, with readable placeholders for missing or archived resources.

Execution re-checks fingerprints immediately before each mutation, applies server changes through existing variation APIs and local changes through the workspace store, verifies local writes, and on ambiguous API failures re-reads LaunchDarkly before treating a write as success. The reviewed manifest is copied so only successful resources advance the returned manifest; failures are reported per resource.

Tests cover the three-way action matrix, first-sync rules, manifest immutability, and JSON/diff messaging.

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

@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/prompt/execute.go
Comment thread internal/sync/prompt/execute.go
Comment thread internal/sync/prompt/execute.go
@ctawiah
ctawiah marked this pull request as draft September 24, 2026 04:33
@ctawiah
ctawiah marked this pull request as ready for review September 24, 2026 14:50
@ctawiah
ctawiah requested a review from a team as a code owner September 24, 2026 17:19
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch from c145a51 to de80ad0 Compare September 24, 2026 17:19

@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/prompt/diff.go
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch from de80ad0 to 2bed547 Compare September 24, 2026 17:32
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch from 2bed547 to 3854a8e Compare September 24, 2026 17:40
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch from 3854a8e to b427151 Compare September 24, 2026 17:57
@ctawiah
ctawiah removed this pull request from stack #815 September 24, 2026 17:59
@ctawiah
ctawiah changed the base branch from ctawiah/AIC-3445/prompt-workspace-management to ctawiah/AIC-3445/prompt-link-detach September 24, 2026 17:59
@ctawiah
ctawiah added this pull request to stack #821 September 24, 2026 17:59
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch from b427151 to 79b386a Compare September 25, 2026 15:31
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch from b7fdbc7 to a9e204b Compare September 25, 2026 16:07
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch from a9e204b to fadb398 Compare September 25, 2026 16:11

@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.

I think this seems fine, but the destructive actions would be executed from that forced-auto mode for applying changes, not sure if we want that!

@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch 2 times, most recently from 8aeee8a to 8f89857 Compare September 28, 2026 21:38
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch from 8f89857 to 7cc8f21 Compare September 28, 2026 21:44

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

Comment thread internal/sync/prompt/plan.go
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch 3 times, most recently from 0f141f8 to 2d7f4ce Compare September 29, 2026 00:04
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch 2 times, most recently from 7638c10 to d2da217 Compare September 29, 2026 00:17
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch 2 times, most recently from e0714b5 to fc46439 Compare September 29, 2026 00:30
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch from fc46439 to 07a2b20 Compare September 29, 2026 00:32
@ctawiah

ctawiah commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

I think this seems fine, but the destructive actions would be executed from that forced-auto mode for applying changes, not sure if we want that!

Good point. Thought about this a little bit more and the intended behavior should be for watch mode to auto-apply non-destructive changes, but still prompt for confirmation before archive or delete actions. I created a ticket to track that follow-up.

Base automatically changed from ctawiah/AIC-3445/prompt-link-detach to main September 29, 2026 00:38
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch from 07a2b20 to b3fc595 Compare September 29, 2026 00:38
@ctawiah
ctawiah force-pushed the ctawiah/AIC-3446/prompt-reconciliation branch from b3fc595 to 005bed3 Compare September 29, 2026 00:45
@ctawiah
ctawiah merged commit f9365cf into main Sep 29, 2026
10 checks passed
@ctawiah
ctawiah deleted the ctawiah/AIC-3446/prompt-reconciliation branch September 29, 2026 00:49
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