Repository navigation
feat(sync): the first pull makes a variation code-owned (AIC-3901, 3/5) - #1034
Closed
nkester-ld wants to merge 1 commit into
Closed
nkester-ld wants to merge 1 commit into
nkester-ld wants to merge 1 commit into
Conversation
This was referenced Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nkester-ld
force-pushed
the
AIC-3901/nkester/code-ownership-2-push
branch
from
November 17, 2026 15:03
d6879c4 to
679ee14
Compare
nkester-ld
force-pushed
the
AIC-3901/nkester/code-ownership-3-first-pull
branch
from
November 17, 2026 15:03
a887e92 to
61ede04
Compare
nkester-ld
marked this pull request as ready for review
November 17, 2026 16:14
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 61ede04. Configure here.
Author
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.

Human
This covers ldcli sync prompts add, the first time a variation comes into the repo we make it code sot.
Stack (merge in order):
Why
AI Config sync is moving to two sources of truth: every variation is owned by exactly one side, LaunchDarkly (UI and API) or code (ldcli). Today ldcli never writes ownership rules, so a variation synced from code stays editable in LaunchDarkly unless someone switches it by hand, and the two copies drift. Syncing a variation from code should make it code-owned. Detaching it should hand it back to LaunchDarkly. A variation someone explicitly kept in LaunchDarkly should never be taken over by a push.
Reviewer Guide
All in
internal/sync/bootstrap/bootstrap.go. ReadclaimNewVariationsfirst: it reads the ownership of every project before claiming anything, then claims the new variations before the files and manifest are written. If a write fails after the claim, the error says the variations are already code-owned and that running add again is safe.prompt/runner.gopasses the settings client,--yesand the error stream into bootstrap.Summary
code_canonicalrule.server_canonicalrule are pulled but not claimed.Testing
go test ./... -count=1passes, and lint reports 0 issues with parts 1–2 below. Key tests inbootstrap/ownership_test.go:TestRunClaimsAVariationWithoutARuleBeforeWritingIt,TestRunPullsButDoesNotClaimAVariationManagedInLaunchDarkly,TestRunWritesNothingWhenTheClaimIsForbidden.Review findings not addressed (medium, test coverage only): the first pull's ownership read returning 403 has no test (
claimNewVariations).Acceptance table, open questions and release notes: see part 1 (#1032).
🤖 Generated with Claude Code
Note
Overview
First-time
addnow records code ownership before writing local files. Bootstrap accepts aSettingsclient plus context,--yes, and a separate error stream so ownership warnings and confirmations don’t mix with normal output.claimNewVariationsruns after the dry-run gate and beforeStore.Add/ manifest updates: it groups new (not-yet-locked) variations by project, reads ownership for every project first, then issues at most oneClaimForCodeper project. Variations explicitly managed in LaunchDarkly are still pulled but skipped for claiming, with a notice on the error stream. Missing sync settings (404) triggerConfirmWithoutSettingsunless--yes; forbidden or failed claims abort with structured sync problems, and partial multi-project failures name projects already claimed. If claiming succeeds but a later step fails, errors note that code ownership was already recorded and re-running add is safe.prompt/runnerpasses the API client and CLI flags into bootstrap. Newownership_test.gocovers claim ordering, dry-run, terminal/404 flows, and adoption tests now assert aPATCHto/configs/sync/settingswithcode_canonicalrules.Reviewed by Cursor Bugbot for commit 61ede04. Bugbot is set up for automated code reviews on this repo. Configure here.
Related Jira issue: AIC-3901: [ldcli] Pushing, linking or first-pulling a variation makes it code-owned; detach returns it to LaunchDarkly