Preview Foundation
Demo launcher, session preview, clock preview, data source readiness, and creation plan surfaces are available without database writes.
Risk: low
Demo Operations Center
This internal center tracks the path from preview-only demo orchestration to database-backed production-shaped demo fundraisers.
Cleanup readiness
The internal cleanup inspection script resolves records by demo_session_id and prints the safe delete order. Do not expose public self-serve demo creation until cleanup execution, reset safety, and rate limiting are implemented.
Inspect script
Available
Delete script
Not created
Cleanup mode
Read-only
Public launch
Blocked
Reset readiness
Reset must be session-scoped, ownership-validated, and able to restore card lineups, swaps, roster trades, weekly snapshots, and leaderboard state without touching canonical QA records.
Reset script
Not created
Reset scope
Session-only
Weekly rows
Must reset safely
Public launch
Blocked
Weekly simulation readiness
The public demo flow can display session-owned cards and leaderboards, but week finalization must still be validated against demo_session_id ownership before visitors can advance weeks.
Week finalization
Not public
Ownership check
Required
Scoring source
2025 data
Leaderboard
Read-only
Public demo launch blockers
The isolated proof session validates session-owned records and read-only routes. The next launch blockers are destructive cleanup, reset, weekly finalization, and abuse protection.
Session cleanup execution
Delete/expire only records owned by demo_session_id.
Session reset safety
Restore lineups, weekly rows, swaps, trades, and leaderboard state without touching canonical QA data.
Session-owned week finalization
Finalize weekly snapshots for session-owned cards only.
Rate limiting and abuse controls
Prevent anonymous session spam and repeated reset/finalize abuse.
Public creation UX gate
Expose visitor creation only after cleanup, reset, and scoring safety pass.
Cleanup DryRun passed
The cleanup script can resolve session-owned records, verify safety guards, and print the dependency-safe delete plan. Execute mode is still intentionally disabled.
DryRun target
demo_session_internal_create_001
Safety validation
Passed
Deletes
Disabled
Execute mode
Not implemented
Mutation gates remain closed
Cleanup, reset, week finalization, and public self-serve creation are intentionally not exposed. Current scripts validate these flows with read-only or DryRun checks only.
Cleanup Execute
Disabled
DryRun only
Reset Execute
Disabled
DryRun only
Week Finalization
Disabled
DryRun only
Public Creation
Disabled
Internal writer only
Fast validation
These commands read existing proof routes and DryRun-only data. They do not create sessions, reset cards, finalize weeks, or delete records.
1. Proof URLs
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\scripts\demo\check-demo-proof-urls.ps1"2. Proof summary
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\scripts\demo\preview-public-demo-proof-summary.ps1" -DemoSessionId "demo_session_internal_create_001" -CardPublicCode "DEMOATE0010101" -WeekNumber 13. Full safety suite
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\scripts\demo\preview-demo-safety-suite.ps1"Move-on gate
Isolated creation, read-only routes, DryRun reset/finalization, JSON status export, cleanup Execute, and post-delete verification have been validated. Next work should move back to product UX, admin flow, claim/account conversion, or production readiness.
Cleanup Execute
Validated
Active proof
Valid
Remaining demo infra
Defer
Next phase
Product UX
Demo Ops
1/6 complete
This roadmap tracks the path from safe preview-only demo orchestration to database-backed demo creation and controlled cleanup.
Preview Foundation
Demo launcher, session preview, clock preview, data source readiness, and creation plan surfaces are available without database writes.
Risk: low
Schema Migration
Create demo sessions, demo metadata, campaign clocks, demo invites, lifecycle events, audit events, and data source tables through the approved migration system.
Risk: medium
Repository Adapter
Wire database-backed adapters for demo sessions, metadata registration, campaign clocks, invites, lifecycle events, and audit events.
Risk: medium
Production Service Adapters
Connect demo orchestration to real organization, URL reservation, fundraiser, package, participant, card, and Share Engine write services.
Risk: medium
Enable Demo Create
Enable the create action only after schema, repository, service adapters, safety validation, access checks, and cleanup safeguards pass.
Risk: high
Lifecycle & Cleanup Actions
Enable expire, archive, reset, and delete actions only after audit logging and demo-only cleanup verification are database-backed.
Risk: high
Implementation Tracker
These tables and adapters must exist before the demo create button can be enabled.
Required database tables
demo_data_sourcesdemo_sessionsdemo_record_metadatademo_invitescampaign_clocksdemo_lifecycle_eventsdemo_audit_events Required write adapters
demoRepository.createDemoSessiondemoRepository.registerDemoRecorddemoRepository.createCampaignClockdemoRepository.createInvitedemoRepository.writeLifecycleEventdemoRepository.writeAuditEventorganizationService.createOrganizationurlReservationEngine.reserveSlugfundraiserService.createFundraisercampaignClockService.createClockpackageService.createFundraiserPackageparticipantService.createParticipantscardEngine.createCardsshareEngine.createShareLinks DB Readiness
This readiness package documents the schema plan, password-safe PostgreSQL workflow, validation queries, rollback expectations, and blockers before any migration is executed.
Cost
low
Time
short after schema review
Storage
low
Rollback
medium
Blast radius
database-wide if executed against the wrong database; additive within the correct database
Required tables
demo_audit_eventsdemo_lifecycle_eventsdemo_invitesdemo_data_sourcesdemo_record_metadatademo_sessionscampaign_clocks Additive demo fields
is_demodemo_batch_iddemo_session_iddemo_purposedemo_expires_atdemo_delete_after_at Blockers before DB writes
Password-safe PostgreSQL workflow
Use %APPDATA%\postgresql\pgpass.conf for repeated local psql/pg_dump work.
Never commit credentials or put production passwords in repo files.
Read-only inspection command
cd "C:\NYD\repos\app\fansports" powershell -ExecutionPolicy Bypass -File ".\src\db\inspection\run-demo-db-inspection.ps1"
Repository Adapter
6/7 required wired
This contract defines the database-backed methods required before demo creation and lifecycle actions can move beyond preview-only mode.
createDemoSession
demo_sessions
Creates one demo session row before production-shaped demo records are created.
registerDemoRecord
demo_record_metadata
Registers every demo-created production record by demo batch/session for cleanup safety.
createCampaignClock
campaign_clocks
Creates the campaign clock used by scoring-period resolution.
createInvite
demo_invites
Creates invite-only access records using token hashes only.
writeLifecycleEvent
demo_lifecycle_events
Audits lifecycle actions such as pause, reset, expire, archive, and delete.
writeAuditEvent
demo_audit_events
Writes preview, readiness, safety, service, scoring, create, and cleanup audit events.
listDemoSessions
demo_sessions
Reads demo sessions for the internal operations center.
getDemoCleanupCandidates
demo_record_metadata
Reads demo-only records by batch for expire/archive/delete previews.
createDemoSession
insert_demo_session · demo_sessions
registerDemoRecord
insert_demo_record_metadata · demo_record_metadata
createCampaignClock
insert_campaign_clock · campaign_clocks
writeLifecycleEvent
insert_demo_lifecycle_event · demo_lifecycle_events
writeAuditEvent
insert_demo_audit_event · demo_audit_events
Read Model
Database read is unavailable or the demo schema has not been migrated yet, so this surface is using safe fallback data.
spawn psql.exe ENOENT
Database Tracker
These fields and tables are required before demo creation writes to the production database.
demo_audit_events
Audits demo previews, create attempts, readiness checks, safety checks, scoring-period resolution, lifecycle actions, and cleanup previews.
demo_audit_event_idevent_typedemo_batch_iddemo_session_idactor_user_idriskentity_type demo_lifecycle_events
Audits demo activation, pause, resume, reset, expire, archive, and delete actions.
demo_lifecycle_event_iddemo_session_iddemo_batch_idaction_typesource_statustarget_statusactor_user_id demo_invites
Stores invite-only demo access tokens for prospects, investors, staff training, and sales walkthroughs.
demo_invite_iddemo_session_iddemo_batch_idinvite_token_hashemailaccess_modemax_uses demo_data_sources
Tracks hydrated, synthetic, and replay data sources available to demo campaigns.
demo_data_source_idsourcedata_yearstatusrecommendedcapabilities_jsondescription demo_record_metadata
Tracks every production-shaped demo record by batch/session for safe cleanup.
demo_record_iddemo_batch_iddemo_session_identity_typeentity_iddemo_purposedemo_access_mode demo_sessions
Represents a public, invite-only, staff, investor, or sales demo run.
demo_session_iddemo_batch_idpreset_idstatusaccess_modecreated_by_user_idcreated_by_type campaign_clocks
Allows real, manual, and simulated campaign time without changing scoring logic.
campaign_clock_idfundraiser_idcampaign_time_modedemo_data_sourcedemo_data_yearsimulation_profilesimulation_started_at Production table demo fields
is_demodemo_batch_iddemo_session_iddemo_purposedemo_expires_atdemo_delete_after_at Indexes to create
INDEX demo_audit_events_batch_idx (demo_batch_id)INDEX demo_audit_events_session_idx (demo_session_id)INDEX demo_audit_events_event_type_idx (event_type)INDEX demo_lifecycle_events_session_idx (demo_session_id)INDEX demo_lifecycle_events_batch_idx (demo_batch_id)INDEX demo_invites_session_idx (demo_session_id)UNIQUE demo_invites_token_hash_uidx (invite_token_hash)UNIQUE demo_data_sources_source_year_uidx (source, data_year)INDEX demo_record_metadata_demo_batch_id_idx (demo_batch_id)INDEX demo_record_metadata_entity_idx (entity_type, entity_id)INDEX demo_sessions_status_expires_idx (status, expires_at)INDEX campaign_clocks_fundraiser_id_idx (fundraiser_id)