Skip to content

data commands: cleaner output — drop banner, honest empty state, hide internal tables - #370

Merged
LukasWodka merged 3 commits into
developfrom
chore/data-cmds-drop-banner
Jul 21, 2026
Merged

data commands: cleaner output — drop banner, honest empty state, hide internal tables#370
LukasWodka merged 3 commits into
developfrom
chore/data-cmds-drop-banner

Conversation

@LukasWodka

@LukasWodkaLukasWodka commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Two focused cleanups to the data commands' output.

1. Drop the intro banner + honest empty-state hint

The tracebloc banner block —

 tracebloc
────────────────────────────────────────
<subtitle>

— was printed at the top of every data command. It's redundant (each command's own Section/Para header already carries the context) and it hardcoded tracebloc regardless of how the CLI was launched. Removed from data list, data delete, data ingest.

For the empty data list, the hint now uses invokedName() so it echoes what the user actually typed:

 tracebloc → Datasets in <ns> (0)
──────────────────────────────────────── datasets in the cluster No datasets yet — ingest one with `tb data ingest`.
Datasets in <ns> (0)
· No datasets yet — ingest one with `tracebloc data ingest`.

(tb when launched via the tb alias, tracebloc otherwise — the same helper resources already uses.)

2. Hide the ingestor's reserved bookkeeping tables

ListDatasets ran a bare SELECT table_name … WHERE table_schema='training_test_datasets' with no filter, so the ingestor's internal bookkeeping tables leaked into data list as if they were user datasets and inflated the count. The ingestor (data-ingestors/tracebloc_ingestor/database.py) keeps two such tables and its own tests tag them "reserved":

  • tracebloc_ingest_runs (RUNS_TABLE — run tracking / idempotency)
  • tracebloc_ingest_meta (SALT_TABLE — pseudonymization salt)

Now filtered out at the shared ListDatasets layer, so they never surface as datasets anywhere: data list shows only real datasets, and data delete can no longer target the ingestor's bookkeeping. Reserved names live next to IngestionDatabase (kept in sync with the ingestor). The empty→nil listing contract is preserved.

Changed

  • data_list.go, data_delete.go, data_ingest_local.go — drop the banner; empty data list hint via invokedName().
  • push/teardown.go — reserved-table name constants next to IngestionDatabase.
  • push/list.gofilterReserved applied in listDatasetsWith.

Scope

Banner removal is data commands only, by design. The shared ui.Printer.Banner method is still called by resources/resources set/cluster/doctor (being redesigned in parallel); deleting the method + remaining call sites is a small follow-up once those land.

Test plan

  • go build ./..., go vet, gofmt — clean.
  • go test ./internal/push/... ./internal/cli/... ./internal/ui/... — green. New: TestFilterReserved + a reserved-filtering case in TestListDatasetsWith; TestRenderDataList_Empty/_Items still pass; the ui_test.goBanner unit test is untouched (method stays).
  • Verified live against a k3d env: banner gone; header reads Datasets in test0721 (N); DB had 33 tables incl. tracebloc_ingest_runs, data list showed 32 (the reserved table hidden).

🤖 Generated with Claude Code


Note

Low Risk
CLI output and list filtering only; behavior change is hiding internal tables and softer headers, with tests locking the filter contract.

Overview
Data command UX drops the redundant tracebloc intro banner on data list, data delete, and data ingest (replaced with a leading newline where needed); ingest/delete keep their explanatory paragraphs. Empty data list now suggests ingest using invokedName() so the hint matches how the binary was launched (tb vs tracebloc).

Dataset listing filters ingestor-internal MySQL tables (tracebloc_ingest_runs, tracebloc_ingest_meta) in ListDatasets via filterReserved, with constants documented next to IngestionDatabase. That fixes inflated counts and prevents those names from appearing as deletable datasets (delete already resolves targets through the same list). Tests cover filtering and the empty→nil slice contract.

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

Remove the `tracebloc` + rule + subtitle banner block from the data
commands (`data list`, `data delete`, `data ingest`). It's redundant
noise — each command's Section/Para header already carries the context —
and it hardcoded `tracebloc` regardless of how the user launched the CLI.
For an empty `data list`, render the hint via invokedName() so it reads
`tb data ingest` when the user launched via the tb alias (matching what
they typed), falling back to `tracebloc` otherwise — the same mechanism
`resources` already uses.
Scope: data commands only. The shared ui.Printer.Banner method stays for
now (still called by resources/doctor/cluster, being redesigned in
parallel) and will be deleted once those land.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodkaLukasWodka self-assigned this Jul 21, 2026
ListDatasets ran a bare `SELECT table_name … WHERE table_schema=
'training_test_datasets'` with no filter, so the ingestor's internal
bookkeeping tables (tracebloc_ingest_runs / tracebloc_ingest_meta) leaked
into `data list` as if they were user datasets and inflated the count.
Filter them out at the shared ListDatasets layer so they never surface as
datasets anywhere: `data list` shows only real datasets, and `data delete`
can no longer target the ingestor's bookkeeping. Reserved names live next
to IngestionDatabase, kept in sync with data-ingestors database.py
(RUNS_TABLE / SALT_TABLE). The empty→nil listing contract is preserved.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodkaLukasWodka changed the title data: drop the intro banner + honest empty-state hintdata commands: cleaner output — drop banner, honest empty state, hide internal tablesJul 21, 2026
Comment threadinternal/cli/data_ingest_local.go
Comment threadinternal/push/teardown.go
Follow-up to review on #370. Dropping the intro banner left three stale
comments describing output that no longer prints:
- data_list.go: --output-json note said "(the banner)" → header + listing
- data_ingest_local.go: resolveLocalInput doc listed "the intro banner"
→ intro explainer
- data_ingest_local.go: "Intro header: brand + …" → no brand now
Comments only — no behavior change.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodka
LukasWodka merged commit 27998ce into developJul 21, 2026
20 checks passed
@LukasWodka
LukasWodka deleted the chore/data-cmds-drop-banner branch July 21, 2026 11:16
LukasWodka added a commit that referenced this pull request Jul 21, 2026
Resolve internal/cli/data_list.go: keep the rich modality-grouped
renderer (--all, per-dataset size/records/format/split, details JSON)
and adopt #370's cleaner-output conventions on the shared surface —
no banner, honest empty state via invokedName() + Para.
Fold #370's reservedTables set into ListDatasetsDetailed's System-table
detection so the ingest-run journal and ingest-meta store are hidden by
default (alongside the existing data_id heuristic), consistent with how
ListDatasets now filters them.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodkaLukasWodka mentioned this pull request Jul 21, 2026
LukasWodka added a commit that referenced this pull request Jul 21, 2026
…375)
* ui: remove the shared Banner method — no intro banner on any command
Completes the banner removal started for the data commands (#370). The
`tracebloc` + rule + subtitle block is gone from the last callers —
`cluster info`, `resources`, `resources set` — and the shared
`ui.Printer.Banner` method is deleted so nothing can reintroduce it.
(`doctor` already dropped its banner in its own redesign.)
Spacing: commands whose first line is a Section (`cluster info`) keep their
leading blank from Section; the Stat/message-led paths (`resources` show,
the `resources set` no-op / phantom-GPU notes) get an explicit Newline so
every command still opens with exactly one blank line. Also dropped a now-
redundant Newline in the `resources set` dry-run path (Section supplies it).
Tests: drop the Banner unit-test call + its assertion; update the
cluster-info test that asserted the "cluster diagnostics" subtitle; fix
stale "banner" comments (incl. the ui package doc + a data-delete test).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(resources): drop the double blank before the set confirm hint (Bugbot #375)
After removing the intro banner, flag-driven interactive `resources set` (no
--yes/--dry-run) opened with TWO blank lines: a Newline() immediately before
PromptHint, which already self-leads with a newline. The dry-run path dropped
its redundant Newline() (Section supplies one) but the confirm path kept the
stacked pair, so the command no longer opened with a single blank line.
Remove the redundant Newline() — PromptHint's own leading newline gives the one
blank the PR's spacing contract promises. Adds TestSet_ConfirmOpensWithSingleBlank
(drives the flag confirm path via runSet) to pin it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* resources show: pin the single-blank opening with a test (Asad review, #375)
The leading Newline() in runResourcesShow (before resolve, so a resolve-time
redirect line also gets a blank) wasn't covered — every resources-show test
drives renderResources directly, skipping it. Wire runResourcesShow to the
resolveClusterTargetFn seam (matching the data commands) and add
TestShow_OpensWithSingleBlank: it drives the outer function through a canned
target and asserts it opens with exactly one blank — the mirror of
TestSet_ConfirmOpensWithSingleBlank. Confirmed it fails if the Newline() is
removed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodka

Copy link
Copy Markdown
ContributorAuthor

/fr-pass — verified live on dev: data list shows no banner, header "Datasets in test0721 (32)", and the reserved tracebloc_ingest_* bookkeeping tables are filtered out of the count.

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