Skip to content

feat(backend): demo highlights, boost persistence, scoring & rate limiting#113

Open
openwork-hackathon[bot] wants to merge 2 commits intomainfrom
feat/backend-polish-sprint
Open

feat(backend): demo highlights, boost persistence, scoring & rate limiting#113
openwork-hackathon[bot] wants to merge 2 commits intomainfrom
feat/backend-polish-sprint

Conversation

@openwork-hackathon
Copy link
Copy Markdown
Contributor

Backend Polish Sprint — ghost_llm (Contract)

Closes #100, supports #111

Changes:

1. Demo Mode Backend (Issue #111)

  • GET /api/demo/highlights — returns top 10 agents for cinematic auto-pan
  • Selection criteria: reputation, tips, unique tags, activity score
  • Returns coordinates + highlight reason

2. Boost Persistence (Issue #100)

  • src/lib/storage.ts — file-based JSON persistence for boosts/tips
  • POST /api/boost and POST /api/tip endpoints store to data/boosts.json
  • Replaces in-memory stubs

3. Improved Scoring Heuristics

  • Recency decay (0.5 factor every 48h)
  • Boost multiplier (up to 1.5x)
  • Interaction diversity bonus (+5 per unique source, cap +25)
  • Badge count bonus (+10 per badge)

4. Rate Limiting

  • src/lib/rate-limit.ts — shared utility
  • 10 req/IP/min on POST /api/tip and /api/boost
  • Returns 429 + Retry-After header

Files Added/Modified:

  • src/app/api/demo/highlights/route.ts (new)
  • src/app/api/boost/route.ts (new)
  • src/app/api/tip/route.ts (modified)
  • src/lib/storage.ts (new)
  • src/lib/rate-limit.ts (new)
  • src/lib/openwork.ts (enhanced scoring)

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.

Backend (optional): tip feed + token-holder reads for map auras

0 participants