Skip to content

fix(gitops): ignore latestVersion in sync (PRISM-2772) - #116

Open
dhruva-vapi wants to merge 2 commits into
mainfrom
dr/latest-version-sync
Open

dhruva-vapi wants to merge 2 commits into
mainfrom
dr/latest-version-sync

Conversation

@dhruva-vapi

@dhruva-vapi dhruva-vapi commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

PRISM-2772

A publish or rollback to identical settings can look like an edit because the API's top-level latestVersion was written into files and included in their hashes. That could block a legitimate local edit or produce a false conflict for a file using shared blocks.

How it works

  • Treat the top-level pointer as read-only metadata for assistants, tools, and squads. Pull omits it, drift ignores it, and normal POST/PATCH payloads strip it (including promotion's apply step). Nested config and assistant version labels are unchanged.
  • Keep an existing baseline through automatic push bootstrap. If a legacy hash exactly matches a complete config with a version value still visible in the file or API response, it can prove that side hasn't changed. If neither side matches and the configs differ, the normal conflict flow still blocks the overwrite. A blocked handoff tool doesn't get a later destination PATCH.
  • Drift checks use the expanded TypeScript config with credential names. The API request uses resolved UUIDs.
  • No tracked-state migration, snapshot replay changes, or promotion file rewrites.

Verification

Loopback fixtures in both state layouts reproduced version-only drift and a blocked local edit on main. With this change, the same cases stay clean or allow the local edit, while real and ambiguous conflicts still stop the write. The apply and promote fixtures check outgoing payloads and the published assistant version labels.

The scoped push regression test reproduced both-diverged with a named credential, a shared prompt and identical config across three version pointers. It now verifies that the PATCH sends the credential UUID and the expanded prompt, and that push refreshes the normalized baseline.

On a clean checkout with Node 22, npm run build and npm test passed (806 tests). Biome passed across the changed TypeScript files, and actionlint passed.

Link to Devin session: https://app.devin.ai/sessions/30f6e4ce30c441c689d8f958698b7c93
Open in Devin Desktop: https://app.devin.ai/desktop/session/30f6e4ce30c441c689d8f958698b7c93?variant=devin
Requested by: @dhruva-vapi

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Devin Review

🟢 Devin Review found nothing to fix · View findings

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@scott-lowe-vapi scott-lowe-vapi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please fix the false drift for TypeScript resources that use named credentials before merging.

Comment thread src/drift.ts
if (localHash === platformHash) {
const { direction, platformHash } = compareResourceDrift({
local: options.loadedTypeScriptData
? localResourceContent(resourceType, options.loadedTypeScriptData)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Push has already replaced credential names with UUIDs here, while the dashboard hash uses names. I reproduced both-diverged with identical assistant config, v1 in the file, v2 in the baseline, and v3 on the dashboard. Please hash the expanded TypeScript config before credential resolution and cover this case in the push test.

@graphite-app

graphite-app Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Merge activity

  • Dec 4, 12:23 AM UTC: This pull request can not be added to the Graphite merge queue. Please try rebasing and resubmitting to merge when ready.
  • Dec 4, 12:23 AM UTC: Graphite disabled "merge when ready" on this PR due to: a merge conflict with the target branch; resolve the conflict and try again.

dhruva-vapi and others added 2 commits December 6, 2026 10:23
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