Repository navigation
fix(sync): [AIC-4038] attach a tool or skill to a variation linked to code - #1049
Draft
nkester-ld wants to merge 12 commits into
Draft
nkester-ld wants to merge 12 commits into
nkester-ld wants to merge 12 commits into
Conversation
A variation made by sync prompts link has only a .ref.yaml descriptor, so attach failed reading the missing .prompt.md. Attach now adds the key to the descriptor's top-level tools or skills list, keeping the rest of the descriptor, and writes the attachment file in the same transaction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Attaching a key the descriptor already lists no longer re-renders the list, and the attachment file's display path is repository-relative like the descriptor's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lock baseline of a linked variation fingerprints a projection that includes tools and skills only when the descriptor lists them. Adding a list to the descriptor made LaunchDarkly's side look changed, so a repository-only change planned as a conflict, or as a push that claimed to replace a LaunchDarkly change. Compare LaunchDarkly's side against the baseline without the newly listed fields too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the descriptor newly lists tools that LaunchDarkly already has, the row was in sync and the lock kept the old baseline, so a later change made only in LaunchDarkly was pushed over. Plan a lock update instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A link that rebinds a stale descriptor chooses the action again, which dropped the lock update for a lifted baseline. Decide it in chooseAction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s a list A linked descriptor without a tools or skills list leaves that list in LaunchDarkly alone. The list that attach writes makes sync own it, so it now starts with the keys the variation has in LaunchDarkly, and writes a file for each one the repository has no file for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A seeded tool or skill that already has a local file is only listed in the descriptor, a key LaunchDarkly lists twice is attached once, and a variation that its config does not have seeds nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ew tool Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nked-variation # Conflicts: # internal/sync/prompt/attach.go
…o TBD/nkester/attach-linked-variation # Conflicts: # internal/sync/prompt/acceptance_test.go
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
The bug
ldcli sync prompts attach tool|skillonly knew how to edit.prompt.mdfiles. On a variation linked to code (a.ref.yaml), it failed with a raw filesystem error. The workaround, addingtools:to the descriptor by hand, replaced whatever tools LaunchDarkly already had, and the next plan claimed "the LaunchDarkly change is replaced" when nothing had changed in LaunchDarkly. This PR makes attach work on linked variations, keeps what LaunchDarkly already has, and plans the result as a plain push.Failure and reason for change
attach skillandattach toolon a linked variation failed withinspect variation markdown-bot: lstat …/markdown-bot.prompt.md: no such file or directory. In TL-6, adding the list by hand dropped a tool that had been added in LaunchDarkly. In GAP-2, the push was labeled "the LaunchDarkly change is replaced".What changes
attach tool lookup --to <linked variation>lstat … .prompt.md: no such file or directorytools:to the.ref.yaml, pushes, pins the versiontools:yet, LaunchDarkly has tool Athe repository owns it, the LaunchDarkly change is replacedtools changedThis folds in what was #1045 (closed), since that wording only shows up after this attach.
Review focus
descriptorAttachmentsininternal/sync/prompt/attach.go.baselineLacksRelationshipsininternal/sync/prompt/plan.go.tools:list still replaces LaunchDarkly's list on the next push. That's unchanged: code owns a list once it exists.Testing
go test ./...and golangci-lint pass on current main. Retested locally on 2026-11-25: SKL-3, TL-5, TL-6 and GAP-2 pass.Ticket: AIC-4038
🤖 Generated with Claude Code
Related Jira issue: AIC-4038: Fix medium sync bugs found in stage testing