mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 19:28:25 +00:00
Kind 38000 is NIP-87's mint recommendation, but BAO Markets (prediction markets), an auditable-voting app (ballots) and a flood of d-only "sybil test vote" spam share the number. EventFactory mapped every 38000 to MintRecommendationEvent, so markets, ballots and spam rendered as "Ecash Mint Recommendation" cards in feeds, threads and search. EventFactory now dispatches 38000 by tags: - MintRecommendationEvent iff the first `k` is 38172/38173, or, with no `k`, a non-blank `u` (old recommendations); - else BallotEvent on a non-blank `election`; - else PredictionMarketEvent on `market`, >=2 `outcome`s, or `type`+`end`; - else a plain Event (never consumed, never indexed). New read-only, searchable classes under quartz/experimental: predictionMarkets/PredictionMarketEvent (all three BAO shapes: tags + `data` JSON, BAO Fund, and the first shape; title, description, outcomes, status, resolution, end, category, demo network, bet limits, fee, cancel reason) and ballots/BallotEvent (election, answers from `responses`, `ballot` or `vote_choice`, proof hash). JSON is parsed lazily, once, and never throws. EventFactory.probe(kind) answers kind-level questions (isKnownKind, the SQLite/FS FTS reindex pre-filters, SearchableKindsTest) so 38000 still probes as searchable even though a tagless 38000 is now a plain Event. EventCache consumes the new classes as addressables; wallet code keeps seeing only real recommendations. commonsUI renders them with new cards (PredictionMarketCard: kicker, question, status pill, demo pill, category, outcomes with the winner marked, closing time, terms, cancel reason; BallotCard: election, question -> answer rows, proof hash), wired into NoteCompose and ThreadFeedView. GitStatusPill's filled badge is extracted as StatusPill for reuse. Tests use real production events, one per shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CsFEX4ZT8mL1r8h2M6qfH