feat: WIP-102 update/revert recovery agent#381
Conversation
Adds the V2 recovery-agent flow from WIP-102 and deprecates the V1 flow. New `update_recovery_agent` and `revert_recovery_agent_update` wrappers delegate to the SDK's V2 methods. The three V1 wrappers (`initiate_/execute_/cancel_recovery_agent_update`) are kept for backward compat but marked `#[deprecated]`; the SDK marks the underlying methods deprecated too, so the call-site bodies need `#[allow(deprecated)]`. Module-level `#![allow(deprecated)]` is required in `authenticator/mod.rs` because `#[uniffi::export]` generates FFI registrations outside the impl-level lint scope and references the deprecated method names. Updates `walletkit recovery-agent` CLI subcommands from `Initiate/Execute/Cancel` to `Update/Revert` (Execute is dropped — V2 has no execute step; the underlying SDK call is a no-op on a V2-upgraded gateway). WIP-104 verified to have no walletkit impact: the only Rust SDK change is a doc-comment rewording in primitives/lib.rs. Pinned to upstream wip-102 git branch until WIP-102 ships in a world-id-core release; flip to version pin then. Refs: worldcoin/world-id-protocol#692, worldcoin/world-id-protocol#643 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9f942ac to
3ac6f9f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f8d9924b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Those references emit deprecation warnings at the wrapper definition sites, | ||
| // outside the impl-level lint scope. Suppress at module level — the V1 wrappers | ||
| // are intentionally retained for backward compat with existing FFI consumers. | ||
| #![allow(deprecated)] |
There was a problem hiding this comment.
Replace deprecated allow with an expect suppression
The repo guidelines in /workspace/walletkit/AGENTS.md require #[expect(lint, reason = "...")] instead of #[allow(lint)]; this new module-wide allow suppresses every future deprecated use in authenticator and will not fail once the UniFFI warning disappears, so stale or broadened deprecation suppressions can accumulate. Please use #![expect(deprecated, reason = "...")] or a narrower expect at the generated-warning site.
Useful? React with 👍 / 👎.
Summary
Adds the WIP-102 V2 recovery-agent flow to walletkit and deprecates the V1 flow.
Authenticator::update_recovery_agent(new_recovery_agent: String)— V2 replacement forinitiate_recovery_agent_update. Effective immediately with a revert window instead of a 14-day cooldown.Authenticator::revert_recovery_agent_update()— V2 replacement forcancel_recovery_agent_update. Reuses the same EIP-712 typehash; only the gateway endpoint differs.initiate_/execute_/cancel_recovery_agent_update) with#[deprecated]. Kept for backward compatibility — Swift/Kotlin consumers continue to compile.walletkit recovery-agentsubcommands updated:Initiate/Execute/Cancel→Update/Revert.Executeis dropped —Notable implementation detail
Module-level `#![allow(deprecated)]` is required in `walletkit-core/src/authenticator/mod.rs` because `#[uniffi::export]` generates FFI registrations outside the impl-level lint scope and references the deprecated method names — which would otherwise emit warnings at the V1 wrapper definition sites and fail `-D warnings` in CI.
Why draft
This branch points at the upstream `wip-102` git branch for `world-id-core` and `world-id-proof`. CI will fail until upstream merges WIP-102 and cuts a release
Note
Medium Risk
Changes account recovery-agent control flow and public Authenticator/CLI surface; V1 paths are deprecated but still callable, so integrators must migrate to avoid wrong semantics on V2 gateways.
Overview
Implements WIP-102 recovery-agent semantics in walletkit: V2 immediate update + revert window replaces the V1 initiate → 14-day cooldown → execute/cancel flow.
Authenticatorgainsupdate_recovery_agentandrevert_recovery_agent_update(delegating toworld_id_core). The three V1 FFI methods remain but are#[deprecated]with migration notes so Swift/Kotlin keep compiling. Module-level#![allow(deprecated)]avoids CI-D warningsfrom UniFFI-generated references to those wrappers.CLI
recovery-agentsubcommands areUpdate/Revertonly;Executeis removed andInitiate/Cancelare replaced by the V2 names and APIs.Reviewed by Cursor Bugbot for commit 8f8d992. Configure here.