pomaster 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/README.md +102 -183
  2. package/catalog/catalog-lock.draft.json +117 -117
  3. package/catalog/policies/policy.ai.change_plan_first.json +1 -1
  4. package/catalog/policies/policy.ai.fact_inference_separation.json +1 -1
  5. package/catalog/policies/policy.ai.read_search_verify_before_write.json +1 -1
  6. package/catalog/policies/policy.ai.rule_relaxation_approval.json +1 -1
  7. package/catalog/policies/policy.arch.adr_immutable_history.json +1 -1
  8. package/catalog/policies/policy.arch.no_convenience_over_boundary.json +1 -1
  9. package/catalog/policies/policy.arch.prefer_verifiable_option.json +2 -2
  10. package/catalog/policies/policy.authz.no_gating_proxy_trust.json +1 -1
  11. package/catalog/policies/policy.authz.permission_scope_expansion_gate.json +1 -1
  12. package/catalog/policies/policy.authz.server_five_factor_verification.json +1 -1
  13. package/catalog/policies/policy.be.conc.prefer_db_constraints.json +1 -1
  14. package/catalog/policies/policy.be.db.expand_migrate_contract.json +1 -1
  15. package/catalog/policies/policy.be.idem.key_payload_conflict.json +1 -1
  16. package/catalog/policies/policy.be.model.single_boundary_conversion.json +1 -1
  17. package/catalog/policies/policy.be.sql.index_for_known_queries.json +1 -1
  18. package/catalog/policies/policy.be.state.single_rule_source.json +1 -1
  19. package/catalog/policies/policy.be.txn.short_locks_compensation.json +1 -1
  20. package/catalog/policies/policy.bound.search_first_entry_only.json +1 -1
  21. package/catalog/policies/policy.boundary.validate_in_encode_out.json +1 -1
  22. package/catalog/policies/policy.cache.failure_mode_guards.json +1 -1
  23. package/catalog/policies/policy.cache.schema_versioning.json +1 -1
  24. package/catalog/policies/policy.cfg.config_attribute_completeness.json +1 -1
  25. package/catalog/policies/policy.cfg.key_rename_dual_read.json +1 -1
  26. package/catalog/policies/policy.cfg.no_secret_dispersal.json +1 -1
  27. package/catalog/policies/policy.cfg.production_safe_defaults.json +1 -1
  28. package/catalog/policies/policy.cfg.schema_backed_config.json +1 -1
  29. package/catalog/policies/policy.chg.no_unrelated_changes.json +1 -1
  30. package/catalog/policies/policy.contract.no_invented_facts.json +1 -1
  31. package/catalog/policies/policy.dep.build_path_supply_chain.json +1 -1
  32. package/catalog/policies/policy.dep.no_untrusted_source_no_lock_bypass.json +1 -1
  33. package/catalog/policies/policy.dep.time_boxed_urgent_exception.json +1 -1
  34. package/catalog/policies/policy.deploy.no_dev_env_as_production_fact.json +1 -1
  35. package/catalog/policies/policy.deploy.operational_capabilities.json +1 -1
  36. package/catalog/policies/policy.deploy.runtime_fact_record.json +1 -1
  37. package/catalog/policies/policy.err.failure_five_part_mapping.json +1 -1
  38. package/catalog/policies/policy.err.no_internal_detail_exposure.json +1 -1
  39. package/catalog/policies/policy.err.published_code_immutable.json +1 -1
  40. package/catalog/policies/policy.evid.acceptance_binds_verifiable_evidence.json +1 -1
  41. package/catalog/policies/policy.evid.no_silent_gate_removal.json +1 -1
  42. package/catalog/policies/policy.evid.no_unverifiable_pass.json +1 -1
  43. package/catalog/policies/policy.flag.cleanup_after_full_rollout.json +1 -1
  44. package/catalog/policies/policy.flag.consistent_off_state.json +1 -1
  45. package/catalog/policies/policy.flag.kill_switch.json +1 -1
  46. package/catalog/policies/policy.flag.lifecycle_metadata.json +1 -1
  47. package/catalog/policies/policy.flag.not_a_permission.json +1 -1
  48. package/catalog/policies/policy.gate.p0_non_bypassable.json +1 -1
  49. package/catalog/policies/policy.gate.risk_factors_confirmed.json +1 -1
  50. package/catalog/policies/policy.guard.no_check_weakening.json +2 -2
  51. package/catalog/policies/policy.integration.call_definition_minimum.json +1 -1
  52. package/catalog/policies/policy.integration.fault_containment.json +1 -1
  53. package/catalog/policies/policy.job.lifecycle_definition.json +1 -1
  54. package/catalog/policies/policy.job.no_unmanaged_execution.json +1 -1
  55. package/catalog/policies/policy.job.operational_features.json +1 -1
  56. package/catalog/policies/policy.obs.actionable_signals.json +1 -1
  57. package/catalog/policies/policy.obs.alert_with_owner.json +1 -1
  58. package/catalog/policies/policy.obs.context_field_baseline.json +1 -1
  59. package/catalog/policies/policy.obs.no_sensitive_or_unbounded_logging.json +1 -1
  60. package/catalog/policies/policy.obs.no_sensitive_raw_values.json +1 -1
  61. package/catalog/policies/policy.obs.signal_change_impact.json +1 -1
  62. package/catalog/policies/policy.obs.source_map_access_control.json +1 -1
  63. package/catalog/policies/policy.obs.telemetry_lifecycle_declared.json +1 -1
  64. package/catalog/policies/policy.obs.trace_correlation.json +1 -1
  65. package/catalog/policies/policy.perf.budget_change_retest.json +1 -1
  66. package/catalog/policies/policy.perf.evidence_binding.json +1 -1
  67. package/catalog/policies/policy.perf.observation_dimensions.json +1 -1
  68. package/catalog/policies/policy.proc.checklist_change_policy.json +2 -2
  69. package/catalog/policies/policy.proc.scope_drift_reclassify.json +1 -1
  70. package/catalog/policies/policy.prv.processing_scope_re_review.json +1 -1
  71. package/catalog/policies/policy.prv.sensitive_data_six_facts.json +1 -1
  72. package/catalog/policies/policy.registry.human_fields_validated_decorrelated.json +1 -1
  73. package/catalog/policies/policy.rel.no_irreversible_unmonitored_full_release.json +1 -1
  74. package/catalog/policies/policy.rel.observability_before_ship.json +1 -1
  75. package/catalog/policies/policy.rel.process_change_needs_drill_audit.json +1 -1
  76. package/catalog/policies/policy.rel.traceable_build.json +1 -1
  77. package/catalog/policies/policy.role.human_signs_for_ai.json +1 -1
  78. package/catalog/policies/policy.sec.authn_policy_unified.json +1 -1
  79. package/catalog/policies/policy.sec.no_client_side_trust.json +4 -1
  80. package/catalog/policies/policy.sec.no_longterm_security_disable.json +1 -1
  81. package/catalog/policies/policy.sec.no_script_readable_credentials.json +1 -1
  82. package/catalog/policies/policy.sec.no_secrets_in_client_surface.json +2 -2
  83. package/catalog/policies/policy.sec.relaxation_approval.json +1 -1
  84. package/catalog/policies/policy.sec.security_relaxation_gate.json +4 -1
  85. package/catalog/policies/policy.sec.trust_boundary_enforcement.json +4 -1
  86. package/catalog/policies/policy.sec.upload_download_server_recheck.json +1 -1
  87. package/catalog/policies/policy.sec.url_source_allowlist.json +1 -1
  88. package/catalog/policies/policy.spec.family_conflict_precedence.json +1 -1
  89. package/catalog/policies/policy.spec.freeze_before_use.json +1 -1
  90. package/catalog/policies/policy.spec.primary_source_basis.json +1 -1
  91. package/catalog/policies/policy.struct.module_entry_dependency_declared.json +1 -1
  92. package/catalog/policies/policy.struct.no_unexplained_top_level_dir.json +1 -1
  93. package/catalog/policies/policy.struct.reuse_proven_structure.json +1 -1
  94. package/catalog/policies/policy.test.control_nondeterminism_keep_diagnosis.json +1 -1
  95. package/catalog/policies/policy.test.isolation_and_cleanup.json +1 -1
  96. package/catalog/policies/policy.test.no_synthetic_stability.json +1 -1
  97. package/catalog/policies/policy.test.pyramid_and_ci_matrix.json +1 -1
  98. package/catalog/policies/policy.test.removal_justification.json +1 -1
  99. package/catalog/policies/policy.test.removal_needs_substitute_evidence.json +1 -1
  100. package/catalog/policies/policy.test.risk_driven_plan.json +1 -1
  101. package/catalog/policies/policy.test.stable_observable_assertions.json +1 -1
  102. package/catalog/policies/policy.tool.discoverable_toolchain.json +1 -1
  103. package/catalog/policies/policy.tool.no_hand_edit_generated_no_ci_drift.json +1 -1
  104. package/catalog/policies/policy.tool.no_vendored_body_edits.json +1 -1
  105. package/catalog/policies/policy.tool.upgrade_verify_lock_rollback.json +1 -1
  106. package/catalog/policies/policy.web.comp.no_trivial_or_god_component.json +1 -1
  107. package/catalog/policies/policy.web.comp.public_contract_completeness.json +1 -1
  108. package/catalog/policies/policy.web.copy.action_object_clarity.json +1 -1
  109. package/catalog/policies/policy.web.copy.enumerable_placement.json +1 -1
  110. package/catalog/policies/policy.web.copy.error_next_step.json +1 -1
  111. package/catalog/policies/policy.web.handoff.state_matrix_full.json +1 -1
  112. package/catalog/policies/policy.web.i18n.copy_key_discipline.json +1 -1
  113. package/catalog/policies/policy.web.i18n.raw_value_for_compute.json +1 -1
  114. package/catalog/policies/policy.web.page.region_consistency.json +1 -1
  115. package/catalog/policies/policy.web.track.attempt_result_correlation.json +1 -1
  116. package/catalog/policies/policy.web.track.no_synthetic_actions.json +1 -1
  117. package/catalog/policies/policy.web.track.typed_client_validation.json +1 -1
  118. package/catalog/policies/policy.wf.no_planned_as_verified.json +1 -1
  119. package/catalog/policies/policy.wf.task_facts_preconfirm.json +1 -1
  120. package/dist/bin.js +11233 -7336
  121. package/legal/THIRD_PARTY_NOTICES.md +461 -35
  122. package/package.json +1 -1
  123. package/seeds/aggregation-manifest.json +691 -0
  124. package/seeds/manifest.json +466 -1043
  125. package/seeds/specs/hard/stacks/antdesign/antdesign-ui-overlay.md +48 -0
  126. package/seeds/specs/hard/stacks/antdesign/index.md +20 -0
  127. package/seeds/specs/hard/stacks/css/css-system-overlay.md +52 -0
  128. package/seeds/specs/hard/stacks/css/index.md +20 -0
  129. package/seeds/specs/hard/stacks/geist/geist-design-system-overlay.md +48 -0
  130. package/seeds/specs/hard/stacks/geist/index.md +20 -0
  131. package/seeds/specs/hard/stacks/vue3/index.md +20 -0
  132. package/seeds/specs/hard/stacks/vue3/vue3-framework-overlay.md +71 -0
  133. package/seeds/specs/hard/themes/ai-generated-code.md +171 -0
  134. package/seeds/specs/hard/themes/api-contract-and-error-semantics.md +532 -0
  135. package/seeds/specs/hard/themes/architecture-and-module-boundaries.md +323 -0
  136. package/seeds/specs/hard/themes/data-and-transactions.md +582 -0
  137. package/seeds/specs/hard/themes/engineering-toolchain-and-dependencies.md +333 -0
  138. package/seeds/specs/hard/themes/environment-and-configuration.md +196 -0
  139. package/seeds/specs/hard/themes/frontend-state-and-client-data.md +342 -0
  140. package/seeds/specs/hard/themes/index.md +374 -0
  141. package/seeds/specs/hard/themes/integration-and-async-runtime.md +331 -0
  142. package/seeds/specs/hard/{frontend/38-internationalization-protocol.md → themes/internationalization-and-copywriting.md} +112 -5
  143. package/seeds/specs/hard/themes/observability-and-analytics.md +305 -0
  144. package/seeds/specs/hard/themes/page-composition-and-browser-environment.md +554 -0
  145. package/seeds/specs/hard/{frontend/31-performance-protocol.md → themes/performance-and-capacity.md} +95 -6
  146. package/seeds/specs/hard/themes/permission-and-authorization.md +168 -0
  147. package/seeds/specs/hard/themes/privacy-and-data-lifecycle.md +176 -0
  148. package/seeds/specs/hard/themes/release-and-feature-flags.md +237 -0
  149. package/seeds/specs/hard/{frontend/04-security-protocol.md → themes/security.md} +95 -6
  150. package/seeds/specs/hard/themes/task-governance-and-acceptance.md +554 -0
  151. package/seeds/specs/hard/themes/testing-and-verification.md +266 -0
  152. package/seeds/specs/hard/themes/ui-presentation-and-design.md +670 -0
  153. package/seeds/specs/hard/themes/value-semantics-and-domain-data.md +339 -0
  154. package/seeds/specs/hard/backend/01-architecture-governance-protocol.md +0 -68
  155. package/seeds/specs/hard/backend/02-project-structure-governance-protocol.md +0 -68
  156. package/seeds/specs/hard/backend/03-directory-boundary-protocol.md +0 -68
  157. package/seeds/specs/hard/backend/04-layering-architecture-protocol.md +0 -68
  158. package/seeds/specs/hard/backend/05-task-workflow-protocol.md +0 -68
  159. package/seeds/specs/hard/backend/06-ai-generated-code-protocol.md +0 -68
  160. package/seeds/specs/hard/backend/07-evidence-acceptance-protocol.md +0 -68
  161. package/seeds/specs/hard/backend/08-contract-change-protocol.md +0 -68
  162. package/seeds/specs/hard/backend/09-role-responsibility-protocol.md +0 -68
  163. package/seeds/specs/hard/backend/10-security-protocol.md +0 -68
  164. package/seeds/specs/hard/backend/11-environment-configuration-protocol.md +0 -67
  165. package/seeds/specs/hard/backend/12-api-contract-protocol.md +0 -68
  166. package/seeds/specs/hard/backend/13-privacy-data-lifecycle-protocol.md +0 -68
  167. package/seeds/specs/hard/backend/14-business-rules-state-protocol.md +0 -68
  168. package/seeds/specs/hard/backend/15-data-model-protocol.md +0 -68
  169. package/seeds/specs/hard/backend/16-error-code-protocol.md +0 -68
  170. package/seeds/specs/hard/backend/17-permission-authorization-protocol.md +0 -68
  171. package/seeds/specs/hard/backend/18-database-schema-migration-protocol.md +0 -68
  172. package/seeds/specs/hard/backend/19-query-index-sql-protocol.md +0 -68
  173. package/seeds/specs/hard/backend/20-transaction-boundary-protocol.md +0 -68
  174. package/seeds/specs/hard/backend/21-concurrency-locking-protocol.md +0 -68
  175. package/seeds/specs/hard/backend/22-idempotency-protocol.md +0 -68
  176. package/seeds/specs/hard/backend/23-cache-redis-consistency-protocol.md +0 -68
  177. package/seeds/specs/hard/backend/24-external-integration-resilience-protocol.md +0 -68
  178. package/seeds/specs/hard/backend/25-async-job-scheduler-protocol.md +0 -68
  179. package/seeds/specs/hard/backend/26-engineering-tooling-protocol.md +0 -68
  180. package/seeds/specs/hard/backend/27-dependency-supply-chain-protocol.md +0 -68
  181. package/seeds/specs/hard/backend/28-testing-protocol.md +0 -68
  182. package/seeds/specs/hard/backend/29-observability-logging-tracing-protocol.md +0 -68
  183. package/seeds/specs/hard/backend/30-performance-capacity-protocol.md +0 -68
  184. package/seeds/specs/hard/backend/31-runtime-deployment-protocol.md +0 -68
  185. package/seeds/specs/hard/backend/32-release-versioning-rollback-protocol.md +0 -68
  186. package/seeds/specs/hard/backend/index.md +0 -177
  187. package/seeds/specs/hard/frontend/01-development-checklist-protocol.md +0 -86
  188. package/seeds/specs/hard/frontend/02-ai-generated-code-protocol.md +0 -82
  189. package/seeds/specs/hard/frontend/03-acceptance-gate-protocol.md +0 -86
  190. package/seeds/specs/hard/frontend/05-environment-configuration-protocol.md +0 -80
  191. package/seeds/specs/hard/frontend/06-change-governance-protocol.md +0 -90
  192. package/seeds/specs/hard/frontend/07-frontend-backend-communication-protocol.md +0 -219
  193. package/seeds/specs/hard/frontend/08-role-responsibility-protocol.md +0 -80
  194. package/seeds/specs/hard/frontend/09-module-boundary-protocol.md +0 -81
  195. package/seeds/specs/hard/frontend/10-engineering-tooling-protocol.md +0 -89
  196. package/seeds/specs/hard/frontend/11-dependency-package-management-protocol.md +0 -87
  197. package/seeds/specs/hard/frontend/12-business-rules-protocol.md +0 -79
  198. package/seeds/specs/hard/frontend/13-monetary-precision-protocol.md +0 -81
  199. package/seeds/specs/hard/frontend/14-data-model-protocol.md +0 -85
  200. package/seeds/specs/hard/frontend/15-request-api-protocol.md +0 -87
  201. package/seeds/specs/hard/frontend/16-error-handling-protocol.md +0 -79
  202. package/seeds/specs/hard/frontend/17-permission-protocol.md +0 -79
  203. package/seeds/specs/hard/frontend/18-state-management-protocol.md +0 -88
  204. package/seeds/specs/hard/frontend/19-cache-protocol.md +0 -79
  205. package/seeds/specs/hard/frontend/20-testing-protocol.md +0 -88
  206. package/seeds/specs/hard/frontend/21-design-system-protocol.md +0 -79
  207. package/seeds/specs/hard/frontend/22-theme-protocol.md +0 -79
  208. package/seeds/specs/hard/frontend/23-accessibility-protocol.md +0 -189
  209. package/seeds/specs/hard/frontend/24-component-protocol.md +0 -80
  210. package/seeds/specs/hard/frontend/25-page-structure-protocol.md +0 -79
  211. package/seeds/specs/hard/frontend/26-style-layout-protocol.md +0 -80
  212. package/seeds/specs/hard/frontend/27-rendering-state-protocol.md +0 -81
  213. package/seeds/specs/hard/frontend/28-form-protocol.md +0 -88
  214. package/seeds/specs/hard/frontend/29-routing-url-protocol.md +0 -79
  215. package/seeds/specs/hard/frontend/30-data-grid-protocol.md +0 -83
  216. package/seeds/specs/hard/frontend/32-file-import-export-protocol.md +0 -80
  217. package/seeds/specs/hard/frontend/33-release-versioning-protocol.md +0 -79
  218. package/seeds/specs/hard/frontend/34-monitoring-logging-protocol.md +0 -128
  219. package/seeds/specs/hard/frontend/35-mock-protocol.md +0 -97
  220. package/seeds/specs/hard/frontend/36-feature-flag-protocol.md +0 -79
  221. package/seeds/specs/hard/frontend/37-browser-device-compatibility-protocol.md +0 -83
  222. package/seeds/specs/hard/frontend/39-copywriting-protocol.md +0 -79
  223. package/seeds/specs/hard/frontend/40-analytics-protocol.md +0 -98
  224. package/seeds/specs/hard/frontend/41-design-handoff-protocol.md +0 -80
  225. package/seeds/specs/hard/frontend/42-browser-runtime-lifecycle-protocol.md +0 -86
  226. package/seeds/specs/hard/frontend/43-time-temporal-protocol.md +0 -86
  227. package/seeds/specs/hard/frontend/44-privacy-data-lifecycle-protocol.md +0 -87
  228. package/seeds/specs/hard/frontend/45-browser-storage-protocol.md +0 -87
  229. package/seeds/specs/hard/frontend/index.md +0 -308
@@ -0,0 +1,266 @@
1
+ ---
2
+ seed_source: packages/cli/seeds/aggregation-manifest.json
3
+ seed_source_sha256: 039b637ccffacdfe3ce30d85e193f4b38928fcdfb16efdc4eb255e35e05af91f
4
+ seed_version: B7-THEME
5
+ lane: [frontend, backend]
6
+ status: CURRENT
7
+ authority_scope: mixed_required_and_advisory
8
+ applies_to: [frontend, backend]
9
+ related_evidence_specs: []
10
+ related_tools: []
11
+ legacy_id: theme:testing-and-verification
12
+ criticality: critical # 聚合注记:取源最高;info 性注记非执行语义
13
+ injection_mode: triggered # 聚合注记:来源同值;info 性注记非执行语义
14
+ stages: [prepare, check, release] # 聚合注记:来源 stages 并集;info 性注记非执行语义
15
+ triggers: [testing, acceptance] # 聚合注记:来源 triggers 并集;info 性注记非执行语义
16
+ requires: [] # 聚合注记:来源 requires 并集(全空)
17
+ x-aggregation: # 聚合来源(D6):逐源 vendor pin(sha256 与卡 vendor_pin 同值)
18
+ - seed_source: pomaster/components/frontend-hard-spec/assets/universal/20-testing-protocol.md
19
+ sha256: 477dc049d1e1ec72898a07615655ee374924c7796a0210741e8c97474644a4d6
20
+ seed_version: B6B-1
21
+ - seed_source: pomaster/components/frontend-hard-spec/assets/universal/35-mock-protocol.md
22
+ sha256: c9288fe227cb26633d23c5d0e2e710b9cde716371f66cf3157c63b3ec8a58342
23
+ seed_version: B6B-2
24
+ - seed_source: pomaster/components/backend-hard-spec/assets/universal/28-testing-protocol.md
25
+ sha256: f5df73dd7bec4ccf4132c3d7a9918a6f1cb0dd9682aa17956cb24446aa406ad7
26
+ seed_version: B6C
27
+ ---
28
+
29
+ # 测试与验证
30
+
31
+ > **聚合纪律**:本文档 12 节正文规则行逐字取自 frontmatter x-aggregation 所列来源协议(节内按「端 → 源编号升序」以加粗来源行分块,源内标题与层级原样保留),零新增、零改写、零删除;新增文本仅限文档标题、本注记与逐节来源行。
32
+
33
+ ## Scope
34
+
35
+ **源:FE 20 测试协议(pomaster/components/frontend-hard-spec/assets/universal/20-testing-protocol.md)**
36
+
37
+ P1。定义类型、单元、组件、集成、E2E、视觉、可访问性和性能测试边界。
38
+
39
+ **源:FE 35 Mock 协议(pomaster/components/frontend-hard-spec/assets/universal/35-mock-protocol.md)**
40
+
41
+ P2。定义后端未就绪或测试时的 Mock 来源、场景、契约校验和启停。
42
+
43
+ **源:BE 28 测试协议(pomaster/components/backend-hard-spec/assets/universal/28-testing-protocol.md)**
44
+
45
+ 规范单元、API、集成、契约、迁移、并发、安全、性能与故障测试。
46
+
47
+ ## Non-Scope
48
+
49
+ **源:FE 20 测试协议**
50
+
51
+ 不替代验收门禁、业务 UAT 或生产监控。
52
+
53
+ **源:FE 35 Mock 协议**
54
+
55
+ Mock 不定义正式业务规则,不替代接口契约和真实集成测试。
56
+
57
+ **源:BE 28 测试协议**
58
+
59
+ 不规定统一覆盖率阈值或替代验收证据协议。
60
+
61
+ ## Terms
62
+
63
+ **源:FE 20 测试协议**
64
+
65
+ - Risk-based Testing:按变更风险和影响面选择测试。
66
+ - Contract Test:验证跨层 schema 和行为一致性。
67
+ - Regression Set:受公共变更影响的代表性场景集合。
68
+
69
+ **源:FE 35 Mock 协议**
70
+
71
+ - Fixture:稳定可复用的测试数据。
72
+ - Scenario:success、empty、error、timeout 等受控响应模式。
73
+ - Contract Mock:由正式 schema 生成或校验的 Mock。
74
+
75
+ **源:BE 28 测试协议**
76
+
77
+ 测试层级按需要隔离的边界与要证明的风险划分。
78
+
79
+ ## MUST
80
+
81
+ **源:FE 20 测试协议 · §MUST**
82
+
83
+ - 公共函数/组件、复杂表单、关键流程、权限和错误态必须测试。
84
+ - 页面覆盖 loading、empty、error、permission、normal 和大数据。
85
+ - 公共变更扩大到全部受影响调用方。
86
+ - 接口变化同步 contract、adapter、Mock 和页面测试。
87
+ - 测试必须稳定、可重复并断言用户可观察行为。
88
+ - 跨进程或跨信任边界的 API、存储、消息、配置和第三方 SDK 数据必须包含运行时 schema 失败用例。
89
+ - 测试必须隔离并在结束时清理 cookie、浏览器存储、服务端测试数据、Mock、订阅和未完成异步任务。
90
+ - 时间、时区、locale、随机数、网络延迟和失败模式必须可控制;并发与取消场景必须覆盖迟到结果不会污染新状态。
91
+
92
+ **源:FE 35 Mock 协议 · §MUST**
93
+
94
+ - Mock 字段符合正式接口契约。
95
+ - Mock schema 必须与正式 OpenAPI 或等价契约保持一致;漂移必须被 CI 检测并阻断。
96
+ - 覆盖 success、empty、large、slow、timeout、permission、conflict、error 和 partial success。
97
+ - Fixture 使用稳定 id、时间和有种子的生成器。
98
+ - Mock 通过统一环境开关启停,生产默认关闭。
99
+ - 临时 Mock 必须记录 contract_version、到期日(expires_at)和替换状态(active/deprecated/removed)。
100
+ - 真实接口接入后保留测试 Mock 并删除临时错误结构。
101
+
102
+ **源:BE 28 测试协议 · §MUST**
103
+
104
+ - 测试计划必须覆盖变更行为、边界、失败、兼容和高风险交互。
105
+
106
+ ## MUST NOT
107
+
108
+ **源:FE 20 测试协议 · §MUST NOT**
109
+
110
+ - MUST NOT 只测试成功场景。
111
+ - MUST NOT 只靠人工点页面验收公共变更。
112
+ - MUST NOT 为通过测试删除用例、降低断言或跳过风险状态。
113
+ - MUST NOT 让测试依赖随机时间和不稳定外部数据。
114
+ - MUST NOT 用固定 sleep 等待异步完成;应等待可观察状态、事件或受控时钟。
115
+ - MUST NOT 用实现细节选择器作为 E2E 主定位方式;优先使用角色、可访问名称和稳定的用户语义。
116
+ - MUST NOT 用自动重试掩盖 flakiness;重试后的通过仍必须可追踪并治理根因。
117
+
118
+ **源:FE 35 Mock 协议 · §MUST NOT**
119
+
120
+ - MUST NOT 只 Mock 成功小数据。
121
+ - MUST NOT 用 Mock 推导正式字段和规则。
122
+ - MUST NOT 在业务组件写 Mock 分支。
123
+ - MUST NOT 生产默认启用 Mock。
124
+
125
+ **源:BE 28 测试协议 · §MUST NOT**
126
+
127
+ - 不得用固定 sleep、共享脏数据或只测成功路径获得虚假稳定性。
128
+
129
+ ## SHOULD
130
+
131
+ **源:FE 20 测试协议 · §SHOULD**
132
+
133
+ - SHOULD 使用测试金字塔并保留少量高价值 E2E。
134
+ - SHOULD 自动生成受影响测试清单。
135
+ - SHOULD 在 CI 中固定时区、locale、依赖与浏览器版本,并对关键组合做显式矩阵验证。
136
+
137
+ **源:FE 35 Mock 协议 · §SHOULD**
138
+
139
+ - SHOULD 由契约生成类型和基础场景。
140
+ - SHOULD 模拟幂等、409、429、断线和任务状态。
141
+ - SHOULD 在 `outputs/frontend/10_planned/mock-contract.yaml` 中维护场景清单与契约版本绑定。
142
+
143
+ **源:BE 28 测试协议 · §SHOULD**
144
+
145
+ - 应控制时间、随机、网络和外部依赖,并保留失败诊断信息。
146
+
147
+ ## Contract
148
+
149
+ **源:FE 20 测试协议 · §Contract**
150
+
151
+ ```text
152
+ ChangeType, Unit[], Component[], Contract[], E2E[],
153
+ Visual[], Accessibility[], Performance[], Evidence
154
+ ```
155
+
156
+ **源:FE 35 Mock 协议 · §Contract**
157
+
158
+ ```text
159
+ Endpoint, ScenarioId, RequestMatch, ResponseSchema,
160
+ Delay, Error, FixtureSeed, ContractVersion
161
+ ```
162
+
163
+ ### Mock 生命周期
164
+
165
+ `outputs/frontend/10_planned/mock-contract.yaml` 记录每个 Mock 场景:
166
+
167
+ ```text
168
+ Endpoint, ScenarioId, ContractVersion, Status,
169
+ ExpiresAt, ReplacementEndpoint, OpenapiDiffChecked
170
+ ```
171
+
172
+ - 临时 Mock 必须有到期日;到期前必须完成真实接口替换或显式延期。
173
+ - 每个场景必须通过 OpenAPI diff 检查;漂移项必须阻塞合并。
174
+
175
+ **源:BE 28 测试协议 · §Contract**
176
+
177
+ 测试证据必须包含范围、环境、命令、结果、失败和未覆盖风险。
178
+
179
+ ## Checklist
180
+
181
+ **源:FE 20 测试协议 · §Checklist**
182
+
183
+ - [ ] 风险状态覆盖。
184
+ - [ ] 公共调用方回归。
185
+ - [ ] 契约与 Mock 同步。
186
+ - [ ] 测试稳定可重复。
187
+ - [ ] 外部状态已隔离和清理,异步任务无泄漏。
188
+ - [ ] 时钟、时区、随机与网络条件可控制。
189
+
190
+ **源:FE 35 Mock 协议 · §Checklist**
191
+
192
+ - [ ] 契约一致。
193
+ - [ ] OpenAPI/契约漂移检查通过。
194
+ - [ ] 非理想态完整。
195
+ - [ ] 数据稳定可重复。
196
+ - [ ] 生产安全关闭。
197
+ - [ ] 临时 Mock 有到期日和替换状态。
198
+ - [ ] mock-contract.yaml 已维护。
199
+
200
+ **源:BE 28 测试协议 · §Checklist**
201
+
202
+ - [ ] API、DB、事务、并发、幂等、缓存、安全和回滚按影响选择。
203
+
204
+ ## Examples
205
+
206
+ **源:FE 20 测试协议 · §Examples**
207
+
208
+ ### 内容示例,可删除
209
+
210
+ 表格壳变更同时测试列配置、固定列、横向滚动和不同表格类型。
211
+
212
+ **源:FE 35 Mock 协议 · §Examples**
213
+
214
+ ### 内容示例,可删除
215
+
216
+ 同一接口提供 normal、empty、409 和 slow 场景,组件测试通过 scenario id 切换。
217
+
218
+ **源:BE 28 测试协议 · §Examples**
219
+
220
+ - migration 在真实数据库版本上验证前向、兼容与恢复。
221
+
222
+ > 注(结构事实,非规则):FE 源的 Examples 带「### 内容示例,可删除」模板提示、BE 源为平列表——两族源本文即存在此差异,本样板原样保留、不做归一化(置换不变优先;是否归一化属内容演进,不属重组)。
223
+
224
+ ## Anti-patterns
225
+
226
+ **源:FE 20 测试协议 · §Anti-patterns**
227
+
228
+ 只测 API 200 和当前页面截图,忽略 403、409、空态和大数据。
229
+
230
+ **源:FE 35 Mock 协议 · §Anti-patterns**
231
+
232
+ 页面内写死假数组,字段与后端完全不同,联调时才重写页面。
233
+
234
+ **源:BE 28 测试协议 · §Anti-patterns**
235
+
236
+ - Mock 掉所有边界后声称集成行为已验证。
237
+
238
+ ## Ownership
239
+
240
+ **源:FE 20 测试协议 · §Ownership**
241
+
242
+ 实现者维护近层测试,QA 维护关键流程,公共能力 Owner 维护回归集。
243
+
244
+ **源:FE 35 Mock 协议 · §Ownership**
245
+
246
+ 契约 Owner 负责 schema,前端/QA 维护场景,平台 Owner 维护启停基础设施。
247
+
248
+ **源:BE 28 测试协议 · §Ownership**
249
+
250
+ 实现者维护变更测试,测试与评审角色检查风险覆盖。
251
+
252
+ ## Change Policy
253
+
254
+ **源:FE 20 测试协议 · §Change Policy**
255
+
256
+ 删除测试必须证明行为已删除或由等价测试覆盖;门禁测试降级需批准。
257
+
258
+ **源:FE 35 Mock 协议 · §Change Policy**
259
+
260
+ 契约变化必须同步 Mock;删除场景前确认无测试依赖。
261
+
262
+ **源:BE 28 测试协议 · §Change Policy**
263
+
264
+ 删除或放宽测试必须说明替代证据和风险审批。
265
+
266
+ > **语言节**:本主题无语言节挂点(缺席诚实);规则本体即上文通用节。