Appearance
Gaps
Cross-check of src/ as of this audit: 866 REST routes, 8 socket namespaces, 99 jobs, 126 events, 104 seeded notification types, 81 deep-link screens, and every port in src/app/compose.
Clean: every defineJob is processed and is either enqueued or scheduled; every defineEvent is published at least once. The gaps below are wiring, consumers, notifications, links and stubs.
Blockers
| ID | Area | What's missing | Where | Suggested fix |
|---|---|---|---|---|
| B1 | Distribution settlement | distribution.earnings_held and distribution.earnings_released are sent but not seeded. notify throws NOTIFICATION_TYPE_UNKNOWN inside the posting transaction, so any store receipt that holds a share (recording without a confirmed split sheet) rolls back and distribution.receipt-post retries into the dead-letter queue; held earnings can never be released. | modules/distribution/settlement/service.ts:297,375; catalogue in app/compose/notification-types.ts | Append both rows (category creator, push on, high/normal) to notification-types.ts. |
| B2 | Referrals | Identity is built without growth ports, so the reward consumer is never registered: no referral.reward_earned, no credited days, and referral.joined / referral.reward_earned notifications are never sent (the referral notifier is undefined). /me/referrals shows 0 reward days forever. | app/app.ts:69; modules/identity/index.ts:171,273-286 | Add a subscriptions "credit days" API, then pass late-bound ReferralPorts (that API, createSubscriptionPayments, the forwarding notifier) into createIdentityModule. |
| B3 | Account erasure (NDPR/GDPR) | identity.user.deleted has no consumer in messaging (device keys, prekeys, envelopes, memberships), calls (logs, links), live (chat, tickets, reminders), mart (device keys, offline licences), wallet (bank accounts, virtual funding account), funding (supporter messages), muzcast, affiliates, ads, media (uploads), catalog, safety, distribution. | each module's index.ts | Subscribe in each module: erase or anonymise personal rows, keep ledger rows by ID. |
Important
| ID | Area | What's missing | Where | Suggested fix |
|---|---|---|---|---|
| I1 | Social notifications | Follows, likes and reactions notify nobody: social.follow.created, social.like.created, social.reaction.set have no consumer; social.followed, social.liked seeded, never sent. live-extras.ts assumes notifications run on FOLLOW_CREATED. | modules/social/follow/service.ts, like/service.ts; app/compose/live-extras.ts | Subscribe in notifications (or notify from social) with collapse keys per target. |
| I2 | New releases | Followers are never pushed a new release: catalog.release.published only records feed activity and a studio emit. release.published is sent only by creative drops. | app/compose/events-discovery.ts:166 | Notify audience followers of the owner profile on first publication. |
| I3 | Release moderation | Owner is not notified of approve, reject or takedown (studio socket only); release.approved seeded, never sent; no rejected/taken-down types. | app/compose/events-listening.ts:139-156 | Notify the owner with deep link studioRelease; seed release.rejected, release.taken_down. |
| I4 | Verification | Verification has no notifier: KYC/badge approve, reject, request-info and revoke are silent; verification.request.status_changed has no consumer. | modules/verification | Add a notifier port and types verification.* with deep link verifyIdentity. |
| I5 | Security | New-device sign-in alerts (TASK 24) never sent: security.new_sign_in seeded, unused. | modules/identity/session, auth | Notify on session issue for an unseen device key. |
| I6 | Engagement | No engagement port is passed, so continue listening, weekly mix, new for you, digest, streak and we-miss-you never send. | app/compose/social.ts:177; modules/notifications/engagement/service.ts:89 | Build EngagementPort from playback, recommendation and creative. |
| I7 | Data export | registerExportSection missing for wallet (payments, receipts, ledger), mart (orders, library), live (tickets, chat), moments, muzcast, catalog/studio content, ads, distribution, royalties, media. | modules/identity/data-export/service.ts:98 | Register a section in each module. |
| I8 | Deactivation | identity.user.deactivated has no consumer: subscriptions keep auto-renewing for the 30-day window; profile, live, listings and links stay public. | modules/identity/account/service.ts:158 | Subscriptions turn off auto-renew; identity and owners hide public content until reactivation. |
| I9 | Safety enforcement | Stub ports: restrictVisibility, setAgeRestricted, setDemonetized are no-ops for every non-catalog type (moments, playlists, comments, DJ sets, muzcast, mart, live); accounts.reinstate, suspendProfile, reinstateProfile are no-ops, so a suspended creator's profile stays public. safety.content.actioned has no consumer. | app/compose/safety.ts:146-148,249,251-252 | Give owners enforcement APIs (flags on their rows) and a profile suspension column. |
| I10 | Safety links | Every safety notification ("Tap to see why and to appeal") opens settings; the registry has no decision, appeal, report or copyright screens. | modules/safety/notify.ts; platform/links/routes.ts | Add safetyDecision/:id, safetyAppeal/:id, safetyReport/:id, copyrightNotice/:id. |
| I11 | Call links | call.incoming uses plemuz://call/${call.id}, which the registry reads as a call-link code; call.missed uses plemuz://calls, which has no screen (resolve → 404). Hard-coded custom scheme, no https form. | modules/calls/call/core.ts:192,332; answer.ts:150 | Add activeCall: call/active/:id and calls: calls, use links.*. |
| I12 | Search | Creators, users, DJ sets and stations are never indexed (only releases, recordings, playlists, shows, episodes, live, products). Identity publishes no profile published/updated event. | app/compose/events-discovery.ts; modules/identity/events.ts | Add identity.profile.published/updated and index creator documents. |
| I13 | Discover | artworkUrl: null for track, video, show, episode, live and chart items; editorialRecordings always []. | app/compose/discover.ts:55,109,118,126,138; engagement.ts:278 | Resolve artwork through media; feed editorial from discover shelves. |
| I14 | Studio analytics | Empty stubs: segments (zeros), topPlaylists, realtime, releaseDayCurve, revenue.streamRevenue, retention; demographics country only. Routes answer with empty data. | app/compose/studio-analytics.ts:143,144,156,157,187; studio-stats.ts:87 | Add playback position curves and per-playlist rollups, and a royalties revenue reader. |
| I15 | Drops | parties.scheduleListeningParty rejects DEPENDENCY_UNAVAILABLE; cancelListeningParty is a no-op. A drop with a listening party fails. | app/compose/engagement.ts:220-223 | Expose LiveApi.schedule for listening_party streams. |
| I16 | TASK items not built | User 2FA (TOTP/passkeys; only staff MFA), breached-password check, CI pipeline (no .github), migration from plemuz_backend (TASK 25), guest device actor. TASK.md sections 1–26 are all unchecked while STATUS says built. | TASK.md; modules/identity | Build or descope, then tick TASK.md to match STATUS. |
| I17 | Student plans | isVerifiedStudent always false, so student plans are closed; PLAN_STUDENT_VERIFICATION_REQUIRED offers verify_identity (KYC) instead of verifyStudent, and no student verification route exists. | app/compose/money.ts:46; platform/errors/codes/listening.ts | Add a student check in verification; point the action at verifyStudent. |
| I18 | Trial abuse | paymentFingerprintOf returns null: "one trial per payment method" and the referral fingerprint check never trigger. | app/compose/money.ts:49 | Expose saved-method fingerprints from wallet. |
| I19 | Ads targeting | Listener topGenreIds is always [], so genre targeting has no listener signal. | app/compose/engagement.ts:135-136 | Read top genres from recommendation taste vectors. |
Minor
| ID | Area | What's missing | Where | Suggested fix |
|---|---|---|---|---|
| M1 | Payments | wallet.payment.failed has no consumer; payment.failed and wallet.topup_succeeded seeded, unused. A failed card top-up or purchase is silent. | modules/wallet/payment/settlement.ts | Notify the payer on failure; drop the unused seed. |
| M2 | Live replay | live.replay.ready has no consumer: ticket holders and reminder holders aren't told. | modules/live/replay/service.ts | Notify with deep link live. |
| M3 | Live extras | Follow-from-live and share-to-moment write follows and moments by raw SQL, bypassing owners' validation and counters. | app/compose/live-extras.ts | Add write APIs to social and moments. |
| M4 | Wizards | Onboarding hasWallet never wired (always false); wallet_setup and ad_creation wizard codes have no implementation. | modules/identity/wizard/service.ts:61; wizard/contract.ts | Wire hasWallet from wallet; build or remove the codes. |
| M5 | Notification seeds | Seeded duplicates never sent: social.mentioned, playlist.collab_requested, playlist.collab_accepted, mart.purchase_completed, mart.sale_made. | modules/notifications/catalogue/seed.ts | Remove or rename to the sent codes. |
| M6 | Unused screens | station, liveTicket, studioUploads, studioStats, studioDistribution, updateApp are never linked (update_app actions carry no deep link). | platform/links/routes.ts | Use them (ticket notification → liveTicket, delivery updates → studioDistribution) or remove. |
| M7 | Missing screens | No screen for onboarding, chat requests, notification settings, live replay, verification status, data export, call history. | platform/links/routes.ts | Add screens. |
| M8 | Media | media.asset.duplicate_detected and media.asset.preview_changed have no consumer: duplicates don't flag safety. | modules/media/pipeline/ingest.ts | Safety opens a copyright flag on duplicates. |
| M9 | Quiet events | No notifications for moment reactions/replies, playlist items added, funding refunds, mart refunds. | moments, playlists, funding, mart | Add types where useful. |
| M10 | Mart | Downloads record a fingerprint but the file is the master as is: no per-buyer watermark. | app/compose/catalog.ts:79 | Watermark in media on download. |
| M11 | Money ops | Reconciliation skips the bank side (bankBalance: null); Hyparrow has no refund API (staff manual refunds). | app/compose/money.ts:33 | Add a bank feed; keep manual refund runbook. |
| M12 | Assistant | publicPlayCount: null in song info; no release or viral chart for its tools. | app/compose/assistant-ports.ts:123,151 | Read counts from playback; add chart kinds. |
| M13 | Docs coverage | No journey page yet for creative (DJ sets, contests, drops, superfans, stations, stem packs, wrapped, badges), muzcast publishing, verification badge and rights-holder claims, studio team, catalog bulk import, staff discover curation, legal publishing. | docs/flows | Add pages. |
| M14 | Audit-only events | Published with no consumer, fine as facts but nothing reads them: notifications.notification.opened, assistant.*, calls.call.*, together.*, studio.member.*, studio.goal.*, creative.*, most distribution.*, ads.campaign.*, affiliates.*, messaging.* (except sent, key change), royalties.*, catalog.recording.published, catalog.moderation.changed. | modules/*/events.ts | Keep as outbox facts or wire analytics. |
Admin and org consoles
Audit of every /v1/staff/* (≈ 290 routes) and /v1/org/* (≈ 75 routes). Auth worlds are clean: user authentication skips /v1/(org|staff) (src/app/app.ts:40,165-169), each world verifies its own token audience, every staff route checks staff plus a permission or role list, and every org route checks the org user (role via orgActor). No user-facing schema exposes staff IDs, internal notes or internal support messages.
| ID | Sev | What's missing | Where | Suggested fix |
|---|---|---|---|---|
| C1 | important | Organization withdrawals have only approve/reject: no staff list or detail, so held org payouts can't be found | modules/wallet/staff/org-withdrawal-routes.ts | Add GET /staff/organization-withdrawals?status&organizationId and /:id |
| C2 | important | Distribution staff actions are not audited: delivery retry, acknowledgements, takedown/purge, report upload/complete, unmatched-line resolve, catalog-import approve | modules/distribution/delivery, report, catalog-import services | Record audit rows in each service |
| C3 | important | Discover, assistant and distribution staff routes check hard-coded role lists, not platform permissions; the console can't derive their access from the permission model | modules/discover/shelf/routes.ts:36, modules/assistant/routes-extra.ts:78, modules/distribution/access.ts:14 | Add discover:manage, assistant:manage, distribution:manage to platform/access/permissions.ts |
| C4 | important | Org catalogue has no release detail or edit, no import detail or cancel, and no takedown/redeliver (studio has them) | modules/organizations/catalog/routes.ts | Add GET/PATCH /org/catalog/releases/:id, GET /org/catalog/imports/:id, cancel, takedown |
| C5 | important | No staff view of a role's permissions and no staff-user detail; /staff/auth/me returns role only | modules/identity/staff/routes.ts | GET /staff/roles (permission matrix), GET /staff/users/:id, include permissions in /me |
| C6 | minor | Missing detail routes: ads campaign (/staff/ads/campaigns/:id), promo code, subscription plan, store price tier, legal drafts list | ads, subscriptions, wallet/store-tier, identity/consent routes | Add GET /:id and a staff legal list |
| C7 | minor | No staff routes for advertiser suspension (ADS_ADVERTISER_SUSPENDED exists), live streams (end/hide), mart products, royalty statements by profile, distribution statements | ads, live, mart, royalties, distribution | Add as needed or route through safety |
| C8 | minor | Unpaged lists that can grow: /staff/users, /staff/organizations/:id/users, /org/team, /org/invitations, /org/finance/bank-accounts, /staff/discover/categories | listed routes | Use sendPage |
| C9 | minor | Sub-labels can be created but not edited or removed; invitations can't be resent; creators can accept a roster deal but not decline it | modules/organizations/organization/routes.ts, roster/routes.ts | Add PATCH/DELETE /org/sub-labels/:id, POST /org/invitations/:id/resend, POST /studio/:profileId/organizations/:id/decline |
| C10 | minor | Org finance has no payout detail and no statement export | modules/organizations/finance/routes.ts | GET /org/finance/payouts/:id, statement CSV |
| C11 | minor | The VitePress sidebar doesn't list the two console pages yet (config is outside docs/flows) | docs/.vitepress/config.ts | Add flow("Admin console", "admin-console"), flow("Org console", "org-console") |