Thorough review pass#99
Merged
Merged
Conversation
Address three release-quality bugs plus a set of copy-paste mistakes in user-facing strings surfaced during the pre-v1.0 review: - collection list: render Dimension/VectorCount via strconv instead of string(int32), which emitted Unicode runes instead of numbers - index configure: register the missing --json/-j flag so its existing JSON output and FailJSON error paths are reachable - auth configure: nil-check the --project-id lookup so an unmatched ID fails cleanly instead of panicking on a nil deref Help/error string fixes: - local-keys prune: dry-run hint referenced a nonexistent --yes flag; corrected to re-run without --dry-run (+ optional --skip-confirmation) - organization delete: remove doubled quote in example - project update/describe, organization update, api-key list: "no target set" hints pointed at the wrong subcommand - vector query: fix verbless required-input error string
A2: remove the -p/-d shorthands from index configure and index restore deletion-protection flags so the flag is long-form-only and consistent across create/configure/restore (no shorthand collisions with project/dimension/description elsewhere). A3: document that namespace operations address the default namespace via __default__. Per the server contract (pc-commons namespace_util.rs, query-router service), namespace describe/delete require __default__ and reject the empty string, while responses already render the default as __default__ at the pinned API version (2025-10). No CLI-side namespace rewriting is needed, so this is help-text only: add a __default__ example and flag hint to namespace describe and namespace delete.
A4: add interactive confirmation to destructive delete commands that lacked it. Introduce a shared confirm.Deletion helper (internal/pkg/utils/confirm) and route all delete commands through it, replacing the three duplicated confirmDelete copies (organization, project, api-key) and adding prompts to index delete, collection delete, backup delete, namespace delete, and vector delete. Each gains a --skip-confirmation flag, and --json also bypasses the prompt. vector delete only confirms for --all-vectors; targeted --ids/--filter deletes proceed without a prompt. A1: correct the AGENTS.md --json description. The flag is explicit and is not inferred from TTY state (only color is auto-suppressed on a non-TTY); the login/target/auth interactive flows are the documented exception.
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.
Summary
A pre-v1.0 finalization pass over the CLI. A review across code, help text, docs, and release plumbing surfaced a handful of release-quality bugs plus several inconsistencies in the soon-to-be-frozen public surface. This PR fixes the bugs and settles the surface ahead of tagging v1.0.0. Internal-quality follow-ups (test coverage, service-interface refactors) are intentionally deferred to post-tag.
Bug fixes
collection list: dimension/vector-count rendered viastring(int32), emitting Unicode runes instead of numbers — now formatted withstrconv.index configure --json: the flag was read but never registered, so JSON output andFailJSONerror paths were unreachable. Flag is now registered.auth configure --project-id <unknown>: an unmatched project id fell through to a nil dereference (panic). Now fails cleanly with a clear message.Help text & error-message corrections
auth local-keys prune: dry-run hint referenced a nonexistent--yesflag.organization delete: stray doubled quote in an example.project update/project describe/organization update/api-key list: "no target set" hints pointed users at the wrong subcommand.index vector query: fixed a verbless required-input error string.Public-surface finalization
-p/-dshorthands onindex configureandindex restore(collided with project/dimension shorthands elsewhere); the flag is now long-form-only across create/configure/restore.__default__. Validated against the server contract (namespace ops require__default__and reject""; responses already render__default__at the pinned API version), so no client-side rewriting was needed — help-text only. See pc index vector query: empty --namespace coerced to __default__ #85 for background.confirm.Deletionhelper and routed all delete commands through it — consolidating three duplicatedconfirmDeletecopies (organization/project/api-key) and adding prompts toindex,collection,backup,namespace, andvectordelete. Each gains a--skip-confirmationflag, and--jsonalso bypasses the prompt.vector deleteconfirms only for--all-vectors; targeted--ids/--filterdeletes proceed silently.--jsondocs: corrected the AGENTS.md claim —--jsonis explicit and is not inferred from TTY state (only color is auto-suppressed on a non-TTY); thelogin/target/authinteractive flows are the documented exception.Deferred to post-tag
Test-coverage and refactor work that doesn't affect the public surface: vector-ops tests + service-interface refactor, api-key command tests, sdk credential-resolution tests, and whoami/logout de-duplication.
Testing
go build,go vet,go test ./..., andgolangci-lint runall pass.Note
Medium Risk
Adds confirmation gates and changes
--json/TTY semantics across many delete commands, which can break non-interactive scripts that relied on silent deletes or implicit JSON; fixes are low-risk but behavior change is broad.Overview
Pre-v1.0 pass that fixes several user-visible bugs, tightens help/errors, and standardizes destructive deletes and flag behavior.
Bug fixes:
collection listnow prints numeric dimension/vector counts viastrconvinstead of bogus Unicode fromstring(int32).index configureregisters--jsonso JSON success/error paths work.auth configure --project-idwith an unknown ID fails with a clear message instead of panicking.Deletion UX: New shared
confirm.Deletionreplaces three duplicated confirm helpers and adds interactive prompts (plus--skip-confirmation;--jsonskips prompts) on index, collection, backup, namespace, and API key/org/project deletes.vector deleteonly prompts for--all-vectors.Public surface / docs:
--deletion-protectionis long-form only on configure/restore (removed-p/-dshorthands). Namespace help documents__default__for the default namespace. AGENTS.md clarifies--jsonis explicit (not TTY-inferred), exceptlogin/target/auth. Various hint strings and examples corrected; e2e teardowns pass--skip-confirmationon deletes.Reviewed by Cursor Bugbot for commit cd109e5. Bugbot is set up for automated code reviews on this repo. Configure here.