fix(interactive): show Windows path examples on Windows (client#615) - #487
Merged
Conversation
Step 3 of the guided ingest ("Where is your data?") offered only POSIX examples:
Tabular one CSV file e.g. ~/data/patients.csv
Images a folder with labels.csv + images/ e.g. ~/data/xray/
Text a folder with labels.csv + texts/ e.g. ~/data/reviews/
A Windows user has no such path, and with nothing in the right shape to copy they
invent one. The reported case entered a Python-style r"C:\Users\..." literal, which
the CLI can't read -- the prompt is read literally, not shell-parsed.
datasetPathExamples now returns examples in the form the host OS actually uses, so
a Windows user sees C:\Users\you\data\patients.csv and folder examples that end in
a separator (a folder example that doesn't look like a folder invites a file path).
The label and padding text stays in ONE place -- only the example is substituted --
so the STYLE.md column alignment can't drift between two copies.
It takes goos as a parameter instead of reading runtime.GOOS internally, so the
Windows branch is exercised from a Linux/macOS runner where it would otherwise never
be covered; the call site passes runtime.GOOS.
Tests: 4 new. They pin that Windows examples carry no POSIX syntax and folder
examples end in a separator, that the POSIX branch is not regressed while fixing
Windows, that the three modalities stay distinguishable, and that the call site
follows the host OS. Verified they fail when the Windows branch is disabled.
The copy-catalog golden now records the format strings (`e.g. %s`) rather than the
concrete examples, since the text is dynamic; the example values are covered by the
unit tests instead. Regenerated with TB_UPDATE_GOLDEN=1 and reviewed the diff --
exactly the four intended strings changed, nothing else.
Full suite green; gofmt -s, goimports, vet, errcheck, misspell, staticcheck clean;
builds for windows/amd64 as well as the host.
Closes tracebloc/client#615
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
shujaatTracebloc
marked this pull request as draft
August 11, 2026 14:51
shujaatTracebloc
marked this pull request as ready for review
August 12, 2026 07:56
version-bump-gate fails a PR that touches publish paths (cmd/*, internal/*, go.mod, go.sum, VERSION) while VERSION still names an ALREADY-TAGGED release. This PR changes internal/cli, and VERSION was 0.10.4 with v0.10.4 already tagged, so the gate was red by construction. The gate's contract is that the PR carries the bump -- 'a PR that bumps to an unreleased version passes' -- so bump to 0.10.5 (verified untagged, after a --tags fetch). Distinct from hand-cutting a release: no tag is created here, and the train remains the only path to one. Nothing else in the tree pins 0.10.4 (checked .go, .golden, .yml). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
saadqbal
approved these changes
Aug 12, 2026
saadqbal
left a comment
Collaborator
There was a problem hiding this comment.
Clean, tight fix 👍 Parameterizing datasetPathExamples on goos so the Windows branch is testable from a Linux/macOS runner is the right call, and the tests bite (verified locally — package green, vet clean). Golden switching to e.g. %s for the now-dynamic lines is correct.
One tiny non-blocker (pre-existing, not introduced here): the three e.g. markers don't quite line up in monospace — Tabular sits at col 46, Images 47, Text 48. Since the PR leans on column alignment as a design detail, might be worth a 2-space / 1-space nudge while these lines are open. Not merge-blocking.
shujaatTracebloc
added a commit
that referenced
this pull request
Aug 12, 2026
…; zero == unknown) (#492) * fix(data list): text datasets showed no size — measure apparent bytes, and stop conflating zero with unknown `tb data list` showed no size for EVERY text dataset (text/token classification, masked + causal LM, seq2seq, sentence-pair, embeddings) while image datasets in the same namespace showed real sizes. Records, classes, extension and task were all correct; only the size was missing. Two independent defects compound: 1. MIS-MEASURED. Sizes come from `du -sk <shared>/*` in the jobs-manager pod. Without --apparent-size, du measures st_blocks, and on a bind-mounted host filesystem (Docker Desktop, and any mount that doesn't report block allocation for small files) that returns 0 for a directory of small files. Measured on a real node: mlm_train 0, text_train 0, image_train 180. Image datasets survive only because their files are big enough to occupy reported blocks; text datasets are dozens of small .txt documents, so every one measures zero. Now probes --apparent-size support once (busybox du rejects the flag) and passes it to a single du run. Deliberately NOT `du --apparent-size … || du …`: du exits non-zero if ANY path is unreadable, so that chain would silently fall back to block sizes whenever one dataset dir was inaccessible — reintroducing the bug intermittently, which is harder to diagnose than never having the flag. A test pins that the real du runs exactly once. 2. ZERO == UNKNOWN. sizeCell gated on `SizeBytes > 0`, so a dataset measured at 0 was indistinguishable from one we never managed to measure. That is why this presented as "size missing" rather than "size wrong", and why it looked like a broken lookup when the lookup was fine. DatasetInfo now carries SizeKnown: a measured zero renders 0 B, and only a failed lookup renders —. SizeKnown rather than an inverted SizeUnknown on purpose: if a producer ever forgets the flag, rendering — understates what we know, whereas the inverted field would assert a confident 0 B that is false. Tabular/time-series hid defect 1 by accident — their empty Extension routes them to DBBytes instead of du. Tests: 4 new. Verified both guards fail when their own defect is reintroduced. Existing fixtures that set a size now declare SizeKnown, since they model measured datasets; the copy-catalog golden is UNCHANGED, which is the point — measured datasets render exactly as before and only genuinely-unknown ones change. (My first pass at annotating fixtures missed the two in copy_catalog_test.go because they end in `}` not `,`; reviewing the regenerated golden caught it showing — where real sizes belong, so the golden was reverted and the fixtures fixed instead of accepting the drift.) VERSION -> 0.10.6 (0.10.5 is claimed by #487): version-bump-gate fails any PR touching internal/* while VERSION names an already-tagged release. No tag is cut here. Full suite green; gofmt -s, goimports, vet, errcheck, staticcheck clean. Closes #491 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(data list): expose size_known in --output-json too Asked whether the size fix covered ALL text data, and checking properly found a gap I had left: the JSON view still had size_bytes with no way to tell a MEASURED zero from "couldn't measure". That is the same ambiguity the rendered table had — the one that made an entire modality read as sizeless while the lookup was fine — so fixing only the human view would have left every scripted consumer with the original bug. size_known is emitted always, never omitempty: omitting it when false would recreate exactly the ambiguity it exists to remove. Coverage confirmed while checking, rather than assumed: all seven FamilyText categories (text_classification, masked_language_modeling, causal_language_modeling, seq2seq, token_classification, sentence_pair_classification, embeddings) are fixed by one change, because the du runs once over the whole shared root — it is not per-category. Any small-file dataset of any modality is fixed with them. Test asserts a measured zero reports size_known=true with 0 bytes, an unmeasured one reports false, and the key is present in the payload. Verified it fails when the mapping is dropped. 16 packages green; gofmt + staticcheck clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: shujaat hasan <shujaathasan@shujaats-MacBook-Pro.local> Co-authored-by: Claude Opus 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 free
to 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.
Closes tracebloc/client#615.
The bug
Step 3 of the guided ingest — "Where is your data?" — offered only POSIX examples:
A Windows user has no such path. With nothing in the right shape to copy, they invent one — the
reported case entered a Python-style
r"C:\Users\..."literal, which the CLI can't read becausethis prompt is read literally, not shell-parsed.
The change
datasetPathExamplesreturns examples in the form the host OS actually uses. On Windows:Two deliberate details:
STYLE.md column alignment can't drift between two copies of the same line.
goosas a parameter rather than readingruntime.GOOSinternally, so the Windowsbranch is exercised from a Linux/macOS runner where it would otherwise never be covered. The
call site passes
runtime.GOOS.Folder examples end in a separator on both platforms: a folder example that doesn't look like a
folder invites a file path instead.
Tests
Four new, covering the things that would actually regress:
~or/) and folder examples end in\.goos.Verified they bite: disabling the Windows branch fails the suite.
Note on the copy golden
zz-all-strings.goldennow records the format strings (e.g. %s) instead of the concreteexamples, since the text is dynamic — the example values are covered by the unit tests instead.
Regenerated with
TB_UPDATE_GOLDEN=1and I reviewed the diff rather than accepting it blind:exactly the four intended strings changed, nothing else.
Verification
go test ./...— 16 packages ok, 0 failures.gofmt -s,goimports -local,go vet,errcheck,misspell,staticcheck -checks all,-ST1005all clean. Builds forwindows/amd64as well as the host.
I develop on macOS, so the Windows rendering is reasoned from the format string plus
Printer.Infof(which doesfmt.Sprintf) — I verified the formatting path rather than assumingit, but the visual check on a Windows console is still worth one glance.
🤖 Generated with Claude Code
Note
Low Risk
Prompt-copy UX fix only; no path parsing, auth, or ingest logic changes. Risk is limited to incorrect example text on Windows.
Overview
Fixes the guided ingest "Where is your data?" step so example paths match the host OS. Windows users previously only saw POSIX
~/data/...examples and sometimes entered unreadable formats (e.g. Pythonr"..."literals).Adds
datasetPathExamples, parameterized bygoosfor testability, and wires it into the modality hints and input help text viaruntime.GOOS. Windows getsC:\Users\you\data\...examples (folders ending in\); other OSes keep~/data/....Includes unit tests for Windows/POSIX shape, modality distinctness, and host-OS selection, and updates the strings golden to record
%splaceholders for the now-dynamic examples. Bumps version to 0.10.5.Reviewed by Cursor Bugbot for commit f36ede4. Bugbot is set up for automated code reviews on this repo. Configure here.