Skip to content

feat: rewrite non-canonical model files on pull - #244

Merged
angeloashmore merged 1 commit into
aa/deep-sort-canonicalizefrom
aa/pull-canonical-writes
Jul 30, 2026
Merged

feat: rewrite non-canonical model files on pull#244
angeloashmore merged 1 commit into
aa/deep-sort-canonicalizefrom
aa/pull-canonical-writes

Conversation

@angeloashmore

Copy link
Copy Markdown
Member

Resolves:

Description

Stacked on #243.

Files that matched remote semantically but had non-canonical key order were never rewritten by prismic pull. They stayed non-canonical until a real change arrived, which then buried that change in a full-file reformat diff.

The fix: pull no longer canonicalizes the local side of the comparison. The remote model's canonical form is compared against the local file as parsed. Non-canonical files now count as updates and get rewritten, so files self-heal on the next pull.

status and push keep the semantic comparison. Push has no file bytes to compare against, and reorder-tolerance there prevents no-op version bumps.

Checklist

  • A comprehensive Linear ticket, providing sufficient context and details to facilitate the review of the PR, is linked to the PR.
  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1

In a project with committed model files in non-canonical key order (e.g. written by Slice Machine), run prismic pull. The files should be rewritten in canonical form and reported as updated. A second pull should report "Already up to date."

🤖 Generated with Claude Code

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@angeloashmore
angeloashmore merged commit e87830f into aa/deep-sort-canonicalize Jul 30, 2026
14 checks passed
@angeloashmore
angeloashmore deleted the aa/pull-canonical-writes branch July 30, 2026 00:39
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