Skip to content

Approver remove: pass the id after -- so a dash-leading id isn't read as a flag - #11

Merged
johnpippett merged 1 commit into
mainfrom
fix/approver-remove-dash-id
Nov 14, 2026
Merged

johnpippett merged 1 commit into
mainfrom
fix/approver-remove-dash-id

Conversation

@johnpippett

@johnpippett johnpippett commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

What and why

Before: about 1 in 64 phone approvers couldn't be removed from the console. Approver ids are base64url, so some start with -, and keyflap approver remove -Xyz… failed as an unknown flag. The same thing made approver.test.ts fail at random, which is what turned macOS CI red on main on Nov 13 (expected 2 to be +0 on the native approver remove; the run's id happened to start with a dash).

After: the console's "Remove one" phone action runs approver remove -- ID, so any id works. The approver tests pass ids after -- too, so they no longer depend on luck.

How: one-line change in packages/cli/src/console/menu.ts. New tests pin the parse (-abc is a usage error, -- -abc parses) and the console path (a dash-leading id, and one that looks like --data-dir, both come through as the id). The console test fails without the menu change. Agent ids (UUIDs) and password ids (pw_…) can't start with a dash, so only approvers needed it.

Checklist

  • pnpm check passes. check:static is clean and the touched suites pass. The full unit run in my container showed 9 failures (8 in simple-install-shell.test.ts, 1 in keystore.test.ts), the same 9 on unmodified main there; they come from running as root, not from this change. CI is the real check.
  • No security invariant (ARCHITECTURE.md section 5) is weakened; changed or new invariant behavior has an automated test.
  • Tests use only the local test RP and the fake pass-cli, never third-party sites or real vaults.
  • No secrets (passwords, keys, tokens, one-time codes) in code, tests, logs or this PR.
  • Any new deviation from the design is recorded in docs/IMPLEMENTATION_NOTES.md (none).

Generated by Claude Code

… as a flag

Approver ids are base64url (a random passkey credential id, or a SHA-256 of
the iOS app key), so about 1 in 64 starts with "-". `keyflap approver remove
-Xyz…` then fails as an unknown option. The console's "Remove one" phone action
hit this for real users, and approver.test.ts hit it at random, which is what
turned macOS CI on main red on Nov 13 (expected exit 0, got 2).

The console now builds `approver remove -- ID`, the tests do the same, and new
tests pin both the parse and the console path with ids that start with a dash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@johnpippett
johnpippett marked this pull request as ready for review November 14, 2026 14:23
@johnpippett
johnpippett merged commit b5070cb into main Nov 14, 2026
16 checks passed
@johnpippett
johnpippett deleted the fix/approver-remove-dash-id branch November 14, 2026 14:23
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.

1 participant