Skip to content

test(push): pin preflight label + time-series validators - #263

Merged
saadqbal merged 1 commit into
developfrom
test/push-preflight-validators
Jul 14, 2026
Merged

test(push): pin preflight label + time-series validators#263
saadqbal merged 1 commit into
developfrom
test/push-preflight-validators

Conversation

@LukasWodka

@LukasWodkaLukasWodka commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Second follow-up from the mutation-testing pass — the preflight.go cluster (the biggest, 35 survivors). These are the ingestion-correctness gates, so an unguarded boundary here silently lets a bad dataset through local pre-flight. This PR takes the pure / in-memory-testable validators (no fixtures) and kills their survivors:

ValidatorMutant killedTest pins
CheckLabelColumnmatchColumnIndex(...) >= 0> 0a label column in the first header slot (index 0) is still accepted
CheckAnnotationPairinglen(noAnn) > 0 / len(noImg) > 0>= 0an asymmetric mismatch reports only the orphaned side (no bogus "0 X ()")
labelConstantViolationlen(shown) > 5>= 5constant-label-per-sequence + the "+N more" truncation (exactly 5 → no (+N more))
perGroupTimeViolationboth len > 5 truncationsnumeric-time ordering + invalid-value and out-of-order truncation boundaries
isNumericTimeColumnswitch-selectornumeric (INT/FLOAT/DECIMAL/…) vs temporal branch

Mutation-proven: 3 representative mutants (the matchColumnIndex boundary, a len > 5 truncation, a len > 0 clause) were flipped in-source and confirmed to fail the matching test; the parallel truncation/asymmetric cases share the same operator.

Deliberately not chased: the isNumericTimeColumnIndexByte guards (equivalent — post-TrimSpace, index-0 is impossible). The fixture-needing validators (ValidateImages, CheckCSVEncoding, scanTSCRows, CrossCheckLabels, HasBOM) are a natural follow-up.

Test plan

  • make ci green (build, vet, gofmt -s, go test -race, errcheck/ineffassign/misspell, schema-check). Pure additive test file; no production change.

🤖 Generated with Claude Code


Note

Low Risk
Test-only additive change; strengthens guards on ingestion preflight behavior with no runtime impact.

Overview
Adds internal/push/preflight_validators_test.go, a pure in-memory test suite that locks down edge cases in push preflight validators (no production code changes).

Coverage targets gremlins survivors: CheckLabelColumn accepts a label in the first header column (index 0); CheckAnnotationPairing reports only the orphaned side on asymmetric image/annotation mismatches; labelConstantViolation and perGroupTimeViolation enforce constant labels per sequence, numeric time ordering, and the exactly 5 vs 6"(+N more)" error truncation boundaries; isNumericTimeColumn distinguishes numeric SQL types from temporal/text and missing columns.

Reviewed by Cursor Bugbot for commit d064b5a. Bugbot is set up for automated code reviews on this repo. Configure here.

…on survivors)
Second follow-up from the mutation pass. Gremlins found unguarded boundaries in
the preflight validators — the ingestion-correctness gates. Add pure, fixture-
free unit tests that each KILL a surviving mutant:
- CheckLabelColumn: a label column in the FIRST header slot (index 0) must be
accepted (kills matchColumnIndex(...) >= 0 -> > 0)
- CheckAnnotationPairing: an asymmetric mismatch reports only the orphaned side
(kills len(noAnn) > 0 / len(noImg) > 0 -> >= 0, which emitted a bogus "0 X ()")
- labelConstantViolation: constant-label-per-sequence rule + the "+N more"
truncation boundary (exactly 5 offenders -> no "(+N more)"; kills len > 5 -> >= 5)
- perGroupTimeViolation: numeric-time ordering + BOTH truncation boundaries
(invalid-values and out-of-order)
- isNumericTimeColumn: numeric (INT/FLOAT/DECIMAL/...) vs temporal branch selector
3 representative mutants mutation-proven (matchColumnIndex boundary, len>5
truncation, len>0 clause); the parallel truncation/asymmetric cases share the
same operator. Equivalent mutants (isNumericTimeColumn's post-trim index-0
IndexByte guards) deliberately not chased. Pure additive test file.
make ci green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodkaLukasWodka self-assigned this Jul 14, 2026
@LukasWodka

Copy link
Copy Markdown
ContributorAuthor

bugbot run

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d064b5a. Configure here.

@saadqbalsaadqbal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Solid mutation-kill coverage — verified the index-0 CheckLabelColumn boundary (>=0 not >0), the asymmetric annotation-pairing clauses, the len > 5 truncation edges (5→no '+N more', 6→'+1 more'), and the isNumericTimeColumn suffix/UNSIGNED normalization. Each case earns its place.

@saadqbal
saadqbal merged commit 253d6d2 into developJul 14, 2026
22 checks passed
@saadqbal
saadqbal deleted the test/push-preflight-validators branch July 14, 2026 09:02
Sign up for freeto 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.

2 participants

@LukasWodka@saadqbal