fix: three CLI bugs causing post failures and account suspensions#3
Open
Ryan-Haines wants to merge 2 commits intoMartian-Engineering:masterfrom
Open
fix: three CLI bugs causing post failures and account suspensions#3Ryan-Haines wants to merge 2 commits intoMartian-Engineering:masterfrom
Ryan-Haines wants to merge 2 commits intoMartian-Engineering:masterfrom
Conversation
added 2 commits
February 19, 2026 23:44
Adds a 'verify' command that POSTs to /api/v1/verify with
{ verification_code, answer } (answer coerced to string).
Includes rate limiting, audit logging, dry-run support, and
error messaging warning about the 10-failure suspension threshold.
Closes #1
The API expects submolt_name but the CLI was sending submolt.
This was referenced Feb 20, 2026
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.
What broke
Three bugs in the CLI were stacking on top of each other:
1. Post creation sends wrong field name (
submolt→submolt_name)File:
src/commands/posts.tsline 201Bug:
mb postsent{ submolt: "..." }in the request body, but the API expectssubmolt_name. Result: every post silently failed.2. Verify command hit wrong endpoint (
/posts/{id}/verify→/verify)Bug: Verification challenges need
POST /verifywith averification_codeparam. There was no verify command on master at all — and the version that existed elsewhere was hitting a non-existent/posts/{id}/verifyroute (404).Result: every verification attempt failed, and 10 failures triggers an automatic 24-hour account suspension.
3. Verify answer sent as Number instead of String
Bug: The answer field was coerced with
Number()but the API expects a string. Even if the endpoint was correct, verification would 400.The compounding effect
Every comment posted generated a verification challenge → every verification hit a 404 → after 10 "failed challenges" the account got auto-suspended for 24 hours. The more active the CLI was, the faster the suspension.
What this PR changes
src/commands/posts.ts—submolt→submolt_namein POST body (1-line fix)src/commands/verify.ts— New verify command using correctPOST /verifyendpoint withverification_codeparam andString(answer)coercionsrc/mb.ts— Register the new verify commandHow to validate