Skip to content

Migration phase 2: 72 of 95 migrators read raw v1, each with a round-trip check - #253

Merged
jesshaley merged 62 commits into
V2from
claude/phase2
Oct 27, 2026
Merged

jesshaley merged 62 commits into
V2from
claude/phase2

Conversation

@jesshaley

Copy link
Copy Markdown
Collaborator

This is phase 2 of the plan for a complete generic migration (did-schema docs/V2_PLAN.md). It builds the decisions by Jess Haley recorded in did-schema schemas/V_eta_go_forward_class_audit.md: [migrators read raw v1], [renames carry is temporary], [migration reliability practices] (a: a round trip per class; b: deterministic ids), [early migration pieces fixed], and the class-level decisions listed below.

What changes

  • Raw v1 reading.
    • 72 of the 95 +migrators_j migrators now read the v1 document exactly as NDI's template and writer define it. The switch is did2.convert.rawV1Classes, which lists v1 spellings and holds one mapping table.
    • The shared readers are +v1read/ (readDependsOn, readBase, readApp, readStamp) and jRawBody / jRawAccount / jRawCarry.
    • A carry returns the untouched v1 source.
  • A round trip per class. +roundtrip/<class>.m inverts each switched class. roundtrip.check reports what was lost, invented or unplaced.
    • 22 testRawV1RoundTrip<Family> suites check writer-shaped fixtures. Where possible these are the writers' own stored outputs, or NDI templates copied verbatim from locked main 3cb19a8.
    • Every lost path must be a listed known finding.
    • The raw path and the old renamed path must agree.
  • No silent drops. A field outside the NDI template now carries the document under carry-100 ([fields outside the template are malformed], 2026-10-27). These fields used to be dropped.
  • Deterministic ids for documents with no base block (mintKey).
  • Decisions built here:
    • [element local identifier is name and reference] (<name> | <reference>);
    • [element types have no default], [electrode spellings and imaging types are devices], [event lines and environment probes are devices];
    • [sorted units are cells or groups], [unlabelled units need a map];
    • [dependents of a carried document carry] (carryDependents; one record per carried source).
  • ontologyLabel by either class name. The DID side of this uses the isOntologyLabelClass helper, mirroring NDI's from #1076.
  • Tests that were never running now run: four test files that quick CI silently left out (parse errors and arguments blocks on teardownOnce).
  • Removed: old +migrators wrappers that nothing reaches, including calcCommon and the tuning, spike, bath and position wrappers.

Not switched (23)

The list, each with its reason, is in rawV1Classes.m under NOT LISTED:

  • openMINDS: waiting on the team;
  • simple_calc, image, control_stimulus_ids;
  • the spike classes that carry an app block;
  • the classes whose batch readers still compare the old name;
  • pyraview;
  • classes with no writer.

Their open questions are items 14, 23 and 24 of the plan's "Waiting for Jess". universalRenames, ensureClassBlocks and the superclass migrators those classes still reach stay until those classes switch.

Pairing

NDI-matlab #1078 (claude/phase2) updates one NDI test fixture for [element types have no default] and adds the ontology-label test. NDI e2e paired with this branch: run 40467734314, 509 passed, 0 failed.

CI on 2599d51


Generated by Claude Code

claude added 30 commits October 26, 2026 23:37
…ubject family switched

Phase 2 of the generic migration, on a small scale (Decided by Jess Haley,
2026-10-26: [migrators read raw v1], [migration reliability practices] (a);
did-schema V_eta_go_forward_class_audit.md).

- +did2/+convert/+v1read: readDependsOn, readBase, readApp, readStamp read
  the raw v1 document as NDI's templates (locked NDI-matlab main 3cb19a8)
  define it, and drop nothing: a losing depends_on key, a version, both app
  spellings, fields outside the template come back in other/extra.
- did2.convert.rawV1Classes: the classes whose migrator takes raw v1.
  v1_to_v2 hands those to their +migrators_j migrator without
  universalRenames or superclass migrators; a carry is the untouched v1
  source. Counted as legacy_ndi_document.bodies_read_raw_v1 (in the
  denominator). Option 'RawV1Classes' ({} = everything as before).
- +did2/+convert/+roundtrip: check rebuilds the v1 document from the
  emitted V2 documents with the class's inverse and compares leaf by leaf
  (matched / not set / restated / exempt / lost / invented / unplaced).
- subject and subject_group switched, reading through the helpers; carries
  keep citing carry-033 / carry-034.
- Tests: testV1Read, testRawV1RoundTrip (NDI writer shapes; two broken
  inputs the round trip must catch; the raw path emits the same converted
  documents as the renamed path).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Phase 2 of the generic migration, second family (Decided by Jess Haley,
2026-10-26: [migrators read raw v1], [migration reliability practices] (a);
did-schema V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + treatment, treatment_drug, treatment_transfer,
  virus_injection. Each migrator reads the raw document through jRawBody
  (identity by v1read.readBase, a legacy ndi_document-only identity as the
  renamed path gave it) and returns the untouched v1 source when it carries.
  treatment.m reads NDI's `ontologyName` (then `ontology_name`); the other
  three already read the v1 camelCase spellings first.
- +roundtrip: inverses for the four classes (treatmentParts / treatmentRows
  rebuild the mixture rows from chemicals, formulation and dose); check.m
  gains spec.same (a field kept in another notation: a mixture table's rows,
  a CURIE's prefix case; [spelling is notation]) reported as `equivalent`.
- Fixtures: NDI templates treatment, treatment_drug, treatment_transfer,
  virus_injection copied verbatim from locked NDI-matlab main 3cb19a8.
- testRawV1RoundTripTreatment: writer shapes (treatmentMaker with the vhlab,
  Birren and Babu rows; table2treatment; Haley; Dabrowska) round trip with
  their lost fields listed EXACTLY as known findings (open questions, no
  rule made); the raw path converts every writer and DID-side fixture as
  the renamed path did; three broken inputs must fail the round trip.
- testConvertV1ToV2 / testRawV1RoundTrip: tests about the universalRenames
  path pass 'RawV1Classes', {} or use an unswitched class.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
… legacy-identity difference

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
… mints random ids on either path)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Practice (b) of [migration reliability practices] (Jess Haley, 2026-10-26,
did-schema V_eta_go_forward_class_audit.md): v1_to_v2 keyed each source's
mint context on base.id alone, so a pre-2023 document whose identity is only
in `ndi_document` (or a document with no id) minted RANDOM ids on every run.
did2.convert.mintKey keys it on base.id, else the legacy block's id (`id`,
then the 2019 `document_id` / `document_unique_reference`), else the
document's canonical JSON.

Tests: testMintId (the key's order; a base-less treatment converted twice
gives identical ids on both paths); testRawV1RoundTripTreatment's legacy
identity test compares the minted ids directly again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
…nts of a carry carry

Decided by Jess Haley, 2026-10-26 (did-schema V_eta_go_forward_class_audit.md):
[migrators read raw v1], [migration reliability practices] (a), and

- [element local identifier is name and reference]: local_identifier is
  '<name> | <reference>' (did2.convert.elementLocalIdentifier /
  elementNameReference, mirrors of NDI-matlab ndi.vintage's on claude/phase3
  471cd5c66); not reversible -> carried (carry-048 / carry-055). epochMint
  and resolveEpochProbemap join probemap rows with the same function.
- [element types have no default], [electrode spellings and imaging types are
  devices], [event lines and environment probes are devices]: a device only
  for a registered probe type (NDI probetype2object.json) or a spelled
  electrode on an ndi.probe.* class; anything else carried (carry-063).
- [sorted units are cells or groups], [unlabelled units need a map]: a
  sorted unit is a cell (single) or group (multi) by the batch's
  neuron_extracellular quality_label (did2.convert.unitQualityLabels;
  v1_to_v2 'UnitQualityLabels' for a label from outside the batch); no label
  or conflicting labels -> carried (carry-062).
- [dependents of a carried document carry]: v1_to_v2 carries, down the chain,
  a converted source whose depends_on edge names a source carried in the
  batch (carry-064).
- element added to did2.convert.rawV1Classes; +roundtrip/element.m;
  testRawV1RoundTripElement (writer shapes from element.json; lost fields
  listed as known findings). Tests whose fixtures the decisions change are
  inverted or given their sorting-run label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
… registry spelling of Numeric Value

carryDependents follows no carry that only hands a document to NDI's second
pass (stimulus_presentation, carry-045; daqmetadatareader_epochdata_ingested,
carry-046): those are converted there, so an edge to them is not an edge to a
v1 document. The treatment round trip and testMigratorsJ read the condition's
variable as did-schema main now registers it (NCIT:C81274 "Numeric Value").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
NDI-matlab V2 (#1074) calls ndi.migrate.internal.carryRowOf from local.m, so
testBatchPassWiring measured a new NDI-only name with no row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Conflicts: testMigratorsJ's Numeric Value check takes phase1's regName form;
testBatchPassWiring keeps phase1's carryRowOf row (this branch's duplicate
row dropped).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Decided by Jess Haley, 2026-10-26 (did-schema V_eta_go_forward_class_audit.md):
[migrators read raw v1], [migration reliability practices] (a).

- element_epoch added to did2.convert.rawV1Classes. The migrator reads the
  raw document through jRawBody, writes depends_on as {name, document_id}
  (the shape the batch passes read; an entry universalRenames would have
  discarded is carried, carry-049, as the renamed path carried it), and
  returns the untouched v1 source when it carries ([small unread settings]
  (4), carry-009 / carry-038).
- +roundtrip/element_epoch.m rebuilds the v1 document from the
  acquisition_epoch carrier (clocks -> epoch_clock / t0_t1, element_id,
  epochid, files). The batch dissolution (epochMint, resolveEpochProbemap:
  [device clocks on one epoch], [untied epochs keep the session anchor]) is
  unchanged and not inverted here.
- Fixtures: NDI templates element_epoch.json, epochid.json (locked main
  3cb19a8). testRawV1RoundTripElementEpoch: writer shapes (one clock, two
  clocks, a file_info) round trip with nothing lost; a mismatched t0_t1 is
  carried untouched; the epoch of a carried element is carried (carry-064);
  the raw and renamed paths make the same carrier.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
ensureClassBlocks reads document_class.superclasses by class_name; a raw v1
document names them by definition path only (universalRenames derived the
name). The carrier now lists them by name (v1read.readStamp); the V_eta chain
is rebuilt from the class name as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Decided by Jess Haley, 2026-10-26 (did-schema V_eta_go_forward_class_audit.md):
[migrators read raw v1], [renames carry is temporary], [migration reliability
practices] (a).

- stimulus_response_scalar and stimulus_response_scalar_parameters_basic added
  to did2.convert.rawV1Classes (one line each; v1 spelling = migrator name).
  No superclass migrator exists for `stimulus_response`,
  `stimulus_response_scalar_parameters` or `base`, so nothing is folded or
  deleted.
- The response migrator reads the raw document (edges by name in v1's `value`
  key, identity through jRawBody for a legacy-only ndi_document); every carry
  and passthrough returns the untouched v1 source. What universalRenames would
  have discarded (a depends_on version or second id, ndi_document beside base,
  an app name conflict, a camelCase twin of a field read) is carried,
  carry-049, as the renamed path carried it (private/jResponseRenameCollisions).
- The parameters migrator stays a pass-1 passthrough that
  resolveResponseParameters turns into a `method`; it carries the same
  collisions (carry-049).
- ensureClassBlocks names a v1 superclass by its definition path when it has
  no class_name (a switched class's passthrough is not renamed).
- +roundtrip/stimulus_response_scalar.m (converted calculation + anchor +
  software [+ the epoch entity], or a passthrough) and
  +roundtrip/stimulus_response_scalar_parameters_basic.m (pass-1 passthrough,
  or the batch pass's method with the responses using it).
- NDI templates stimulus_response*.json copied verbatim from locked main
  3cb19a8. testRawV1RoundTripStimulusResponse: writer shapes from
  ndi.app.stimulus.tuning_response (the only writer) are carried, carry-050,
  and round trip; the converted DID-side shape round trips; lost paths equal
  the listed known findings; broken inputs fail; raw and renamed paths agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
… output

Phase 2 of the generic migration, the tuning family (Decided by Jess Haley,
2026-10-26: [migrators read raw v1], [early migration pieces fixed] (1),
[migration reliability practices] (a); did-schema
V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + tuningcurve_calc, contrasttuning_calc,
  oridirtuning_calc, spatial_frequency_tuning_calc,
  temporal_frequency_tuning_calc, contrastsensitivity_calc (the v1
  spellings). ONE table maps contrasttuning_calc -> contrast_tuning_calc and
  contrastsensitivity_calc -> contrast_sensitivity_calc, to go when
  universalRenames is deleted and the migrators are renamed;
  v1_to_v2 dispatches through it.
- The six migrators read the raw document (jRawBody; a carry is the untouched
  v1 source). contrast_sensitivity_calc reads its result block by the
  document's own class name. jCalculation 'AccountForEveryField' (these six
  only): a field the fold reads nowhere (tuningcurve_calc.log and
  stim_property_list, a calculator-block field, an app field outside app.json
  or two differing spellings via v1read.readApp, an edge the calculation
  does not write, another top-level block, an unread contrastsensitivity
  field) carries the document (carry-056) instead of being dropped.
  jTuningCurve: an unread `significance` field is unplaced too.
- The old +migrators wrappers for the six classes are deleted: never reached
  (each class has a +migrators_j migrator; no v1 class names them as a
  superclass). testMigrators: testTheOldTuningWrappersAreGone.
- +roundtrip: inverses for the six classes (calcParts, tuningInverse,
  tuningBlock, fitBlocks, rawCurveBlock, csfBlock, methodParameters).
- Fixtures: the NDI and NDIcalc-vis templates verbatim (NDI-matlab 3cb19a8,
  NDIcalc-vis-matlab 00e3e0f), and each calculator's stored self-test output
  (mock.N.json) verbatim as the writer shape.
- testRawV1RoundTripTuning: writer outputs and corpus-vintage variants round
  trip with nothing lost (oridir and contrast sensitivity convert; the other
  four carry); the converted shapes of the other four round trip; both
  spellings dispatch to the same documents; raw and renamed paths agree;
  unread fields carry; broken inputs fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Decided by Jess Haley, 2026-10-26 (did-schema V_eta_go_forward_class_audit.md):
[migrators read raw v1], [renames carry is temporary], [migration reliability
practices] (a), [image file details placed], [one-reading quick answers] (Q3),
[dependents of a carried document carry].

- imageStack added to did2.convert.rawV1Classes (one line), with its row in
  the v1 name -> migrator table (imageStack -> image_stack). The table also
  maps ontologyLabel -> ontology_label, for a caller that passes it.
- +migrators_j/image_stack.m reads either spelling (the raw imageStack /
  imageStack_parameters blocks and formatOntology, or the renamed ones a v1
  `image` still arrives with). On the raw path: what universalRenames would
  have discarded carries the document, carry-049; the superclass migrator's
  timestamp refusals run on the raw block (it is called, not copied: the v1
  `image` still uses it); identity through jRawBody; every carry or
  passthrough is the untouched v1 source. Carry notes keep their class names.
- Not switched, with the reason in rawV1Classes: `image` (no writer, no corpus
  document, and its raw passthrough would meet the renamed-shape `image`
  tombstone) and `ontologyLabel` (NDI's second pass and foldGenericFiles find
  labels by the name `ontology_label`; siblings first). ontology_label's guard
  reads either spelling and +roundtrip/ontologyLabel.m is its inverse.
- +roundtrip/imageStack.m: the passthrough, or the observation + sampled_body
  + anchor of a converted stack.
- NDI templates imageStack.json, imageStack_parameters.json, ontologyLabel.json
  copied verbatim from locked main 3cb19a8. testRawV1RoundTripImage: Haley
  behaviour shapes carried (carry-052), Haley E. coli shapes passed through,
  Babu shapes converted; lost paths equal the listed findings; broken inputs
  fail; raw and renamed paths agree. testTemplateLiteralTypeTraps pins the
  superclass migrator on the renamed path, where it still runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
…asses

Phase 2 of the generic migration, the ingested-epoch / sync family (Decided by
Jess Haley, 2026-10-26: [migrators read raw v1], [renames carry is
temporary], [migration reliability practices] (a); did-schema
V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + daqreader_mfdaq_epochdata_ingested,
  epochfiles_ingested, syncrule_mapping, daqmetadatareader_epochdata_ingested
  (v1 spelling = migrator name; no superclass migrator exists for base,
  epochid or daqreader_epochdata_ingested, so nothing is folded or deleted).
- daqreader_mfdaq_epochdata_ingested reads the raw document (jRawBody,
  v1read.readDependsOn / readStamp) and emits exactly the body the renamed path
  emitted (edges as {name, document_id}); a depends_on version or second id,
  or an ndi_document beside base, is carried (carry-049) as before; a field
  of the mfdaq block other than `parameters`, which the old migrator dropped
  silently, or a legacy identity field outside base.json's four, now carries
  the document (no register row yet: marker `none`).
- epochfiles_ingested: still a pass-1 passthrough, on the raw body; what
  universalRenames would discard (incl. an epochId twin) is carried, carry-049.
- syncrule_mapping: pass 1 carries the raw v1 (carry-036, id via readBase).
  When epochMint re-runs it armed, the fold first accounts for every v1 field
  (unplacedInFold): base.name, an extra edge or version, a file, an extra
  block or node field, a non-finite cost, or an epoch_session_id other than
  the document's own keep the mapping carried instead of being dropped.
- daqmetadatareader_epochdata_ingested: carried untouched (carry-046), id via
  readBase.
- +roundtrip: inverses for the four classes (the de-encoded mfdaq cache and its
  lift; the manifest passthrough; the mapping's fold from the clock_alignment,
  its references, epochs, acquisition systems, software and manifests; the
  stimulus file, which pass 1 never converts) and private/undoOutbound.
- Fixtures: NDI templates copied verbatim from NDI-matlab locked main 3cb19a8
  (daqreader_mfdaq_epochdata_ingested, daqreader_epochdata_ingested,
  epochfiles_ingested, syncrule_mapping, daqmetadatareader_epochdata_ingested).
- testRawV1RoundTripIngested: writer-shaped fixtures (mfdaq.m, navigator.m,
  syncgraph.m, metadatareader.m) round trip with nothing lost, invented or
  unplaced; the fold round trips on epochMint's output (two epochs, and one
  epoch with two systems); raw and renamed paths agree or both carry; unread
  fields carry; broken inputs fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
…-image

rawV1Classes.m: both families kept, the ingested-epoch / sync classes and
then imageStack in the list, and both comment blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Phase 2 of the generic migration, the acquisition-system family (Decided by
Jess Haley, 2026-10-26: [migrators read raw v1], [renames carry is
temporary], [migration reliability practices] (a); did-schema
V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + daqsystem, filenavigator, daqreader,
  daqreader_ndr, daqmetadatareader, syncrule, syncgraph, probe_location (one
  line each; the v1 spelling is the migrator name, so no table row). No
  superclass migrator exists for `base` or `daqreader`, so nothing is folded
  or deleted.
- Each migrator reads the raw document through private/jRawAccount (identity
  via v1read.readBase, a legacy ndi_document read as base; edges with either
  key via v1read.readDependsOn) and emits exactly what the renamed path
  emitted. What universalRenames would discard (a depends_on version or second
  id, an ndi_document beside base, a camelCase twin with another value) is
  carried, carry-049, as before. A field, block or edge the migrator does not
  read, which the renamed path dropped without a word, now carries the
  document whole as v1 (private/jRawCarry; marker `none`: no register row
  yet). Passthroughs and carries return the untouched v1 source. Bodies the
  batch pass re-runs (stamped did_v2: resolveClockAlignment's syncgraph and
  filefind arms) were accounted for in pass 1.
- +roundtrip inverses for the eight classes (and private/daqParts,
  cell2strOf, allEmpty): the acquisition_system / epoch_file_pattern /
  acquisition_reader / epoch_parameter_reader / clock_alignment_policy /
  clock_alignment_configuration and its software; the filefind fold with its
  acquisition_channels and systems; the probe-location observation and its
  session anchor; each pass-1 passthrough.
- Fixtures: NDI templates copied verbatim from NDI-matlab locked main 3cb19a8
  (daqsystem, filenavigator, daqreader, daqreader_ndr, daqmetadatareader,
  syncrule, syncgraph, probe_location).
- testRawV1RoundTripDaq: fifteen writer-shaped fixtures (system.m,
  navigator.m, reader.m, mfdaq/ndr.m, metadatareader.m, syncrule.m for three
  rules, syncgraph.m, the Dabrowska and probeLocations4probes probe
  locations) round trip with nothing lost, invented or unplaced; the filefind
  fold round trips on resolveClockAlignment's output on both paths; raw and
  renamed paths agree; unread fields carry; broken inputs fail; three known
  findings (shapes no writer makes) are reported lost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
…riters' output

Phase 2 of the generic migration, the spike-sorting / calculation family
(Decided by Jess Haley, 2026-10-26: [migrators read raw v1], [renames carry is
temporary], [early migration pieces fixed] (1), [migration reliability
practices] (a); did-schema V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + neuron_extracellular, jrclust_clusters,
  hartley_calc, speedtuning_calc (one line each); the table maps
  speedtuning_calc (NDIcalc-vis's spelling) -> speed_tuning_calc.
  universalRenames never made that mapping, so before the switch a writer's
  speed document passed through unconverted. simple_calc is not listed (its
  raw passthrough would meet the V_eta simple_calc class's app_name and
  quarantine; reason in rawV1Classes).
- The four migrators read the raw document (jRawBody; v1read.readApp /
  readDependsOn). What universalRenames would have discarded carries the
  document as before (carry-049; Q5's ndi_document.name 'jrclust.prm').
  Every other v1 field is accounted for: hartley_calc's four blocks
  (unreadFields + jCalculation 'AccountForEveryField', new 'OtherBlocks'
  option; carry-056), ngrid.data_size only when it restates the data type;
  jrclust_clusters and neuron_extracellular (unreadFields; no register row
  yet, marker `none`), including a waveform without times or times without a
  waveform, a fractional cluster index and a quality label with spaces, which
  were dropped or rewritten before.
- hartley_calc calls +migrators_j/+super/ngrid.m (a guard) on the raw block;
  it stays for ontology_image.
- speed_tuning_calc: a document whose fit blocks would become model_fit
  entries all named 'Priebe fit' (the writer's fit, fit_no_speed,
  fit_fullspeed) is carried (carry-056): which fit is which would be kept by
  order only.
- Deleted (never reached): +migrators/hartley_calc.m, speed_tuning_calc.m,
  simple_calc.m, jrclust_clusters.m and their helper calcCommon (and its
  tests in testMigrators).
- +roundtrip: inverses for the four classes (private/speedBlock).
- Fixtures: NDI templates verbatim (NDI-matlab 3cb19a8: jrclust_clusters,
  ngrid; NDIcalc-vis-matlab 00e3e0f: hartley_calc,
  hartley_reverse_correlation, reverse_correlation, speedtuning_calc,
  speed_tuning) and the calculators' stored self-test outputs
  (hartley_calc.mock.1.json, speedtuning_calc.mock.1.json).
- testRawV1RoundTripSpike: writer-shaped documents round trip; the lost paths
  are exactly the known findings (jrclust base.name; neuron base.id and
  waveform_sample_times, rebuilt from origin + spacing to 1.1e-19); nothing
  invented or unplaced; raw and renamed paths agree or both carry; unread
  fields carry; broken inputs fail; the converted documents validate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
…rray

The renamed path quarantines a depends_on that jsondecode gives as a cell
(entries with different keys); the carry-049 case is a version on one entry
of the writer's struct array, as testRawV1RoundTripIngested states it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
rawV1Classes keeps both families: the acquisition-system classes and the
spike-sorting / calculation classes, each with its comment block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
…iters' output

Phase 2 of the generic migration, the bath / position-metadata family
(Decided by Jess Haley, 2026-10-26: [migrators read raw v1], [renames carry is
temporary], [early migration pieces fixed] (1), [migration reliability
practices] (a); did-schema V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + stimulus_bath, position_metadata,
  distance_metadata (one line each; the v1 names are the migrator names).
- stimulus_bath: still defers every whole bath (needsSessionContext) to
  resolveDeferredBaths / NDI's stimulusBathToBath, which read the quarantined
  raw source. It first accounts for every v1 field (jRawAccount, plus the
  location's fields and a mixture_table that is not text); one the resolvers
  cannot read whole is carried (carry-049 as before, else no row yet).
- position_metadata: reads ontologyNode (and universalRenames' ontology_node
  on the renamed path); the writer's units and dimensions carry it, carry-053,
  as before. A document naming no measurement, which used to pass through as a
  V2 position_metadata (a class to retire), is carried as v1 (no row yet).
- distance_metadata: reshapes the v1 spelling itself (and the renamed one,
  until universalRenames is deleted); a field it does not read carries the
  document (no row yet).
- Deleted: +migrators/position_metadata.m, distance_metadata.m and
  stimulus_bath.m (never reached, or reached only through distance's own
  +migrators_j migrator) and their tests in testMigrators.
- +roundtrip inverses for the three classes; stimulus_bath's rebuilds from
  what resolveDeferredBaths assembles.
- Fixtures: NDI templates copied verbatim from NDI-matlab locked main 3cb19a8
  (stimulus_bath, position_metadata, distance_metadata); writer-shaped
  documents (stimulusDocMaker / marderbath, haley/doImport.m) with corpus
  Dab's four mixture tables. Test fixtures in testMigratorsJ and
  testFixtureCorpus now spell position_metadata.ontologyNode as v1 does.
- testRawV1RoundTripBath, testRawV1RoundTripPosition: writer-shaped documents
  round trip; the lost paths are exactly the known findings (the coarse bath
  pass keeps neither the stimulator edge nor the epoch id, and a table with a
  pH or osm row loses those rows' nodes and places); nothing invented or
  unplaced; raw and renamed paths agree or both carry; unread fields carry;
  broken inputs fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
NDI-matlab V2 (4effe11e0, #1076; b729b8728) added
ndi.migrate.internal.isOntologyLabelClass, called from ndi.migrate.local, so
the cross-repo divergence gate failed on every DID-matlab branch: a pass on
the NDI side only, with no row. It is a predicate (either spelling of the v1
ontology-label class), not a transform; the row says why it has no DID twin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
…urce

ontologyLabel joins did2.convert.rawV1Classes: pass 1 hands the label to NDI's
second pass as v1 wrote it (class ontologyLabel, block ontologyLabel). NDI-matlab
finds labels under either name since #1076 (isOntologyLabelClass).

- did2.convert.isOntologyLabelClass: the one DID-side place that decides "is
  this a label" by class name, mirroring NDI's helper.
- foldGenericFiles finds the sibling label through the helper and reads its
  node from either block spelling.
- carryDependents: a source the loop recorded as a passthrough and that is then
  carried (carry-064) had two passthrough records; the carry now replaces the
  first, so NDI's carryUnchangedAsV1 counts the document once.
- testRawV1RoundTripImage: the label tests run on the default path; new tests
  for the helper, the fold on a raw label, the renamed path, and one record per
  carried label on both paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
…logyLabelClass

NDI-matlab #1076 calls ndi.migrate.internal.isOntologyLabelClass from
ndi.migrate.local, so the cross-repo gate reads it as an NDI-only pass. It is a
predicate; the DID side has the same test, did2.convert.isOntologyLabelClass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
claude added 22 commits October 27, 2026 06:54
Phase 2 of the generic migration, the probe family (Decided by Jess Haley,
2026-10-26: [migrators read raw v1], [renames carry is temporary], [migration
reliability practices] (a); 2026-10-27 [fields outside the template are
malformed]; did-schema V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + probe_geometry, site2channelmap,
  electrode_offset_voltage (the v1 names are the migrator names).
- probe_geometry: the V_alpha guard first, then the raw read (jRawAccount on
  the template's fifteen fields). An ndim other than 2 (fromStruct's and the
  template's default, [writer default is not set]) and a unit no length term is
  known for were dropped without a word; they now carry the document. Every
  fromStruct document still carries, carry-001 (it always writes shank_id).
- site2channelmap: still a pass-1 passthrough; its raw shape is the renamed one
  but for the `value` edge key. A field outside the template, which the
  passthrough met as an undeclared field, carries it.
- electrode_offset_voltage: a temperature that is neither one finite number
  nor the writer's NaN (dropped before) carries the document; NaN stays
  unwritten, as before.
- What a migrator does not read carries the document (private/jRawAccount,
  jRawCarry); marker `none` until the generic malformed row (did-schema #173)
  reaches main, which the carry-citation gate reads.
- +roundtrip inverses for the three classes; private/sessionAnchorOf.
- Fixtures: NDI templates copied verbatim from NDI-matlab locked main 3cb19a8
  (probe_geometry, site2channelmap, electrode_offset_voltage).
- Test helpers (did2.unittest.helpers): ndiDocument (a document from NDI's
  templates, superclass blocks included, as ndi.document builds it),
  setDependency, rawAndRenamed (the switch changes no outcome), carryNote,
  verifyRoundTrip.
- testRawV1RoundTripProbe: the writers' documents (fromStruct,
  makeVoltageOffsets) round trip with nothing lost, invented or unplaced; raw
  and renamed paths agree; unread fields carry; the V_alpha guards still fail;
  broken inputs fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
…ers' output

Phase 2 of the generic migration (Decided by Jess Haley, 2026-10-26:
[migrators read raw v1], [renames carry is temporary], [migration reliability
practices] (a); 2026-10-27 [fields outside the template are malformed];
did-schema V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + spike_extraction_parameters,
  spike_extraction_parameters_modification, sorting_parameters,
  kilosort_clusters, kiasort_clusters, SpikeInterfaceSortingOutputs (table row
  -> spike_interface_sorting_outputs).
- The three settings migrators: the raw read checks the other blocks, base
  and edges (every block field still goes to a bound parameter or the bag, as
  before); jMethodParameters keeps the renamed bag spelling for a nameless
  app block's leftover, so the switch changes no emitted parameter. Every
  writer document still carries (carry-002/003/004: newdocument's os and
  interpreter).
- kilosort_clusters / kiasort_clusters: a checksum that the body would
  rewrite (not lower-case, trimmed hex) now carries the document.
- spike_interface_sorting_outputs: no writer at the locked main and no corpus
  document; the template fixes its shape. Its raw passthrough keeps v1's class
  name, under which V_eta keeps no class (counted, not validated), as a raw
  imageStack passthrough does; the guard reads either block spelling.
- NOT switched (rawV1Classes, NOT LISTED): spikewaves and spike_clusters. Pure
  passthroughs with an `app` block: raw, app.name would quarantine against the
  V_eta classes' app_name; carrying them in pass 1 would carry every converted
  document naming them. A question for the team.
- +roundtrip inverses for the six classes (private/methodDocParts,
  spikeExtractionBlock, parkedMethodBlocks, sorterInverse).
- Fixtures: NDI templates copied verbatim from NDI-matlab locked main 3cb19a8.
- testRawV1RoundTripSpikeParameters: the writers' documents round trip with
  nothing lost, invented or unplaced; raw and renamed paths agree (but for the
  SpikeInterfaceSortingOutputs class name); unread fields carry; broken inputs
  fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf

# Conflicts:
#	src/did/+did2/+convert/rawV1Classes.m
…2-rest

# Conflicts:
#	src/did/+did2/+convert/rawV1Classes.m
The merge of origin/claude/phase2 (3db719c) committed the header's conflict
markers. Both entries are kept: the session / dataset / presentation family,
then ontologyLabel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Decided by Jess Haley, 2026-10-27 [fields outside the template are malformed]
(did-schema V_eta_go_forward_class_audit.md; carry-100, did-schema #173, now on
main, which the carry-citation gate reads).

- private/jRawCarry: carry-100 is the row for UNPLACED (the default; any other
  row is refused). A new optional VALUEREASONS lists template fields whose
  value the migrator cannot place or would rewrite (no register row yet); the
  note gives them after the carry-100 part, or alone, uncited.
- Every jRawCarry call names carry-100: the daq, ingested, spike, position,
  bath, probe and spike-parameters families (session family already did).
- The three hand-written `none` sites for unread fields move to jRawCarry:
  daqreader_mfdaq_epochdata_ingested, jrclust_clusters, neuron_extracellular
  (a `path (why)` value reason stays uncited).
- Value reasons, uncited: probe_geometry ndim / unit, electrode_offset_voltage
  temperature, kilosort / kiasort checksum case, stimulus_bath location shape
  and a mixture_table that is not text.
- testRawV1RoundTripDaq reads the carry-100 note.

Remaining `none` markers (check_carry_citations.py): position_metadata naming
no measurement; jMembershipBodies' linked-session reference / creator input
(a separate open question); jRawCarry's value reasons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Phase 2 of the generic migration (Decided by Jess Haley, 2026-10-26:
[migrators read raw v1], [renames carry is temporary], [migration reliability
practices] (a); 2026-10-27 [fields outside the template are malformed],
carry-100; did-schema V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + daqreader_epochdata_ingested,
  daqreader_image_epochdata_ingested, vmneuralresponseresiduals,
  vmspikesummary. All four are pass-1 passthroughs with snake_case blocks and
  no `app` block: the raw passthrough is the renamed one but for v1's `value`
  edge key, which every reader takes (jEpochDocId, epochMint, NDI's
  sliceTetanus).
- Each migrator accounts for every v1 field (jRawAccount on the template); one
  outside the template, which the passthrough met as an undeclared field,
  carries the document, carry-100. The V_alpha guards run first, as before.
- daqreader_epochdata_ingested takes an optional `delegated` flag: the mfdaq
  migrator, which accounts for its own raw fields and moves its parameters
  onto this block, hands its de-encoded body over with it set, so it is not
  read twice.
- The vm classes have no writer at NDI-matlab locked main 3cb19a8 and no
  corpus document; the template alone fixes their shape. The plain
  daqreader_epochdata_ingested writer (+daq/reader.m) names an undefined
  variable and cannot run at that main; its shape is the fixture.
- +roundtrip inverses (private/passthroughInverse).
- Fixtures: NDI templates copied verbatim (daqreader_image_epochdata_ingested,
  vmneuralresponseresiduals, vmspikesummary).
- testRawV1RoundTripIngestedEpochs: each round trips as itself; raw and
  renamed paths agree, and validate alike; off-template fields carry; the
  mfdaq delegation is not read twice; broken inputs fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
A parameter's or condition's variable is a term, and did2.convert.registeredTerm
writes a registered term with the registry's label ([term labels stay as the
ontology spells them], Jess Haley, 2026-10-26): quick run 40465272543 showed
the electrode offset's condition named "Temperature" and the spike-extraction
bag entry for `overlap` named "Overlap". The inverses now match a variable's
name ignoring case, and private/templateSpelling gives a rebuilt bag field the
spelling of its NDI template when only case differs ([spelling is notation]).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Phase 2 of the generic migration (Decided by Jess Haley, 2026-10-26:
[migrators read raw v1], [renames carry is temporary], [migration reliability
practices] (a); 2026-10-27 [fields outside the template are malformed],
carry-100; did-schema V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + cellTypeLabels, geneExpression, geneList,
  geneListMapping, spatialGeneExpressionCells, spatialGeneExpressionPyramid,
  spatialGeneExpressionTiles, each joined to its snake_case migrator by the
  table.
- All seven are pure pass-1 passthroughs. Each migrator now accounts for every
  v1 field (jRawAccount on the template; one outside it carries the document,
  carry-100). The raw passthrough keeps v1's camelCase class name, under which
  V_eta keeps no class, so it is counted as a passthrough with no schema where
  the renamed one was validated against the snake_case (`retire`) class, as a
  raw imageStack passthrough is; NDI's last step stores the v1 source either
  way. No DID batch pass or NDI second-pass step reads these classes.
- geneExpression (only a superclass block in NDI's writers) and
  geneListMapping have no writer at NDI-matlab locked main 3cb19a8; no corpus
  holds any of the seven.
- +roundtrip inverses under the v1 names (private/passthroughInverse).
- Fixtures: NDI templates copied verbatim from 3cb19a8; documents in the shapes
  +ndi/+fun/+doc/+gene/makeGeneList, makeCellTypeLabels, makeCells and
  makePyramid give them.
- testRawV1RoundTripGene: each round trips as itself; both paths pass it
  through with no quarantine (validated); off-template fields carry; broken
  inputs fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Phase 2 of the generic migration (Decided by Jess Haley, 2026-10-26:
[migrators read raw v1], [renames carry is temporary], [migration reliability
practices] (a); 2026-10-27 [fields outside the template are malformed],
carry-100; did-schema V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + measurement, subjectmeasurement,
  stimulus_parameter.
- measurement reads v1's `ontologyName` (and the renamed `ontology_name`). A
  manipulation_id or protocol_id naming a document, dropped before, carries it
  (no register row yet). A measurement with no V2 statement (a date, an untyped
  number, text) passed through as a V2 `measurement` (a `retire` class); its
  raw passthrough would meet the renamed field `ontology_name` as an
  undeclared field, so it is carried as v1 at once (no register row yet): the
  end state NDI's last step gave the passthrough ([passthrough stays v1: how]).
- subjectmeasurement and stimulus_parameter are snake_case with no `app`
  block: read as before, every field accounted for (carry-100 outside the
  template). subjectmeasurement has no writer at NDI-matlab locked main
  3cb19a8 outside its tests; that shape is the fixture.
- +roundtrip inverses (private/statementValue).
- Fixtures: NDI templates copied verbatim from 3cb19a8; documents in the shapes
  treatmentMaker.m create_measurement_doc, build_intan_flat_exp.m and
  temptable2stimulusparameters.m give them.
- testRawV1RoundTripMeasurement: the writers' documents round trip with
  nothing lost, invented or unplaced; converted documents equal on both paths;
  unread fields carry; broken inputs fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Phase 2 of the generic migration (Decided by Jess Haley, 2026-10-26:
[migrators read raw v1], [migration reliability practices] (a);
did-schema V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + stimulus_tuningcurve (ndi.app.stimulus.
  tuning_response) and orientation_direction_tuning (ndi.app.oridirtuning).
  Both migrators read as their calculator siblings do: jRawBody, then
  jCalculation with 'AccountForEveryField' (carry-056 for what the fold does
  not read, as for the *_calc classes); a carry or passthrough is the untouched
  v1 source.
- +roundtrip inverses through private/tuningInverse, as for tuningcurve_calc
  and oridirtuning_calc (this class is their result block).
- NOT switched, listed in rawV1Classes: contrast_tuning,
  spatial_frequency_tuning, temporal_frequency_tuning, speed_tuning. No NDI
  template at the locked main (their templates are NDIcalc-vis-matlab's), no
  writer that makes a document of one alone, no corpus document.
- testRawV1RoundTripTuningResults: fixtures are the apps' result blocks (the
  calculators' stored outputs, the same struct the apps build) over the NDI
  templates (3cb19a8), with the apps' own app block and edges. The tuning
  curve carries (carry-056: stimid, stimulus_presentation_number, as for
  tuningcurve_calc); its converted shape and the orientation document convert
  and lose nothing; raw and renamed paths agree; unread fields carry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Phase 2 of the generic migration (Decided by Jess Haley, 2026-10-26:
[migrators read raw v1], [migration reliability practices] (a); 2026-10-27
[fields outside the template are malformed], carry-100; did-schema
V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + demoNDI, demoNDIMock (joined by the table to
  demo_ndi / demo_ndi_mock), binaryseries_parameters.
- private/jDemoFold reads the blocks in v1's spelling (demoNDI, demoNDIMock)
  or the renamed one; the migrators account for every field first, so a field
  outside the template carries the document (carry-100) where the fold refused
  it with an error (a quarantine) before.
- binaryseries_parameters: no writer at NDI-matlab locked main 3cb19a8 and no
  corpus document; the template fixes its shape (snake_case, no edges): read
  as before after the raw read.
- +roundtrip inverses (private/demoInverse; binaryseries_parameters through
  private/passthroughInverse).
- Fixtures: NDI templates copied verbatim (demoNDI, demoNDIMock, mock,
  binaryseries_parameters); demoNDIMock as +ndi/+calc/+example/simple.m writes
  it.
- testRawV1RoundTripDemo: each round trips with nothing lost; raw and renamed
  paths agree; the demo documents validate; off-template fields carry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
…2-rest

# Conflicts:
#	src/did/+did2/+convert/rawV1Classes.m
Phase 2 of the generic migration (Decided by Jess Haley, 2026-10-26:
[migrators read raw v1], [early migration pieces fixed] (1), [migration
reliability practices] (a); 2026-10-27 [fields outside the template are
malformed], carry-100; did-schema V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + oneepoch.
- The migrator accounts for every v1 field (jRawAccount on oneepoch.json and
  element_epoch.json; carry-100 outside them, where the strict-fields check
  refused it before), then does what the renamed path's superclass migrator
  did, on the raw block: did2.convert.migrators.element_epoch (the clocks
  records, or its carry-009 / carry-038), as +migrators_j/element_epoch.m
  already does, and writes its edges as {name, document_id}, as the renamed
  path did.
- +roundtrip/oneepoch.m.
- Fixtures: NDI template oneepoch.json copied verbatim from NDI-matlab locked
  main 3cb19a8; documents in the shape ndi.element addepoch writes with
  EPOCHIDS (one clock; two clocks).
- testRawV1RoundTripOneEpoch: round trips with nothing lost; raw and renamed
  paths agree and validate alike; off-template fields and mismatched t0_t1
  carry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
…ogyName as v1 does

measurement reads raw v1 (did2.convert.rawV1Classes), so the renamed spelling
ontology_name is a field outside the NDI template and carries the document
(carry-100; quick run 40467206622). The fixture now spells the field as NDI's
measurement.json and treatmentMaker.m do; the assertions are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
The pass finds a label under either class name (isOntologyLabelClass):
`ontologyLabel` as pass 1 now hands it over raw v1, or the renamed
`ontology_label`. BATCH-PASS-CONSUMES names both, each with its own
`-> nothing` EMITS line (rule 3 of tools/batch_pass_declarations.py).
The stale `:446-457` line citation is replaced by the loop it means.
did-schema tools/coverage.py matches a declared name on the row's
v1_class, veta_class or snake form and credits a pass once per row, so
both spellings land on the one ontologyLabel row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Phase 2 of the generic migration (Decided by Jess Haley, 2026-10-26:
[migrators read raw v1], [early migration pieces fixed] (1), [migration
reliability practices] (a); 2026-10-27 [fields outside the template are
malformed], carry-100; did-schema V_eta_go_forward_class_audit.md).

- did2.convert.rawV1Classes: + ontologyImage (table row -> ontology_image).
- The migrator calls the superclass guard the renamed path ran
  (+migrators_j/+super/ngrid.m) on the raw document first, so a reshaped ngrid
  block is still refused, then accounts for every field (carry-100 outside the
  template), and reads the block in v1's spelling (ontologyImage;
  ontologyNodes, the writer's, or ontologyNode, the template's; the legacy
  ontologyName / ontologyRegion) or the renamed one.
- A writer document (imageDocMaker.m, ontologyNodes) passes through unchanged
  as before, under its v1 class name, which V_eta keeps no class for (counted,
  not validated); NDI's last step stores the v1 source either way. A legacy
  document naming an ontologyTableRow_id, dropped before, carries (no register
  row yet).
- +roundtrip/ontologyImage.m (the passthrough; the legacy vintage, with no
  writer at the locked main, has no inverse and reports itself unplaced).
- Fixture: ontologyImage.json copied verbatim from NDI-matlab locked main
  3cb19a8; the document as imageDocMaker.m createOntologyImageDoc writes it.
- testRawV1RoundTripOntologyImage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Quick run 40467465070:
- testMigratorsJDemoFold: a quarantined demoNDI keeps v1's class name; a field
  outside NDI's template now carries the document (carry-100, [fields outside
  the template are malformed], Jess Haley, 2026-10-27) where the fold refused
  it, and the test checks both: the raw carry, and the renamed path's refusal.
- testConvertV1ToV2: RenameClassNames is the renamed path's option; the test
  names that path ('RawV1Classes', {}) now that demoNDI is read raw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
…gy_image, ontology_label

[early migration pieces fixed] (1) (Jess Haley, 2026-10-26, did-schema
V_eta_go_forward_class_audit.md): one migrator per class.

- v1_to_v2 runs a class's +migrators_j migrator instead of its +migrators one
  (runConcreteMigrator), and element, ontology_image and ontology_label each
  have one; all three classes now read raw v1. The superclass pass
  (applySuperclassMigrators) would reach them only for a document naming
  element, ontologyImage or ontologyLabel as a superclass, and no NDI template
  at the locked main (3cb19a8) does (grep of the templates; the NDIcalc-vis
  templates in tests/+did2/fixtures neither). Their only callers were five
  tests in testMigrators, which are removed; the behaviour is tested where it
  lives (testRawV1RoundTripElement, testRawV1RoundTripOntologyImage,
  testRawV1RoundTripImage). testTheUnreachedBaseMigratorsAreGone guards it.
- NDI-matlab V2 names none of them.
- Kept, with what still reaches each (+migrators/Contents.m): element_epoch
  (called by +migrators_j/element_epoch.m and oneepoch.m on the raw block),
  epochclocktimes and filter (pyraview's superclasses on the renamed path),
  ngrid (the concrete migrator of a leaf `ngrid` document), identity
  (v1_to_v2's fallback).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Keeps phase 2's isOntologyLabelClass divergence row (ontologyLabel is now
switched), dropping V2's interim text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Remove six stale %#ok<AGROW> suppressions in +roundtrip (hartley_calc,
oneepoch, neuron_extracellular x2, syncrule_mapping, private/demoInverse)
and use isscalar for numel(x) == 1 in private/rawCurveBlock,
private/csfBlock and metadata_editor (same result for empty, struct
arrays and 1x1 cells).

The kilosort/kiasort checksum strcmp(md5, lower(strtrim(md5))) is left
as is: it detects a case difference so the document is carried, which
strcmpi would hide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
@jesshaley
jesshaley marked this pull request as ready for review October 27, 2026 10:00
@jesshaley
jesshaley merged commit e73aec7 into V2 Oct 27, 2026
12 checks passed
jesshaley pushed a commit that referenced this pull request Oct 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
@jesshaley
jesshaley deleted the claude/phase2 branch October 30, 2026 13:59
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.

3 participants