feat(sync): persist prompt sync manifests - #818
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ 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 766f9bd. Configure here.
nieblara
left a comment
There was a problem hiding this comment.
LGTM
Quick ux question: The manifest is committed, so each branch has its own baseline, but LaunchDarkly only has one state. Say someone archives or edits a prompt on a feature branch and syncs. Every other branch, main included, will then see delete_local / update_local for changes that were never merged, and with --yes those get applied automatically, right?
Is the intended workflow to only sync from the default branch? If it is, maybe add a warning when someone syncs from a different branch, or at least mention it in the help text.
766f9bd to
9aabe6d
Compare
9aabe6d to
1f80088
Compare
2aaf8c8 to
dd1a370
Compare
dd1a370 to
ff50923
Compare
ff50923 to
db471a4
Compare
db471a4 to
c07599b
Compare
Good catch! Ideally, developers should be able to sync from any branch. I plan to move the manifest to LaunchDarkly instead locally in the source code and add version checks to fix concurrent updates, then I'll look into preventing stale branches from overwriting newer LaunchDarkly state - i've added a ticket to track this. |

Context
The manifest is the local baseline used to determine which side changed since the last successful sync. This layer introduces only that persistence contract, before local prompt wrappers and mutation workflows are added.
What changes
Review focus
Verification
go test ./internal/sync/...git diff --checkRelated changes
Review the stack in this order:
Note
Overview
Introduces
internal/sync/manifest, a new persistence layer for the sync baseline: a versionedmanifest.yamlunder the repo’s sync root that records each tracked resource’s last acceptedsha256:fingerprint keyed by resource kind, project, and lookup key.The model adds helpers to upsert/remove entries, validate format version, fingerprints, duplicate identities, and unsafe path segments, and sort resources for stable Git diffs. The store loads missing files as an empty manifest, rejects unknown YAML fields and multi-document files, and writes via temp file + rename (with sync) so readers see either the old or new file. Tests cover round-trip determinism, validation edge cases, and atomic write behavior.
Reviewed by Cursor Bugbot for commit c07599b. Bugbot is set up for automated code reviews on this repo. Configure here.