fix(cli): report defaulted global parameters in whoami - #65
TristanSpeakEasy wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
|
Both findings in this review are addressed in 1d8152a:
Primary regeneration, compilation/staticcheck, template checks, and the focused whoami/keyring tests ( |
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would not auto-approve. Auto-approval blocked by 1 unresolved issue from previous reviews.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would auto-approve. Fixes whoami so unchanged global parameter flags with built-in defaults (including false/0) are reported as [default], with regression tests, docs, and generated CLI updates; the change is confined to reporting and test isolation and is clearly beneficial.
Re-trigger cubic
AshGodfrey
left a comment
There was a problem hiding this comment.
whoami and request construction disagree. The new fallback in ResolveCredential reports [default] whenever an unchanged flag has a non-empty string value, which includes the implicit false and 0 of boolean and numeric flags. Request construction in templating.ts only applies the flag default when the schema declares one. So for a required integer path global with no schema default, whoami says [default] 0 while the CLI sends nothing. The PR's own test asserts this wrong output for global-header-param and global-path-param.
Possible ix: emit the default branch per field at generation time only when field.Default is set, for example by threading a hasDefault bool into the resolver call.
FWIW, the tests fake a default by mutating flag.DefValue rather than using a spec default, which is why they could not catch the above.
Why
whoamireports unchanged global parameter flags as unset even when they have a default value. This hides the configured fallback, including booleanfalseand numeric0.What changed
defaultin text and machine output.Testing
TestWhoamiGlobalDefaultsandTestResolveCredentialDefaultPrecedencetests. Default assertions failed before the fix.whoamicheck forfalse,0and an unset optional string.npm run format,make check-template-cli, andgit diff --check.TARGET=primary make test-cli: 1,449 tests, four failures in unchanged configure tests (TestConfigureSkipsOptionalCredentials,TestConfigurePreservesExistingValues,TestConfigureMaskSecretDisplay,TestConfigureCreatesConfigDir). These expect an interactive form but receive the non-interactive "no flags provided" error.make lint: blocked in the unchanged permission generator by source-path resolution (./gen.gocannot be made relative to the repository root). Restored its truncated generated manifest; no permission changes are included.Public-safety check
.claude/skills/public-repo-communication/SKILL.md).git diff --check.Summary by cubic
Fixes
whoamiso unchanged global parameter flags with built-in defaults are reported as[default]rather than[unset].falseand numeric0.[unset]; security credential resolution, masking, and request construction are unchanged.Written for commit eab983d. Summary will update on new commits.