Uh oh!
There was an error while loading. Please reload this page.
fix(preflight): mirror SequenceGroupValidator's null set for sequence ids (#239) - #240
Merged
Merged
Conversation
LukasWodka
commented
Jul 11, 2026
ContributorAuthor
Retargeted Merge order: #234 first, then this. When #234 merges to |
… ids (#239) CheckSequenceRows / sequenceScanFrom decided whether a sequence_id cell is null by trimming the cell and testing the curated coercion.NA_SENTINELS map (naSentinels). But it previews SequenceGroupValidator, which plain-reads the CSV (pd.read_csv, keep_default_na=True) and computes null as `ids.isna() | (ids.astype(str).str.strip() == "")` — i.e. pandas' DEFAULT STR_NA_VALUES (matched on the raw cell) UNION whitespace-only cells, NOT the coercion set. Two divergences resulted: - "none" (lowercase): pandas keeps it → the ingestor ACCEPTS, but the CLI treated it as null → false REJECT (the dangerous over-reject direction — blocks an ingest the cluster accepts). - "#NA": pandas drops it to NaN → the ingestor rejects, but the CLI's coercion set lacks it → under-reject. Reuse the pandasDefaultNA map cli#218 added for the grouped label/time checks: null iff `raw ∈ pandasDefaultNA` OR `strings.TrimSpace(raw) == ""`, matched on the raw cell (dropping the pre-strip), and count distinct ids on the raw value (pandas groups the object key verbatim, consistent with the grouped previews). Parity: new tsc-none-sequence-id case (accept), goldens regenerated against the pinned data-ingestors ref; tsc-null-sequence-id (empty + NA) still rejects. TestCheckSequenceRows gains none/#NA/whitespace/padded-NA boundaries — each ground-truthed against the real validator's null_mask; reverting to naSentinels fails the pins (mutation-proved). Closes#239 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
aptraceblocforce-pushed
the
fix/239-tsc-sequence-id-na-parity
branch
from
July 13, 2026 11:45
8105679 to
3bd3fe2Compareaptracebloc
approved these changes
Jul 13, 2026
Uh oh!
There was an error while loading. Please reload this page.
LukasWodka added a commit
that referenced
this pull request
Jul 14, 2026
…vs merged di#358 (cli#286)
di#365 adoption (ValidateImages/spec): the upstream ImageResolutionValidator
now validates min_size VALUES at construction — each side must be a positive
integer (integer-valued floats coerced; strings/bool/None/non-integral floats
rejected as a config error instead of surfacing as a phantom corrupt-image
error). No CLI code change is needed: ParseMinSize's WxH grammar (Atoi + >0)
is the equivalent gate at flag-parse time, so spec.file_options.min_size can
only ever carry the positive ints upstream accepts. Documented on
SpecArgs.MinSize + ValidateImages, and TestParseMinSize now pins the float
boundary ('16.5x32', '32.0x32' both rejected).
di#358 audit (CheckMaskIdColumn vs the merged MaskIdColumnValidator at
8f89aec) — semantics verified point for point, no divergence found:
- exact-lowercase 'mask_id' required after whitespace strip (ReadCSVHeader
trims like CSVIngestor's columns.str.strip())
- case/whitespace variant → rename hint (matchColumnIndex ≙ _match_column)
- empty scan tests the RAW untrimmed cell against NA_SENTINELS (naSentinels
is byte-identical, 12 tokens) + whitespace-only/missing — not trimmed-then-
matched (the #239/#240 padded-sentinel null-set trap)
- mid-read error fails closed on both sides
- duplicate stripped-equal headers: both sides inspect the FIRST exact match
- schema-declaration half satisfied by construction (buildImage always
declares mask_id VARCHAR(255)); csv_options dialect threading N/A (CLI
stages comma-separated UTF-8)
Recorded as a doc block on CheckMaskIdColumn.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>saadqbal pushed a commit
that referenced
this pull request
Jul 14, 2026
…it di#358 (cli#286) (#305) * chore(schema): bump data-ingestors pin to develop HEAD 8f89aec (cli#286) Adopts the 6 upstream commits since the 7b4ecac (di#359) pin: - di#358 — require-and-enforce semseg mask_id validator (backend#816) - di#365 — min_size values validated as positive ints at construction (#348) - di#369 — orphan-row reconcile before retry ingest (write path only) - di#366 — content-comparison e2e (tests only) - di#368 — ingest correlation id (write path only) - the 0.7.0 version bump Both sync scripts re-run against the new pin: - scripts/sync-schema.sh: ingest.v1.json + layout.v1.json byte-identical (no upstream schema change in the range) — no diff. - scripts/sync-validator-goldens.sh: regenerated against the REAL validators at 8f89aec — byte-identical goldens, so no verdict or value-level drift for the existing corpus. di#358 only adds the semseg MaskIdColumnValidator (no semseg parity cases yet) and di#365 only changes verdicts for malformed min_size values the corpus never emits. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs(push): adopt di#365 min_size contract + audit CheckMaskIdColumn vs merged di#358 (cli#286) di#365 adoption (ValidateImages/spec): the upstream ImageResolutionValidator now validates min_size VALUES at construction — each side must be a positive integer (integer-valued floats coerced; strings/bool/None/non-integral floats rejected as a config error instead of surfacing as a phantom corrupt-image error). No CLI code change is needed: ParseMinSize's WxH grammar (Atoi + >0) is the equivalent gate at flag-parse time, so spec.file_options.min_size can only ever carry the positive ints upstream accepts. Documented on SpecArgs.MinSize + ValidateImages, and TestParseMinSize now pins the float boundary ('16.5x32', '32.0x32' both rejected). di#358 audit (CheckMaskIdColumn vs the merged MaskIdColumnValidator at 8f89aec) — semantics verified point for point, no divergence found: - exact-lowercase 'mask_id' required after whitespace strip (ReadCSVHeader trims like CSVIngestor's columns.str.strip()) - case/whitespace variant → rename hint (matchColumnIndex ≙ _match_column) - empty scan tests the RAW untrimmed cell against NA_SENTINELS (naSentinels is byte-identical, 12 tokens) + whitespace-only/missing — not trimmed-then- matched (the #239/#240 padded-sentinel null-set trap) - mid-read error fails closed on both sides - duplicate stripped-equal headers: both sides inspect the FIRST exact match - schema-declaration half satisfied by construction (buildImage always declares mask_id VARCHAR(255)); csv_options dialect threading N/A (CLI stages comma-separated UTF-8) Recorded as a doc block on CheckMaskIdColumn. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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 freeto 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.
This branch is based on the local
feat/218-tsc-preflight-paritywork (pandasDefaultNA), which is not ondevelopyet. Until #218 lands, this PR's diff shows two commits:fe46ff0— TSC preflight parity: mid-sequence label-flip + per-group unsorted timestamps pass local dry-run but are rejected in-cluster #218 (the two grouped TSC validators + thepandasDefaultNAmap)8105679— this change (the only commit to review here)Once #218 is merged to
develop, GitHub will dropfe46ff0from the diff and this PR will show only the sequence-id fix. If #218 ships separately first, rebase this on the updateddevelop.What
Closes #239. Same family as #218, a different validator not covered by it.CheckSequenceRows/sequenceScanFrom(internal/push/preflight.go) decided whether asequence_idcell is null by trimming it and testing the curatedcoercion.NA_SENTINELSmap (naSentinels). But it previews the ingestor'sSequenceGroupValidator, which plain-reads the CSV (pd.read_csv,keep_default_na=True) and computes null as:So the faithful null set is pandas' default
STR_NA_VALUES(matched on the raw cell — pandas tokenises NA before stripping) ∪ whitespace-only cells, not the coercion set. Two divergences:naSentinels+trim)none(lowercase)naSentinels→ null → reject#NASTR_NA_VALUES→ null → rejectnaSentinels→ real id → miss" NA "(padded)NA→ nullFix
Reuse the
pandasDefaultNAmap #218 added for the grouped checks:""is already inpandasDefaultNA, so the whitespace clause only adds genuine whitespace-only cells. Distinct ids are counted on the raw value (pandas groups the object key verbatim, consistent with #218'slabelConstantViolation/perGroupTimeViolation).naSentinelsstays in use for the label-diversity read path (which the ingestor genuinely pins tocoercion.NA_SENTINELS,keep_default_na=False).Test plan
tsc-none-sequence-id(accept), driven against the realSequenceGroupValidator—goldens.jsonregenerated at the pinned data-ingestors ref (7b4ecac); the goldens diff is exactly the one new accept entry, andscripts/sync-validator-goldens.sh --checkis green.tsc-null-sequence-id(empty +NA) still rejects.TestCheckSequenceRowsgainsnone/#NA/ whitespace-only / padded-NAboundaries, each ground-truthed against the validator'snull_mask.sequenceScanFromtonaSentinels+trim fails the new parity case (over-reject) and thenone/#NA/padded assertions (both directions).go build/go vet/gofmtclean;go test ./...green;scripts/coverage-floor.shgreen (internal/cli 73.9%, internal/submit 76.1%).🤖 Generated with Claude Code
Note
Low Risk
Scoped to local preflight parity for time-series sequence id validation; behavior change only affects edge-case NA/id strings, with tests and parity pins guarding regressions.
Overview
Aligns
CheckSequenceRowswith ingestorSequenceGroupValidator: nullsequence_idcells are detected withpandasDefaultNAon the raw CSV value plus whitespace-only, instead of trimmedcoercion.NA_SENTINELS. Distinct sequence counts also use raw ids so grouping matches pandas.This fixes over-reject when the id is the literal
none(pandas keeps it) and under-reject for tokens like#NA, and treats padded values such as" NA "as real ids. Label diversity still usesnaSentinels.Adds unit boundaries and parity case
tsc-none-sequence-idwith updated goldens.Reviewed by Cursor Bugbot for commit 3bd3fe2. Bugbot is set up for automated code reviews on this repo. Configure here.