Skip to content

feat(sync): add searchable attachment API foundation - #839

Merged
ctawiah merged 1 commit into
mainfrom
ctawiah/sync-attachment-foundation
Oct 7, 2026
Merged

ctawiah merged 1 commit into
mainfrom
ctawiah/sync-attachment-foundation

Conversation

@ctawiah

@ctawiah ctawiah commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Context

This stack adds support for attaching LaunchDarkly tools and skills to prompt variations that are synchronized with repository files. This first layer adds the API and interactive search behavior the rest of the stack builds on. It does not write attachment files or change how variations are reconciled yet.

What changes

  • Uses the existing sync API client for projects, configs, model configs, tools, and skills.
  • Searches projects, configs, tools, and skills through their backend APIs instead of loading every result before showing a selection.
  • Adds a shared paginated search prompt that keeps filtering and scrolling consistent across sync flows.
  • Defines the common tool and skill shapes used by later layers.
  • Adds API operations for reading, searching, creating, and updating tools and skills.
  • Shows stable resource keys clearly when users select projects, configs, and variations.

Review focus

  • Does the shared search flow work cleanly for projects, configs, tools, and skills?
  • Are backend filters and pagination passed through correctly?
  • Do the attachment API types include only the data later sync layers need?
  • Is this layer independent from local attachment storage and reconciliation?

Verification

  • go test ./internal/sync/api ./internal/sync/interactive ./internal/sync/bootstrap ./internal/sync/link ./internal/sync/prompt
  • go test ./...
  • git diff --check

Related changes

Review the stack in this order:

  1. Confirm destructive watch actions
  2. Guarantee prompt fingerprint convergence
  3. Add searchable attachment API foundations
  4. Reconcile variation attachments
  5. Attach tools and skills to variations
  6. Render attachment-aware review output
  7. Safely clean unreferenced attachments
  8. Persist sync manifests in LaunchDarkly

Note

Overview
Adds server-paginated catalog and attachment APIs on the unified sync Client, plus a reusable SearchSelect TUI so bootstrap and link no longer fetch entire project/config lists up front.

Catalog: Projects/Configs full-list helpers and CatalogClient are removed in favor of SearchProjects and SearchConfigs returning Page[T] with limit, offset, and API filter strings (including config mode filters used when linking by prompt mode).

Attachments: New domain types (Tool, Skill, Attachment, AttachmentRef) and API methods to search, read, create (tools only), and patch tools/skills. Tool search re-fetches each hit so results reflect the latest version; mutations send empty fields/collections to clear remote values. Shared newResourceMutationError / IsNotFound support later reconciliation.

Interactive UX: Slash-triggered search, “Load more,” alt-screen forms, taller lists, and clearer Key: labels in choice descriptions.

Reviewed by Cursor Bugbot for commit c33b971. Bugbot is set up for automated code reviews on this repo. Configure here.

@ld-ahartmann ld-ahartmann left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not diving too deep but all looks reasonable here

@ctawiah
ctawiah force-pushed the ctawiah/sync-attachment-foundation branch 2 times, most recently from 171d01b to d49b3db Compare October 7, 2026 15:44
@ctawiah
ctawiah force-pushed the ctawiah/sync-attachment-foundation branch from d49b3db to 47f099b Compare October 7, 2026 23:33
Base automatically changed from ctawiah/AIC-3485/prompt-fingerprint-round-trips to main October 7, 2026 23:34
@ctawiah
ctawiah force-pushed the ctawiah/sync-attachment-foundation branch from 47f099b to c33b971 Compare October 7, 2026 23:34
@ctawiah
ctawiah merged commit ef8ffb0 into main Oct 7, 2026
10 checks passed
@ctawiah
ctawiah deleted the ctawiah/sync-attachment-foundation branch October 7, 2026 23:37

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit c33b971. Configure here.

model.rebuildList(page.offset > 0)
if page.offset > 0 {
model.list.Select(previousCount)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Load-more cursor can go out of range

Low Severity

After a Load more fetch, receivePage always moves the cursor to previousCount, including when the new page is empty. hasMore treats a missing totalCount as unknown and offers Load more on a full page, so the last page can request another page, get zero items, drop the Load more row, and leave Index() past the end of the list. SelectedItem() then returns nil and Enter does nothing.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c33b971. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants