Repository navigation
Zarr: adopt biosigio 1.2.10 - #1552
Conversation
biosigio 1.2.10 reports every channels.tsv row it matched only by ignoring case in a per-channel map, which units_report republished verbatim. Replace it with a count (matched_case_only) and at most five examples, declared in the JSON Schema, zod and MCP z4 mirrors, and refuse the raw map in the schema. Reword unmatched_channels and unmatched_case_only, which said matching is exact. Tested: bun zarr-schema-contract and mcp-schema-parity; pytest join and convert_one classes on biosigio 1.2.9 and 1.2.10.
Raise the pin to >=1.2.10,<1.2.11 in requirements.txt, the hallu-zarr.sh fallback and BIOSIGIO_FLOOR, and test_hallu_zarr_config.py. The case-only canary now asserts 1.2.10's join on real EDFs through convert_one; new tests cover an ambiguous case row and a 300-channel case-differing sidecar whose index entry stays small. ZARR_ENGINE_VERSION unchanged. Tested: pytest converter suites on biosigio 1.2.10 (hallu config tests that need bash 4+ not runnable on this macOS host); ruff no new findings.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR1552Version: 🤖 Updated on each push. |
Review recordOne Sonnet 5.5 review pass. No critical findings. Verified by the reviewer: every path that builds a
Verification: 944 passed, 5 skipped on biosigio 1.2.10 ( |
* docs: CHANGELOG entry for 0.10.10 Covers #1550 (Sonnet 5.5 enrichment, DOI lookups, relation guard) and #1552 (biosigio 1.2.10 case-only sidecar matches). Claims checked against the merged code. * docs: add #1556 to the 0.10.10 entry Failed-lookup warnings, the lookup-stage deadline, the over-cap marker, and the summary now printing warnings. Changelog format test passes.
Adopts biosigio 1.2.10 (biosigio#140, closing #136) in the Zarr converter, on
devonly. The<1.2.10cap inscripts/zarr/requirements.txtlisted what adopting it needed; this PR does those things and then raises the cap.Changes
1.
fix: publish case-only sidecar matches bounded(e71d3f7)matched_case_insensitive,{sidecar_name: channel_label}, to itschannels_tsv_unitsreport, andstore_metadatacopied that report into every store's index entry verbatim. That map has one entry per matched channel, in every store entry. The newbound_units_report(ingenerate_zarr.py) replaces it with:units_report.matched_case_only: an integer count, at least 1. It is absent when there are no case-only matches, which is how the otherunmatched_*counts behave.units_report.matched_case_only_examples: at mostCASE_MATCH_EXAMPLES_MAX(5) strings of the form"<channels.tsv name> -> <store label>", in channels.tsv row order. It is present exactly when the count is.store_metadata. Bounding at that point means the map never reaches the entry. The previous code only touchedunits_reportwhen the converter had resolvedchannels_rel, so a report without it would still have been published verbatim. The full map now travels only as the_case_matchesdiagnostic, which_-prefixed stripping keeps out of the published entry, andsidecar_join_reportreads it from there. I confirmed by reading the code thatstore_metadatais the only place that republisheschannels_tsv_units. The store's ownzarr.jsonstill holds biosigio's full report, which is the store's own metadata.shared/zarr-index.schema.json,shared/contract/zarr-index.ts(zod) andbackend/src/mcp/schemas.ts(z4).matched_case_insensitiveas{"not": {}}, so the converter's pre-upload self-check refuses an index that carries it. The zod mirrors stay passthrough, so a consumer does not reject an index over it.unmatched_channelsnow says a row reaches the channel it names exactly, or (from 1.2.10) the one channel it names in another letter case when that match is unambiguous.unmatched_case_onlystays declared, for older stores, and is described as "differed only in case and was not matched: converted before 1.2.10, or the case match was ambiguous".maxItemsand both zod.max()bounds are tied toCASE_MATCH_EXAMPLES_MAX, which the tests read fromgenerate_zarr.py. They follow theUNMATCHED_EXAMPLES_MAXpattern intest/zarr-schema-contract.test.tsandbackend/test/mcp-schema-parity.test.ts. There are also rejection cases for a zero count, non-string examples, and the raw map.bound_units_report, and a test that the schema bound equals the constant.2.
feat: adopt biosigio 1.2.10 in the converter(45c5f61)The pin is now
biosigio[zarr,meg,mef3,hdf5]>=1.2.10,<1.2.11in all three places at once:requirements.txtBIOSIGIO_SPECfallback inhallu-zarr.sh, together withBIOSIGIO_FLOOR="1.2.10", which setup()'s post-install floor probe usestest_hallu_zarr_config.pyThe upper bound is still a cap that is raised on purpose for each release. The comments in
requirements.txtandhallu-zarr.shnow say what 1.2.10 adds, and that the three texts and the bounded field were done in this change.Floor tests.
1.2.9joins the parameters that must be refused. It is also the case where a string comparison would go wrong against a 1.2.10 floor.1.2.10,1.2.11,1.10.0and2.0.0.The canary now runs against the real 1.2.10 in CI. It is renamed
test_a_case_only_row_is_applied_and_reported_per_biosigios_join, and CI installs fromrequirements.txt. It asserts biosigio's case matching directly instead of branching on it. It runs throughconvert_oneon a real EDF whose header hasFP1-F7and a sidecar withFp1-F7, on both exporters, and checks:Vis applied and the channel is convertedunmatched_channels: 0, and nounmatched_case_onlyand no warningmatched_case_only: 1with["Fp1-F7 -> FP1-F7"], and no raw map in the entryNew end-to-end tests through
convert_one(real files, biosigio 1.2.10):FZandFzin the file,fzin the sidecar) stays unmatched, is reported underunmatched_case_only, and keeps the importer's unit.matched_case_only: 300, 5 examples,units_reportunder 600 bytes. Compared with the same recording under an exact sidecar, the entry grows by less than 400 bytes; biosigio's map alone would be about 9 KB. The index validates.test_every_repeated_label_is_served_on_both_exporters) still passes on 1.2.10: all channels are present, the gate passes, and the index and manifest validate.Updated
.memory/repeated-channel-labels-collapse-stores.md, which said the texts still claimed exact matching.Other 1.2.10 changes, checked against this repo
select_channelsraising,add_channel, the EDF export sidecar: nothing here callsselect_channels,add_channelor the EDF exporter (checked withgit grepoverscripts).channel_labels_deduplicated.label_renamesalready reads that key for any importer, sopositions_for_renamed_labelsandunmatched_raw_labelnow also cover those formats. Nothing needed changing.Fz, Fz, Fz_2becomesFz, Fz_3, Fz_2): these change the bytes of a regenerated store only for files with such collisions. See below.Engine stamp (ADR 0033): not bumped, on purpose
ZARR_ENGINE_VERSIONis unchanged.FP1-F7againstFp1-F7.units_report.unmatched_case_only, so a targeted--datasetorrequeue --status done --dataset <id> --executerun fixes them. Older stores do not carry the report and need to be found from their channels.tsv.Tests run
pyteston biosigio 1.2.10 (installed withuv pip install --refresh --no-cache), acrosstest_generate_zarr.py,test_zarr_queue.py,test_purge_non_raw_stores.py,test_find_collapsed_channel_stores.pyandtest_hallu_zarr_config.py: 917 passed, 5 skipped (Linux-only). The 58 failures are all intest_hallu_zarr_config.pyand all come from this host's bash 3.2 (hallu-zarr.sh requires bash 4+); the unmodified branch fails the same way (56, plus the 2 new floor parameters). No bash 4+ is available on this host, so CI (bash 5) is where these run. The pin tests that do not need bash pass.scripts/test_patch_duration.pyandtest_patch_power_line_frequency.pypass on 1.2.10.convert_oneclasses pass on biosigio 1.2.9 as well.bun test zarr mcp: 879 pass at the root and 679 pass inbackend/. The ADR index test passes, andbun run lintand the typecheck hooks are clean.ruff: no new findings compared withorigin/dev.ty: no findings on changed lines.Follow-ups (not in this PR)
matched_case_onlyandmatched_case_only_examples, and the rewordedunmatched_case_only.dev -> main, requeue nm000110 and any dataset whose index showsunmatched_case_only, one dataset at a time.find_collapsed_channel_stores.py --case-only --alllists them (see the review round below).zarr.jsonstill carries biosigio's full per-channelmatched_case_insensitivemap in itschannels_tsv_unitsreport (a root attribute from the streaming exporter, underrecording_metadatafrom the in-memory one). This is by design: only the index entry is bounded, because it repeats per store in one document, while the store's attributes are that store's own metadata.Review round 1
3.
fix: heal a carried raw case-match map on merge(acb5fb1)merge_indexcarries unchanged stores from the prior index verbatim. An entry published with biosigio's rawmatched_case_insensitivemap (a 1.2.10 run before the converter bounded it: staging, an exemplar, an ad hoc--dataseton a branch) would be re-carried by every incremental run and fail the pre-upload schema check each time, until a--cleanrebuild.units_reportholds the map now goes throughbound_units_report. The count and examples are derived from the map and the map is dropped, so the entry heals on the next merge. Other entries are carried as they were, andprioris not mutated.matched_case_only: 40, 5 examples, no raw map, and its other keys unchanged. The test fails without the fix.4.
feat: find stores whose sidecar missed by case(1ccac5f),docs: name the case-only detector for requeues(f9a06d3)find_collapsed_channel_stores.py --case-onlyis a read-only mode that reads each dataset'sindex.jsonand nothing else. I chose a mode over a separate script because it reuses the same HTTP client,Retry-Afterhandling, pacing, catalog walk and exit-status rules.units_report.unmatched_case_only > 0: stores converted before 1.2.10, where the sidecar's type and unit were not applied. It also flags stores where the case match was ambiguous, which a requeue does not fix; the docstring says so.units_report.unmatched_channels);no_units_reportis broken out. The docstring, the stderr progress line and the report'sunverifiable_notesay plainly that these cannot be enumerated from the index. They can only be found by comparing each recording's channels.tsv with the store's labels.matched_case_only) for information only.--allcatalog walk was incomplete; "unchecked" is never reported as clean. The report has its own format name (nemar-zarr-case-only-join-report).--repo-dirand--labelsare refused with--case-only.index.jsonis read, a 503 that outlives the retries, a 404, an index without astoreslist,Retry-Afteron a 429, and an incomplete--allwalk. No git repository is involved, because this mode never reads one.requirements.txtcomment and.memory/repeated-channel-labels-collapse-stores.mdnow name this mode as the way to find affected datasets. They also say the XDF/EEGLAB/neo/Trigno collision case has no detector. The memory file also lost a stale sentence that said 1.2.10 was capped out.5.
fix: check the biosigio cap and pre-releases(9b6f64f)hallu-zarr.shis now two-sided. The installed biosigIO must be a final release in[BIOSIGIO_FLOOR, BIOSIGIO_CAP)(newBIOSIGIO_CAP="1.2.11"). The probe exits 3 below the floor or when the version is unreadable, 4 at or above the cap, and 5 for a pre-release or dev build. setup() prints a distinct FATAL for each and stops before the queue is touched.packagingpath and the fallback now agree. The fallback accepts only a canonical final release (N(.N)*, with an optional.postNand+local), so1.2.10rc1and1.2.10.dev0are refused on both paths. Before, a tuple of leading digits read them as 1.2.10 and accepted them.1.2.10,1.2.10.post1and1.2.10+local.1.1.2.11,1.2.11.post1,1.10.0and2.0.0must be refused with the cap FATAL.BIOSIGIO_CAPmust be the<half ofBIOSIGIO_SPEC.ack_runfixture's default version moved from9.9.9to1.2.10.biosigio 1.2.10for 1.2.10, and the cap and pre-release FATALs for 1.2.11 and 1.2.10rc1 stubs. Real biosigIO venvs always havepackaging(matplotlib imports it), so the fallback path is covered by the stub table only.Operational note: the first retry after deploy is a full rebuild
This is existing design, stated here so it is not a surprise.
pending_retry_worklistlimits a retry round to the pending recordings only when the published index was built with the same commit, engine, biosigIO version and provenance. Every index built before this deploy saysbiosigio_version: 1.2.9. So the first retry round for a dataset with pending recordings falls back to a full rebuild ("the index was built with a different biosigIO"). Later rounds are pending-only again.Tests run (this round)
pyteston biosigio 1.2.10 (installed withuv pip install --refresh --no-cache), acrosstest_generate_zarr.py,test_zarr_queue.py,test_purge_non_raw_stores.py,test_find_collapsed_channel_stores.pyandtest_patch_power_line_frequency.py: 944 passed, 5 skipped (Linux-only).test_hallu_zarr_config.py: the 51 tests that do not need bash 4 pass, including all the new probe and cap/spec tests. The 74 that invokehallu-zarr.shfail on this host's bash 3.2 only (requires bash 4+), so CI (bash 5) is where they run.bun test zarr mcp: 879 pass at the root and 679 pass inbackend/.ruff: no new findings compared withorigin/dev, compared by rule and message.ty: no new diagnostics on the changed files.shellcheck: clean.