# FusionCX Library — Regression scenario card
# Format delivered under 05 QA. Recreate only in test environments and
# test accounts the client designates, never in a live customer application.
# Last reviewed: 3 September 2026

scenario_id: REG-XXXX-014
status: draft # draft | accepted | live | retired
client: "[client]"
product: "[product]"
owner:
  support_pattern_id: "[error-register id]"
  qa_owner: "[name]"
  engineering_owner: "[name]"

# Frequency and severity from the support error register; you designate
# which patterns become scenarios.
severity: P2 # P1 | P2 | P3 | P4
frequency:
  tickets: 31
  window_days: 90

title: "Postgres migration drops RLS policy"
summary: >
  After a schema edit and redeploy, row-level security policy is dropped
  and reads return empty. Customers see a successful deploy and empty data.

preconditions:
  environment: test_account_only
  accounts:
    - "[designated test account]"
  configuration:
    - "Postgres connector v2"
    - "RLS enabled"
    - "[any feature flags]"

trigger_sequence:
  - "Prompt 1: [minimal prompt that creates the schema]"
  - "Prompt 2: [minimal prompt that attaches the connector]"
  - "Prompt 3: [minimal prompt that enables RLS]"
  - "Schema edit in the visual editor: [exact change]"
  - "Redeploy"

failing_output: >
  Migration drops policy; authenticated reads return empty result sets.
expected_output: >
  Policy preserved across migration; reads return authorised rows only.

remediation:
  applied_in_support: "Connector pins policy before migrate"
  engineering_fix: "[ticket / PR once designated]"
  kit_or_prompt_guard: "[optional kit id]"

test_case:
  framework: "[your framework]"
  reference: suite/db/rls_migrate_spec
  type: automated # automated | manual
  evidence_location: "[client tooling path]"

runs:
  sla_after_release_availability: 2_business_days
  last_run:
    release: "2026.08.3"
    at: "2026-08-20T16:00:00Z"
    result: pass # pass | fail | blocked
    evidence: "[link in client tooling]"
  history: []

acceptance:
  # Scenario acceptance: reproducible on first attempt by your engineer.
  target: 0.95
  reproducible_on_first_attempt: null
  accepted_by: null
  accepted_at: null

notes: |
  Do not copy production data into the test account.
  Attach failing and expected artefacts as files in your tooling, not in this card.
