feat: collection offer books, royalty enforcement, signal edit history, emoji reactions - #194
Merged
Darkvader-ship-it merged 2 commits intoAug 31, 2026
Conversation
…y, emoji reactions (PHASE-STELLAR#88, PHASE-STELLAR#89, PHASE-STELLAR#100, PHASE-STELLAR#101) Adds four flag-gated features, each an isolated module in an existing *-store.ts wired additively into its API routes: - PHASE-STELLAR#88 (phase-139): collection-level offer books aggregated from per-token offers, plus bulk-bid across a collection's listings. - PHASE-STELLAR#89 (phase-140): royalty enforcement on secondary sales — a creator/seller split computed and ledgered at offer-accept time. - PHASE-STELLAR#100 (phase-82): signal edit history with word-level version diffing, author-only, non-destructive (pre-edit snapshot on every edit). - PHASE-STELLAR#101 (phase-83): emoji-reaction aggregation on signals (curated set, toggle per wallet) with a per-wallet rate limit. Also fixes a pre-existing bug blocking all of the above: `sqliteDb` was never registered in lib/server-data-paths.ts's FILES map when signals/market were migrated onto SQLite (issue PHASE-STELLAR#36), so every getDb() call threw. Masked by an unrelated tsc parse failure in app/api/forge-agent/route.ts that was silently suppressing all semantic typecheck diagnostics project-wide. One-line, additive fix; see IMPLEMENTATION_SUMMARY_88_89_100_101.md for the full verification trail (253 → 269 tests passing, 0 regressions). All four flags default off; zero behavioural change until enabled. Closes PHASE-STELLAR#88 Closes PHASE-STELLAR#89 Closes PHASE-STELLAR#100 Closes PHASE-STELLAR#101 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@KingFRANKHOOD Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements four flag-gated features, each an isolated module in an existing
*-store.tswired additively into its API routes. All four flags default off — zero behavioural change onmainuntil explicitly enabled.phase-139): collection-level offer books aggregated from per-token offers, plus bulk-bid across a collection's listings. New:GET/POST /api/market/collections/[collection_id]/offer-book.phase-140): royalty enforcement on secondary sales — a creator/seller split computed and ledgered at offer-accept time. Listing create gains optionalcreator_wallet/royalty_bps; accepting an offer on a secondary sale now records and reports aroyaltysplit.phase-82): signal edit history with word-level version diffing. NewPATCH /api/signals/[id](author-only, snapshots the pre-edit state) andGET /api/signals/[id]/history.phase-83): emoji-reaction aggregation on signals (curated 6-emoji set, toggle per wallet) with a 20/60s per-wallet rate limit. NewGET/POST /api/signals/[id]/reactions.Each issue's "Impacted Subsystems" pointed at files that didn't line up with where the feature actually belongs in this codebase (e.g. offers/listings live in
lib/market-store.tsbehindapp/api/market/*, not the signals/replies files listed). Implemented against the domain each feature actually fits, per the title + acceptance criteria — seeIMPLEMENTATION_SUMMARY_88_89_100_101.mdfor the reasoning and full per-issue breakdown.Also fixes a pre-existing bug blocking all of the above
lib/sqlite-db.ts:getDb()callsserverDataJsonPath("sqliteDb"), but"sqliteDb"was never registered inlib/server-data-paths.ts'sFILESmap when signals/market were migrated onto SQLite (issue #36) — everygetDb()call threw at runtime, i.e. every signal/market read or write. This was masked because a pre-existing, unrelated syntax error inapp/api/forge-agent/route.tsabortstsc's whole-program check before semantic diagnostics run, sonpm run typechecksilently reported nothing wrong, andlib/__tests__/signals-social.test.ts/market-profile-views.test.tswere quietly failing onmaintoo. One-line, additive fix (sqliteDb: "phase.sqlite3") — no schema change, no migration.Test plan
npx tsc --noEmit(scoped to exclude the pre-existingforge-agentparse failure): 0 errors in every changed/new file.eslinton every changed/new file: clean.node --test --import ./node_modules/tsx/dist/loader.mjs ...): 253 → 269 passing, 0 regressions. Remaining 26 failures are pre-existing/unrelated (see summary doc).PROJECT_ARCHITECTURE.md§10 anddocs/TECHNICAL.md§5.3/§9.1 updated with the four new flags perCLAUDE.md's change-management rule.Closes #88
Closes #89
Closes #100
Closes #101
🤖 Generated with Claude Code