feat(sync): persist local prompt workspaces - #811
Merged
Merged
Conversation
This was referenced Sep 24, 2026
ctawiah
added this pull request to stack #815
September 24, 2026 04:16
ctawiah
marked this pull request as ready for review
September 24, 2026 04:26
ctawiah
marked this pull request as draft
September 24, 2026 04:33
ctawiah
marked this pull request as ready for review
September 24, 2026 14:50
ctawiah
force-pushed
the
ctawiah/AIC-3444/local-prompt-workspaces
branch
from
September 24, 2026 17:32
bf4101a to
a63297e
Compare
ctawiah
force-pushed
the
ctawiah/AIC-3444/local-prompt-workspaces
branch
from
September 24, 2026 17:40
a63297e to
5198e87
Compare
ctawiah
force-pushed
the
ctawiah/AIC-3444/local-prompt-workspaces
branch
from
September 24, 2026 17:57
5198e87 to
fba62f6
Compare
ctawiah
removed this pull request from stack #815
September 24, 2026 17:59
ctawiah
changed the base branch from
ctawiah/AIC-3447/sync-foundations
to
ctawiah/AIC-3444/prompt-sync-manifest
September 24, 2026 17:59
ctawiah
added this pull request to stack #821
September 24, 2026 17:59
This was referenced Sep 24, 2026
ctawiah
force-pushed
the
ctawiah/AIC-3444/local-prompt-workspaces
branch
from
September 25, 2026 15:31
fba62f6 to
ad520c9
Compare
ctawiah
force-pushed
the
ctawiah/AIC-3444/local-prompt-workspaces
branch
from
September 25, 2026 16:00
ad520c9 to
13ef784
Compare
ctawiah
force-pushed
the
ctawiah/AIC-3444/local-prompt-workspaces
branch
from
September 25, 2026 16:07
13ef784 to
7c97750
Compare
ctawiah
force-pushed
the
ctawiah/AIC-3444/local-prompt-workspaces
branch
from
September 25, 2026 16:11
7c97750 to
bb38036
Compare
nieblara
approved these changes
Sep 28, 2026
ctawiah
force-pushed
the
ctawiah/AIC-3444/local-prompt-workspaces
branch
2 times, most recently
from
September 28, 2026 21:38
151db1c to
cd28bdb
Compare
ctawiah
force-pushed
the
ctawiah/AIC-3444/local-prompt-workspaces
branch
from
September 28, 2026 21:44
cd28bdb to
73ad202
Compare
ctawiah
force-pushed
the
ctawiah/AIC-3444/local-prompt-workspaces
branch
2 times, most recently
from
September 28, 2026 22:08
3e00ff3 to
7e234ed
Compare
Base automatically changed from
ctawiah/AIC-3444/prompt-sync-manifest
to
main
September 29, 2026 00:04
ctawiah
force-pushed
the
ctawiah/AIC-3444/local-prompt-workspaces
branch
from
September 29, 2026 00:04
7e234ed to
2c2211e
Compare
ctawiah
force-pushed
the
ctawiah/AIC-3444/local-prompt-workspaces
branch
from
September 29, 2026 00:10
2c2211e to
d59af3d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit d59af3d. Configure here.
| } | ||
| if err := temp.Close(); err != nil { | ||
| return fmt.Errorf("close variation %s: %w", filepath.Base(path), err) | ||
| } |
There was a problem hiding this comment.
Create path skips durability Sync
Medium Severity
createFile writes and closes the temp file, then publishes it with os.Link, without Sync(). Bootstrap then treats the directory rename as the commit point. A crash after that rename can leave already-published wrappers with empty or partial contents. stageReplacement already flushes before its commit.
Additional Locations (1)
Triggered by learned rule: Atomic sync writes: rename is the commit point
Reviewed by Cursor Bugbot for commit d59af3d. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Context
Prompt sync needs a local representation that is easy to review in Git and safe to replace when LaunchDarkly is selected as the source of truth. This layer adds prompt wrapper parsing, rendering, and transactional file mutations on top of the manifest and reference contracts.
What changes
.launchdarkly/<project>/configs/<config>/.Review focus
Verification
go test ./internal/sync/...git diff --checkRelated changes
Review the stack in this order:
Note
Overview
Adds
internal/sync/localto read and write prompt variations under.launchdarkly/<project>/configs/<config>/*.prompt.md, turning YAML front matter plus inline or referenced prompt bodies intoSyncedResourcevalues for reconciliation.Compile walks project trees (with path-aware parse errors); Store supports bootstrap, add (create-only via hard link), replace, and delete with batch preflight, staging, rollback, and “changed while syncing” checks. Linked prompts use repository-relative
refpaths with symlink re-validation on read; Replace can update external sources when the adapter can render them.Shared
NormalizePromptText(line endings + trim) is used in fingerprints, local render/parse, and plain-markdown adapters so server and on-disk prompts fingerprint consistently.Reviewed by Cursor Bugbot for commit d59af3d. Bugbot is set up for automated code reviews on this repo. Configure here.