[claude] Nostr identity lifecycle coverage T41–T45 (#55) #106
Reference in New Issue
Block a user
Delete Branch "claude/issue-55"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #55
What
Adds T41–T45 to the testkit covering the full Nostr identity lifecycle, plus two new endpoints.
New endpoints
POST /api/identity/me/decay(test-only)NODE_ENV === "production")X-Nostr-TokenheaderTrustService.decayOnce()methodGET /api/identity/leaderboard(public)trustScoredescendingpubkey,trustScore,tier,interactionCountNew tests (T41–T45)
All five tests share a single inline node script preamble (same pattern as T36) that generates an ephemeral keypair, completes the full challenge→sign→verify flow, then performs all subsequent API calls. Tests skip gracefully if
nodeornostr-toolsis unavailable.POST /api/jobswith validX-Nostr-Token→ HTTP 201,nostrPubkeyin response matches token identityPOST /api/sessionswith validX-Nostr-Token→ HTTP 201,nostrPubkeyin response matches token identityGET /api/identity/mereturnstier,score, andinteractionCountfieldsPOST /api/identity/me/decay→newScore ≤ previousScore(skipped gracefully in prod)GET /api/identity/leaderboard→ HTTP 200, array sorted bytrustScoredescendingFiles changed
artifacts/api-server/src/lib/trust.ts— addedTrustService.decayOnce()artifacts/api-server/src/routes/identity.ts— added/identity/me/decayand/identity/leaderboardendpointsartifacts/api-server/src/routes/testkit.ts— added T41–T45 + audit log entries