Repository navigation
Conversation
0aed9eb to
84d0406
Compare
| // validateSelections rejects variations that come both from positional | ||
| // selectors and from target flags. | ||
| func validateSelections(selectors []syncdomain.ResourceID, filter syncdomain.Filter) error { | ||
| if err := filter.Validate(syncdomain.KindVariation); err != nil { |
There was a problem hiding this comment.
Add/detach error still names variations
Low Severity
validateSelections now takes a kind so add and detach work for tools and skills, but the error still tells the user to pass variations via --config-key and project-key/config-key/variation-key. Mixing positional selectors with target flags in a tools or skills command therefore names a selector that does not exist in that scope.
Reviewed by Cursor Bugbot for commit 84d0406. Configure here.
There was a problem hiding this comment.
Only sync prompts add and sync prompts detach take positional selectors. The tool and skill commands use cobra.NoArgs and reject one as an unknown command, so this check only runs in the prompts scope, where the variation wording is right.
84d0406 to
d41ab35
Compare
d41ab35 to
31dcddf
Compare
31dcddf to
000e9ee
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ 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 000e9ee. Configure here.
The scope moves from SyncAction to Options, so that every action has it. A sync of prompts, tools, skills, or all kinds plans only its scope. An add or a detach takes resources of the kind of the scope, and the add of tools and skills uses the add from the bootstrap package. A sync of every kind in a repository without sync files fails with a message that names the three add commands. A sync of tools or skills starts its add, as a sync of prompts does. An empty scope names its add command. A sync of prompts notes the tool and skill files that no variation uses, because its plan leaves them out. The note counts paths and reads no file. After a sync of tools or skills pushes a tool or skill, a note names each local variation that repins on the next sync of prompts. Without a terminal, an unresolved conflict outside the prompts scope names only --conflict, because only sync prompts has --resolve.
000e9ee to
5b45276
Compare


Context
Since #939, the sync code has a scope:
prompts,tools,skills, orall. Only the sync uses it, throughSyncAction. Soaddanddetachalways work on variations, and every message talks about prompts. This PR routes sync, add, and detach by scope, so that the next PR only adds the commands.What changes
Scopemoves fromSyncActiontoOptions, so that every action gets it.AddAction.VariationsbecomesResources.sync allfails withNothing to sync in this repository. To start, run ldcli sync prompts add, ldcli sync tools add, or ldcli sync skills add.--resolveonly in the prompts scope, because onlysync promptshas it.No tools are synced in this repository. To start, run ldcli sync tools add.Design notes
ParseManagedPath), so an invalid standalone file never breakssync prompts. Only a prompts plan counts. A tool or skill with a row in the plan, for example a row from the first PR of this stack, is not counted.usedBy, set in the same loop that setsSyncedElsewhere. The repin note is its only user. The other option, a second compile of the variations after the apply, reads the files twice.applyConflictResolutionsnow copies the rows of the plan before it changes them, so the reviewed plan stays as it was.Review focus
Verification
go test ./...andgolangci-lint run(v2.9.0) pass.Runner.Run:TestWritePlanReviewNamesTheAddOfAnEmptyScopechecks the empty-plan message of each scope.Related changes
This stack builds on #937 to #941, which are merged.
ctawiah/fix-prompt-tool-diff-5b1c)ctawiah/plan-referenced-attachments-1e8a)ctawiah/keep-unused-attachments-1e8a)ctawiah/add-attachments-1e8a)ctawiah/route-scopes-1e8a)ctawiah/scope-commands-1e8a)ctawiah/create-attachments-1e8a)ctawiah/create-attachment-flags-1e8a)ctawiah/share-variation-selection-1e8a)ctawiah/create-variations-1e8a)ctawiah/create-variation-flags-1e8a)Note
Overview
Sync, add, and detach are driven by command scope instead of carrying scope only on
SyncAction.Scopelives onOptions;AddActionuses a genericResourceslist validated against the scope’s resource kind.Empty-repo and messaging behavior is scope-aware:
sync allerrors with a combined “nothing to sync” hint; scoped tool/skill sync can bootstrap an add. Empty plans, filter errors, and non-interactive conflict messages point at the rightldcli sync …commands (--resolveonly for prompts).Prompt-only plans count standalone tool/skill files (path-only, respecting filters) and print notes that they’re excluded unless you run
sync all. Tool/skill syncs don’t write variations; after a successful push, repin notes tell users to runsync promptsorsync all. Plans trackusedByfor that flow.Conflict resolution copies the plan before mutating rows so the reviewed plan stays intact. Acceptance tests cover scoped sync, standalone counts, add/detach tools, and shared tool conflicts.
Reviewed by Cursor Bugbot for commit 5b45276. Bugbot is set up for automated code reviews on this repo. Configure here.