Skip to content

fix(#386): strip surrounding quotes from the ingest path prompt + clarify dataset-name rules - #469

Merged
divyasinghds merged 1 commit into
developfrom
fix/386-ingest-prompt-quotes
Aug 7, 2026
Merged

fix(#386): strip surrounding quotes from the ingest path prompt + clarify dataset-name rules#469
divyasinghds merged 1 commit into
developfrom
fix/386-ingest-prompt-quotes

Conversation

@divyasinghds

@divyasinghdsdivyasinghds commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Fixes two independent UX papercuts in the interactive tracebloc data ingest flow (both localized to the guided-prompt code).

Part 1 — strip surrounding quotes from the "Where is your data?" prompt

The prompt is read literally, not shell-parsed. A pasted quoted path — common when dragging a folder into a terminal (auto-quoted) or quoting a path with spaces — had the quote chars become part of the path, so ingest failed with e.g. no such file or directory: "'/home/me/my data/train'".

  • Added stripSurroundingQuotes (removes at most one matching pair of the same surrounding quote char '/"; inner and mismatched quotes untouched) and dequotePath (trim → strip → trim).
  • Applied to the interactive answer before expandHome / statDatasetPath, and inside validateDatasetPath so the re-prompt guard is consistent (an answer of just an empty quote pair is now rejected at the prompt instead of dying later with a messy error).
  • Applied only to the guided answer — never the flag/positional path (the shell already de-quotes those).

Acceptance: pasting '…' or "…" resolves identically to the bare path; an unquoted path with spaces still works; a name that really contains a quote loses only the single matched outer pair.

Part 2 — clarify the dataset-name rules

Names must match [A-Za-z_][A-Za-z0-9_]*, but the hint/error never said hyphens and spaces are rejected, so kebab-case (tsc-train) surprised users.

  • Name-prompt hint now reads "no hyphens or spaces, use _".
  • First line of the ValidateTableName error now leads with "no hyphens or spaces (use _)" before the MySQL/PVC rationale.

Wording only — nothing changes about what names are accepted or rejected.

Validation

  • go build ./..., go test ./..., go vet, gofmt -s all pass.
  • Regenerated zz-all-strings.golden for the hint change (only that line moved).
  • Added table-driven tests for the quote helpers ('/a/b', "/a/b", bare, spaces, name-with-a-quote, mismatched, empty-quote pairs) plus a wording-pin test for the error.

Closes#386

🤖 Generated with Claude Code


Note

Low Risk
Localized CLI prompt/validation and copy changes with no change to accepted table names or non-interactive ingest paths.

Overview
Fixes two guided data ingest UX issues (#386).

Path prompt: The "Where is your data?" answer is read literally (not shell-parsed), so pasted '…' or "…" paths failed with no such file or directory. The flow now stores dequotePath (trim + stripSurroundingQuotes for one matching outer '/" pair) before expandHome / stat, and validateDatasetPath uses the same canonicalization so '' / "" are rejected at the prompt. This applies only to the interactive answer, not flag/positional paths.

Dataset name: Copy-only updates to the name-prompt hint and ValidateTableName error text to state that hyphens and spaces are not allowed and _ should be used; validation rules are unchanged.

Adds table-driven tests for the quote helpers and a wording pin for invalid kebab-case names; golden strings updated for the hint line.

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

… dataset-name rules
Part 1: the interactive "Where is your data?" prompt is read literally, not
shell-parsed, so a pasted quoted path (dragging a folder into a terminal
auto-quotes it; users habitually quote paths with spaces) had the quote chars
become part of the path and failed to resolve. Add stripSurroundingQuotes /
dequotePath and apply them to the interactive answer before expandHome /
statDatasetPath, and inside validateDatasetPath so the re-prompt guard is
consistent. Conservative: strips at most one matching outer pair of the same
quote char, leaves inner/mismatched quotes untouched, and only touches the
guided answer — never the flag/positional path (the shell de-quotes those).
Part 2: spell out "no hyphens or spaces — use _" in the name-prompt hint and
on the first line of the ValidateTableName error. Wording only; nothing
changes about what names are accepted or rejected.
Regenerated zz-all-strings.golden for the hint change. Added table-driven
tests for the quote helpers and a wording-pin test for the error.
Closes#386
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@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.

Clean, well-scoped fix — the dequote path canonicalization is consistent between store and validate, and the mismatched/inner-quote edge cases are handled correctly. Tests pass locally. 👍

@divyasinghds
divyasinghds merged commit 9fbc976 into developAug 7, 2026
28 checks passed
@divyasinghds
divyasinghds deleted the fix/386-ingest-prompt-quotes branch August 7, 2026 10:25
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.

data ingest: strip surrounding quotes from the path prompt + clarify dataset-name rules

3 participants

@divyasinghds@saadqbal@LukasWodka