Verse4Verse scaffold — FLT-281¶
Superseded (Andrew, 2026-11-04). This no longer binds the product.
docs/REQUIREMENTS.mdwins wherever they differ. Kept only as a record of the original scaffold.
Verse4Verse is a Hymn Hop Lyrical Bible Study. Catalog metadata and public-domain Scripture are the only implemented content surfaces. All communities, including verified artists, must follow love thy neighbor: hateful annotations are prohibited. This scaffold stores no accounts, lyrics, annotations, or moderation records.
Module map¶
Each module owns its Postgres schema and future DbContext. Empty modules register no services or routes. Cross-module project references are forbidden; future integration uses explicit contracts/events through BuildingBlocks, never EF joins across module internals. API is composition root; Worker runs local imports and heartbeat. Production providers are Npgsql; SQLite exists only in tests.
| Module | Schema | Responsibility | Implemented |
|---|---|---|---|
| Catalog | catalog | Artist/release/song metadata, official platform IDs | Read models |
| Lyrics | lyrics | Versioned, licensed lyric content | Empty |
| Transcripts | transcripts | Podcast episodes and timed transcript versions | Empty |
| Annotations | annotations | Content anchors, commentary, Scripture citations | Empty |
| Scripture | scripture | Translation provenance, books, verses, local USFX import | Yes |
| Studies | studies | Bible studies, devotionals, reading plans, sessions | Empty |
| Commitments | commitments | Concrete Live-it actions and completion evidence | Empty |
| Community | community | Groups and membership | Empty |
| Moderation | moderation | Love-thy-neighbor policy decisions and appeals | Empty |
| ArtistPortal | artist_portal | Verified artist claims and licensed submissions | Empty |
| CatalogSync | catalog_sync | Approved catalog synchronization jobs | Empty |
| Discover | discover | Bounded discovery feed | Empty |
| Identity | identity | Future identity/account boundary | Empty |
Data model¶
Names below describe intended ownership, not migrations already deployed. IDs are UUIDs unless noted; cross-module IDs have no navigation properties. Content version IDs are immutable. All timestamps are UTC. Planned writes require a separate security-reviewed change. Implemented entities: Catalog and Scripture only.
| Module | Tables and principal columns |
|---|---|
| Catalog | Artist(Id,Name); Release(Id,ArtistId,Title); Song(Id,ArtistId,ReleaseId?,Title); SongPlatformLink(Id,SongId,Platform,ExternalId), Platform=YouTube/Spotify/AppleMusic; unique SongId+Platform+ExternalId |
| Scripture | BibleTranslation(Id,Code,Name,License,SourceUrl,Language,Dialect?,ReviewStatus); Book(Osis,Order,Name); Verse(TranslationId,BookOsis,Chapter,VerseNumber,Text); unique translation+book+chapter+verse |
| Lyrics | LyricWork(Id,SongId); LyricVersion(Id,WorkId,Version,Text,LicenseState,LicenseEvidenceId,PublishedAt?); LicenseEvidence(Id,Rightsholder,Grant,ExpiresAt?); LicenseState=Licensed/ArtistSubmitted/Unlicensed; Unlicensed content is never displayed; ArtistSubmitted requires rights review before publication |
| Transcripts | Podcast(Id,Title); Episode(Id,PodcastId,Title,MediaReference); TranscriptVersion(Id,EpisodeId,Version,LicenseState); TranscriptSegment(Id,VersionId,StartMs,EndMs,Text); validate nonnegative ordered ranges |
| Annotations | Annotation(Id,AuthorId,Body,Status); TextAnchor(Id,AnnotationId,LyricVersionId,Exact,Prefix,Suffix), W3C TextQuoteSelector; TranscriptAnchor(Id,AnnotationId,TranscriptVersionId,StartMs,EndMs); exactly one anchor type per annotation; AnnotationScriptureRef(Id,AnnotationId,TranslationCode,BookOsis,StartChapter,StartVerse,EndChapter,EndVerse) |
| Studies | Study(Id,Title,SourceType,SourceId,Version); StudyScriptureRef(Id,StudyId,Reference); Plan(Id,StudyId,Title); PlanDay(Id,PlanId,DayNumber,StudyId); GroupSession(Id,GroupId,StudyId,StartsAt,FacilitatorId); SessionProgress(Id,SessionId,MemberId,CompletedAt?) |
| Commitments | LiveItCommitment(Id,ActorId,StudyId?,Action,DueAt?,Visibility,CreatedAt); CommitmentCompletion(Id,CommitmentId,CompletedAt,EvidenceNote?); CompletionEvent(Id,CommitmentId,OccurredAt), no fabricated completion records |
| Community | Group(Id,Name,OwnerId); GroupMembership(Id,GroupId,MemberId,Role,Status); GroupInvitation(Id,GroupId,ExpiresAt,ConsumedAt?) |
| Moderation | ModerationCase(Id,ContentType,ContentId,PolicyVersion); ModerationDecision(Id,CaseId,ActorId,Decision,Reason,CreatedAt,PreviousDecisionId?), append-only; Appeal(Id,DecisionId,AppellantId,Reason,CreatedAt); AppealDecision(Id,AppealId,ActorId,Decision,Reason,CreatedAt), append-only |
| ArtistPortal | ArtistClaim(Id,ArtistId,ClaimantId,Status,EvidenceReference); ArtistSubmission(Id,ClaimId,WorkId,RightsAttestation,Status); verification evidence never implies moderation exemption |
| CatalogSync | SyncSource(Id,Provider,Enabled); SyncRun(Id,SourceId,StartedAt,CompletedAt?,Status,Cursor?); ExternalMapping(Id,SourceId,ExternalId,EntityId); no third-party calls in scaffold |
| Discover | FeedSnapshot(Id,ViewerId?,GeneratedAt,PolicyVersion); FeedItem(Id,SnapshotId,Position,SourceType,SourceId); enforce maximum 8 entries |
| Identity | Account(Id,Subject,Status); Profile(Id,AccountId,DisplayName); Consent(Id,AccountId,PolicyVersion,GrantedAt); auth/session/token design deferred |
| Each writing module | OutboxMessage(Id,OccurredAt,Type,Payload,ProcessedAt?,Attempts); same transaction as owned write, idempotent consumer inbox keyed MessageId; scaffold has record contract only |
Scripture provenance is explicit: public-domain status must be checked for each translation and jurisdiction before import/publication. WEB is an example code, not permission to ingest arbitrary translations. USFX import reads a caller-supplied local file, never downloads, rejects DTD/entities, bounds input and text, and commits only a fully parsed valid document. OSIS read references are validated before queries. EF LINQ produces parameterized queries; interpolated raw SQL is not used.
API outline¶
Only implemented GET routes are mapped. Every future write below is DEFERRED; there are no dormant write handlers. Future read outlines are also deferred.
| Module | Method + path | Purpose / state |
|---|---|---|
| Host | GET /health | Process health, implemented |
| Catalog | GET /api/catalog/songs/{id} | Song metadata and platform IDs, implemented |
| Catalog | GET /api/catalog/artists/{id} | Artist metadata and songs, implemented |
| Catalog | POST /api/catalog/songs | Metadata curation, DEFERRED |
| Scripture | GET /api/scripture/translations | Translation provenance, implemented |
| Scripture | GET /api/scripture/{translation}/{book}/{chapter} | Chapter verses, implemented |
| Scripture | GET /api/scripture/{translation}/passage?ref=JHN.3.16-17 | Validated passage, implemented; malformed reference gets 400 ProblemDetails |
| Scripture | Worker import-usfx --translation WEB --file PATH | Local operator CLI; no HTTP import endpoint |
| Lyrics | GET /api/lyrics/songs/{id} | Licensed lyric version, DEFERRED |
| Lyrics | POST /api/lyrics/submissions | Rights-reviewed submission, DEFERRED |
| Transcripts | GET /api/transcripts/episodes/{id} | Licensed timed transcript, DEFERRED |
| Transcripts | POST /api/transcripts/imports | Transcript ingestion, DEFERRED |
| Annotations | GET /api/annotations?sourceId=... | Approved commentary, DEFERRED |
| Annotations | POST /api/annotations | Anchored commentary, DEFERRED |
| Studies | GET /api/studies/{id}; GET /api/plans/{id} | Study and day sequence, DEFERRED |
| Studies | POST /api/studies; POST /api/group-sessions | Author/publish study and schedule session, DEFERRED |
| Commitments | GET /api/commitments | Authorized personal actions, DEFERRED |
| Commitments | POST /api/commitments; POST /api/commitments/{id}/completion | Adopt and complete Live-it action, DEFERRED |
| Community | GET /api/groups/{id} | Authorized group view, DEFERRED |
| Community | POST /api/groups; POST /api/groups/{id}/memberships | Group creation/join, DEFERRED |
| Moderation | GET /api/moderation/cases/{id} | Restricted case view, DEFERRED |
| Moderation | POST /api/moderation/decisions; POST /api/moderation/appeals | Append decisions and appeals, DEFERRED |
| ArtistPortal | GET /api/artist-portal/claims/{id} | Restricted claim view, DEFERRED |
| ArtistPortal | POST /api/artist-portal/claims | Verification claim, DEFERRED |
| CatalogSync | GET /api/catalog-sync/runs/{id} | Restricted sync status, DEFERRED |
| CatalogSync | POST /api/catalog-sync/runs | Approved synchronization, DEFERRED |
| Discover | GET /api/discover | Bounded feed, DEFERRED |
| Identity | GET /api/identity/profile | Authorized profile, DEFERRED |
| Identity | POST /api/identity/accounts; POST /api/identity/sessions | Accounts/login, DEFERRED |
STRIDE threat model¶
S=spoofing, T=tampering, R=repudiation, I=information disclosure, D=denial of service, E=elevation of privilege. Future controls are requirements, not implemented guarantees. Active pentests require separately approved isolated targets and time windows. No production testing is authorized by this document.
Web app¶
| Threat | Mitigation | Where enforced |
|---|---|---|
| S: malicious embed imitates official artist | Validate YouTube ID, fixed youtube-nocookie host | URL builder + unit tests |
| T: script/markup injection in API content | Angular escaping, no content HTML execution | Angular templates, strict CSP meta |
| R: forged user action history | Future server-side audit and explicit action receipts | Deferred identity/commitments |
| I: iframe tracking/referrer leakage | Privacy embed host, no-referrer policy | iframe attributes, CSP |
| D: runaway reader requests or huge responses | Loading/error states; bounded API and rate limits | Reader service, API |
| E: client invents privileged access | Client has no write/privileged capabilities | Read-only API; future server authorization |
API¶
| Threat | Mitigation | Where enforced |
|---|---|---|
| S: forged origin | Exact configured origin CORS; CORS is not authentication | Host CORS policy |
| T: query injection/invalid references | EF parameterization, validated OSIS/route inputs | Module read handlers |
| R: untraceable future changes | Append-only decisions, outbox, audit requirements | Deferred writing modules |
| I: error/secret disclosure | ProblemDetails, no production Swagger, restrictive headers | Host error pipeline |
| D: request flooding/large bodies | Fixed-window limiter on endpoints, body limits | ASP.NET host |
| E: unauthorized mutation | No account/write endpoints exist | Module route surface; future auth council |
Worker / imports¶
| Threat | Mitigation | Where enforced |
|---|---|---|
| S: mislabeled Bible provenance | Explicit translation metadata and review status | Scripture import records; operator review |
| T: DTD/XXE or malformed XML | XmlReader DtdProcessing.Prohibit, XmlResolver=null | UsfxImporter and rejection tests |
| R: disputed import origin | Retain source URL/license/review status; future file digest audit | Translation model; digest audit deferred |
| I: XML reads local/network files | Disable resolver/entities; local file only | Importer and Worker CLI |
| D: oversized/nested XML | Document/text/verse bounds, cancellation | Importer |
| E: import overwrites other module data | Own schema/context; no HTTP import route | Scripture boundary, architecture tests |
Capacitor app¶
| Threat | Mitigation | Where enforced |
|---|---|---|
| S: malicious deep links | Explicit scheme/host allowlists before adding links | Future platform integration; no platforms now |
| T: modified bundle or injected bridge code | Signed distributions, restricted navigation/plugins | Future native build/release |
| R: unverifiable offline actions | Server-generated receipts, idempotent synchronization | Deferred offline writes |
| I: credential extraction from device | No secrets in scaffold; secure storage review before auth | Config now, future native storage |
| D: bridge/request abuse | API limits, bounded retry and payload policy | API now, native retry policy deferred |
| E: excessive native permissions | No platforms/plugins provisioned | Capacitor scaffold; future permission review |
Future OBS overlay / SMTC tray app¶
| Threat | Mitigation | Where enforced |
|---|---|---|
| S: fake local media source | Validate source identity, explicit user connection | Future desktop integration |
| T: hostile track titles/overlay markup | Escape metadata; fixed template rendering | Future desktop/overlay renderer |
| R: disputed displayed content | Local diagnostic events without content/secrets | Future tray audit policy |
| I: playback/private study exposure | Opt-in display, least metadata, loopback binding | Future overlay configuration |
| D: event storms | Debounce and bounded queues | Future SMTC event pipeline |
| E: local control endpoint abuse | Loopback allowlist and scoped capabilities; no shell commands | Future tray boundary security review |
Future Twitch extension¶
| Threat | Mitigation | Where enforced |
|---|---|---|
| S: forged viewer/broadcaster | Verify extension assertions and audience server-side | Future extension backend |
| T: manipulated overlay events | Validate schemas and signed message provenance | Future extension message ingress |
| R: disputed channel moderation | Append-only server audit with correlation IDs | Future moderation integration |
| I: viewer identity leakage | Minimize scopes, isolate channel data, no public personal actions | Future extension data boundary |
| D: channel traffic spikes | Per-channel budgets and bounded fan-out | Future extension gateway |
| E: cross-channel/broadcaster privilege abuse | Authorize channel+role for every privileged operation | Future extension authorization |
Discover rule and evidence¶
Feed is capped at 6–8 items, never ranked by watch time. North-star metric is Live-it completions: an explicit user-recorded completion of a concrete action. No demand, traction, or spiritual outcome is claimed by the scaffold. Event definitions, consent, retention and anti-gaming review precede measurement.
Local operation and validation¶
Copy .env.example to ignored .env, provide local disposable passwords, then
docker compose up -d. Set ConnectionStrings__Postgres locally. Schema
provisioning/migrations must be explicit; production startup never creates tables.
For the fictional development catalog, set ASPNETCORE_ENVIRONMENT=Development
and SeedCatalog=true locally; startup applies the Catalog migration and seeds
three metadata-only songs. The switch has no effect outside Development.
Run API and Worker with dotnet run --project src/Verse4Verse.Api and
dotnet run --project src/Verse4Verse.Worker. Local file import:
dotnet run --project src/Verse4Verse.Worker -- import-usfx --translation WEB --file PATH.
No network fetching is performed. Seed data is fictional metadata with no lyrics.
CI builds/tests backend, builds/tests frontend headlessly, scans secrets and
dependencies, and runs C#/JavaScript CodeQL. Every gate fails on its findings.
Private-repository gitleaks and CodeQL require appropriate service entitlements;
missing entitlement is a visible gate failure, never a silently skipped scan.
The reviewer supplies web/src/assets/brand/kente-strip.png; no invented asset is included.
Deferred (security-sensitive, needs full security council)¶
- Authentication/login, accounts, sessions, credentials and secrets management.
- User-generated writes, annotations, moderation, append-only decisions and appeals.
- Artist claims, verification, submissions, license grants and content publication.
- Third-party API calls, catalog sync, external media ingestion and outbox execution.
- Group membership/authorization, commitments, personal progress and retention.
- Native platforms/plugins, OBS/SMTC integration, Twitch extension and remote control.
- Production deployment, schema migration permissions, operational audit and active pentesting.