2.4 KiB
2.4 KiB
Task 06: Публичная проверяемость розыгрыша
Assigned to: Antigravity (Implementation Orchestrator)
Priority: MEDIUM (product claim alignment)
Date: 2026-08-21
Base SHA: 1a27a10847fe510f0ed0f128087271f78a489c7b
Scope
- Implement public read-only giveaway result endpoint
GET /api/giveaways/[id]/public:- Publicly accessible without session.
- Bounded by anonymous rate limiting (
expensiveApiRateLimiter.assertAllowed('giveaway-public-get:' + clientIp + ':' + id)). - Exposes safe public information:
- Post metadata & snapshot
filterRules participantsSnapshotHash,conditionsHash,algorithmVersionseedCommitment— both BEFORE and AFTER the draw- After
DRAWN:seed(revealed only once finalized),deterministicProofHash,auditEventHash, winners & reserve winners (public winner names & IDs) - Before
DRAWN:seed === null(strictly masked) - Zero private PII: full eligible/excluded participants list is omitted to protect third-party privacy
- Zero credential/token/internal organizer metadata
- Post metadata & snapshot
- Update public giveaway view page
src/app/giveaways/[id]/page.tsx:- Works seamlessly for unauthenticated visitors by fetching from
/api/giveaways/[id]/public. - Displays post information, winners, seed pre-commitment SHA-256, proof hash, and mathematical verification state.
- Works seamlessly for unauthenticated visitors by fetching from
- Update
README.mdanddocs/ARCHITECTURE.mdto document the Provably Fair model honestly and explicitly:- What is independently verifiable by external observers (seed pre-commitment binding, draw execution reproducibility from snapshot hash + seed).
- What remains unverifiable externally without raw PII (external observers cannot re-compute
participantsSnapshotHashwithout the full raw participant list, and the server DB holds the proof without external decentralized timestamping/blockchain anchor).
- Create test suite
tests/public-verification.test.ts:- Anonymous user retrieves public results for
DRAWNgiveaway. - Anonymous user does not receive
seedon non-DRAWNgiveaway (seed === null). seedCommitmentis visible before draw and equalssha256(seed)after draw.- Anonymous user still receives
401 Unauthorizedon privateGET /api/giveaways/[id]. - Zero private participant PII or tokens in public response.
- Anonymous user retrieves public results for
- Verification gate & report in
agents/antigravity/done/TASK-2026-08-21-06-public-verification.md.