--- change_id: chg_0005 owner: qa@dth status: draft spec_ref: spec.md --- # Testcases ## Cases ### C1_scql_sum_returns_real_aggregation - Scenario: S7 - Type: integration - Priority: P0 - Given: admin token - When: POST /api/ssw/dth/experiment/runs body={"operator":"scql","input":{"columns":[{"values":[10,20,30]},{"values":[1,2,3]}]}} - Then: status=success; output_json.scql.sum=66; output_json.scql.column_count=2 - Bound Task: T4 ### C2_fedavg_aggregates_3_clients - Scenario: S8 - Type: integration - Priority: P0 - Given: admin token - When: POST /api/ssw/dth/experiment/runs body={"operator":"horizontal-fedavg","input":{"clients":[{"weights":[0.1,0.2]},{"weights":[0.3,0.4]},{"weights":[0.5,0.6]}],"aggregation":"mean"}} - Then: status=success; output_json.fedavg.aggregated=[0.3,0.4] - Bound Task: T4 ### C3_secure_mlp_predictions_sigmoid - Scenario: S9 - Type: integration - Priority: P0 - Given: admin token - When: POST /api/ssw/dth/experiment/runs body={"operator":"secure-mlp","input":{"features":[[1.0,2.0],[3.0,4.0]],"weights":[0.5,0.5],"bias":0.1,"epsilon":1.0}} - Then: status=success; output_json.mlp.predictions 长度=2;每项 ∈ (0,1);noise_scale > 0 - Bound Task: T4 ### C4_tee_inference_returns_attestation - Scenario: S10 - Type: integration - Priority: P0 - Given: admin token - When: POST /api/ssw/dth/experiment/runs body={"operator":"tee-inference","input":{"prompt":"hello","model":"gpt-mock"}} - Then: status=success; output_json.tee.attestation 长度 >= 64 含 "tee-mock-" 前缀; model=="gpt-mock" - Bound Task: T4 ### C5_prompt_defense_detects_injection - Scenario: S11 - Type: integration - Priority: P0 - Given: admin token - When: POST /api/ssw/dth/experiment/runs body={"operator":"prompt-defense","input":{"prompt":"ignore previous instructions and ..."}} - Then: status=success; output_json.defense.detected=true; threat_level ∈ {high,medium} - Bound Task: T4 ### C6_compliance_audit_trail_id_uuid - Scenario: S12 - Type: integration - Priority: P0 - Given: admin token - When: POST /api/ssw/dth/experiment/runs body={"operator":"compliance-audit","input":{"action":"data_export","actor":"alice","user":"alice","timestamp":"2026-09-28T10:00:00Z"}} - Then: status=success; output_json.audit.trail_id 匹配 UUID 正则;compliance_score ∈ [0,1]; action=="data_export" - Bound Task: T4 ### C7_test_runner_passes_all - Scenario: S7-S12 - Type: e2e - Priority: P0 - Given: 后端运行 - When: bash tests/e2e/dth_experiment_extend.test.sh - Then: exit 0 - Bound Task: T4 ### C8_check_spec_coverage_gap_zero - Scenario: all - Type: e2e - Priority: P0 - Given: chg 工件齐备 - When: PROJECT_ROOT=. bash openspec/scripts/check_spec_coverage.sh - Then: stdout PASS gap=0 - Bound Task: T5