Repository navigation
Store a migrated element's name apart from its reference - #299
Merged
Merged
Conversation
[element name and reference stored apart] (Jess Haley, 2026-10-29, did-schema V_eta_go_forward_class_audit.md): +migrators_j/element.m writes the v1 element.name, exactly, to the entity's `name`, and keeps '<name> | <reference>' in local_identifier (did2.convert.elementHandle). The round trip reads the reference as what follows the known name (did2.convert.elementNameReferenceApart), falling back to today's parse for an entity with no `name`. A name that reads as a pair, a non-integer and a text reference now convert; the unpackable-pair carry site is gone. A non-empty v1 base.name, which [v1 name is the entity name] wrote to entity.name, now has no field and is carried with no register row: an open question for the team. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Decided by Jess Haley, 2026-10-30 [element name kept apart, base.name carried] (did-schema V_eta_go_forward_class_audit.md): local_identifier stays '<name> | <reference>', and an element whose v1 base.name is not empty is carried whole as v1, malformed, under register row carry-149. The carry site cites the row; testANonEmptyBaseNameIsCarried expects it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
…s carried The run's migration_notes has no carried_as_v1 field when no document in it was carried (CI on 050744f: 'Unrecognized field name carried_as_v1' in testNameAndReferenceStoredApartRoundTrip, whose elements now convert). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
jesshaley
marked this pull request as ready for review
October 30, 2026 07:31
jesshaley
pushed a commit
that referenced
this pull request
Oct 30, 2026
The one conflict, testRawV1RoundTripElement testCarriedElementsCiteTheirRows: V2 (#299) replaced the carry-055 cases with the carry-120 one; this branch added the carry-151 'unit, probe not in the batch' case. Both kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
jesshaley
pushed a commit
that referenced
this pull request
Oct 30, 2026
Merges origin/V2 (through #311), including #299 [element name and reference stored apart]: carry-055 is gone, a reference neither one number nor one text is carry-120, a non-empty base.name is carry-149, a unit whose probe is not in the batch is carry-151. Conflicts, both sides kept: - +migrators_j/element.m header: V2's element.name / local_identifier rows (carry-048 / carry-120) with this branch's element.type rows (device kind, element type assertion only where the kind does not rebuild the word). - +roundtrip/element.m header: V2's name/reference rows and pre-2026-10-29 fallback with this branch's element.type-from-kind row. - testRawV1RoundTripElement: V2's header row and tests; this branch's testEveryDeviceHasItsDecidedKind and testTheElementTypeAssertionIsKeptOnlyWhereTheKindDoesNotRebuildIt; the carried list is this branch's (stimulator, event, electrode spellings, neuron, cell, lfp, patch on a non-probe class) plus V2's carry-120, carry-048 and carry-151 rows, without the carry-055 rows (V2 converts them) and without the carry-121 rows (batch 2 makes them microscopes). testGroupIsWrittenAsTheRegistryNamesIt and testAUnitThatDisagreesWithItsProbeIsCarried, which #299 removed with no replacement while its header still cites carry-120 for the unit case, are kept. Added on the merge: - resolveEpochProbemap writes the decided recording / imaging mode as the recording observation's method term ([element type is a device kind term], [imaging mode is a method term], [element types batch 1], [element types batch 2], [cell-attached is OBI]): patch-attached OBI:0002179, brightfield-imaging EMPTY:0000300; counter mode_methods_written, rendered by census_digest.py. Test: testMigratorsJRecordingObservation/testTheDecidedModeIsTheObservationsMethodTerm. - testRawV1RoundTripBath/testTheSwitchChangesNoBath compares the carried stimulator element by id only: a carried document is its v1 source as each path spells it (it failed on #304's head, CI run of 41ab1d6). No file cites carry-055 or carry-121. MATLAB has not run on this merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Decisions
schemas/V_eta_go_forward_class_audit.md). A migratedelementwrites its v1 name, exactly, to the entity'sname, andlocal_identifierstays the dataset-unique handle. The reference is read back as what follows the known name. As a result, every name and reference rebuilds, including a name that contains " (ref " or " | ". No new term and no schema change. carry-055 is no longer needed.local_identifierstays NDI's<name> | <reference>, the form built since [element local identifier is name and reference]; the earlier line's(ref N)wording was a wrong premise. An element whose v1base.nameis not empty is carried whole as v1, as malformed, under the new register row carry-149. ndi.element/newdocument writesbase.nameas'': at NDI-matlab main 441530d0,+ndi/element.mnewdocument sets onlyelement.*.Dependency: carry-149 is on did-schema branch
claude/ecstatic-pascal-md91fw(75db7c9), not yet onmain. This repository's CI reads did-schemamain, or a branch with the same name. Until carry-149 reachesmain, the "Every carry note cites a carry register row" step fails its R1 check: the code cites a row that main's register does not have. Merge the did-schema side first.Change
+migrators_j/element.m:name= v1element.name, exactly; nothing is written when the name is empty.local_identifierwith the newdid2.convert.elementHandle. An integer reference produces the same text as before (int2str, aselementLocalIdentifierand NDI's display form write it). A non-integer reference is written withnum2str(x,17), and a text reference verbatim.base.name: carry-149, note[carry-149] malformed: ....did2.convert.elementNameReferenceApart(entityName, localId): whenlocal_identifierstarts with the entity'sname, it reads the reference after it (| X, or(ref X)). Otherwise, and for an entity with noname, it falls back to today'sdid2.convert.elementNameReference.+roundtrip/element.m:element.namefrom the entity'snameand the reference from what follows it, and rebuildsbase.nameas''.name, or anamethat does not start itslocal_identifier. Its name and reference come from the old parse, andbase.namefromentity.name.+roundtrip/private/manifestProbemap.m: reads the instrument's name and reference the same way.epochMint.m/resolveEpochProbemap.m: the probe-map join key now comes fromelementHandle, so it matches the identifiers that elements now get.elementLocalIdentifier.m/elementNameReference.mare kept as mirrors of NDI's; their headers now point to the new functions. ThejBaseName.mheader is updated.Tests
testRawV1RoundTripElement:testNameAndReferenceStoredApartRoundTrip. These elements convert and round-trip exactly, withentity.namechecked:leftcortex (ref 3)with reference 2, and with no reference;leftcortex | 2with no reference, and with reference 5;These cases are inverted from the carry-055 rows of
testCarriedElementsCiteTheirRows. That test now has a carry-120 row for a non-scalar reference.testAnEntityWithoutNameReadsByTheOldParse: an entity with nonamestill round-trips in both the| 2and(ref 2)forms. So does a pre-change entity whosenameis itsbase.name.testABaseNameIsTheEntityNameis replaced bytestANonEmptyBaseNameIsCarried. The new test expects a non-emptybase.nameto be carried under[carry-149] malformed:. It keeps the old test's other checks: an emptybase.nameconverts,entity.nameis the element name, and the device validates.testTheLocalIdentifierIsNameBarReferencealso checksentity.name.testMigratorsJ: three bath tests gave their stimulator elementbase.name'stimulator'. That value was incidental and is not one the writer produces. These fixtures now use'', as the writer does, so the stimulator is not carried.check_carry_citations.pyOK, with no carry-055 site left.check_migrator_roster.pyOK. The quick workflow's python tool tests pass.Not run locally: no MATLAB. CI is the only MATLAB run.
Known limit
A document migrated before this change is misread in one case: its
entity.nameholds itsbase.name, and that text happens to start itslocal_identifier. The round trip then reads it as the new layout and rebuildsbase.nameas''. This has not been measured on the corpora.Follow-up needed in NDI-matlab (separate PR)
+vintage/elementFields.m,elementDoc.mandelementNameReferencemust read the element name from the entity'snamefirst and take the reference after it, falling back to the old parse. Until then, NDI splitslocal_identifieralone, which goes wrong for elements that now convert but used to be carried:|with no reference;NDI's
elementLocalIdentifierprobe-map joins have the same gap.🤖 Generated with Claude Code
https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf