Skip to content

fix(sync): guarantee prompt fingerprint convergence - #836

Open
ctawiah wants to merge 2 commits into
ctawiah/AIC-3487/confirm-destructive-watch-actionsfrom
ctawiah/AIC-3485/prompt-fingerprint-round-trips
Open

ctawiah wants to merge 2 commits into
ctawiah/AIC-3487/confirm-destructive-watch-actionsfrom
ctawiah/AIC-3485/prompt-fingerprint-round-trips

Conversation

@ctawiah

@ctawiah ctawiah commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Context

Prompt sync uses fingerprints to decide whether local and LaunchDarkly variations still represent the same state. Equivalent API defaults could produce different fingerprints, and an omitted custom model version previously could not converge with the concrete version stored by LaunchDarkly.

What changes

  • Normalize only equivalent API defaults: absent versus empty parameters and custom maps.
  • Treat an omitted custom model version as “follow latest” at sync time; explicit versions remain pinned.
  • Fetch the exact model config by key, which returns its latest version without listing the project catalog.
  • Resolve that authored intent before planning, while leaving the local file unchanged.
  • Revalidate the complete plan once after confirmation instead of rereading every resource before its write.
  • Preserve the existing verification read for uncertain writes whose response may have been lost.

For example, this authored intent remains unchanged:

modelConfigKey: claude-prod

If the current version is 4, sync plans and applies the effective variation with modelConfigVersion: 4. A later model-config release is picked up by the next sync.

Verification

  • go test ./internal/sync/...
  • go test ./...
  • go vet ./internal/sync/... ./cmd/sync
  • Create and update convergence acceptance tests
  • 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
Fixes prompt sync so equivalent LaunchDarkly API shapes and “follow latest” model configs stop causing endless drift.

Fingerprinting now strips only API-noise defaults—empty parameters and custom maps—while still treating other empty model fields (e.g. metadata) as meaningful.

Model config intent: omitted modelConfigVersion means follow latest. Planning calls the new ModelConfig GET-by-key, resolves version and merged model in memory, and pushes the resolved version on create/update to the server. Local files keep version 0 on pull when follow-latest is intended; LocalFollowsLatestModelConfig drives that behavior and local verification fingerprints.

Concurrency: per-write verifyResourceUnchanged is removed; the runner still re-plans once after confirmation via samePlanState. Uncertain server writes still verify with a read.

Watch mode: non-destructive plans auto-apply without --yes; archives/deletes still prompt (or need --yes). Confirmation respects cancel via context; watch no longer forces Yes: true on each tick.

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

@ctawiah
ctawiah force-pushed the ctawiah/AIC-3485/prompt-fingerprint-round-trips branch 3 times, most recently from 0f595e5 to b72f419 Compare October 1, 2026 03:50
@ctawiah
ctawiah marked this pull request as ready for review October 1, 2026 03:53
@ctawiah
ctawiah requested a review from a team as a code owner October 1, 2026 03:53

@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 2 potential issues.

Fix All in Cursor

❌ 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 b72f419. Configure here.

Comment thread internal/sync/prompt/model_config.go Outdated
Comment thread internal/sync/prompt/execute.go
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.

1 participant