Repository navigation
feat(sync): push, link and create make a variation code-owned (AIC-3901, 2/5) - #1033
Closed
nkester-ld wants to merge 2 commits into
Closed
nkester-ld wants to merge 2 commits into
nkester-ld wants to merge 2 commits into
Conversation
This was referenced Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nkester-ld
force-pushed
the
AIC-3901/nkester/code-ownership-1-foundation
branch
from
November 17, 2026 15:03
e93b237 to
4e53436
Compare
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
marked this pull request as ready for review
November 17, 2026 16:14
nkester-ld
requested review from
btesfamariam
and removed request for
a team
November 17, 2026 16:14
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 679ee14. Configure here.
nkester-ld
force-pushed
the
AIC-3901/nkester/code-ownership-1-foundation
branch
from
November 17, 2026 23:26
4e53436 to
162272e
Compare
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
Take current variations that we're pushing/linking/syncing and attempt to make them code owned! Don't make them code owned if explicitly LD owned.
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
Start with
internal/sync/prompt/state.go(applyVariationOwnership,enforceOwnership): it marks each planned variation to claim, skip or leave. Thensync.go(claimOwnership): claims are written before the plan writes anything.create.goclaims a new variation before it's created.plan.go,output.goandreview.goadd the one-line skip message and the JSONnotes.Summary
code_canonicalrule before writing content. A forbidden claim stops the run before anything is pushed.server_canonicalrule is pulled but never claimed or pushed. Each one gets one line saying to switch it to Code in LaunchDarkly, and anotesentry in JSON output.syncAIConfigVariationonproj/<key>:env/*:aiconfig/<config>.Testing
go test ./... -count=1passes, and lint reports 0 issues on this branch with part 1 below it. Key tests inprompt/ownership_test.go:TestPushClaimsAVariationWithoutARuleBeforeWritingIt,TestLinkClaimsAVariationWithoutARule,TestPushSkipsAVariationManagedInLaunchDarkly,TestPullOfAVariationManagedInLaunchDarkly,TestPushStopsWhenTheClaimIsForbidden,TestPromptPushNamesSyncAIConfigVariationWhenTheVariationWriteIsForbidden; andprompt/create_test.go:TestCreateVariationClaimsItBeforeTheCreate.Acceptance table, open questions and release notes: see part 1 (#1032).
🤖 Generated with Claude Code
Note
Overview
Push, link, and create now treat LaunchDarkly sync ownership rules as the source of truth for variations: planning resolves ownership via
ResolveOwnership, marks rows to claim (code_canonical), skip push when LaunchDarkly-managed, or proceed when already code-owned.Before any variation mutation,
claimOwnershipwrites sync settings (ClaimForCode) per project; forbidden or non-404 read/write failures stop the run; missing settings warn and may still push after--yes. Create/link paths refresh ownership at review time so claims happen before variation POST/PATCH.User-facing output adds managed-in-LaunchDarkly notes (plain text + JSON
notes), ownership-unrecorded warnings, and clearer 403 messages namingupdateSyncSettingsvssyncAIConfigVariation. Watch mode no longer auto-applies when ownership cannot be recorded.Tests extend the fake API for sync settings PATCH and add
ownership_test.goplus acceptance/create coverage for claim ordering and skip behavior.Reviewed by Cursor Bugbot for commit 679ee14. 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