Skip to content

broker: remove dead IdempotencyStore (post-issue-#72)#105

Merged
hanwencheng merged 1 commit into
mainfrom
claude/modest-lalande-04448a
May 23, 2026
Merged

broker: remove dead IdempotencyStore (post-issue-#72)#105
hanwencheng merged 1 commit into
mainfrom
claude/modest-lalande-04448a

Conversation

@hanwencheng
Copy link
Copy Markdown
Member

Summary

Issue #72 / PR #96 deleted POST /v1/mint-aws-creds and the crates/agentkeys-broker-server/src/handlers/mint.rs handler, which was the only production consumer of IdempotencyStore. The store remained wired through boot.rs → AppState but no live code path read or wrote through it.

What landed

  • Deleted crates/agentkeys-broker-server/src/storage/idempotency.rs (the store, IdempotencyOutcome, the 4 unit tests).
  • Removed pub mod idempotency; + pub use idempotency::{IdempotencyOutcome, IdempotencyStore}; from storage/mod.rs.
  • Removed idempotency_store field + doc comment from AppState (state.rs).
  • Removed idempotency_store field from BootArtifacts, the IdempotencyStore::open(...) block, the Ok(BootArtifacts { … }) assignment, and the idempotency_path() helper from boot.rs.
  • Removed idempotency_store: boot_artifacts.idempotency_store, from the AppState constructor in main.rs.
  • Removed the dead idempotency_hits + idempotency_conflicts AtomicU64 counters and their /metrics array entries from metrics.rs; no live code path bumped them. Updated the help/type-line-count test assertion from 10 → 8.
  • Cleaned up IdempotencyStore::open_in_memory() boilerplate in the six integration tests that constructed AppState: auth_wallet_flow.rs, email_flow.rs, grant_flow.rs, oauth2_flow.rs, oidc_flow.rs, wallet_flow.rs.
  • Removed the dedicated Idempotency-Key subsection + the agentkeys_broker_idempotency_hits_total / _conflicts_total bullet from docs/operator-runbook-stage7.md and the ## 12. Metrics + idempotency section + ### 12.2 Idempotency-Key subsection from docs/stage7-demo-and-verification.md. The BROKER_REQUEST_BODY_LIMIT_BYTES paragraph was preserved (it documents an unrelated router-level cap, not the Idempotency-Key feature).

What did NOT land

The two remaining Idempotency-Key mentions in operator-runbook-stage7.md:391 + line 407 are inside /v1/mint-aws-creds endpoint documentation that PR #96 already made stale (the endpoint itself was deleted). Cleaning those up is part of the broader /v1/mint-aws-creds-doc-residue cleanup, not specific to IdempotencyStore, and belongs to a separate follow-up PR.

No BROKER_IDEMPOTENCY_* env vars existed in env.rs (audit returned zero hits), so none to remove there.

Verification

cargo build -p agentkeys-broker-server                             # exit 0
cargo test  -p agentkeys-broker-server                             # exit 0
cargo clippy -p agentkeys-broker-server -- -D warnings             # exit 0

Post-edit audit confirms no IdempotencyStore/idempotency_store references remain in crates/agentkeys-broker-server/src/ or crates/agentkeys-broker-server/tests/.

Test plan

  • cargo build passes
  • cargo test passes (all integration tests)
  • cargo clippy clean with -D warnings
  • Reviewer confirms no live caller is reintroduced by an in-flight PR before merge

Issue #72 / PR #96 deleted POST /v1/mint-aws-creds and the
crates/agentkeys-broker-server/src/handlers/mint.rs handler, which was
the only production consumer of IdempotencyStore. The store remained
wired through boot.rs -> AppState but no live code path read or wrote
through it.

Removed:
- crates/agentkeys-broker-server/src/storage/idempotency.rs (the store
  + tests).
- pub mod / pub use lines in storage/mod.rs.
- idempotency_store field on AppState (state.rs).
- idempotency_store field on BootArtifacts + open() block + idempotency_path()
  helper in boot.rs.
- Assignment in main.rs AppState constructor.
- agentkeys_broker_idempotency_hits / _conflicts AtomicU64 counters and
  their /metrics array entries (no live path bumped them); test
  assertion for help/type-line count updated from 10 to 8.
- IdempotencyStore::open_in_memory() boilerplate in six integration
  tests.
- Idempotency-Key sub-section + bullet in docs/operator-runbook-stage7.md
  and docs/stage7-demo-and-verification.md (only the parts that
  documented the removed metric counters + dedup feature; other
  /v1/mint-aws-creds doc residue from PR #96 stays for a separate
  doc-cleanup PR).

cargo build + cargo test -p agentkeys-broker-server + cargo clippy
-p agentkeys-broker-server -- -D warnings all exit 0.
@hanwencheng hanwencheng force-pushed the claude/modest-lalande-04448a branch from 92e46ef to 230c18d Compare May 23, 2026 16:36
@hanwencheng hanwencheng merged commit 0b92028 into main May 23, 2026
3 checks passed
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