Skip to content

feat(sync): persist manifests in LaunchDarkly - #852

Merged
ctawiah merged 1 commit into
mainfrom
ctawiah/sync-remote-manifests
Oct 8, 2026
Merged

ctawiah merged 1 commit into
mainfrom
ctawiah/sync-remote-manifests

Conversation

@ctawiah

@ctawiah ctawiah commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Context

Prompt sync currently stores its reconciliation baseline in a committed .launchdarkly/manifest.yaml file. That keeps each checkout isolated, but separate branches and clones do not share the latest synchronized state. Gonfalon now provides source-scoped, project-scoped manifest endpoints with resource versions for optimistic concurrency.

This layer replaces local manifest persistence with those endpoints. Local prompt, tool, and skill files remain unchanged, and sync continues to use the manifest as the common ancestor when comparing local and LaunchDarkly state.

What changes

  • Adds GET and PATCH clients for the LaunchDarkly sync manifest endpoints.
  • Uses the required Git origin as a canonical source identifier across SSH and HTTPS clones.
  • Loads project-scoped manifests and combines them into the workspace baseline used by reconciliation.
  • Converts manifest changes into versioned upserts and deletions.
  • Reports an optimistic concurrency conflict when another sync updates an entry first.
  • Batches manifest mutations to respect the endpoint limit.
  • Verifies ambiguous writes by reading the manifest back before reporting failure.
  • Updates bootstrap, normal sync, watch mode, and detach to persist manifest changes through LaunchDarkly.
  • Removes local manifest YAML reads, writes, rollback, and format-version handling.
  • Preserves project discovery when a managed file has been deleted from Git.

The command still requires a Git repository and origin. It does not add source or project flags to the normal sync workflow.

Review focus

  • Does the canonical Git source remain stable for SSH and HTTPS clones of the same repository?
  • Are project manifests combined without changing resource identity or reconciliation behavior?
  • Do upserts and deletions always send the version returned by the latest GET?
  • Does a 409 stop the sync with a clear instruction to run it again?
  • Can bootstrap or detach rollback leave the remote manifest inconsistent with local files?
  • Has local manifest persistence been removed without changing the local resource layout?

Verification

  • go test ./cmd/sync ./internal/sync/source ./internal/sync/repository ./internal/sync/manifest ./internal/sync/prompt ./internal/sync/bootstrap ./internal/sync/detach ./internal/sync/api
  • go test ./...
  • go vet ./internal/sync/... ./cmd/sync
  • git diff --check

Related changes

Review the stack in this order:

  1. Confirm destructive watch actions
  2. Guarantee prompt fingerprint convergence
  3. Add searchable attachment API foundations
  4. Reconcile variation attachments
  5. Attach tools and skills to variations
  6. Render attachment-aware review output
  7. Safely clean unreferenced attachments
  8. Persist sync manifests in LaunchDarkly

Note

Overview
Moves the prompt sync reconciliation baseline from committed .launchdarkly/manifest.yaml to LaunchDarkly’s source-scoped sync manifest API, so clones and branches share versioned state.

Adds GET/PATCH clients and a remote manifest.Store that merges per-project manifests, diffs fingerprints into versioned upserts/deletions, batches patches, treats 409 as “run sync again,” and re-reads after ambiguous writes. Manifest entries now carry remote Version; local YAML/format-version persistence is removed.

Sync requires a configured Git origin and derives a canonical git:host/repo source (SSH/HTTPS). Bootstrap, normal sync, watch, and detach use Load/Update with optimistic concurrency; project keys are discovered from managed files plus Git-deleted .launchdarkly paths. Minor UX/docs tweaks and tolerance when .launchdarkly is missing during orphan cleanup.

Reviewed by Cursor Bugbot for commit 086ee1a. 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.

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

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 d2de224. Configure here.

Comment thread internal/sync/prompt/runner.go
Comment thread internal/sync/source/resolver.go
Comment thread internal/sync/bootstrap/bootstrap.go Outdated
@ctawiah
ctawiah force-pushed the ctawiah/sync-remote-manifests branch 2 times, most recently from f7134df to ee34f22 Compare October 7, 2026 15:44
Base automatically changed from ctawiah/sync-attachment-cleanup-safety to main October 8, 2026 00:44
@ctawiah
ctawiah force-pushed the ctawiah/sync-remote-manifests branch from ee34f22 to 086ee1a Compare October 8, 2026 00:48
@ctawiah
ctawiah merged commit b16faca into main Oct 8, 2026
10 of 11 checks passed
@ctawiah
ctawiah deleted the ctawiah/sync-remote-manifests branch October 8, 2026 01:00
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