Skip to content

Rename a program, a scan or a directory - #15

Merged
bbfrederick merged 1 commit into
mainfrom
exar1-rename
Sep 3, 2026
Merged

Rename a program, a scan or a directory#15
bbfrederick merged 1 commit into
mainfrom
exar1-rename

Conversation

@bbfrederick

Copy link
Copy Markdown
Owner

An archive built from a template inherits the template's program name, and
the console disambiguates on import rather than complaining. The capabilities
load test was seeded from Potpourri_P1 and arrived on the scanner as
Potpourri_P1 (2) — tidy, and also how a generated protocol ends up named
after whichever export happened to seed it.

What it does

Names are not in the protocol. They hang off Instance.LabelElement_id on an
EdfString node holding a locale table, which is precisely what lets a scan
be renamed without re-hashing the content. So rename rewrites that table and
nothing else, and the test asserts the protocols come back byte-identical
rather than merely that the archive still validates.

It works on any named node, which is three useful things:

Node What changes
EdfProgram the protocol name
EdfMeasurementStep a scan name
EdfDirectory where it lands in the tree

Two details

Every entry in the locale table is set rather than the one an export happens
to use: most write "" for the default and some write "en", and both
spellings are in the corpus. Reading only one is what once produced a
nameless tree.

It refuses a node whose label is shared with another. No corpus archive shares
one — checked, zero across every example — but the store is content-addressed
and nothing in the format forbids it, so the alternative is renaming two
things while being asked to rename one.

Testing

2351 passed, 17 skipped. Two new tests: renaming a program leaves every scan
name and every protocol byte-identical, and renaming a scan does the same
while a node with no label of its own is refused.

🤖 Generated with Claude Code

An archive built from a template inherits the template's program name, and
the console disambiguates on import rather than complaining: the capabilities
load test was seeded from Potpourri_P1 and arrived on the scanner as
"Potpourri_P1 (2)". Tidy, and also how a generated protocol ends up named
after whichever export happened to seed it.

Names are not in the protocol -- they hang off Instance.LabelElement_id on an
EdfString node holding a locale table, which is what lets a scan be renamed
without re-hashing the content. So rename rewrites that table and nothing
else, and the test asserts the protocols come back byte-identical rather than
merely that the archive still validates.

Every entry in the table is set rather than the one the export happens to
use: most write "" for the default and some write "en", and both spellings
are in the corpus.

It refuses a node whose label is shared with another. No corpus archive
shares one -- checked, zero across every example -- but the store is
content-addressed and nothing in the format forbids it, so the alternative is
renaming two things while being asked to rename one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@bbfrederick
bbfrederick merged commit c20c882 into main Sep 3, 2026
9 checks passed
@bbfrederick
bbfrederick deleted the exar1-rename branch September 3, 2026 19:26
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