Skip to content

feat(cli): add catalog-aware value completions - #415

Merged
BramVR merged 1 commit into
mainfrom
codex/issue-401-value-completions
Jul 31, 2026
Merged

feat(cli): add catalog-aware value completions#415
BramVR merged 1 commit into
mainfrom
codex/issue-401-value-completions

Conversation

@BramVR

@BramVR BramVR commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • add catalog-aware completion for export datasets, sync/raw Data Types, raw targets/endpoints, scope keywords, Rollup modes, and source families
  • preserve CSV prefixes, suppress duplicates, sort candidates lexically, and retain filesystem fallback only for path values
  • derive candidates from typed registries with completion-policy and catalog drift guards

Proof

  • Formatting: make fmt-check
  • Lint: pinned golangci-lint v2.12.2, 0 issues
  • Tests: go test ./...
  • Race: go test -race ./...
  • Build: make build
  • Docs: make docs-check
  • Project Site: make docs-site plus full Pages artifact smoke
  • Built CLI: hidden callback candidates, CSV prefix/dedup, Rollup window=, path-only fallback, and deterministic generation
  • Shells: Bash and Zsh generated scripts parse and load locally; Fish/PowerShell generation is deterministic, and hosted Windows exercises the PowerShell parser
  • Security: go vet ./..., go mod verify, govulncheck (no vulnerabilities), TruffleHog/autoreview clean
  • Public Model Identifier Gate: no model identifiers introduced
  • Docs/changelog impact reviewed: install and generated completion docs updated; repository has no changelog file
  • Public artifact confidentiality gate reviewed: no secrets, tokens, OAuth client JSON, personal Health Archive data, provider payloads, private paths, or identifying screenshots/logs are exposed

Notes

  • Closes feat(cli): add catalog-aware value completions #401
  • Dependency freshness: Cobra is current; modernc.org/sqlite has a direct v1.53.0 → v1.55.0 update, unrelated to this focused change and not vulnerability-driven
  • Claude Opus review not required: all new discovery functions are under Go's internal package boundary; no public API contract changes
  • Local Fish and PowerShell executables were unavailable; exact-head hosted Windows proof is required before merge

Copilot AI review requested due to automatic review settings July 31, 2026 08:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds catalog-aware, deterministic value completion to the CLI by introducing explicit “value completion policies” in the command/flag registry and wiring those into Cobra’s completion protocol. It sources candidates from typed catalogs (export datasets, Google Health Data Types/endpoints, rollup kinds, scope keywords, and source families), preserves CSV prefixes while deduplicating, and keeps filesystem completion enabled only for path values.

Changes:

  • Add completion policy metadata to commandDef/flagSpec, validate registry coverage, and register per-flag/per-positional completion handlers.
  • Introduce canonical catalog projection helpers for raw targets/endpoints, syncable/listable data types, and supported source families (with drift-guard tests).
  • Update CLI help/docs to describe catalog-backed completions and path-only filesystem fallback.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/googlehealth/scopes.go Adds RawEndpointNames() catalog projection for raw endpoint completion.
internal/googlehealth/fetch.go Introduces typed raw target kinds and exposes RawTargetNames() for completion.
internal/googlehealth/fetch_extra_test.go Adds drift tests for raw endpoint/target completion projections.
internal/googlehealth/catalog.go Adds completion views (SyncableDataTypes, ListableDataTypes, SupportedSourceFamilies) and source-family catalog mapping.
internal/googlehealth/catalog_test.go Adds drift tests for completion view projections and copy safety.
cmd/gohealthcli/sync.go Uses catalog-backed usage strings for rollup and source-family flags.
cmd/gohealthcli/connect_add_scopes.go Exposes sorted scope keyword names for completion and keeps usage derived from canonical keyword set.
cmd/gohealthcli/completion.go Implements policy-driven Cobra completion for flags/positionals, CSV prefix preservation, dedup, and sorting.
cmd/gohealthcli/completion_test.go Adds protocol-level tests for catalog candidates, directives, stability, sorting, and path-only filesystem fallback.
cmd/gohealthcli/common_flags.go Marks --config and --db as file-completable (filesystem fallback).
cmd/gohealthcli/commands.go Adds completion policy fields and populates them across command registry surfaces.
docs/install.md Documents catalog-backed completions and path-only filesystem fallback behavior.
docs/commands/completion.md Updates completion command docs to reflect new value completion behavior and constraints.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@BramVR
BramVR merged commit 135752e into main Jul 31, 2026
7 checks passed
@BramVR
BramVR deleted the codex/issue-401-value-completions branch July 31, 2026 08:48
Sign up for free to 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.

feat(cli): add catalog-aware value completions

2 participants