|
3 | 3 | **Status:** Not started. |
4 | 4 |
|
5 | 5 | Let users establish an animal's hardware configuration by importing the `.trodesconf` (the SpikeGadgets |
6 | | -workspace XML embedded in every `.rec`) instead of hand-building electrode groups and counting |
7 | | -channels. The import is a **hardware-structure scaffold**: from the config it creates the exact |
8 | | -electrode-group/ntrode structure with per-ntrode channel counts (guaranteeing the YAML matches the |
9 | | -`.rec` so trodes_to_nwb's `len(map)` cross-check can't fail) and records the board's DIO channel |
10 | | -inventory; it deliberately leaves the experiment semantics it cannot know — `device_type`, brain |
11 | | -`location`, stereotax coordinates — blank for the existing validation to drive. It targets the |
12 | | -**animal configuration version** (seed v1 at create-animal; a changed layout makes a new version via |
13 | | -the existing reconfiguration path), feeding the diff/apply machinery the app already has. **Exported |
14 | | -YAML is unchanged** — the importer fills the same fields the user would, and the channel `map` values |
15 | | -still come from `device_type` as today. |
| 6 | +workspace XML embedded in every `.rec`) instead of hand-building electrode groups and counting channels. |
| 7 | +The import is a **hardware-structure scaffold**: it creates ntrode rows with the exact channel counts |
| 8 | +**and immutable `ntrode_id`s from the config** (so the YAML matches the `.rec` and trodes_to_nwb's |
| 9 | +`ntrode_id`/`len(map)` cross-check cannot fail), groups them (default 1 ntrode → 1 group; the user merges |
| 10 | +shanks for a multi-shank probe), and records the board's DIO channel inventory. It deliberately leaves |
| 11 | +the experiment semantics it cannot know — `device_type`, brain `location`, coordinates — for the user; |
| 12 | +when `device_type` is set, a **new import-aware completion path fills the map values into the existing |
| 13 | +rows without renumbering** (the central invariant). It targets the **animal configuration version** |
| 14 | +(seed v1 at create-animal; a changed layout makes a new version via the existing reconfiguration path). |
| 15 | +**Exported YAML is unchanged** — the importer produces the same fields a hand-built config would. |
16 | 16 |
|
17 | 17 | ## Reading order |
18 | 18 |
|
19 | 19 | For agent invocation, **load only the slice you need**: |
20 | 20 |
|
21 | 21 | 1. **Working a specific phase?** Open the matching phase file — each is self-contained. |
22 | | -2. **Need the channel-map contract or the parsed-config type?** [shared-contracts.md](shared-contracts.md). |
| 22 | +2. **Need the invariant, the parsed type, the plan shape, or the DIO mapping?** [shared-contracts.md](shared-contracts.md). |
23 | 23 | 3. **Need upstream `.trodesconf` XML / trodes_to_nwb line refs?** [appendix.md](appendix.md). |
24 | | -4. **Need scope / risks / rollout / the persistence-migration call?** [overview.md](overview.md). |
| 24 | +4. **Need scope / risks / rollout / the persistence + renumbering integration calls?** [overview.md](overview.md). |
25 | 25 |
|
26 | 26 | ## Files |
27 | 27 |
|
28 | | -- [overview.md](overview.md) — scope, integration points, the byte-identity + persistence invariants, risks, rollout. |
29 | | -- [shared-contracts.md](shared-contracts.md) — the `ParsedTrodesConfig` type, the trodes_to_nwb channel-map contract, and the import-plan shape; referenced by ≥2 phases. |
30 | | -- [appendix.md](appendix.md) — `.trodesconf` XML structure + trodes_to_nwb consumer file:line refs (the authoritative behavior the plan is built against). |
| 28 | +- [overview.md](overview.md) — scope, integration points, the byte-identity + persistence + renumbering invariants, risks, rollout. |
| 29 | +- [shared-contracts.md](shared-contracts.md) — `ParsedTrodesConfig`, the channel-map contract, **the ntrode_id-immutability + import-aware-completion invariant**, the import-plan shape, and the DIO id-reconciliation contract. |
| 30 | +- [appendix.md](appendix.md) — `.trodesconf` XML structure + trodes_to_nwb consumer file:line refs. |
31 | 31 | - Phases (each ships as a separable PR, in dependency order): |
32 | | - - [phase-1-parser.md](phase-1-parser.md) — pure `.trodesconf` XML → `ParsedTrodesConfig`. |
33 | | - - [phase-2-plan.md](phase-2-plan.md) — candidate `ProbeConfiguration` + diff/plan (reuses `diffProbeConfigs`) + count/device_type conflict flags. |
34 | | - - [phase-3-apply.md](phase-3-apply.md) — apply via the existing reconfig action; add the optional `dioInventory` field. |
35 | | - - [phase-4-ui.md](phase-4-ui.md) — entry points (create-animal + new-configuration), file upload, diff preview, post-import validation punch-list. |
36 | | - - [phase-5-dio-day.md](phase-5-dio-day.md) — surface the config DIO inventory as a channel picker in the day DIO editor. |
| 32 | + - [phase-1-parser.md](phase-1-parser.md) — pure XML → `ParsedTrodesConfig` (+ stricter DIO direction, informational `numChannels`). |
| 33 | + - [phase-2-plan.md](phase-2-plan.md) — candidate config + diff/plan with **id-preserving** ntrode shells + the grouping model. |
| 34 | + - [phase-3-completion.md](phase-3-completion.md) — **the invariant:** `fillImportedNtrodeMaps` (preserve ids) + branch `ElectrodeGroupsContainer` away from the renumbering path. |
| 35 | + - [phase-4-apply.md](phase-4-apply.md) — apply via the existing reconfig action; add the optional `dioInventory` field (+ extend `ConfigSnapshotInput` + the transition). |
| 36 | + - [phase-5-ui.md](phase-5-ui.md) — real file-input + `file.text()`, a **new** diff/preview component, the grouping + device_type step, entry points. |
| 37 | + - [phase-6-dio.md](phase-6-dio.md) — reconcile board ids → editor index + limit the day DIO picker to present channels. |
0 commit comments