Skip to content

fix(registry): generate resource templates without instance uuids - #394

Merged
Xuwznln merged 1 commit into
devfrom
feat/registry-template-no-uuid
Nov 21, 2026
Merged

Xuwznln merged 1 commit into
devfrom
feat/registry-template-no-uuid

Conversation

@Xuwznln

@Xuwznln Xuwznln commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Why

config_info of a PLR resource entry was dumped from a freshly built PLR tree, so every node carried a random uuid, a name equal to that uuid and a parent_uuid, and carrier sites carried random uuid / material_uuid. Every regeneration (cache miss, a new Host, a cache version bump) produced a different definition, and the materials authority stored a new template version although the resource had not changed. A registry entry is a template, not an instance: the authority assigns real uuids when it creates a material (and already drops template site uuids then).

What

  • ResourceTreeSet.dump_templates() dumps the same shape as dump() without instance identity: no uuid / parent_uuid / name on nodes; the parent is parent_id (the parent's PLR id, unique within a PLR tree; null for the root). Site definitions drop uuid / material_uuid / occupied_material_uuid. The same resource definition now dumps byte-identically every time.
  • The registry uses it for config_info. Registry cache version 11 regenerates old cached config_info once (one last template version change per Host, then stable).
  • Legacy cloud upload keeps the old node shape: uuid, name (= uuid) and parent_uuid are derived with uuid5 from (template id, node id), so they are stable across uploads. Nodes that already carry a uuid are passed through.
  • Readers in this repo only use config_info[0].type, config.type and sites, which are unchanged. OpenLabSite does not read config_info.
  • Docs: docs/developer_guide/add_registry.md.

Tests

  • New tests/resources/test_registry_template_config_info.py (5 tests, all fail before this change): two generations are identical and contain no uuid-like string (tip rack and a carrier with sites); parent links via parent_id; registry population plus a stable authority template; legacy upload restores stable, linked uuids.
  • tests/resources + tests/registry + legacy adaptor / graph / materials service tests: 832 passed. 3 tests need the ROS message package and fail the same way on dev without it.
  • Full registry scan: 56 templates, about 4.9k nodes, no duplicate ids within any tree.

config_info was dumped from a freshly built PLR tree, so every node
carried a random uuid, a name equal to that uuid and a parent_uuid, and
carrier sites carried random uuid / material_uuid. Every regeneration
(cache miss, new Host, cache version bump) therefore produced a
different definition and the authority stored a new template version,
although nothing about the resource had changed. The authority assigns
real uuids when it creates a material anyway.

- ResourceTreeSet.dump_templates() dumps the same shape without
  uuid / parent_uuid / name; the parent is parent_id (the parent's PLR
  id, unique within a PLR tree; root is null). Site definitions drop
  uuid / material_uuid / occupied_material_uuid
- the registry uses it for config_info; cache version 11 regenerates
  old cached config_info once
- the legacy cloud upload still gets the old node shape: uuid,
  name (= uuid) and parent_uuid are derived with uuid5 from
  (template id, node id), so they are stable across uploads; nodes that
  already carry a uuid are passed through
@Xuwznln
Xuwznln merged commit 2e772b6 into dev Nov 21, 2026
9 of 10 checks passed
@Xuwznln
Xuwznln deleted the feat/registry-template-no-uuid branch November 27, 2026 13:10
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