Skip to content

BUILD-43: Make account registration output conditional on acceptance - #58

Merged
matthewkmartin merged 1 commit into
mainfrom
BUILD-43
Nov 3, 2026
Merged

matthewkmartin merged 1 commit into
mainfrom
BUILD-43

Conversation

@matthewkmartin

Copy link
Copy Markdown
Contributor

Summary

band account register and band account send-code exit 0 when the API accepts the request, which doesn't guarantee that an email or verification code was actually sent. Their success output said both unconditionally, so a mistyped --email/--phone, an expired registration, or an existing account left users waiting on something that never arrives.

  • register: the success output now says a registration link is on its way if the email can be used to create an account. It also points existing customers at band auth login or a password reset, and step 2 of the next steps is conditional ("If this is a new account, check your email…").
  • send-code: now says a code is on its way if a pending registration matches, with a short "No code?" hint (check --email/--phone, or re-run register).
  • verify: when the API rejects the request with a 400, prints a hint to check that --email and --phone match what was registered, since a mistyped value is reported the same way as a wrong code. No hint for other failures, and none on success.
  • Docs: README.md and AGENTS.md say that success output doesn't confirm delivery. AGENTS.md tells agents to report a code or email as requested, never as sent, and what to try if the user says nothing arrived (including not looping on send-code).
  • Test helpers: testutil.FakeClient.PostErr and testutil.CaptureStderr so the failure path and the stderr messages can be tested.

No API contract or flag changes, and JSON/stdout output is untouched.

Testing

  • New cmd/account/messages_test.go covers the conditional wording for register and send-code, and the verify hint for a 400 (shown) versus a 500, a network error and success (not shown).
  • go test ./..., go vet ./... and gofmt are clean. golangci-lint reports the same 4 typecheck issues in internal/testutil/golden.go on an untouched main locally (it looks like the installed linter predates the module's Go version), so I'm relying on CI's lint for this PR.

AI assistance

This PR was substantially written with Claude Code. It stays a draft until a human has reviewed it.


🤖 Generated with Claude Code

register and send-code exit 0 when the request is accepted, which does
not guarantee that an email or code was sent. Their success output
claimed both unconditionally, so a mistyped --email/--phone or an
existing account left users waiting on something that never arrives.

register and send-code now say a message or code is on its way only if
the details match, and point existing customers at "band auth login" or
a password reset. verify adds a hint when the API rejects the request
with a 400, since a mistyped --email or --phone is reported the same
way as a wrong code.

README.md and AGENTS.md describe the new behavior, including guidance
for agents on not reporting delivery as fact.

Add testutil.FakeClient.PostErr and testutil.CaptureStderr so tests can
cover failures and the stderr messages.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@bwappsec

bwappsec commented Nov 3, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@matthewkmartin
matthewkmartin requested review from a team, TroyArcher, jsanmartin123 and kylefirman and removed request for a team November 3, 2026 14:21
@matthewkmartin
matthewkmartin marked this pull request as ready for review November 3, 2026 14:23
@matthewkmartin
matthewkmartin requested review from a team as code owners November 3, 2026 14:23
@matthewkmartin
matthewkmartin merged commit d1e566b into main Nov 3, 2026
8 checks passed
@matthewkmartin
matthewkmartin deleted the BUILD-43 branch November 3, 2026 14:43
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.

6 participants