================================================================================
ROLLBACK_AND_RECOVERY_PROCEDURES_5_12_26.txt
CollabORhythm / Collabtunes — Production Acceleration Prep Phase
Generated: 5.12.26
PURPOSE: Backup strategy, checkpoint cadence, rollback triggers, recovery priorities
================================================================================

RULE: Every edit to a live or canon file starts with a backup.
No exceptions. A 2-minute ZIP now prevents hours of recovery later.

================================================================================
SECTION 1 — BACKUP STRATEGY
================================================================================

THREE TYPES OF BACKUPS:

TYPE 1 — PRE-EDIT SNAPSHOT (Before any live file change)
  When:    Before editing any Yola nav, any deployed HTML, any canon file
  What:    ZIP of all files in scope for the edit
  Name:    ROLLBACK_[SYSTEM]_PRE_[OPERATION]_[DATE].zip
  Examples:
    ROLLBACK_NAV_PRE_CHAPTER_DRIFT_FIX_5_13_26.zip
    ROLLBACK_BOUNCER_PRE_DEFAULT_STATE_FIX_5_13_26.zip
    ROLLBACK_CANON_PRE_GX_UPDATE_5_14_26.zip

TYPE 2 — SESSION CHECKPOINT (Every 30–45 minutes during active work)
  When:    Periodically during any long work session
  What:    All current output files
  Name:    CHECKPOINT_[SESSION_DATE]_[TIME_OR_SEQUENCE].zip
  Examples:
    CHECKPOINT_5_13_26_SESSION1_MID.zip
    CHECKPOINT_5_13_26_SESSION1_END.zip

TYPE 3 — PHASE COMPLETION ARCHIVE (After completing each Execution Phase)
  When:    At end of Phase 1, Phase 2, Phase 3, etc.
  What:    All files produced in that phase
  Name:    [N]_[TYPES]_COLLABTUNES_PHASE[N]_COMPLETE_[DATE].zip
  Examples:
    7_HTML_COLLABTUNES_PHASE1_LIVE_FIXES_COMPLETE_5_13_26.zip
    34_HTML_COLLABTUNES_PHASE5_AIO_GENERATION_COMPLETE_5_15_26.zip

================================================================================
SECTION 2 — ZIP CHECKPOINT CADENCE
================================================================================

FREQUENCY RULES:
  Every 30 minutes during active file editing → session checkpoint
  Before any live site edit → pre-edit snapshot
  After every 5 generated HTML pages → batch checkpoint
  End of every session → session-end checkpoint
  After Tom approves any milestone → phase-complete archive

MINIMUM CHECKPOINTS FOR HIGH-RISK OPERATIONS:
  Chapter drift fix:        Before + after each of the 17 chapter label changes
  URL rename operation:     Before renaming + after each URL + after all redirects set
  Mass HTML generation:     Before batch + after every 5 pages
  Canon update:             Before any canon file edit

STORAGE:
  Keep all rollback ZIPs in 09_HTML_PROTOTYPES/ARCHIVE/ or a dedicated ROLLBACK/ folder
  Never delete rollback ZIPs for at least 30 days after the operation

================================================================================
SECTION 3 — ROLLBACK TRIGGERS
================================================================================

IMMEDIATELY roll back if any of these occur:

TRIGGER 1: Live site shows broken layout on any page
  ROLLBACK TO: Most recent pre-edit snapshot of that page/system
  TIME TO ROLLBACK: Under 10 minutes — this is a live site issue

TRIGGER 2: Rating gate malfunction (wrong content showing at wrong rating)
  ROLLBACK TO: Last known good bouncer state
  CRITICAL: This is a content safety issue — prioritize above all other work

TRIGGER 3: Nav menu shows 404 links or wrong destinations
  ROLLBACK TO: Nav snapshot from before the nav edit
  NOTE: Yola propagates nav changes globally — a bad nav change hits all 121+ pages

TRIGGER 4: Generated HTML pages show wrong collection title or rating
  ROLLBACK TO: Prior template version; do not continue generation
  FIX: Identify template error, correct, re-lock, regenerate affected batch

TRIGGER 5: Canon data was changed without Tom approval
  ROLLBACK TO: Prior canon files immediately
  FLAG: All pages generated from incorrect canon must be regenerated

TRIGGER 6: Chapter drift fix applied but chapter numbers mixed (some fixed, some not)
  ROLLBACK TO: Pre-drift-fix nav snapshot
  RULE: All 17 chapters must be fixed in one operation — partial fix = rollback

TRIGGER 7: defamation-flagged content appeared in any public-facing page
  ROLLBACK TO: Version before that content was added
  ESCALATE: Alert Tom immediately — this is a legal risk

================================================================================
SECTION 4 — RECOVERY PRIORITIES
================================================================================

PRIORITY 1 — CONTENT SAFETY (Fix in under 10 minutes)
  X-rated or NC-17 content accessible without gate
  Profanity visible before rating selection on bouncer
  RECOVERY: Revert to last known good bouncer state; revert gating JS

PRIORITY 2 — LIVE SITE BREAKAGE (Fix in under 30 minutes)
  Nav shows 404s or broken layout
  Pages returning 500 errors
  Footer missing or garbled
  RECOVERY: Revert Yola changes using pre-edit snapshot

PRIORITY 3 — CANON CORRUPTION (Fix before next generation session)
  Wrong album title in generated page
  Wrong rating badge applied
  Wrong GX score deployed
  RECOVERY: Revert canon file; identify all pages using wrong data; regenerate

PRIORITY 4 — NAVIGATION INTEGRITY (Fix before public launch)
  Chapter drift partially applied
  Duplicate page conflict not resolved
  Lady Weaver conflict still live
  RECOVERY: Revert nav to pre-operation state; resolve conflict fully; re-apply

PRIORITY 5 — PLACEHOLDER LEAKS (Fix before announcing launch)
  Raw [SOURCE_PULL_REQUIRED] text visible
  Empty blocks visible
  Staging pages deployed accidentally
  RECOVERY: Apply placeholder badge CSS; remove staging pages from public access

================================================================================
SECTION 5 — CATASTROPHIC EDIT RECOVERY
================================================================================

SCENARIO: Multiple systems broken simultaneously

STEP 1: Stop all work immediately. Do not make additional edits.
STEP 2: Identify which rollback ZIP covers the last known good state.
STEP 3: Restore Yola nav from rollback ZIP nav export.
STEP 4: Restore HTML files from rollback ZIP.
STEP 5: Restore canon files from FINAL_CANON_AUTHORITY_REGISTRY (always stable).
STEP 6: Verify live site is functional on 5 representative pages.
STEP 7: Document exactly what happened before starting again.
STEP 8: Identify the root cause. Fix it in a controlled way. Test on 1 page first.

CANONICAL SAFE STATE (always recoverable to this):
  FINAL_CANON_AUTHORITY_REGISTRY_5_12_26.txt — locked
  MASTER_URL_AUTHORITY_REGISTRY_5_12_26.txt — locked
  FIXED_COLOR_CODING_HTMLS_5_11_26.zip — archived and stable
  COLLABTUNES_LIVE_CAPTURE_FINAL_2026-05-12.zip — snapshot of known-good live state

THESE FILES ARE NEVER MODIFIED. They are the recovery baseline.
If these files are ever modified, create a new dated version first.

================================================================================
SECTION 6 — ROLLBACK FILE QUICK REFERENCE
================================================================================

SYSTEM TO ROLL BACK     | USE THIS FILE
------------------------|--------------------------------------------------
Bouncer HTML            | ROLLBACK_BOUNCER_PRE_[OP]_[DATE].zip
Yola nav menu           | ROLLBACK_NAV_PRE_[OP]_[DATE].zip
Canon files             | FINAL_CANON_AUTHORITY_REGISTRY_5_12_26.txt (baseline)
URL registry            | MASTER_URL_AUTHORITY_REGISTRY_5_12_26.txt (baseline)
Generated HTML batch    | Most recent CHECKPOINT or pre-batch snapshot
AIO template            | Prior locked template version file
Rating gate JS          | Prior bouncer file version
Chapter labels          | Pre-drift-fix nav snapshot

================================================================================
END ROLLBACK_AND_RECOVERY_PROCEDURES_5_12_26.txt
================================================================================
