Restore scoped reads of stored creator-post comments
Restore the existing documented GET /api/comments workflow for reading saved comments on a creator's linked posts. Authentication derives the caller, access is checked before content reads, and an optional stored-post UUID only narrows the authorized set. No scraping, provider work, writes or billing are added.
Returns the five documented comment fields with saved nulls, exact scoped totals and timestamp/ID ordering. Pagination defaults to 1/10 and caps page size at 100; ambiguous inputs and unsupported offsets fail locally. Responses disable shared caching and storage failures return bounded errors.
Access reuses direct/shared-organization/Recoup-admin roster checks, with endpoint-local self-creator and owning-organization-key reads. Existing artist mutation permissions are unchanged. Missing/denied targets both return 403. The original artist_account_id wire name is retained.
Validation: 85 focused route/auth/roster/fan/query cases pass (33 new), plus 14 existing published-document/semantic cases; full ESLint, owned-file Prettier and diff checks pass. Real Supabase SDK URL/range/count serialization is checked behind an HTTP stub. One additional existing fan-schema suite cannot load locally because the shared dependency cache lacks ajv. Repository typecheck reports existing diagnostics outside these added files; no diagnostics in the added files at the checked revision. Locked-install CI and independent review remain required.
Existing work: Mono #327 and original app #2023; the shipped fan-date alternative (#1057/#1058/#1061) remains intact. The closed provider-scrape PR #480 is a different operation. The verification note records the contract, response nullability companion and limits.
Do not merge until independent review and coordinator approval. Public documentation needs a companion for nullable saved fields, bounded pagination and 401/403/500 responses. This PR does not close the whole reconciliation ticket or prove a live customer weekly-report journey.
Refs recoupable/mono#327, recoupable/app#2023.
Summary by cubic
Restores the documented GET /api/comments endpoint for reading stored comments on a creator's linked posts, without scraping, writes, or billing. Caller identity comes only from authentication, access is checked before any content read, and the optional stored post_id narrows only the authorized set.
Behavior
- Returns the five documented comment fields with saved nulls, post-scoped exact totals, and
commented_at DESC, id DESCordering. - Pagination defaults to 1/10, caps at 100; duplicate, unknown, or out-of-range inputs return 400.
- Responses disable shared caching; lookup failures return a masked 500 instead of revealing details.
Access
- Reuses existing roster checks and adds endpoint-local self-creator and owning-organization-key reads, leaving artist mutation permissions unchanged.
- Missing and denied targets both return 403; the original
artist_account_idwire name is retained.