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
@@ -1,79 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/frontend-hard-spec/assets/universal/16-error-handling-protocol.md
3
- seed_source_sha256: 0c6adc425e01a003e1f3c83fcf51f1d287767c95a4da50c15f5f639d9104f07f
4
- seed_version: B6B-1
5
- lane: frontend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [frontend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- ---
12
-
13
- # 16 错误处理协议
14
-
15
- ## Scope
16
-
17
- P1。定义认证、权限、资源、冲突、校验、限流、服务、网络和部分失败的前端呈现与恢复。
18
-
19
- ## Non-Scope
20
-
21
- 不定义后端错误码本身,不替代监控采集和业务校验。
22
-
23
- ## Terms
24
-
25
- - Field Error:可定位到字段/单元格的错误。
26
- - Recover Action:登录、刷新、重试、重载、联系管理员或解决冲突。
27
- - Error Boundary:隔离渲染失败的边界。
28
-
29
- ## MUST
30
-
31
- - 将原始错误归一化为稳定 code、trace、fieldErrors、retryable 和 recoverAction。
32
- - 401、403、404、409、422、429、5xx 和网络错误分别处理。
33
- - 字段错误定位字段,部分失败提供逐项明细。
34
- - 分层设置错误边界,局部失败不得导致整页白屏。
35
- - 用户知道发生什么、能否恢复和下一步。
36
-
37
- ## MUST NOT
38
-
39
- - MUST NOT 用一个 Toast 处理所有错误。
40
- - MUST NOT 吞掉字段错误、冲突或 TraceId。
41
- - MUST NOT 展示技术堆栈、敏感参数或原始 HTML。
42
- - MUST NOT 自动重试不安全 mutation。
43
-
44
- ## SHOULD
45
-
46
- - SHOULD 区分页面错误、字段错误、后台任务和短暂反馈。
47
- - SHOULD 在错误恢复后刷新受影响数据。
48
-
49
- ## Contract
50
-
51
- ```text
52
- Error { status?, code, safeMessage, traceId?,
53
- fieldErrors?, retryable, recoverAction? }
54
- ```
55
-
56
- ## Checklist
57
-
58
- - [ ] 错误分类和位置正确。
59
- - [ ] 恢复动作可执行。
60
- - [ ] TraceId 可定位。
61
- - [ ] 敏感信息未泄露。
62
-
63
- ## Examples
64
-
65
- ### 内容示例,可删除
66
-
67
- 409 保留本地编辑,提示比较最新版本,而不是自动覆盖。
68
-
69
- ## Anti-patterns
70
-
71
- 所有失败统一 Toast“操作失败”,字段输入被清空且无错误编号。
72
-
73
- ## Ownership
74
-
75
- 契约 Owner 定义错误码,平台 Owner 维护归一化,页面 Owner 负责上下文呈现。
76
-
77
- ## Change Policy
78
-
79
- 错误码或恢复语义变化必须同步契约、映射、文案、Mock、监控和测试。
@@ -1,79 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/frontend-hard-spec/assets/universal/17-permission-protocol.md
3
- seed_source_sha256: 3f51aeb30497c07a3b552c8f21ecff22730d276c85fd504fde16e9e17b622ec0
4
- seed_version: B6B-1
5
- lane: frontend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [frontend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- ---
12
-
13
- # 17 权限协议
14
-
15
- ## Scope
16
-
17
- P1。定义菜单、页面、按钮、字段、数据范围和接口权限的前端一致表现。
18
-
19
- ## Non-Scope
20
-
21
- 不替代后端鉴权,不允许前端扩大或计算权威数据权限。
22
-
23
- ## Terms
24
-
25
- - Operation Permission:可执行某动作。
26
- - Field Permission:字段可见、脱敏、只读或编辑。
27
- - Data Scope:允许访问的数据集合。
28
-
29
- ## MUST
30
-
31
- - 菜单、路由、按钮、字段和接口使用同一权限语义。
32
- - 直达 URL 仍经过页面权限守卫。
33
- - 字段权限明确可见、脱敏、只读和编辑策略。
34
- - 数据范围由后端过滤并影响查询、详情和导出。
35
- - 权限不足提供一致、可解释状态。
36
-
37
- ## MUST NOT
38
-
39
- - MUST NOT 只隐藏菜单或按钮而省略后端鉴权。
40
- - MUST NOT 前端获取全量数据后自行过滤敏感内容。
41
- - MUST NOT 按角色名称硬编码权限。
42
- - MUST NOT 将 Feature Flag 当权限。
43
-
44
- ## SHOULD
45
-
46
- - SHOULD 使用统一 gate/hook/component。
47
- - SHOULD 对禁用动作展示只读原因。
48
-
49
- ## Contract
50
-
51
- ```text
52
- PermissionCode, Resource, Action, FieldPolicy?,
53
- DataScope?, BackendEnforcement, DeniedPresentation
54
- ```
55
-
56
- ## Checklist
57
-
58
- - [ ] 菜单到接口一致。
59
- - [ ] URL 无法绕过。
60
- - [ ] 字段和数据范围安全。
61
- - [ ] 无权限状态可解释。
62
-
63
- ## Examples
64
-
65
- ### 内容示例,可删除
66
-
67
- 无导出权限时入口按产品策略隐藏或禁用,后端导出接口仍拒绝请求。
68
-
69
- ## Anti-patterns
70
-
71
- 前端按 `role === 'admin'` 显示全部按钮,并认为无需后端校验。
72
-
73
- ## Ownership
74
-
75
- 业务/安全 Owner 定义权限,后端执行鉴权,前端平台维护统一呈现。
76
-
77
- ## Change Policy
78
-
79
- 权限码和数据范围变化必须同步菜单、路由、缓存、接口、测试和审计。
@@ -1,88 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/frontend-hard-spec/assets/universal/18-state-management-protocol.md
3
- seed_source_sha256: 72445fcd0ac7e21ebea38a5f72849543f936c7a96eee54eb99330226acaaf400
4
- seed_version: B6B-1
5
- lane: frontend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [frontend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- ---
12
-
13
- # 18 状态管理协议
14
-
15
- ## Scope
16
-
17
- P1。定义 local、page、URL、global、server、form 和 persisted state 的归属与生命周期。
18
-
19
- ## Non-Scope
20
-
21
- 不指定状态库品牌,不替代缓存和路由协议。
22
-
23
- ## Terms
24
-
25
- - Local State:单组件短生命周期状态。
26
- - Server State:远端权威数据及请求生命周期。
27
- - URL State:需分享、刷新或返回恢复的状态。
28
- - Persisted Preference:跨会话用户偏好。
29
-
30
- ## MUST
31
-
32
- - 每个状态声明 owner、更新者、存储位置、生命周期和清理策略。
33
- - server state 由查询缓存层管理。
34
- - 可分享和可恢复状态进入 URL。
35
- - 全局 store 只保存稳定跨页面状态。
36
- - 用户、权限或范围切换时清除越权风险状态。
37
- - 表单区分 initial、current、dirty、errors、submitting 和 conflict。
38
- - 状态拥有的监听器、计时器、观察器、请求、流、连接、Worker 和对象 URL 必须声明释放时机,并在卸载、身份切换或能力关闭时清理。
39
- - 第三方 SDK 实例、DOM 节点、连接句柄等不可序列化资源必须保持为不透明运行时引用,不进入持久化、URL 或可序列化全局状态。
40
- - 持久化状态必须区分用户/租户/环境命名空间,并在登出、权限收缩或版本不兼容时失效或迁移。
41
-
42
- ## MUST NOT
43
-
44
- - MUST NOT 将组件状态放入全局 store。
45
- - MUST NOT 复制 server state 到全局 store 手动同步。
46
- - MUST NOT 将敏感或未提交表单写入 URL。
47
- - MUST NOT 共享未隔离的页面状态。
48
- - MUST NOT 把认证凭据、敏感表单原值或第三方资源句柄写入通用持久化状态。
49
- - MUST NOT 让已取消请求、旧订阅或旧身份上下文的迟到结果继续写入当前状态。
50
-
51
- ## SHOULD
52
-
53
- - SHOULD 让状态更新来源唯一且可追踪。
54
- - SHOULD 使用 schema/version 管理持久化状态。
55
-
56
- ## Contract
57
-
58
- ```text
59
- StateId, Category, Owner, Writer, Storage,
60
- Persistence, IsolationKey, CleanupTrigger
61
- ```
62
-
63
- ## Checklist
64
-
65
- - [ ] 状态分类正确。
66
- - [ ] writer 和生命周期明确。
67
- - [ ] URL/global 白名单遵守。
68
- - [ ] 切换身份可安全清理。
69
- - [ ] 运行时资源有释放时机,迟到结果不会污染新上下文。
70
- - [ ] 持久化命名空间、版本迁移和失效策略明确。
71
-
72
- ## Examples
73
-
74
- ### 内容示例,可删除
75
-
76
- 分页筛选进入 URL,列表数据留在 server cache,抽屉开关留在页面状态。
77
-
78
- ## Anti-patterns
79
-
80
- 把所有列表、筛选、弹窗和表单都塞进一个全局 store。
81
-
82
- ## Ownership
83
-
84
- 平台 Owner 维护状态基础设施,页面/领域 Owner 负责具体状态归属。
85
-
86
- ## Change Policy
87
-
88
- 状态位置或持久化变化必须提供迁移、清理和兼容策略,尤其是用户隔离数据。
@@ -1,79 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/frontend-hard-spec/assets/universal/19-cache-protocol.md
3
- seed_source_sha256: 893d5651016233eec36333775441a935746fe1202c8924dc2edf753d61523daf
4
- seed_version: B6B-1
5
- lane: frontend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [frontend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- ---
12
-
13
- # 19 缓存协议
14
-
15
- ## Scope
16
-
17
- P1。定义字典、用户、权限、列表、详情、任务和偏好的缓存、隔离与失效。
18
-
19
- ## Non-Scope
20
-
21
- 不定义 HTTP/CDN 服务端缓存,不替代状态管理和接口契约。
22
-
23
- ## Terms
24
-
25
- - Query Key:唯一描述结果集合的结构化键。
26
- - Stale Time:数据可视为新鲜的时间。
27
- - Invalidation:写操作后使依赖缓存失效。
28
-
29
- ## MUST
30
-
31
- - 每个缓存声明 key、参数、身份/权限隔离、stale、保留和失效规则。
32
- - Query Key 包含所有影响结果的筛选和上下文。
33
- - 写操作定义依赖失效矩阵。
34
- - 用户、角色、组织和数据范围切换时清理风险缓存。
35
- - schema 变化时迁移或重置持久化偏好。
36
-
37
- ## MUST NOT
38
-
39
- - MUST NOT 用同一 key 表示不同筛选或权限范围。
40
- - MUST NOT mutation 后只改视觉而不刷新依赖。
41
- - MUST NOT 长缓存实时敏感数据而无批准。
42
- - MUST NOT 将 server cache 再复制进全局 store。
43
-
44
- ## SHOULD
45
-
46
- - SHOULD 使用结构化 key factory 和集中失效策略。
47
- - SHOULD 在后台刷新时保留可用旧数据并标识 stale。
48
-
49
- ## Contract
50
-
51
- ```text
52
- Resource, QueryKey, IsolationKeys[], StaleTime,
53
- Retention, RefetchTriggers[], MutationInvalidations[]
54
- ```
55
-
56
- ## Checklist
57
-
58
- - [ ] key 覆盖所有结果参数。
59
- - [ ] 身份与权限隔离安全。
60
- - [ ] mutation 失效完整。
61
- - [ ] schema 迁移明确。
62
-
63
- ## Examples
64
-
65
- ### 内容示例,可删除
66
-
67
- 列表 key 同时包含用户数据范围、分页、筛选和排序;权限变化后整体清除。
68
-
69
- ## Anti-patterns
70
-
71
- 所有用户共用 `['entity-list']`,导致筛选串扰甚至越权复用。
72
-
73
- ## Ownership
74
-
75
- 平台 Owner 维护缓存工具,领域 Owner 定义数据依赖和实时性。
76
-
77
- ## Change Policy
78
-
79
- Key 结构或持久化 schema 改变必须版本化并提供迁移/清理。
@@ -1,88 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/frontend-hard-spec/assets/universal/20-testing-protocol.md
3
- seed_source_sha256: 477dc049d1e1ec72898a07615655ee374924c7796a0210741e8c97474644a4d6
4
- seed_version: B6B-1
5
- lane: frontend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [frontend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- ---
12
-
13
- # 20 测试协议
14
-
15
- ## Scope
16
-
17
- P1。定义类型、单元、组件、集成、E2E、视觉、可访问性和性能测试边界。
18
-
19
- ## Non-Scope
20
-
21
- 不替代验收门禁、业务 UAT 或生产监控。
22
-
23
- ## Terms
24
-
25
- - Risk-based Testing:按变更风险和影响面选择测试。
26
- - Contract Test:验证跨层 schema 和行为一致性。
27
- - Regression Set:受公共变更影响的代表性场景集合。
28
-
29
- ## MUST
30
-
31
- - 公共函数/组件、复杂表单、关键流程、权限和错误态必须测试。
32
- - 页面覆盖 loading、empty、error、permission、normal 和大数据。
33
- - 公共变更扩大到全部受影响调用方。
34
- - 接口变化同步 contract、adapter、Mock 和页面测试。
35
- - 测试必须稳定、可重复并断言用户可观察行为。
36
- - 跨进程或跨信任边界的 API、存储、消息、配置和第三方 SDK 数据必须包含运行时 schema 失败用例。
37
- - 测试必须隔离并在结束时清理 cookie、浏览器存储、服务端测试数据、Mock、订阅和未完成异步任务。
38
- - 时间、时区、locale、随机数、网络延迟和失败模式必须可控制;并发与取消场景必须覆盖迟到结果不会污染新状态。
39
-
40
- ## MUST NOT
41
-
42
- - MUST NOT 只测试成功场景。
43
- - MUST NOT 只靠人工点页面验收公共变更。
44
- - MUST NOT 为通过测试删除用例、降低断言或跳过风险状态。
45
- - MUST NOT 让测试依赖随机时间和不稳定外部数据。
46
- - MUST NOT 用固定 sleep 等待异步完成;应等待可观察状态、事件或受控时钟。
47
- - MUST NOT 用实现细节选择器作为 E2E 主定位方式;优先使用角色、可访问名称和稳定的用户语义。
48
- - MUST NOT 用自动重试掩盖 flakiness;重试后的通过仍必须可追踪并治理根因。
49
-
50
- ## SHOULD
51
-
52
- - SHOULD 使用测试金字塔并保留少量高价值 E2E。
53
- - SHOULD 自动生成受影响测试清单。
54
- - SHOULD 在 CI 中固定时区、locale、依赖与浏览器版本,并对关键组合做显式矩阵验证。
55
-
56
- ## Contract
57
-
58
- ```text
59
- ChangeType, Unit[], Component[], Contract[], E2E[],
60
- Visual[], Accessibility[], Performance[], Evidence
61
- ```
62
-
63
- ## Checklist
64
-
65
- - [ ] 风险状态覆盖。
66
- - [ ] 公共调用方回归。
67
- - [ ] 契约与 Mock 同步。
68
- - [ ] 测试稳定可重复。
69
- - [ ] 外部状态已隔离和清理,异步任务无泄漏。
70
- - [ ] 时钟、时区、随机与网络条件可控制。
71
-
72
- ## Examples
73
-
74
- ### 内容示例,可删除
75
-
76
- 表格壳变更同时测试列配置、固定列、横向滚动和不同表格类型。
77
-
78
- ## Anti-patterns
79
-
80
- 只测 API 200 和当前页面截图,忽略 403、409、空态和大数据。
81
-
82
- ## Ownership
83
-
84
- 实现者维护近层测试,QA 维护关键流程,公共能力 Owner 维护回归集。
85
-
86
- ## Change Policy
87
-
88
- 删除测试必须证明行为已删除或由等价测试覆盖;门禁测试降级需批准。
@@ -1,79 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/frontend-hard-spec/assets/universal/21-design-system-protocol.md
3
- seed_source_sha256: 317d4086949eb7d26ea2465adc6521ba6ebb611dca0d2f32aec2c57a985be4f3
4
- seed_version: B6B-1
5
- lane: frontend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [frontend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- ---
12
-
13
- # 21 设计系统协议
14
-
15
- ## Scope
16
-
17
- P1。定义合法 UI 的 token、组件、视觉状态、栅格、密度和动效来源。
18
-
19
- ## Non-Scope
20
-
21
- 不决定具体品牌主题,不替代页面结构、可访问性和设计交付协议。
22
-
23
- ## Terms
24
-
25
- - Design Token:可复用的设计决策变量。
26
- - Semantic Token:按用途而非具体值命名的 token。
27
- - Component Token:组件级语义变量。
28
-
29
- ## MUST
30
-
31
- - 定义颜色、字体、间距、圆角、阴影、层级、断点、状态和动效 token。
32
- - UI 只能从 token 和批准组件取得视觉规则。
33
- - hover、active、focus、disabled、loading、empty、error 状态完整。
34
- - token 到代码和设计工具的映射有唯一来源。
35
- - 新视觉规则有复用语义和 Owner。
36
-
37
- ## MUST NOT
38
-
39
- - MUST NOT 写孤立色值、魔法间距和临时阴影。
40
- - MUST NOT 用“看起来差不多”代替 token。
41
- - MUST NOT 在业务页面创建第二套视觉语言。
42
- - MUST NOT 用设计稿临时样式覆盖 Design Token。
43
-
44
- ## SHOULD
45
-
46
- - SHOULD 使用语义 token 分离品牌值与组件用途。
47
- - SHOULD 自动校验 token 使用和弃用。
48
-
49
- ## Contract
50
-
51
- ```text
52
- TokenName, Layer, SemanticMeaning, ValueByTheme,
53
- AllowedConsumers, Deprecated?, Owner
54
- ```
55
-
56
- ## Checklist
57
-
58
- - [ ] 所有视觉值来自 token。
59
- - [ ] 状态与断点完整。
60
- - [ ] 设计和代码来源一致。
61
- - [ ] 新 token 有复用语义。
62
-
63
- ## Examples
64
-
65
- ### 内容示例,可删除
66
-
67
- 组件使用 `color.action.primary`,而不是直接写品牌蓝十六进制值。
68
-
69
- ## Anti-patterns
70
-
71
- 页面根据设计截图手写近似颜色和 13px/17px 等孤立间距。
72
-
73
- ## Ownership
74
-
75
- Design System Owner 与前端 Owner 共同维护,组件 Owner 消费但不私自改值。
76
-
77
- ## Change Policy
78
-
79
- Token 改名/删除先 deprecated;值变化评估所有组件并执行视觉与对比度回归。
@@ -1,79 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/frontend-hard-spec/assets/universal/22-theme-protocol.md
3
- seed_source_sha256: b93ed272a0def5abc689fe66d939b87cacf6f38cce5d6278cfd5c94d1754b3ec
4
- seed_version: B6B-1
5
- lane: frontend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [frontend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- ---
12
-
13
- # 22 主题协议
14
-
15
- ## Scope
16
-
17
- P1。定义亮暗、品牌、紧凑、大字体等主题及 token 覆盖、切换和持久化。
18
-
19
- ## Non-Scope
20
-
21
- 不定义基础 token 语义,不允许主题改变业务含义。
22
-
23
- ## Terms
24
-
25
- - Theme:一组完整 token 值。
26
- - Theme Mode:light/dark 或其他可选模式。
27
- - Theme Adapter:同步第三方组件、图表和 portal 的适配层。
28
-
29
- ## MUST
30
-
31
- - 明确支持的主题列表和默认主题。
32
- - 所有主题覆盖完整语义 token,而非只换背景。
33
- - 表格、图表、弹层、焦点和状态随主题同步。
34
- - 切换、持久化、系统偏好和失败回退有策略。
35
- - 每个主题满足可访问性和视觉回归。
36
-
37
- ## MUST NOT
38
-
39
- - MUST NOT 在业务组件写死应由主题控制的颜色。
40
- - MUST NOT 让局部页面自行换肤。
41
- - MUST NOT 只处理页面背景而遗漏 portal/图表。
42
- - MUST NOT 用主题切换表达权限或业务状态。
43
-
44
- ## SHOULD
45
-
46
- - SHOULD 使用 CSS variables 或等价运行时 token。
47
- - SHOULD 避免主题切换闪烁和布局变化。
48
-
49
- ## Contract
50
-
51
- ```text
52
- ThemeId, TokenSet, Default, Persistence,
53
- SystemPreference, ThirdPartyAdapters[], Fallback
54
- ```
55
-
56
- ## Checklist
57
-
58
- - [ ] 支持范围和默认值明确。
59
- - [ ] token 覆盖完整。
60
- - [ ] 第三方与 portal 同步。
61
- - [ ] 对比度和回退通过。
62
-
63
- ## Examples
64
-
65
- ### 内容示例,可删除
66
-
67
- 主题切换统一更新页面、弹窗、表格和图表 palette。
68
-
69
- ## Anti-patterns
70
-
71
- 仅给 body 加 dark class,而下拉、弹窗和图表仍使用亮色。
72
-
73
- ## Ownership
74
-
75
- Design System Owner 维护主题 token,平台 Owner 维护切换,组件 Owner 负责兼容。
76
-
77
- ## Change Policy
78
-
79
- 新增主题必须完整覆盖和验收;删除主题需迁移用户偏好并提供回退。