Skip to content

feat(sync): render attachment-aware review output - #842

Open
ctawiah wants to merge 1 commit into
ctawiah/sync-attach-workflowfrom
ctawiah/sync-attachment-review-output
Open

ctawiah wants to merge 1 commit into
ctawiah/sync-attach-workflowfrom
ctawiah/sync-attachment-review-output

Conversation

@ctawiah

@ctawiah ctawiah commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Context

Tool and skill changes are reviewed as part of the variation that references them. This layer updates the terminal output so users can see that relationship clearly and understand exactly what will change before confirming a sync.

What changes

  • Groups sync output by project, config, and variation.
  • Shows every tool and skill as a separate child of its variation instead of combining several attachments into one diff.
  • Labels stable keys consistently so names and identifiers are easy to distinguish.
  • Uses indentation to make the resource hierarchy clear in the terminal.
  • Renders attachment content in a readable form instead of showing raw API JSON.
  • Keeps side-by-side diffs focused on the lines around a change.
  • Separates variation content changes from tool and skill content changes.
  • Avoids showing an empty-field difference when omitted maps are semantically the same as empty maps returned by LaunchDarkly.

Review focus

  • Is it clear which config and variation own each attachment?
  • Can a user distinguish several tools or skills attached to the same variation?
  • Are the side-by-side diffs concise without hiding useful context?
  • Do no-change variations avoid displaying misleading content differences?
  • Does the output remain readable in both interactive and non-interactive terminals?

Verification

  • go test ./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
Reworks sync plan review output so project → config → variation hierarchy is obvious in the terminal, with bold headings and deeper indentation for actions and errors.

Tool and skill changes are no longer one blob of JSON or a collapsed “whole variation” diff. Each attachment is its own section (e.g. Tool "my-first-tool" (added)), with readable fields (description, schema, markdown) and (not attached) when missing; unchanged attachments are skipped. Tool/skill diffs drop @@ hunk lines, and unified diffs use 1 line of context instead of 3 for tighter side-by-side output.

Adds tests covering attachment rendering, per-skill sections, config grouping, and diff context.

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

@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.

Stale Bugbot comment from a previous run.

Comment thread internal/sync/prompt/diff.go
@ctawiah
ctawiah force-pushed the ctawiah/sync-attachment-review-output branch from 4e9f066 to 6fee270 Compare October 7, 2026 15:41
@ctawiah
ctawiah force-pushed the ctawiah/sync-attachment-review-output branch from 6fee270 to 1a2e390 Compare October 7, 2026 15:44

@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 1a2e390. Configure here.

}
if outputKind == "markdown" {
_, _ = fmt.Fprintf(&rendered, "\n#### %s (%s)\n\n", section.title, section.change)
_, _ = fmt.Fprintf(&rendered, "```diff\n%s\n```\n", strings.Join(diffLines, "\n"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Markdown skill diffs break code fences

Medium Severity

Markdown review wraps skill diffs in a diff fence while skill bodies are emitted as raw markdown. An unchanged closing fence line from the skill becomes a CommonMark closer (three leading spaces plus backticks) and terminates the outer fence, so later diff lines render as broken markdown.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1a2e390. Configure here.

}
_, _ = fmt.Fprintf(rendered, "\n%s%s:", padding, key)
for _, item := range nested {
_, _ = fmt.Fprintf(rendered, "\n%s- %v", strings.Repeat(" ", indent+2), item)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nested schema objects dump as Go maps

Low Severity

writeDiffMap prints JSON Schema arrays with %v, so nested objects and nulls show up as Go values like map[type:string] and <nil>. Tool schemas that use anyOf, oneOf, or prefixItems are less readable than the JSON they replaced, and null defaults are easy to misread.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1a2e390. 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