feat(sync): add prompt reference workspaces - #817
Conversation
nieblara
left a comment
There was a problem hiding this comment.
WOO!
Non-blocking: findGitRepository reports every git failure as "not found." So if you're inside a repo but git refuses to run, say because of "detected dubious ownership" (common in containers, WSL, and CI) or a permissions error, you get told to "initialize a Git repository." That might be a bit confusing to users, and it could send an agent using these tools down the wrong path too.
One option is to split this into three cases: git isn't installed, the directory isn't a repo, and some other git error. For the last one, include the stderr from exec.ExitError. That way the error return actually gets used. Up to you!
cd63a93 to
29b98e5
Compare
d3d7bc2 to
db54d1e
Compare
db54d1e to
f6ee3d2
Compare
08c675a to
8966178
Compare
|
Addressed this feedback. Repository discovery now distinguishes a missing Git executable, an explicit “not a git repository” response, and other Git failures. Operational failures preserve Git’s stderr, with coverage for dubious ownership and errors that do not include stderr. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ 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 8966178. Configure here.
8966178 to
99a6a94
Compare

Context
Prompt sync needs a stable repository root and a small adapter boundary for prompt content maintained outside
.launchdarkly. This layer adds those boundaries without creating local sync state or exposing a command.What changes
plain-markdownas the first adapter.Review focus
Verification
go test ./internal/sync/...git diff --checkRelated changes
Review the stack in this order:
Note
Overview
Introduces the prompt reference foundation for sync: a pluggable adapter contract (
Parse/Render) with sharedPrompttypes, plusplain-markdownas the first format (whole file → one system message, line-ending normalization, round-trip viareference.Parse/ApplyToVariation/Render).Adds Git-backed workspace discovery:
repository.FindGitRepository(git rev-parse --show-toplevel,LC_ALL=Cfor stable “not a git repository” detection) andsource.Resolver, which returns a canonical repo root (absolute path, symlinks resolved) orErrGitRequiredwhen not inside an initialized repo.Reviewed by Cursor Bugbot for commit 99a6a94. Bugbot is set up for automated code reviews on this repo. Configure here.