Skip to content

feat(data ingest): wire semantic_segmentation (RFC-0002 phase 4, #182) - #247

Merged
saadqbal merged 2 commits into
developfrom
feat/182-semantic-segmentation
Jul 14, 2026
Merged

feat(data ingest): wire semantic_segmentation (RFC-0002 phase 4, #182)#247
saadqbal merged 2 commits into
developfrom
feat/182-semantic-segmentation

Conversation

@LukasWodka

@LukasWodkaLukasWodka commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Wires semantic_segmentation into data ingest — the last CLI-pending task, closing out #182 / RFC-0002 phase 4. semseg is an existing, fully-registered category (backend/engine/SDK/zoo/ingestor all have it — the category blueprint §4.2 names it the donor for "CSV link-column" file-bearing categories); this is only the CLI-push slice (§3.2). Its blockers landed: di#358 shipped the ingestor's mask_id require-and-enforce (v0.7.0) and backend#816 closed.

What changed

  • category.gosemantic_segmentationCLISupported: true (all 16 tasks now wired).
  • DiscoverSemanticSegmentationlabels.csv + images/ + masks/*.png (required), mirroring DiscoverObjectDetection.
  • spec.go — emits masks: + declares schema: {mask_id: VARCHAR(255)} so the ingestor storesmask_id (the backend#816 crux — an undeclared one is dropped and training can't find masks), matching the canonical example manifest.
  • Preflight mirrors the ingestor's semseg validators (modalities/validators.py):
  • data.go — friendly "needs --label-column" pre-check extended to semseg (the schema's allOf requires label for it, but the per-image label reads as vestigial beside the masks, so the flag is easy to forget → without this, an opaque schema dump).
  • No vendored-schema change (the contract already declared semseg's masks sidecar — drift check green).

Faithfulness (RFC-0002 Principle 6 — mirror the ingestor, never over-reject)

Reviewed adversarially (a 3-angle /code-review + a walk of the blueprint §3.2/§7). Findings fixed:

Deliberately not added (would over-reject / out of scope): CheckLabelColumn for semseg (the ingestor omits LabelColumnValidator — labels come from the masks).

Deferred (noted for follow-up, not blockers)

  • Mask resolution / PNG-readability preview — the ingestor runs a 2nd ImageResolutionValidator + FileTypeValidator on masks/; the CLI previews the high-value checks and leaves these to the in-cluster pass (an under-rejection, not over-rejection).
  • CheckAnnotationPairing (object_detection) has the same pre-existing dotfile gap; extending the #214 friendly-label guard to all label-requiring image categories would help imgc/OD/keypoint too.
  • Sidecar-validator parity cases (testdata/parity/) — object_detection (the file-bearing donor) has none either; covered here by unit tests.

Test plan

  • make ci green (build, -race tests, gofmt, lint, schema drift).
  • New unit tests, mutation-proven: discovery (valid / missing masks), CheckMaskPairing (paired / image-without-mask / mask-without-image / non-conforming / hidden-file), CheckMaskIdColumn (valid / missing / wrong-case / empty / NA / padded-NA), TestBuild_SemanticSegmentation (masks + schema{mask_id} emission + schema validation — guards the #816 crux), TestSemsegSidecarMirrorsContract (pins the hardcoded masks/*.png/mask_id to the vendored contract).
  • Updated the registry / picker / gate tests that pinned "semseg pending" (all 16 categories CLI-supported now).

Checklist

  • Targets develop
  • make ci green
  • Mirrors the ingestor (blueprint §3.2 CLI touchpoints all covered; faithful to the semseg validators)
  • Tests added + mutation-checked
  • Human review

Closes#182.

🤖 Generated with Claude Code


Note

Medium Risk
Adds a new file-bearing ingest path and CSV/mask contract checks; behavior is scoped to one task and heavily tested for ingestor parity, but mistakes could still cause late cluster failures or incorrect staging.

Overview
Enables data ingest for semantic_segmentation, completing CLI support for all 16 ingest schema tasks. The category registry marks it CLI-supported (no pending note); docs and gates now describe full task coverage instead of semseg as blocked.

Local layout follows object detection: labels.csv + images/ plus required masks/*.png, discovered via DiscoverSemanticSegmentation and staged through the existing sidecar/tar path. Ingest specs add masks/ and declare schema: { mask_id: VARCHAR(255) } so the ingestor stores the mask link column.

Preflight mirrors ingestor validators: CheckMaskPairing (<image>_mask.png), CheckMaskIdColumn (exact mask_id, row population, NA-sentinel parity), and CrossCheckLabels for rows vs images—without CheckLabelColumn, which the ingestor omits for semseg. --label-column gets the same friendly missing-label guard as tabular tasks; the pre-flight summary shows mask file counts.

Tests drop “semseg pending” expectations, add discovery/preflight/spec/contract coverage, and assert the image task picker lists semantic segmentation under “Available now.”

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

LukasWodkaand others added 2 commits July 13, 2026 17:29
Closes the last CLI-pending task now that its blockers landed: di#358
shipped the ingestor's mask_id require-and-enforce (v0.7.0) and backend#816
closed. semantic_segmentation now ingests like the other image tasks, with a
masks/ sidecar and the mask_id link-column contract.
- category.go: flip semantic_segmentation CLISupported -> true.
- DiscoverSemanticSegmentation: labels.csv + images/ + masks/*.png (required),
mirroring DiscoverObjectDetection's sidecar path.
- spec: emit spec["masks"] + declare the mask_id column
(schema:{mask_id: VARCHAR(255)}, matching the canonical example) so the
ingestor STORES it -- an undeclared mask_id is dropped and the training
client then can't locate masks (backend#816).
- preflight mirrors the ingestor's semseg validators (modalities/validators.py):
CheckMaskPairing (images<->masks by the "_mask" suffix, FilePairingValidator)
+ CheckMaskIdColumn (mask_id declared exact-lowercase + populated on every
row, NA-sentinel-aware -- MaskIdColumnValidator, backend#816).
- Vendored layout.v1.json already declared semseg's masks sidecar, so no
schema change (drift check green).
Tests: discovery (valid/missing masks), pairing (4 cases), mask_id (5 cases).
Updated the registry/picker/gate tests that pinned "semseg pending" (all 16
categories are CLI-supported now); retired the known-but-unsupported
pending-note test (no such category remains; the defensive branch stays).
make ci green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…images, friendly label
Adversarial self-review (3-angle /code-review) + a walk of the backend#1074
category blueprint (§3.2 CLI touchpoints, §7 traps) before human review. Fixes:
- CheckMaskIdColumn tests the RAW cell against the NA set (+ a whitespace-only
clause) instead of trimming first, so a padded token like " NULL " isn't
false-flagged empty -- pandas keeps the spaces, so it's a real value
in-cluster (the cli#218/#239 over-rejection parity trap; flagged by all 3
review finders).
- CheckMaskPairing skips hidden files (macOS AppleDouble ._x), mirroring
FilePairingValidator._stems, so a stray ._x.png can't fake a mismatch.
- semseg preflight adds CrossCheckLabels (labels.csv rows -> images/), the same
fail-fast image_classification runs.
- the #214 friendly "needs --label-column" guard now covers semseg (the ingest
schema's allOf requires label for it; the vestigial-looking per-image label
makes the flag easy to forget -> was an opaque schema dump).
- empty mask_id rows reported as "data row N"; graceful empty UnsupportedNote.
Tests (mutation-proven): padded-NA + hidden-file cases, TestBuild_SemanticSegmentation
(masks + schema{mask_id} emission + schema validation), TestSemsegSidecarMirrorsContract
(pins hardcoded masks/*.png/mask_id to the vendored contract). make ci green.
Deferred (noted in PR): mask-resolution/PNG preview (under-rejection); OD's
same pre-existing dotfile gap.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@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 51b61d3. 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.

Solid PR 👍 The padded-NA handling in CheckMaskIdColumn (raw cell vs naSentinels before trim) is exactly right — that's the parity trap that bit us on #218/#239. Mask pairing + the mask_id schema declaration all check out against the vendored contract. LGTM.

@saadqbal
saadqbal merged commit 3ec2c4d into developJul 14, 2026
22 checks passed
@saadqbal
saadqbal deleted the feat/182-semantic-segmentation branch July 14, 2026 08:34
LukasWodka added a commit that referenced this pull request Jul 14, 2026
…elease policy (#296)
Every claim re-verified against the actual command tree (go run
./cmd/tracebloc --help + each subcommand on develop @ 5af9a80):
README:
- v0.3.0 status blurb -> v0.8.0 latest release + a lifecycle command
table (login/logout/auth, client/status, resources show+set,
data ingest/list/delete/validate, cluster info, doctor, delete,
version/completion/home screen); notes what landed post-v0.8.0
- 15-of-16 tasks -> all 16 (semantic_segmentation shipped in #247;
registry verified: 16x CLISupported, zero false)
- roadmap tail: 9-of-10-modalities + v0.2/v0.3 story -> v0.2-v0.8
arc; semseg removed from Next (done); cloud-source kept (backed
by RFC-0002 + the in-help 1 GiB cap copy)
- links the navigation map
docs/cli-navigation.md:
- stale-basis disclaimer removed (was develop @ 27c5392)
- resources set (#241) + status-aware home screen (#244) un-dashed —
both merged; proposed classDef dropped
- nonexistent home-screen-spec.md references removed (point at #244)
- doctor node: top-level doctor shipped, cluster doctor = hidden
alias (pinned by TestClusterCmd_DoctorIsHiddenAlias)
- known-gaps list pruned to what is still true (offboard partial
teardown still exits 0 — re-verified in delete.go)
scripts/RELEASE_CHECKLIST.md:
- 5-line release policy: trigger = customer-visible merge or weekly,
owner = DevEx squad (role, not person)
- EKS smoke: dataset push -> data ingest; v0.1-ticket pre-flight
genericized
release.yml: header comment claimed release notes come from
CHANGELOG.md — no such file exists; it's generate_release_notes: true.
Fixes#296
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
saadqbal pushed a commit that referenced this pull request Jul 14, 2026
…release policy (#307)
* docs: truth pass — README/nav-map/checklist match the v0.8 surface; release policy (#296)
Every claim re-verified against the actual command tree (go run
./cmd/tracebloc --help + each subcommand on develop @ 5af9a80):
README:
- v0.3.0 status blurb -> v0.8.0 latest release + a lifecycle command
table (login/logout/auth, client/status, resources show+set,
data ingest/list/delete/validate, cluster info, doctor, delete,
version/completion/home screen); notes what landed post-v0.8.0
- 15-of-16 tasks -> all 16 (semantic_segmentation shipped in #247;
registry verified: 16x CLISupported, zero false)
- roadmap tail: 9-of-10-modalities + v0.2/v0.3 story -> v0.2-v0.8
arc; semseg removed from Next (done); cloud-source kept (backed
by RFC-0002 + the in-help 1 GiB cap copy)
- links the navigation map
docs/cli-navigation.md:
- stale-basis disclaimer removed (was develop @ 27c5392)
- resources set (#241) + status-aware home screen (#244) un-dashed —
both merged; proposed classDef dropped
- nonexistent home-screen-spec.md references removed (point at #244)
- doctor node: top-level doctor shipped, cluster doctor = hidden
alias (pinned by TestClusterCmd_DoctorIsHiddenAlias)
- known-gaps list pruned to what is still true (offboard partial
teardown still exits 0 — re-verified in delete.go)
scripts/RELEASE_CHECKLIST.md:
- 5-line release policy: trigger = customer-visible merge or weekly,
owner = DevEx squad (role, not person)
- EKS smoke: dataset push -> data ingest; v0.1-ticket pre-flight
genericized
release.yml: header comment claimed release notes come from
CHANGELOG.md — no such file exists; it's generate_release_notes: true.
Fixes#296
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs: refresh README latest-release refs v0.8.0 -> v0.9.1 (#296)
Addresses Asad's review on #307: this truth pass predated the v0.9.0
and v0.9.1 cuts, so a few version claims went stale.
- Status blurb: "v0.8.0 is the latest release" -> "v0.9.1 is the
latest release".
- The post-v0.8.0 "ships with the next release" framing for
resources / status-aware home screen / top-level doctor /
semantic_segmentation -> "Shipped in v0.9.0" (they released in
v0.9.0, no longer "next").
- Roadmap tail: "Since the v0.8.0 cut, develop gained ..." -> a
"v0.9 added ...; v0.9.1 is the current latest" entry, extending
the v0.2-v0.8 arc.
Historical v0.8.0 references (the v0.8.0 cut, cluster doctor in
v0.8.0) kept as deliberate contrasts. Homebrew tap stays dropped
(#300) - no reintroduction.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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