Skip to content

feat: WIP-102 update/revert recovery agent#381

Open
Kemperino wants to merge 5 commits into
mainfrom
kempy/wip-102-adaptions
Open

feat: WIP-102 update/revert recovery agent#381
Kemperino wants to merge 5 commits into
mainfrom
kempy/wip-102-adaptions

Conversation

@Kemperino

@Kemperino Kemperino commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the WIP-102 V2 recovery-agent flow to walletkit and deprecates the V1 flow.

  • New Authenticator::update_recovery_agent(new_recovery_agent: String) — V2 replacement for initiate_recovery_agent_update. Effective immediately with a revert window instead of a 14-day cooldown.
  • New Authenticator::revert_recovery_agent_update() — V2 replacement for cancel_recovery_agent_update. Reuses the same EIP-712 typehash; only the gateway endpoint differs.
  • Deprecated the three V1 wrappers (initiate_/execute_/cancel_recovery_agent_update) with #[deprecated]. Kept for backward compatibility — Swift/Kotlin consumers continue to compile.
  • CLI walletkit recovery-agent subcommands updated: Initiate/Execute/CancelUpdate/Revert. Execute is 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.

Authenticator gains update_recovery_agent and revert_recovery_agent_update (delegating to world_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 warnings from UniFFI-generated references to those wrappers.

CLI recovery-agent subcommands are Update / Revert only; Execute is removed and Initiate/Cancel are replaced by the V2 names and APIs.

Reviewed by Cursor Bugbot for commit 8f8d992. Configure here.

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>
@Kemperino Kemperino force-pushed the kempy/wip-102-adaptions branch from 9f942ac to 3ac6f9f Compare April 29, 2026 20:27
@Kemperino Kemperino marked this pull request as ready for review June 26, 2026 11:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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