Uh oh!
There was an error while loading. Please reload this page.
feat(push): add time_series_classification category (backend#1054 WS2) - #216
Merged
Conversation
Wire the sequence-grouped time-series task end to end on the CLI side: - category registry: time_series_classification, FamilyTabular, CLISupported, IsClassification (mirrors the ingestor registry's is_classification=True). Not RegressionClass: real class labels use the plain string label form, no label.policy. --task help and the interactive picker derive from the registry, so both pick it up without further edits. No spec.go / flag / prompt changes — the sequence_id / timestamp column names are fixed (Decision-2). - re-vendor ingest.v1.json + layout.v1.json from the WS1 branch (data-ingestors#359) and bump scripts/.data-ingestors-ref to its head SHA so sync-schema.sh --check stays green. The registry<->schema parity tests pin the new enum both ways. - layout contract: parse the new grouping trait (Decision-4) and expose GroupingFor; grouped preflight behaviour gates on the trait, never on a category id. - preflight: extend the label-diversity gate from a hardcoded tabular_classification to IsClassification, and add the cheap local sequence checks — CheckSequenceSchemaColumns (fixed sequence_id / timestamp columns declared in the schema, previewing the ingest.v1 conditional) and CheckSequenceRows (no null/empty sequence ids, previewing SequenceGroupValidator; also yields the sequence count, echoed as a note since the platform counts sequences, not rows — Decision-3). - parity harness: 6 new tsc-* cases with goldens generated from the REAL WS1 validators (existing goldens unchanged). tsc-label-flip and tsc-unsorted-timestamp document the two deliberate divergences (no local whole-group label-constancy / per-group order preview yet). - README: category listing updated (15 of 16 supported). Part of backend#1054 (WS2, backend#1057). Requires data-ingestors#359 in the same release window (T16) — the vendored schema comes from that branch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
divyasinghds
approved these changes
Jul 10, 2026
Uh oh!
There was an error while loading. Please reload this page.
LukasWodka added a commit
that referenced
this pull request
Jul 10, 2026
Closes the T16 coupled release opened by #216: the vendored schema was pinned to the WS1 PR-branch head pre-merge; data-ingestors#359 is now merged, so the pin moves to the merge commit on develop (7b4ecac21ee491998ea4252daace9a5af6a1cb4a). sync-schema.sh confirms both vendored files (ingest.v1.json, layout.v1.json) are byte-identical to the merge commit - no vendored content changes, ref-only. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 tasks
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.
What / Why
CLI workstream (WS2) of the time-series-classification epic (tracebloc/backend#1054): make
data ingest --task time_series_classificationwork end to end against the sequence-grouped contract WS1 implements in the ingestor.time_series_classificationis the [redacted]-sepsis shape: a single CSV with fixedsequence_id/timestampcolumns (Decision-2), where eachsequence_idgroups the timestep rows of ONE sequence and the label is constant within it — one class per whole sequence, and the platform counts the dataset in sequences, not rows (Decision-3).Scope
internal/push/category.go— one registry line:{ID: "time_series_classification", Family: FamilyTabular, Label: "Time-series classification", CLISupported: true, IsClassification: true}. NotRegressionClass→ plain string label form (nolabel.policy).--taskhelp, the interactive picker, and the accept-gate all derive from the registry, so no other listing edits were needed.internal/schema/ingest.v1.json+layout.v1.jsonvia thescripts/sync-schema.shmechanism:scripts/.data-ingestors-refbumped to the WS1 branch head (c38c8ad). The registry↔schema parity tests (TestRegistryCoversSchemaCategories/TestRegistryWithinSchema) pin the new enum both ways and are green.internal/push/layout_contract.go— parse the contract's newgroupingtrait (Decision-4) and exposeGroupingFor; all grouped preflight behaviour gates on the trait, never on a category id.internal/push/preflight.go—tabular_classificationtoIsClassification(category)(mirrors the ingestor'sis_classificationwiring; covers TSC).CheckSequenceSchemaColumns:sequence_id+timestampmust be declared in the schema (previews the ingest.v1 sequence-grouped conditional).CheckSequenceRows: every timestep row must carry a non-empty sequence id (previewsSequenceGroupValidator's null-id rule; NA sentinels count as null, pandas parity). Also yields the distinct-sequence count, echoed as an advisory note ("N sequence(s) … counts this dataset in sequences, not rows").tsc-*cases; goldens regenerated from the REAL WS1 validators (DATA_INGESTORS_DIR=/tmp/tsc_ws1, branch of data-ingestors#359). All pre-existing golden verdicts/values byte-identical. Two deliberate divergences documented in the manifest:tsc-label-flip(mid-sequence label flip —LabelConstantWithinGroupValidatorrejects in-cluster, no local whole-group preview yet) andtsc-unsorted-timestamp(PerGroupTimeOrderedValidator, same gap). Candidate follow-up if burned uploads show up.spec.go, flags, interactive prompts —buildTabularalready emits the correct string-label tabular spec for TSC.Coupling
Requires tracebloc/data-ingestors PR tracebloc/data-ingestors#359 to land in the same release window (vendored schema comes from that branch — T16).
scripts/.data-ingestors-refpins that PR's head SHA; once #359 merges, bump the ref to the merge commit and re-runscripts/sync-schema.sh(the PR-branch SHA stays fetchable after a squash merge, so CI stays green either way).Test plan
Verified locally:
go build ./...,go vet ./...,gofmt -lclean,go test -race -cover ./...— all packages pass;scripts/coverage-floor.shok (push 84.6%).scripts/sync-schema.sh --checkgreen against the new pinned ref (the exact CI invocation).TestRegistryKnownCategories,TestSupportedCategories(now 15),TestRegistryCoversSchemaCategories,TestRegistryWithinSchema,TestRegistryMirrorsLayoutContract, newTestGroupingForMirrorsContract.TestCheckSequenceSchemaColumns,TestCheckSequenceRows,TestPreflightDataset_SequenceGrouped(dispatch-level: accept + sequence-count note, schema-missing reject, null-id reject, single-class reject, andtime_series_forecastingunaffected),TestBuild_Tabular_PassesSchema/time_series_classification,TestBuild_TSC_SchemaConditionalRequiresSequenceColumns(proves the vendored conditional actually enforces Decision-2).TestValidatorParity: goldens regenerated from the real WS1 validators; all 33 cases pass; zero drift in pre-existing verdicts/values.templates/time_series_classification/time_series_classification_sample_in_csv_format.csv, 6 patients / 30 rows / nullable lactate). Preflight accepts with the "6 sequence(s)" note; the producedingest.yamlpasses BOTH the WS1 branch's canonicalingest.v1.json(python jsonschema) and WS1's full real validator chain (map_validators("time_series_classification", …)) — schema + sequence-group + label-constancy + per-group order + numeric-columns + label-diversity all green.Deferred to CI / dev:
integratione2e suite (nightly /e2elabel) — not run locally.data ingestpush against a live workspace — needs a dev cluster with the WS1 ingestor image; belongs to the epic's FR-on-dev stage.Part of tracebloc/backend#1057 (epic tracebloc/backend#1054).
🤖 Generated with Claude Code
Note
Medium Risk
Touches ingestion validation and couples release to data-ingestors#359; two parity divergences mean some bad TSC CSVs can pass local preflight but fail after upload.
Overview
Adds
time_series_classificationtodata ingestso sequence-grouped tabular CSVs (fixedsequence_id/timestamp, one label per sequence) can be pushed end to end. The category registry marks it CLI-supported and classification-shaped; README now reflects 15 of 16 supported tasks.Vendored contracts (
ingest.v1.json,layout.v1.json) andscripts/.data-ingestors-refare re-synced from the upstream WS1 branch: new enum value, schema conditional requiringsequence_id+timestamp, and agroupingtrait on layout v2.GroupingForreads that trait so grouped behavior is not hardcoded to a category id.Preflight gains
CheckSequenceSchemaColumnsandCheckSequenceRows(null/NA sequence ids, sequence count note). Tabular label-diversity now gates onIsClassification(covers TSC, not onlytabular_classification). Sixtsc-*parity cases and goldens document two known gaps: mid-sequence label flips and per-group timestamp order are still accepted locally but rejected in-cluster.Reviewed by Cursor Bugbot for commit 8c24142. Bugbot is set up for automated code reviews on this repo. Configure here.