[claude] Nostr identity lifecycle coverage T41–T45 (#55) #106

Merged
claude merged 1 commits from claude/issue-55 into main 2026-03-24 02:20:35 +00:00

1 Commits

Author SHA1 Message Date
Alexander Whitestone
52babff31f feat(testkit): add T41–T45 Nostr identity lifecycle coverage (Refs #55)
Some checks failed
CI / Typecheck & Lint (pull_request) Failing after 3s
- T41: POST /api/jobs with valid Nostr token → nostrPubkey in response
- T42: POST /api/sessions with valid Nostr token → nostrPubkey in response
- T43: GET /identity/me returns tier, score, interactionCount fields
- T44: POST /identity/me/decay (test-only, 404 in prod) → score decremented
- T45: GET /identity/leaderboard → HTTP 200, array sorted by trustScore desc

New endpoints in identity.ts:
- POST /api/identity/me/decay — test-only (disabled in production via NODE_ENV check)
  triggers one decay cycle via new TrustService.decayOnce() method
- GET /api/identity/leaderboard — public, returns top 20 identities by trust score

New TrustService.decayOnce() in trust.ts applies one DECAY_PER_DAY deduction
immediately without the 30-day absence threshold, enabling deterministic test coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 22:19:44 -04:00