Commit 50bce471 authored by Aryan Noshirvnai's avatar Aryan Noshirvnai

Add /roadmap: the engineering status audit, viewable in-app

Ports the published roadmap (full feature-by-feature audit: what's
functional, what's built but unreachable, and the two active security
gaps in /remix and the Rooms websocket) into the app itself at
/roadmap, gated behind super_admin like the Admin panel - it names
specific active vulnerabilities in detail, so it isn't something to
leave reachable by a plain logged-in user. Linked from the header
alongside Business/Admin.
Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
parent be345ade
Pipeline #1079 canceled with stage
import { render, screen } from '@testing-library/react'
import { MemoryRouter } from 'react-router-dom'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { Roadmap } from './Roadmap'
import { AuthProvider } from '../context/AuthContext'
import { PlayerProvider } from '../context/PlayerContext'
// Role gating itself (redirect-to-login, access-denied) is covered generically by
// RequireRole.test.tsx - this just checks the page's own content renders once past that gate.
describe('Roadmap', () => {
beforeEach(() => {
vi.stubEnv('VITE_DEV_ACCESS_TOKEN', '')
vi.stubEnv('VITE_DEV_REFRESH_TOKEN', '')
})
afterEach(() => {
vi.unstubAllEnvs()
vi.restoreAllMocks()
})
it('renders the critical security issues and feature inventory', () => {
render(
<MemoryRouter>
<AuthProvider>
<PlayerProvider>
<Roadmap />
</PlayerProvider>
</AuthProvider>
</MemoryRouter>,
)
expect(screen.getByText('/remix has no authentication at all')).toBeInTheDocument()
expect(screen.getByText('Room WebSocket trusts an unauthenticated user_id')).toBeInTheDocument()
// "Soundmarks"/"Remix" also appear in the page nav, so scope to feature-card-only text.
expect(screen.getByText('Location-tied anthems, three tiers')).toBeInTheDocument()
expect(screen.getByText('Stems, key/BPM detect, AI arrangement')).toBeInTheDocument()
expect(screen.getByText('Now')).toBeInTheDocument()
expect(screen.getByText('Next')).toBeInTheDocument()
expect(screen.getByText('Ideas')).toBeInTheDocument()
})
})
import { AlertTriangle } from 'lucide-react'
import { Layout } from '../components/Layout'
type Status = 'good' | 'warn' | 'bad'
const STATUS_STYLES: Record<Status, string> = {
good: 'bg-emerald-500/10 text-emerald-400 border-emerald-500/30',
warn: 'bg-amber-500/10 text-amber-400 border-amber-500/30',
bad: 'bg-red-500/10 text-red-400 border-red-500/30',
}
const STATUS_LABEL: Record<Status, string> = {
good: 'Functional',
warn: 'Partial',
bad: 'Critical gap',
}
function StatusPill({ status, label }: { status: Status; label?: string }) {
return (
<span className={`shrink-0 rounded-full border px-2.5 py-1 text-[11px] font-bold uppercase tracking-wide ${STATUS_STYLES[status]}`}>
{label ?? STATUS_LABEL[status]}
</span>
)
}
interface Feature {
name: string
sub: string
status: Status
statusLabel?: string
built: string
gaps: string
backendTests: string
frontendTests: string
}
const FEATURES: Feature[] = [
{
name: 'Soundmarks',
sub: 'Location-tied anthems, three tiers',
status: 'good',
built: 'Major (super-admin, one song), Business (owner playlist), Community (proposals + voting, top 3 shown). Review queue, dark map re-theme, full CRM.',
gaps: 'None found.',
backendTests: '40+',
frontendTests: 'Full coverage',
},
{
name: 'Rooms',
sub: 'Pass-the-Aux live listening',
status: 'warn',
statusLabel: 'Needs auth fix',
built: 'Chat, reactions, DJ queue/handoff, now-playing with cross-user streaming — a listener actually hears what the DJ picks.',
gaps: 'WebSocket user_id is unauthenticated — see critical issues above.',
backendTests: '20+',
frontendTests: '19',
},
{
name: 'Channels',
sub: 'Follow, vibe sets, stories, showcase',
status: 'warn',
built: 'Create/follow/unfollow. An auth hole (client-supplied user_id/owner_id, no login required) was fixed this pass.',
gaps: 'Vibe sets, 24h audio stories, and post showcase all have working backend endpoints with zero frontend UI.',
backendTests: '13',
frontendTests: '5',
},
{
name: 'Posts',
sub: 'Song posts + remix reply-trees',
status: 'good',
built: 'Feed, composer, recursive remix tree with "remix this" at every node. Was backend-only with no way to even list posts before this pass.',
gaps: 'None found.',
backendTests: '21',
frontendTests: '7',
},
{
name: 'Live Location',
sub: 'Formerly GeoDrops — live presence',
status: 'good',
built: 'Share toggle, live nearby list, geo-playlist shuffle-play. Verified live: two real accounts, spoofed GPS, cross-account streaming confirmed with audio actually playing.',
gaps: 'None found.',
backendTests: '26',
frontendTests: '12',
},
{
name: 'Library & Upload',
sub: 'Tagging, storage, playback',
status: 'good',
statusLabel: 'Mostly functional',
built: 'Upload, tag, stream, cross-user scoping all correct — no impersonation holes.',
gaps: 'No delete for songs or playlist tracks. Playlists, library search, and a standalone lyrics fetch all have working endpoints with no UI. Upload.tsx has zero tests.',
backendTests: '28',
frontendTests: '5',
},
{
name: 'Remix',
sub: 'Stems, key/BPM detect, AI arrangement',
status: 'bad',
built: 'Real pipeline, not vaporware — Demucs stem separation, BPM/key detection, a Gemini-planned arrangement, mastering. Upload/progress/poll UI works end to end.',
gaps: 'No auth at all — see critical issues above. Library-song linking (feeds the Posts remix-tree) is hardcoded off in the UI. Zero frontend tests.',
backendTests: '20',
frontendTests: '0',
},
{
name: 'Discovery',
sub: 'Shazam-style ambient ID',
status: 'warn',
built: 'Identify a clip, 24h history, like/dismiss — real auth, correctly scoped.',
gaps: '"Liked" is a dead end — nothing converts it into a real library song. No rate limit on identify calls. Gemini fallback + lyrics fetch built but never called. Zero frontend tests.',
backendTests: '8',
frontendTests: '0',
},
{
name: 'Auth',
sub: 'Telegram phone/code login',
status: 'warn',
statusLabel: 'Backend solid, UI landing now',
built: 'Real DB-backed rate limiting, refresh-token rotation, a real server-side logout that revokes the token — not just a client-side drop. A real login screen is being added now.',
gaps: 'Per-IP limiter has no proxy-header handling, so every user could share one bucket in production. The real Telegram sign-in code path is fully mocked in every test.',
backendTests: '12',
frontendTests: '—',
},
]
const ROADMAP_COLUMNS: { title: string; sub: string; dot: string; items: string[] }[] = [
{
title: 'Now',
sub: 'Security',
dot: 'bg-red-400',
items: [
'Auth-gate /remix and derive user_id from the JWT instead of a form field.',
'Fix the room WebSocket — stop trusting a bare user_id query param.',
'Real login screen — landing now, so the app finally works for someone other than the dev account.',
],
},
{
title: 'Next',
sub: 'Built, unreachable',
dot: 'bg-amber-400',
items: [
'Playlist UI — create, view, add tracks. Backend is ready.',
'Channels: vibe sets, stories, showcase screens.',
'Discovery → Library — make "like" actually save the song.',
"Wire remix's library linking into the composer UI.",
'Library search box on the Library page.',
'Test coverage for Upload, Discovery, and Remix — all currently zero.',
],
},
{
title: 'Ideas',
sub: 'Not started',
dot: 'bg-emerald-400',
items: [
'Delete/remove songs and playlist tracks — no endpoint exists yet either way.',
'Real "couldn\'t identify" feedback in Discovery — surface a confidence score instead of one generic error.',
"Rate-limit Discovery's identify endpoint the way auth's request_code already is.",
'Proxy-aware IP detection for the auth rate limiter before this sits behind a real load balancer.',
],
},
]
export function Roadmap() {
return (
<Layout title="Status & Roadmap">
<p className="mb-8 max-w-2xl text-sm leading-relaxed text-neutral-400">
A full pass over both repos — what's live and working, what's built but unreachable, and where the
backend trusts something it shouldn't. Compiled 2026-08-15 from a direct audit plus live
cross-account testing.
</p>
<div className="mb-10 flex flex-wrap gap-x-8 gap-y-4">
{[
['9', 'Feature areas'],
['2', 'Critical security gaps'],
['186', 'Backend tests'],
['137', 'Frontend tests'],
['4', 'Pages w/ zero tests'],
].map(([n, l]) => (
<div key={l}>
<p className={`text-xl font-bold tabular-nums ${l === 'Critical security gaps' ? 'text-red-400' : 'text-white'}`}>{n}</p>
<p className="text-[11px] uppercase tracking-wide text-neutral-500">{l}</p>
</div>
))}
</div>
<section className="mb-10">
<div className="mb-3 flex items-center justify-between">
<h2 className="text-xs font-bold uppercase tracking-wide text-neutral-500">Fix now — active security gaps</h2>
<span className="text-xs text-neutral-500">Not roadmap items — live holes in shipped code</span>
</div>
<div className="space-y-3">
<div className="rounded-xl border border-red-900/50 bg-red-950/20 p-4">
<div className="flex items-start gap-3">
<AlertTriangle size={16} strokeWidth={2} className="mt-0.5 shrink-0 text-red-400" />
<div>
<p className="mb-1 text-sm font-semibold text-white">/remix has no authentication at all</p>
<p className="text-sm leading-relaxed text-neutral-400">
<code className="rounded bg-neutral-800 px-1.5 py-0.5 text-xs text-neutral-200">POST /remix</code> and{' '}
<code className="rounded bg-neutral-800 px-1.5 py-0.5 text-xs text-neutral-200">GET /remix/{'{job_id}'}</code>{' '}
never call <code className="rounded bg-neutral-800 px-1.5 py-0.5 text-xs text-neutral-200">get_current_user</code> —
every other router does. <code className="rounded bg-neutral-800 px-1.5 py-0.5 text-xs text-neutral-200">user_id</code>{' '}
is a raw, unvalidated form field, so a remix's resulting library song and social post can be attributed
to anyone. Job status is also fetchable by guessing sequential IDs (IDOR) — no login needed to read or
claim someone else's remix.
</p>
</div>
</div>
</div>
<div className="rounded-xl border border-red-900/50 bg-red-950/20 p-4">
<div className="flex items-start gap-3">
<AlertTriangle size={16} strokeWidth={2} className="mt-0.5 shrink-0 text-red-400" />
<div>
<p className="mb-1 text-sm font-semibold text-white">Room WebSocket trusts an unauthenticated user_id</p>
<p className="text-sm leading-relaxed text-neutral-400">
<code className="rounded bg-neutral-800 px-1.5 py-0.5 text-xs text-neutral-200">WS /social/rooms/{'{room_id}'}/ws</code>{' '}
takes <code className="rounded bg-neutral-800 px-1.5 py-0.5 text-xs text-neutral-200">user_id</code> as a plain
query parameter, no token check. Anyone can connect claiming to be any user — chat as them, join the DJ
queue as them, or take the aux as them.
</p>
</div>
</div>
</div>
</div>
</section>
<section className="mb-10">
<div className="mb-3 flex items-center justify-between">
<h2 className="text-xs font-bold uppercase tracking-wide text-neutral-500">What we have</h2>
<span className="text-xs text-neutral-500">Nine feature areas, audited end to end</span>
</div>
<div className="grid gap-3 sm:grid-cols-2">
{FEATURES.map((f) => (
<div key={f.name} className="rounded-xl border border-neutral-800 bg-neutral-900 p-4">
<div className="mb-3 flex items-start justify-between gap-3">
<div>
<p className="font-semibold text-white">{f.name}</p>
<p className="text-xs text-neutral-500">{f.sub}</p>
</div>
<StatusPill status={f.status} label={f.statusLabel} />
</div>
<dl className="space-y-2 text-sm">
<div className="flex gap-2">
<dt className="w-12 shrink-0 pt-0.5 text-[11px] font-bold uppercase tracking-wide text-neutral-600">Built</dt>
<dd className="text-neutral-300">{f.built}</dd>
</div>
<div className="flex gap-2">
<dt className="w-12 shrink-0 pt-0.5 text-[11px] font-bold uppercase tracking-wide text-neutral-600">Gaps</dt>
<dd className="text-neutral-400">{f.gaps}</dd>
</div>
</dl>
<div className="mt-3 flex gap-4 border-t border-neutral-800 pt-3 text-xs text-neutral-500">
<span>
<b className="font-semibold text-neutral-400">{f.backendTests}</b> backend
</span>
<span>
<b className="font-semibold text-neutral-400">{f.frontendTests}</b> frontend
</span>
</div>
</div>
))}
</div>
</section>
<section>
<div className="mb-3 flex items-center justify-between">
<h2 className="text-xs font-bold uppercase tracking-wide text-neutral-500">What's next</h2>
<span className="text-xs text-neutral-500">Ordered by urgency, left to right</span>
</div>
<div className="grid gap-3 md:grid-cols-3">
{ROADMAP_COLUMNS.map((col) => (
<div key={col.title} className="rounded-xl border border-neutral-800 bg-neutral-900">
<div className="flex items-center gap-2 border-b border-neutral-800 px-4 py-3">
<span className={`h-2 w-2 rounded-full ${col.dot}`} />
<span className="font-semibold text-white">{col.title}</span>
<span className="ml-auto text-[11px] text-neutral-500">{col.sub}</span>
</div>
<ul className="space-y-3 px-4 py-4">
{col.items.map((item) => (
<li key={item} className="relative pl-3 text-sm leading-relaxed text-neutral-400">
<span className="absolute left-0 top-2 h-1 w-1 rounded-full bg-neutral-600" />
{item}
</li>
))}
</ul>
</div>
))}
</div>
</section>
</Layout>
)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment