schema_version: tipoc.v3.spec.v1
identity:
  run_id: tidb-x-premium-migration-poc
  attempt_id: attempt-001
  run_profile_id: tidb-x-premium-migration-poc-a001
init:
  entry_node_id: coordinator-a
  entry_address: 127.0.0.1
  coordinator_node_id: coordinator-a
  attempt_root: runs/tidb-x-premium-migration-poc/attempt-001
  remote_attempt_root: /home/ec2-user/tipoc/runs/tidb-x-premium-migration-poc/attempt-001
  bootstrap_timeout_secs: 60
  status_poll_interval_secs: 30
  coordinator_log_dir: runs/tidb-x-premium-migration-poc/attempt-001/logs/coordinator
scenario:
  industry: securities
  model: tpce
  scale:
    target_size: 1T
target_cluster:
  sql_endpoint: tidb.example.internal:4000
  pd_endpoint: pd.example.internal:2379
  credentials_ref: env:TIPOC_TIDB_DSN
object_store:
  kind: s3
  uri: s3://example-tipoc/tidb-x-premium-migration-poc/source
  credential_ref: env:AWS_PROFILE
generation:
  nodes:
    - node_id: coordinator-a
      address: 127.0.0.1
      capacity: 8
    - node_id: pressure-a
      address: 10.0.0.11
      capacity: 8
    - node_id: pressure-b
      address: 10.0.0.12
      capacity: 8
  load_unit_size: 1000
  rng: lcg64
  random_capacity_budget: lcg64-64bit
prepare:
  source_kind: generated_tpce
  source_format: csv
  import_executor: tidb_import_into_file
  unsupported_source_policy: fail_closed_no_side_effect
  import_mode: import
  ops:
    - generate
    - import
    - add-index
    - backup
  skip_generation: false
  csv_object_target_bytes: 536870912
  scheduling_chunk_bytes: 1073741824
  import_thread: 128
  global_sort_uri_ref: s3://example-tipoc/tidb-x-premium-migration-poc/global-sort
  final_index_policy: prepare_end
  br_checkpoint_policy:
    enabled: true
    scope: prepare_end
    pd_endpoint_ref: pd.example.internal:2379
    storage_uri: s3://example-tipoc/tidb-x-premium-migration-poc/br
    tiup_component: br:v9.0.0-beta.2.pre-nightly
    rate_limit_mib: 0
    log_file: runs/tidb-x-premium-migration-poc/attempt-001/logs/br.log
pressure:
  duration_seconds: 3600
  warmup_seconds: 300
  cooldown_seconds: 60
  progress_interval_secs: 30
  concurrency: 512
  workload_mix: tpce
  workload_profile:
    name: canonical
  nodes:
    - pressure-a
    - pressure-b
  node_specs:
    - node_id: pressure-a
      address: 10.0.0.11
      pressure_capacity_units: 8
      pressure_sql_pool_size: 256
      pressure_ce_worker_limit: 256
    - node_id: pressure-b
      address: 10.0.0.12
      pressure_capacity_units: 8
      pressure_sql_pool_size: 256
      pressure_ce_worker_limit: 256
  runner_launch:
    mode: external
monitoring:
  metrics:
    - tidb_sql_latency
    - tidb_cpu
    - tikv_grpc_rate
    - tikv_write_stall
    - pd_region_health
    - slow_query
reporting:
  output_dir: runs/tidb-x-premium-migration-poc/attempt-001
cleanup:
  policy: preserve_evidence
  preserve_evidence: true
actions:
  - action_id: ttl-cash-transaction-plan
    kind: ttl
    window: parallel_with_workload
    params:
      table: cash_transaction
      column: ct_dts
      interval: "30"
      unit: DAY
cases:
  - id: prep-01-workload-profile
    title: Confirm representative business workload
    category: preparation
    support_status: partial_product
    stage_bindings:
      - init
      - run
    evidence_requirements:
      - run/run-report.md
      - run/global-run-closeout.json
    pass_fail_gate: The report records the TPC-E securities model, scale, pressure shape, workload mix, workload profile, and observed distribution; real business sampling remains external input.
    external_dependency: Business owners must provide real workload dimensions, growth rate, and representative-load classification.
    notes:
      - tipoc owns a securities representative workload, not automatic production workload discovery.
  - id: prep-02-capacity-cost
    title: Capacity planning and cost input package
    category: preparation
    support_status: partial_product
    stage_bindings:
      - prepare
      - run
    evidence_requirements:
      - run/run-report.md
      - run/global-run-closeout.json
    pass_fail_gate: The report records source bytes, row counts, source object count, prepare timings, pressure QPS, latency, and pressure-node shape as capacity inputs.
    external_dependency: TiDB Cloud price sheets, backup cost, network cost, scale policy, and budget guardrails are not product-owned in this testcase.
    notes:
      - The template provides cost-model inputs only.
  - id: required-01-billing-renewal
    title: Verify billing renewal behavior
    category: required
    support_status: manual_required
    evidence_requirements:
      - manual/billing-renewal-evidence.md
    external_dependency: TiDB Cloud billing, credit, permission, and renewal control plane.
    pass_fail_gate: Manual evidence must prove balance exhaustion or renewal simulation, recovery behavior, and billing permission integrity.
    notes:
      - tipoc must not fake account credit state.
  - id: required-02-snapshot-import-index
    title: Snapshot data import speed, consistency, and index build performance
    category: required
    support_status: partial_product
    stage_bindings:
      - prepare
    evidence_requirements:
      - run/run-report.md
      - run/run-receipt.json
      - run/global-run-closeout.json
    pass_fail_gate: Product evidence must include generated source publication, table import terminal states, row-count readiness, prepare-end ADD INDEX duration, and prepare completion timing.
    external_dependency: A true MySQL source snapshot, DM worker scaling, checksum diff, and sample diff remain external until a migration source adapter is added.
    notes:
      - This closes the generated TPC-E source and TiDB IMPORT INTO subset.
  - id: required-03-statistics
    title: Statistics collection speed and readiness
    category: required
    support_status: partial_product
    stage_bindings:
      - prepare
    evidence_requirements:
      - run/run-report.md
      - run/global-run-closeout.json
    pass_fail_gate: Product evidence must include ANALYZE duration, statistics mode, parameter snapshot, table statistics terminal state, stats meta, and stats healthy probes.
    external_dependency: Partition-table experiments, repeated collection matrices, and concurrent-business-impact comparisons require future action harness work.
  - id: required-04-schema-change
    title: Schema change performance and stability
    category: required
    support_status: partial_product
    stage_bindings:
      - prepare
      - run
    evidence_requirements:
      - run/run-report.md
    pass_fail_gate: Product evidence currently covers the frozen prepare-end ADD INDEX subset and declared action reporting; it does not prove a generic DDL harness.
    external_dependency: Add-column, modify-column, drop-index, partition change, multi-DDL, rollback, and workload-impact execution need a future DDL action executor.
  - id: required-05-normal-load-stability
    title: Normal workload performance stability
    category: required
    support_status: supported_now
    stage_bindings:
      - run
    evidence_requirements:
      - run/run-report.md
      - run/run-receipt.json
      - run/global-run-closeout.json
      - run/semantic-proof.json
    pass_fail_gate: The run must execute canonical TPC-E mixed read/write pressure, preserve semantic proof, report stable QPS and latency, and avoid blocked statements.
    notes:
      - Slow full-scan injection remains a future specialized case.
  - id: required-06-hotspot-observability
    title: Hot queries, hot keys, and slow-query observability
    category: required
    support_status: partial_product
    stage_bindings:
      - run
    evidence_requirements:
      - run/run-report.md
      - run/run-receipt.json
      - run/global-run-closeout.json
    pass_fail_gate: Product evidence must show the selected hotspot workload profile, hot dimensions, hot set, skew, observed distribution, QPS, latency, and slow-query import status.
    external_dependency: Alert timeliness, TiDB/TiKV/PD root-cause tracing, and Clinic or Grafana evidence remain external unless imported by a future observability collector.
  - id: required-07-ceiling-search
    title: Performance ceiling search
    category: required
    support_status: supported_now
    stage_bindings:
      - run
    evidence_requirements:
      - run/run-report.md
      - run/run-progress.jsonl
      - run/global-run-closeout.json
    pass_fail_gate: Each step must record concurrency, pressure nodes, stable statement QPS, latency, errors, blocked statements, workload distribution, and bottleneck observation artifacts where imported.
    notes:
      - Fully adaptive search and automatic root-cause closure remain future improvements.
  - id: required-08-promotion-scale
    title: Big promotion traffic and scale-out behavior
    category: required
    support_status: external_required
    stage_bindings:
      - run
    evidence_requirements:
      - external/cloud-scale-evidence.md
    external_dependency: TiDB Cloud scale API or runbook, rebalance observations, post-scale recovery evidence, and permission guardrails.
    pass_fail_gate: Manual cloud-control evidence must be attached; tipoc can only supply the traffic burst and before/after workload reports.
  - id: required-09-fault-response
    title: Cluster overload, failure response, and recovery
    category: required
    support_status: external_required
    evidence_requirements:
      - external/fault-response-evidence.md
    external_dependency: Fault injection rights for TiDB, TiKV, PD, network, or resource isolation, plus alerting and RTO evidence.
    pass_fail_gate: Manual or external fault-injection evidence must prove failure trigger, alert, service impact, recovery time, and data correctness after recovery.
  - id: required-10-minute-backup-restore
    title: Minute-level backup and restore
    category: required
    support_status: external_required
    stage_bindings:
      - prepare
    evidence_requirements:
      - external/continuous-backup-restore-evidence.md
    external_dependency: TiDB Cloud backup or BR schedule control plane, point-in-time restore target, and business reconnect verification.
    pass_fail_gate: Product BR prepare boundary is only a subset; continuous restore-point cadence and restore validation require external control-plane evidence.
  - id: required-11-streaming-migration-catchup
    title: Streaming migration catch-up speed and incremental diff
    category: required
    support_status: external_required
    evidence_requirements:
      - external/streaming-migration-catchup-evidence.md
    external_dependency: MySQL source, DM or migration service, continuous source writes, catch-up metrics, and incremental data diff.
    pass_fail_gate: External migration evidence must prove snapshot-plus-incremental catch-up and insert/update/delete consistency.
  - id: required-12-business-cutover
    title: Smooth business cutover
    category: required
    support_status: external_required
    evidence_requirements:
      - external/business-cutover-evidence.md
    external_dependency: Cutover runbook, connection-string switch, readonly window, rollback plan, session residue checks, and transaction interruption measurement.
    pass_fail_gate: External cutover evidence must prove switch duration, correctness, fallback route, and application impact.
  - id: required-13-cdc-latency-stability
    title: CDC latency and stability
    category: required
    support_status: external_required
    evidence_requirements:
      - external/cdc-latency-stability-evidence.md
    external_dependency: TiCDC or CDC service deployment, downstream sink, DDL and DML burst workload, backlog metrics, retry evidence, and CDC scaling.
    pass_fail_gate: External CDC evidence must prove latency, stability, retry behavior, and backlog recovery.
  - id: required-14-archive-delete
    title: Data archive and delete workflow
    category: required
    support_status: not_supported
    evidence_requirements:
      - gaps/archive-delete-gap.md
    external_dependency: Archive/export/delete adapter, retention policy, space reclamation observation, and online-query impact measurement.
    pass_fail_gate: No current product runner owns archive or delete side effects.
  - id: optional-o1-tiflash
    title: TiFlash analytical performance
    category: optional
    support_status: external_required
    evidence_requirements:
      - external/tiflash-performance-evidence.md
    external_dependency: TiFlash replica management, columnar routing, TiFlash metrics, and write-side cost comparison.
    pass_fail_gate: External TiFlash evidence must prove replica readiness, query routing, performance, and write impact.
  - id: optional-o2-ttl
    title: TTL automatic delete behavior
    category: optional
    support_status: partial_product
    stage_bindings:
      - init
      - run
    evidence_requirements:
      - run/run-report.md
      - run/global-run-closeout.json
      - external/ttl-job-and-delete-validation.md
    external_dependency: TTL job scheduling observation, expired-row deletion evidence, false-delete validation, and production retention-policy signoff.
    pass_fail_gate: Product evidence must show the declared TiDB TTL DDL plan, while external evidence must prove background TTL deletion behavior and false-delete safety before the case is accepted.
    notes:
      - tipoc owns TTL action declaration and TiDB DDL planning only.
  - id: optional-o3-audit
    title: Audit log behavior
    category: optional
    support_status: not_supported
    evidence_requirements:
      - gaps/audit-gap.md
    external_dependency: Audit switch, log collection, queryability, retention, storage cost, and latency overhead measurement.
    pass_fail_gate: No current product runner owns audit-log control or evidence collection.
  - id: optional-o4-million-db-table
    title: Million database and table metadata pressure
    category: optional
    support_status: not_supported
    evidence_requirements:
      - gaps/million-db-table-gap.md
    external_dependency: Metadata-scale schema generator, control-plane limits, DDL scheduling, and information-schema performance measurement.
    pass_fail_gate: The current model is a 33-table securities schema and does not represent million database or table pressure.
  - id: optional-o5-wide-table
    title: Wide-table mixed read/write workload
    category: optional
    support_status: not_supported
    evidence_requirements:
      - gaps/wide-table-gap.md
    external_dependency: Wide-table schema generator, row-amplification data generator, update mix, and wide-row query validation.
    pass_fail_gate: The current securities schema does not represent wide-table workload behavior.
