You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5655274
Browse filesBrowse the repository at this point in the historyBrowse files
Third/fourth-review fixes to phase-4 apply + phase-1 + shared-contracts:
- re-import lands in BOTH the versioned snapshot AND the editable animal.devices
mirror, via an extended addConfigurationSnapshotToAnimal that also carries the
off-export siblings; the mirror sync is probe-fields-only (electrode_groups +
ntrode map) so data_acq_device/device are preserved, not dropped.
- first-config seeds v1 by importing before createAnimal (extended to set v1
siblings); the sibling-incapable updateAnimal fallback is removed.
- sourceName added to TrodesconfImportPlan; dioInventory typed ParsedDioChannel[];
phase-1 DIO direction aligned to shared-contracts (input=0 => out, ECU_ ids).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
-**The written `ntrode_id`s are the plan's preserved ids** ([§3](shared-contracts.md#3-invariant)) —
58
93
never re-derived here.
59
94
-**Persistence decision (from the code).** Determine if the load/shape-ensure path tolerates a snapshot
@@ -75,10 +110,12 @@ byte-identity gate.
75
110
| --- | --- |
76
111
|`applyTrodesconfImport` — first config seeds **v1**| after import-at-create, `configurationHistory.length === 1` and `version === 1` (NOT 2); the snapshot's `devices` = the import, with `dioInventory` + `trodesImport.ntrodeChannelCounts` set. |
77
112
|`applyTrodesconfImport` — re-import | new version via the reconfig action; preserved groups keep `device_type`/`location` + grouping; days re-pin. |
113
+
| re-import updates the **mirror** (must-fix #1) | after re-import, `animal.devices`'s **probe fields** (`electrode_groups`/`ntrode…`) equal the imported snapshot's, while `data_acq_device` + `device` are **preserved** (not dropped); a subsequent `updateAnimal` edit mirrors into the NEW snapshot, not over it. |
114
+
|`addConfigurationSnapshotToAnimal` reconfig regression | the existing reconfig path (config.devices = clone of current) is unchanged — mirror stays equal, no observable behavior change. |
78
115
|`ntrode_id` integrity | the persisted snapshot's `ntrode_id`s equal the plan's (== parsed config's); none renumbered on the way to disk. |
79
116
| bad channels reset | bad channels on the old version don't carry onto the new (inherent to the bump). |
80
117
| persistence | a blob without `dioInventory`/`trodesImport` loads with the defensive selectors → `[]`/`{}`; if bumped, the `vN` fixture hydrates to current. |
81
-
|`baselines`| exported YAML byte-identical; **both `dioInventory` and `trodesImport` are off-export** (export reads only `devices`). |
118
+
|`baselines`| exported YAML byte-identical; **both `dioInventory` and `trodesImport` are off-export** (they sit on the snapshot, outside any `devices`; the export merge never reads them). |
82
119
83
120
## Fixtures
84
121
@@ -87,6 +124,9 @@ Phase 2/3 plan + completed-config fixtures; a persistence blob if a bump is take
87
124
## Review
88
125
89
126
Dispatch `code-reviewer`. Confirm: reuses the reconfig/seed actions (no duplicated version logic);
90
-
`dioInventory` threaded through the transition (not just typed) + defensively read; persisted
91
-
`ntrode_id`s preserved; `baselines` byte-identical + `dioInventory` off-export; CHANGELOG updated; no
92
-
plan/phase refs in code.
127
+
re-import sets **both** the new snapshot **and** the editable `animal.devices` mirror (must-fix #1), with
128
+
a passing `ReconfigWizard` no-op regression; first-config seeds **v1** via the extended `createAnimal`
129
+
(not a v2, not the sibling-incapable `updateAnimal` fallback — must-fix #2); both siblings (`ParsedDioChannel[]`
130
+
`dioInventory` + `trodesImport`) threaded through `addConfigurationSnapshotToAnimal` + defensively read;
131
+
persisted `ntrode_id`s preserved; `baselines` byte-identical + both siblings off-export; CHANGELOG
0 commit comments