Skip to content

#509: distinct uuid for listReducerToSpreadObject, guard against duplicate instance uuids - #606

Merged
miroir-framework merged 1 commit into
_integrationfrom
claude/509-duplicate-transformer-uuid
Oct 30, 2026
Merged

miroir-framework merged 1 commit into
_integrationfrom
claude/509-duplicate-transformer-uuid

Conversation

@miroir-framework

@miroir-framework miroir-framework commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Requested by A · project thread

Closes #509

What changes

  • listReducerToSpreadObject takes the uuid of its file name, 0894ed4f-ca11-4b04-878d-471d1d780fac. It shared 8ddb7e2e-… with indexListBy, so a uuid-keyed store kept only one of the two. No code refers to either definition by uuid (index.ts imports both by path), so no other reference changes.
  • New guard scripts/check_instance_uuids.py (npm run check:uuids). It fails when two tracked instances in one Entity folder of a deployment (packages/**/<entityUuid>/*.json) share a uuid. It skips folders of Entities whose idAttribute is not uuid, and fails on a file that is not valid JSON. A pytest test runs it on the repository, so the existing pytest scripts/tests step of the pre-push gate and of pr-checks.yml enforces it.
  • The guard found a second duplicate. miroir_modelVersion/c3f0facf…/695826c2-…-dee46fe21c1.json was a copy of the Initial ApplicationVersion …dee46fe21c13.json under a truncated file name, with only whitespace differences. The copy is removed and index.ts imports …c13.json. MIROIR_VERSION_HISTORY_PARENTS drops from 2 to 1 for that folder, since the filesystem store had returned the copy as a second row.

Why a Python guard and not a modelValidation test: miroir-app-miroir's modelValidation builds its plan from defaultMiroirMetaModel, which has no TransformerDefinition instances, and modelValidation runs only in nonreg. Details and the rejected options are in code-helpers/features/509-FIX-duplicate-transformer-definition-uuid/analysis.md. The TDD plan sits next to it.

Postgres, IndexedDB and MongoDB stores seeded before this change hold one of the two definitions under 8ddb7e2e-…. They get 0894ed4f-… once reseeded.

Out of scope: 14 files whose name differs from their uuid without a collision (listed in the analysis). A later issue can enforce file name == uuid.

Checks

🤖 Generated with Claude Code

https://claude.ai/code/session_01BHqqe1gocM9Y9mjwK9YX3H

…icate instance uuids

listReducerToSpreadObject shared uuid 8ddb7e2e-… with indexListBy, so uuid-keyed
stores kept only one of them. It now takes the uuid of its file name, 0894ed4f-….

scripts/check_instance_uuids.py fails when two tracked instances of one Entity
folder share a uuid; a pytest test runs it on the repository, so the pre-push
gate and pr-checks enforce it. It also found a second duplicate: a copy of the
Initial ApplicationVersion under a truncated file name, now removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BHqqe1gocM9Y9mjwK9YX3H
@miroir-framework miroir-framework self-assigned this Oct 30, 2026
@greptile-apps

greptile-apps Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Gives listReducerToSpreadObject its own UUID and removes a duplicate ApplicationVersion file.

  • The list reducer now has its own UUID in the Miroir model.
  • The initial application version now comes from one asset.
  • A repository check catches repeated instance UUIDs in deployment assets.

Scope acknowledged by miroir-framework: existing seeded stores need reseeding; filename/UUID mismatches without collisions remain deferred.

Reviews (1) · Last reviewed commit: "#509: distinct uuid for listReducerToSpr..." · Reviewed by Greptile

@miroir-framework
miroir-framework merged commit 9da63cb into _integration Oct 30, 2026
4 checks passed
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.

TransformerDefinitions indexListBy and listReducerToSpreadObject share a uuid

2 participants