← Back to Pull requests

Each account has a name of its own (decision 0016) #38

Closed
unknown closed this pull request without merging on Nov 05, 2026 08:35 UTC
View on GitHub
unknown unknown commented on Nov 04, 2026 18:56 UTC
Author

<!-- claude-projects-attribution: {"github_login":"b3hr4d"} -->
_Requested by Behrad_

Merge #36 first. This branch now contains #36 (contacts, decision 0015), merged in to resolve the conflicts. Once #36 is merged, this PR shows only its own changes.

What this changes ([decision 0016](docs/decisions/0016-unique-account-names.md))

Every account now has a name of its own, so a name like "Savings" always means exactly one account.

  • Unique labels. add_account and the new rename_account refuse a label that another listed account already has. Labels are compared the way candid-profile's names rule compares names: NFKC, lowercase, runs of spaces made one, ends trimmed. So " btc savings " and "BTC Savings" are the same name. Accents are not removed.

  • Contacts. A contact's name and an account's label are compared by the same key. An account cannot be added or renamed to a contact's name, and a contact cannot take an account's name.

  • The wallet's own accounts are named "ICP wallet", "Bitcoin wallet" and "Ethereum wallet" instead of three times "Main". If an owner already took a name, the wallet takes the next free one ("Bitcoin wallet 2").

  • Upgrade. Only the accounts the wallet made itself that are still called "Main" are renamed. An account an owner added keeps its name.

  • Rename. Owners rename an account from its page without approval, since it moves nothing and every screen shows the address beside the name (#37). The rename is in the audit log as AccountRenamed { account, from, to }. The activity page, the UI's audit text and the MCP server's event text all show it.

  • Dependency. unicode-normalization 0.1.25, pinned exactly, for NFKC.
  • This was decision 0015 when it was opened. Contacts (#36) already had that number, so this is now decision 0016. candid-profile #99 follows the new number.

    Checks

  • Unit tests in accounts.rs cover the name key, refused repeats, a merged account's name being free, renaming to one's own name in another case, the default names, and which accounts an upgrade renames. contacts.rs adds a full-width label against a contact and an account taking a contact's name.

  • PocketIC: account_names_are_unique_and_owners_rename_them is new, and the contacts test now checks that an account can't take a contact's name. The whole PocketIC suite passed locally with the previous release's Wasm. Only the bitcoind tests were not run.

  • The wallet's unit tests (191) pass, and so do clippy -D warnings and cargo fmt --check.

  • UI: typecheck, lint, format and 76 tests pass, and the pages are rebuilt. The MCP server's typecheck and 22 tests pass.
  • Not in this PR

  • Member labels may still repeat, because a member chooses their own label when asking to join.

  • The guard (crates/guard) still compares labels without NFKC. A label written in full-width letters is then not checked against the request. It is never matched to the wrong account.
  • 🤖 Generated with Claude Code

    https://claude.ai/code/session_01WnX8bddc3JrctCKFTUAYpp

    Diff: 384 lines (+288 / -96) across 4 files Reviewer: b3hr4d Review duration: 819m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 384 lines diff across 4 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.356
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #38"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 48% (MEDIUM) · Higher = larger blast radius
    48%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.0% · Safe to merge
    19.0%