pomaster 0.4.0 → 0.5.0

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 (228) hide show
  1. package/README.md +51 -15
  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 +10121 -6733
  121. package/package.json +1 -1
  122. package/seeds/aggregation-manifest.json +691 -0
  123. package/seeds/manifest.json +466 -1043
  124. package/seeds/specs/hard/stacks/antdesign/antdesign-ui-overlay.md +48 -0
  125. package/seeds/specs/hard/stacks/antdesign/index.md +20 -0
  126. package/seeds/specs/hard/stacks/css/css-system-overlay.md +52 -0
  127. package/seeds/specs/hard/stacks/css/index.md +20 -0
  128. package/seeds/specs/hard/stacks/geist/geist-design-system-overlay.md +48 -0
  129. package/seeds/specs/hard/stacks/geist/index.md +20 -0
  130. package/seeds/specs/hard/stacks/vue3/index.md +20 -0
  131. package/seeds/specs/hard/stacks/vue3/vue3-framework-overlay.md +71 -0
  132. package/seeds/specs/hard/themes/ai-generated-code.md +171 -0
  133. package/seeds/specs/hard/themes/api-contract-and-error-semantics.md +532 -0
  134. package/seeds/specs/hard/themes/architecture-and-module-boundaries.md +323 -0
  135. package/seeds/specs/hard/themes/data-and-transactions.md +582 -0
  136. package/seeds/specs/hard/themes/engineering-toolchain-and-dependencies.md +333 -0
  137. package/seeds/specs/hard/themes/environment-and-configuration.md +196 -0
  138. package/seeds/specs/hard/themes/frontend-state-and-client-data.md +342 -0
  139. package/seeds/specs/hard/themes/index.md +374 -0
  140. package/seeds/specs/hard/themes/integration-and-async-runtime.md +331 -0
  141. package/seeds/specs/hard/{frontend/38-internationalization-protocol.md → themes/internationalization-and-copywriting.md} +112 -5
  142. package/seeds/specs/hard/themes/observability-and-analytics.md +305 -0
  143. package/seeds/specs/hard/themes/page-composition-and-browser-environment.md +554 -0
  144. package/seeds/specs/hard/{frontend/31-performance-protocol.md → themes/performance-and-capacity.md} +95 -6
  145. package/seeds/specs/hard/themes/permission-and-authorization.md +168 -0
  146. package/seeds/specs/hard/themes/privacy-and-data-lifecycle.md +176 -0
  147. package/seeds/specs/hard/themes/release-and-feature-flags.md +237 -0
  148. package/seeds/specs/hard/{frontend/04-security-protocol.md → themes/security.md} +95 -6
  149. package/seeds/specs/hard/themes/task-governance-and-acceptance.md +554 -0
  150. package/seeds/specs/hard/themes/testing-and-verification.md +266 -0
  151. package/seeds/specs/hard/themes/ui-presentation-and-design.md +670 -0
  152. package/seeds/specs/hard/themes/value-semantics-and-domain-data.md +339 -0
  153. package/seeds/specs/hard/backend/01-architecture-governance-protocol.md +0 -68
  154. package/seeds/specs/hard/backend/02-project-structure-governance-protocol.md +0 -68
  155. package/seeds/specs/hard/backend/03-directory-boundary-protocol.md +0 -68
  156. package/seeds/specs/hard/backend/04-layering-architecture-protocol.md +0 -68
  157. package/seeds/specs/hard/backend/05-task-workflow-protocol.md +0 -68
  158. package/seeds/specs/hard/backend/06-ai-generated-code-protocol.md +0 -68
  159. package/seeds/specs/hard/backend/07-evidence-acceptance-protocol.md +0 -68
  160. package/seeds/specs/hard/backend/08-contract-change-protocol.md +0 -68
  161. package/seeds/specs/hard/backend/09-role-responsibility-protocol.md +0 -68
  162. package/seeds/specs/hard/backend/10-security-protocol.md +0 -68
  163. package/seeds/specs/hard/backend/11-environment-configuration-protocol.md +0 -67
  164. package/seeds/specs/hard/backend/12-api-contract-protocol.md +0 -68
  165. package/seeds/specs/hard/backend/13-privacy-data-lifecycle-protocol.md +0 -68
  166. package/seeds/specs/hard/backend/14-business-rules-state-protocol.md +0 -68
  167. package/seeds/specs/hard/backend/15-data-model-protocol.md +0 -68
  168. package/seeds/specs/hard/backend/16-error-code-protocol.md +0 -68
  169. package/seeds/specs/hard/backend/17-permission-authorization-protocol.md +0 -68
  170. package/seeds/specs/hard/backend/18-database-schema-migration-protocol.md +0 -68
  171. package/seeds/specs/hard/backend/19-query-index-sql-protocol.md +0 -68
  172. package/seeds/specs/hard/backend/20-transaction-boundary-protocol.md +0 -68
  173. package/seeds/specs/hard/backend/21-concurrency-locking-protocol.md +0 -68
  174. package/seeds/specs/hard/backend/22-idempotency-protocol.md +0 -68
  175. package/seeds/specs/hard/backend/23-cache-redis-consistency-protocol.md +0 -68
  176. package/seeds/specs/hard/backend/24-external-integration-resilience-protocol.md +0 -68
  177. package/seeds/specs/hard/backend/25-async-job-scheduler-protocol.md +0 -68
  178. package/seeds/specs/hard/backend/26-engineering-tooling-protocol.md +0 -68
  179. package/seeds/specs/hard/backend/27-dependency-supply-chain-protocol.md +0 -68
  180. package/seeds/specs/hard/backend/28-testing-protocol.md +0 -68
  181. package/seeds/specs/hard/backend/29-observability-logging-tracing-protocol.md +0 -68
  182. package/seeds/specs/hard/backend/30-performance-capacity-protocol.md +0 -68
  183. package/seeds/specs/hard/backend/31-runtime-deployment-protocol.md +0 -68
  184. package/seeds/specs/hard/backend/32-release-versioning-rollback-protocol.md +0 -68
  185. package/seeds/specs/hard/backend/index.md +0 -177
  186. package/seeds/specs/hard/frontend/01-development-checklist-protocol.md +0 -86
  187. package/seeds/specs/hard/frontend/02-ai-generated-code-protocol.md +0 -82
  188. package/seeds/specs/hard/frontend/03-acceptance-gate-protocol.md +0 -86
  189. package/seeds/specs/hard/frontend/05-environment-configuration-protocol.md +0 -80
  190. package/seeds/specs/hard/frontend/06-change-governance-protocol.md +0 -90
  191. package/seeds/specs/hard/frontend/07-frontend-backend-communication-protocol.md +0 -219
  192. package/seeds/specs/hard/frontend/08-role-responsibility-protocol.md +0 -80
  193. package/seeds/specs/hard/frontend/09-module-boundary-protocol.md +0 -81
  194. package/seeds/specs/hard/frontend/10-engineering-tooling-protocol.md +0 -89
  195. package/seeds/specs/hard/frontend/11-dependency-package-management-protocol.md +0 -87
  196. package/seeds/specs/hard/frontend/12-business-rules-protocol.md +0 -79
  197. package/seeds/specs/hard/frontend/13-monetary-precision-protocol.md +0 -81
  198. package/seeds/specs/hard/frontend/14-data-model-protocol.md +0 -85
  199. package/seeds/specs/hard/frontend/15-request-api-protocol.md +0 -87
  200. package/seeds/specs/hard/frontend/16-error-handling-protocol.md +0 -79
  201. package/seeds/specs/hard/frontend/17-permission-protocol.md +0 -79
  202. package/seeds/specs/hard/frontend/18-state-management-protocol.md +0 -88
  203. package/seeds/specs/hard/frontend/19-cache-protocol.md +0 -79
  204. package/seeds/specs/hard/frontend/20-testing-protocol.md +0 -88
  205. package/seeds/specs/hard/frontend/21-design-system-protocol.md +0 -79
  206. package/seeds/specs/hard/frontend/22-theme-protocol.md +0 -79
  207. package/seeds/specs/hard/frontend/23-accessibility-protocol.md +0 -189
  208. package/seeds/specs/hard/frontend/24-component-protocol.md +0 -80
  209. package/seeds/specs/hard/frontend/25-page-structure-protocol.md +0 -79
  210. package/seeds/specs/hard/frontend/26-style-layout-protocol.md +0 -80
  211. package/seeds/specs/hard/frontend/27-rendering-state-protocol.md +0 -81
  212. package/seeds/specs/hard/frontend/28-form-protocol.md +0 -88
  213. package/seeds/specs/hard/frontend/29-routing-url-protocol.md +0 -79
  214. package/seeds/specs/hard/frontend/30-data-grid-protocol.md +0 -83
  215. package/seeds/specs/hard/frontend/32-file-import-export-protocol.md +0 -80
  216. package/seeds/specs/hard/frontend/33-release-versioning-protocol.md +0 -79
  217. package/seeds/specs/hard/frontend/34-monitoring-logging-protocol.md +0 -128
  218. package/seeds/specs/hard/frontend/35-mock-protocol.md +0 -97
  219. package/seeds/specs/hard/frontend/36-feature-flag-protocol.md +0 -79
  220. package/seeds/specs/hard/frontend/37-browser-device-compatibility-protocol.md +0 -83
  221. package/seeds/specs/hard/frontend/39-copywriting-protocol.md +0 -79
  222. package/seeds/specs/hard/frontend/40-analytics-protocol.md +0 -98
  223. package/seeds/specs/hard/frontend/41-design-handoff-protocol.md +0 -80
  224. package/seeds/specs/hard/frontend/42-browser-runtime-lifecycle-protocol.md +0 -86
  225. package/seeds/specs/hard/frontend/43-time-temporal-protocol.md +0 -86
  226. package/seeds/specs/hard/frontend/44-privacy-data-lifecycle-protocol.md +0 -87
  227. package/seeds/specs/hard/frontend/45-browser-storage-protocol.md +0 -87
  228. package/seeds/specs/hard/frontend/index.md +0 -308
@@ -1,68 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/backend-hard-spec/assets/universal/16-error-code-protocol.md
3
- seed_source_sha256: aa80ee60f7431e14859f61e563784e71b2002f35e220964170a779800fdde090
4
- seed_version: B6C
5
- lane: backend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [backend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- legacy_id: backend:error-code-protocol
12
- criticality: standard
13
- injection_mode: triggered
14
- stages: [prepare, implement, check]
15
- triggers: [error-code, error-handling]
16
- requires: []
17
- ---
18
-
19
- # 错误码协议
20
-
21
- ## Scope
22
-
23
- 规范错误分类、稳定错误码、状态映射、字段错误、重试性与安全消息。
24
-
25
- ## Non-Scope
26
-
27
- 不负责日志采样、告警或业务规则本身。
28
-
29
- ## Terms
30
-
31
- 稳定错误码是调用方可依赖且不暴露内部实现的机器语义。
32
-
33
- ## MUST
34
-
35
- - 失败必须映射到稳定 code、适当状态、可选字段错误、retryable 与 TraceId。
36
-
37
- ## MUST NOT
38
-
39
- - 不得向调用方返回堆栈、SQL、secret 或不稳定内部异常文本。
40
-
41
- ## SHOULD
42
-
43
- - 应区分认证、鉴权、未找到、冲突、校验、限流和服务失败。
44
-
45
- ## Contract
46
-
47
- 错误注册项必须包含语义、状态映射、消息边界、重试性和所有者。
48
-
49
- ## Checklist
50
-
51
- - [ ] 新错误已验证客户端恢复、日志关联和兼容行为。
52
-
53
- ## Examples
54
-
55
- - 乐观锁冲突返回稳定冲突 code,并明确客户端是否可重试。
56
-
57
- ## Anti-patterns
58
-
59
- - 所有异常都返回 HTTP 200 或统一未知错误。
60
-
61
- ## Ownership
62
-
63
- Backend 维护错误注册表,API 消费方按稳定语义处理。
64
-
65
- ## Change Policy
66
-
67
- 已发布错误码不得复用;废弃必须保留兼容说明。
68
-
@@ -1,68 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/backend-hard-spec/assets/universal/17-permission-authorization-protocol.md
3
- seed_source_sha256: d85a431b682a3a7c3dd4a6ee1f67fc375b54edb4a8e7fe98d283103b64a6b41e
4
- seed_version: B6C
5
- lane: backend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [backend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- legacy_id: backend:permission-authorization-protocol
12
- criticality: critical
13
- injection_mode: triggered
14
- stages: [prepare, implement, check]
15
- triggers: [authorization, tenant, data-scope]
16
- requires: []
17
- ---
18
-
19
- # 权限与鉴权协议
20
-
21
- ## Scope
22
-
23
- 规范操作权限、数据范围、租户隔离、资源归属和字段脱敏。
24
-
25
- ## Non-Scope
26
-
27
- 不替代认证机制、业务状态规则或隐私保留决策。
28
-
29
- ## Terms
30
-
31
- 数据范围是主体在当前租户、角色与资源关系下可访问的记录集合。
32
-
33
- ## MUST
34
-
35
- - 每个受保护操作必须在服务端验证主体、操作、租户、数据范围和资源归属。
36
-
37
- ## MUST NOT
38
-
39
- - 不得只依赖路由隐藏、按钮状态或客户端传入的租户与 owner。
40
-
41
- ## SHOULD
42
-
43
- - 应采用集中策略并测试越权、跨租户、批量与导出场景。
44
-
45
- ## Contract
46
-
47
- 权限契约必须定义主体、资源、动作、范围、拒绝语义和审计。
48
-
49
- ## Checklist
50
-
51
- - [ ] 单条、列表、搜索、批量、导入与导出均执行一致范围控制。
52
-
53
- ## Examples
54
-
55
- - 查询在数据库条件中收紧租户与数据范围,而不是返回后再过滤。
56
-
57
- ## Anti-patterns
58
-
59
- - 只检查角色名,不检查目标资源归属和字段敏感级别。
60
-
61
- ## Ownership
62
-
63
- BP 定义业务权限语义,Backend 执行最终授权。
64
-
65
- ## Change Policy
66
-
67
- 扩大权限范围必须经过正式业务确认、安全评审和回归测试。
68
-
@@ -1,68 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/backend-hard-spec/assets/universal/18-database-schema-migration-protocol.md
3
- seed_source_sha256: e7d0b660673dc1978653c39c9efcc7ad7d9b2809c4a88040a6fcf74839bc82c0
4
- seed_version: B6C
5
- lane: backend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [backend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- legacy_id: backend:database-schema-migration-protocol
12
- criticality: critical
13
- injection_mode: triggered
14
- stages: [prepare, implement, check, release]
15
- triggers: [database-schema, migration, data-repair]
16
- requires: []
17
- ---
18
-
19
- # 数据库 Schema 与迁移协议
20
-
21
- ## Scope
22
-
23
- 规范 table、column、type、约束、索引、migration、回滚和数据修复。
24
-
25
- ## Non-Scope
26
-
27
- 不规定具体数据库产品的语法或项目表名。
28
-
29
- ## Terms
30
-
31
- 迁移是受版本控制、顺序稳定且可验证的数据结构或数据变更。
32
-
33
- ## MUST
34
-
35
- - 每次 schema 变化必须有前向迁移、兼容分析、验证和回退或 roll-forward 路径。
36
-
37
- ## MUST NOT
38
-
39
- - 不得依赖 ORM 自动改表、手工生产操作或无记录脚本作为正式迁移。
40
-
41
- ## SHOULD
42
-
43
- - 应采用 expand/migrate/contract,避免应用与数据库无法并行部署。
44
-
45
- ## Contract
46
-
47
- 迁移记录必须包含对象、影响数据、锁风险、顺序、验证、修复和恢复。
48
-
49
- ## Checklist
50
-
51
- - [ ] 约束、索引、默认值、历史数据、备份与发布窗口已检查。
52
-
53
- ## Examples
54
-
55
- - 先新增可空字段并双写,完成回填与读切换后再收紧约束。
56
-
57
- ## Anti-patterns
58
-
59
- - 在同一步中删除旧字段并发布仍依赖它的应用版本。
60
-
61
- ## Ownership
62
-
63
- 数据 Owner 审批语义,Backend 维护 migration 与验证证据。
64
-
65
- ## Change Policy
66
-
67
- 已执行 migration 不得原地改写;修正必须追加新 migration。
68
-
@@ -1,68 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/backend-hard-spec/assets/universal/19-query-index-sql-protocol.md
3
- seed_source_sha256: 60a660730a82a4f911bc6c18d5f6808a320f722df27d397a4e4b13835111610d
4
- seed_version: B6C
5
- lane: backend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [backend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- legacy_id: backend:query-index-sql-protocol
12
- criticality: standard
13
- injection_mode: triggered
14
- stages: [implement, check]
15
- triggers: [sql, query, index, pagination]
16
- requires: []
17
- ---
18
-
19
- # 查询、索引与 SQL 协议
20
-
21
- ## Scope
22
-
23
- 规范参数化 SQL、查询形态、分页、N+1、索引和执行计划证据。
24
-
25
- ## Non-Scope
26
-
27
- 不规定具体数据库的固定索引或性能阈值。
28
-
29
- ## Terms
30
-
31
- 查询形态包括过滤、连接、排序、分页、聚合与预期数据规模。
32
-
33
- ## MUST
34
-
35
- - SQL 必须参数化,并以真实查询形态验证结果、边界和执行计划。
36
-
37
- ## MUST NOT
38
-
39
- - 不得用字符串拼接构造不可信 SQL 或无界读取大结果集。
40
-
41
- ## SHOULD
42
-
43
- - 应让索引服务于已知查询,并记录写放大与存储取舍。
44
-
45
- ## Contract
46
-
47
- 关键查询必须记录输入、排序稳定性、分页语义、索引和验证数据规模。
48
-
49
- ## Checklist
50
-
51
- - [ ] 空结果、重复排序键、深分页、N+1 与慢查询已检查。
52
-
53
- ## Examples
54
-
55
- - 游标分页包含稳定唯一排序键并验证并发写入下的行为。
56
-
57
- ## Anti-patterns
58
-
59
- - 仅凭列名添加索引,不检查选择性和实际执行计划。
60
-
61
- ## Ownership
62
-
63
- 查询维护者提供计划证据,数据 Owner 评审容量与一致性影响。
64
-
65
- ## Change Policy
66
-
67
- 索引删除或查询重写必须先验证所有已知消费者和回滚路径。
68
-
@@ -1,68 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/backend-hard-spec/assets/universal/20-transaction-boundary-protocol.md
3
- seed_source_sha256: 4c4634b71f1e07e9cae074f9790fa50b3425f0af71300ab2ac12e644b521eff4
4
- seed_version: B6C
5
- lane: backend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [backend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- legacy_id: backend:transaction-boundary-protocol
12
- criticality: critical
13
- injection_mode: triggered
14
- stages: [prepare, implement, check]
15
- triggers: [transaction]
16
- requires: []
17
- ---
18
-
19
- # 事务边界协议
20
-
21
- ## Scope
22
-
23
- 规范事务所有者、边界、隔离、传播、重试、补偿与外部调用。
24
-
25
- ## Non-Scope
26
-
27
- 不替代业务不变量、锁选择或数据库产品细节。
28
-
29
- ## Terms
30
-
31
- 事务边界是需要原子提交或一致失败的一组本地持久化操作。
32
-
33
- ## MUST
34
-
35
- - 写流程必须明确事务入口、隔离、传播、失败、重试和提交后动作。
36
-
37
- ## MUST NOT
38
-
39
- - 不得在长事务中执行无界网络调用、用户等待或不可控批处理。
40
-
41
- ## SHOULD
42
-
43
- - 应缩短锁持有时间,并将外部副作用设计为可重试或可补偿。
44
-
45
- ## Contract
46
-
47
- 事务设计必须列出读写集合、锁、唯一约束、外部调用和一致性证据。
48
-
49
- ## Checklist
50
-
51
- - [ ] 异常、超时、重试、部分失败和提交后发布均已测试。
52
-
53
- ## Examples
54
-
55
- - 本地事务写入 outbox,提交后由可靠发布器发送外部消息。
56
-
57
- ## Anti-patterns
58
-
59
- - 通过扩大事务范围掩盖跨系统一致性设计缺失。
60
-
61
- ## Ownership
62
-
63
- 应用服务拥有事务编排,Repository 提供明确持久化语义。
64
-
65
- ## Change Policy
66
-
67
- 边界或隔离变化必须复核并发、锁、性能和失败恢复。
68
-
@@ -1,68 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/backend-hard-spec/assets/universal/21-concurrency-locking-protocol.md
3
- seed_source_sha256: 6141612e1135cc67ccd9d47553ea5fa7b9c00e05b6e50706f8e117c80d3b8d95
4
- seed_version: B6C
5
- lane: backend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [backend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- legacy_id: backend:concurrency-locking-protocol
12
- criticality: critical
13
- injection_mode: triggered
14
- stages: [prepare, implement, check]
15
- triggers: [concurrency, locking]
16
- requires: []
17
- ---
18
-
19
- # 并发与锁协议
20
-
21
- ## Scope
22
-
23
- 规范乐观锁、悲观锁、唯一约束、分布式锁和冲突响应。
24
-
25
- ## Non-Scope
26
-
27
- 不替代事务边界或业务状态规则。
28
-
29
- ## Terms
30
-
31
- 竞争窗口是多个执行者可基于同一旧状态作出冲突决策的时间范围。
32
-
33
- ## MUST
34
-
35
- - 并发写必须明确竞争对象、原子条件、冲突结果、重试与最终一致性。
36
-
37
- ## MUST NOT
38
-
39
- - 不得把进程内锁用于跨实例互斥或忽略锁超时与所有权。
40
-
41
- ## SHOULD
42
-
43
- - 应优先使用数据库约束或带版本条件的原子更新保护不变量。
44
-
45
- ## Contract
46
-
47
- 锁设计必须记录粒度、顺序、超时、续租、释放、失败和可观测性。
48
-
49
- ## Checklist
50
-
51
- - [ ] 重复请求、乱序、死锁、超时、崩溃和多实例场景已测试。
52
-
53
- ## Examples
54
-
55
- - 以版本号条件更新并将零行更新映射为稳定冲突错误。
56
-
57
- ## Anti-patterns
58
-
59
- - 先查询再无条件更新,并假设请求不会并发。
60
-
61
- ## Ownership
62
-
63
- 业务用例 Owner 定义冲突语义,持久化维护者验证原子性。
64
-
65
- ## Change Policy
66
-
67
- 锁策略变化必须重新评估事务、性能、恢复和兼容行为。
68
-
@@ -1,68 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/backend-hard-spec/assets/universal/22-idempotency-protocol.md
3
- seed_source_sha256: c97d003622b9075f0c094ec5c5bfa950a977e18b2f4ce8ffc9bc014858e27670
4
- seed_version: B6C
5
- lane: backend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [backend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- legacy_id: backend:idempotency-protocol
12
- criticality: critical
13
- injection_mode: triggered
14
- stages: [prepare, implement, check]
15
- triggers: [idempotency, callback, replay]
16
- requires: []
17
- ---
18
-
19
- # 幂等协议
20
-
21
- ## Scope
22
-
23
- 规范创建、提交、审批、导入、回调和任务重放语义。
24
-
25
- ## Non-Scope
26
-
27
- 不把所有读取或天然无副作用操作强制包装为幂等流程。
28
-
29
- ## Terms
30
-
31
- 幂等键标识同一业务意图,而不是单次网络请求。
32
-
33
- ## MUST
34
-
35
- - 可重试写操作必须定义 key 范围、请求指纹、保留期、并发和响应重放。
36
-
37
- ## MUST NOT
38
-
39
- - 不得仅依赖客户端防抖、按钮禁用或短时进程内缓存。
40
-
41
- ## SHOULD
42
-
43
- - 应对相同 key 不同 payload 返回稳定冲突,而非重复执行。
44
-
45
- ## Contract
46
-
47
- 幂等记录必须包含主体、操作、key、指纹、状态、结果与过期语义。
48
-
49
- ## Checklist
50
-
51
- - [ ] 并发首请求、失败重试、超时、重放和过期边界已测试。
52
-
53
- ## Examples
54
-
55
- - 回调以供应方事件 ID 和租户范围去重,并原子保存处理结果。
56
-
57
- ## Anti-patterns
58
-
59
- - 用当前时间生成幂等键,使每次重试都成为新操作。
60
-
61
- ## Ownership
62
-
63
- API 或任务 Owner 定义业务意图,存储实现维护原子去重。
64
-
65
- ## Change Policy
66
-
67
- key 格式或保留期变化必须处理旧记录和滚动发布兼容。
68
-
@@ -1,68 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/backend-hard-spec/assets/universal/23-cache-redis-consistency-protocol.md
3
- seed_source_sha256: 073da5821658adfc0580798873fde95c49dc9d993a63949b3b1543a9c0e18a11
4
- seed_version: B6C
5
- lane: backend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [backend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- legacy_id: backend:cache-redis-consistency-protocol
12
- criticality: critical
13
- injection_mode: triggered
14
- stages: [prepare, implement, check, release]
15
- triggers: [redis, cache]
16
- requires: []
17
- ---
18
-
19
- # 缓存与 Redis 一致性协议
20
-
21
- ## Scope
22
-
23
- 规范 key、value schema、TTL、序列化、失效、一致性、防击穿与降级。
24
-
25
- ## Non-Scope
26
-
27
- 不默认指定 Redis,也不规定项目 key 与 TTL 数值。
28
-
29
- ## Terms
30
-
31
- 权威数据源是在冲突时决定业务事实的持久来源。
32
-
33
- ## MUST
34
-
35
- - 缓存必须定义 key 维度、权限隔离、TTL、更新失效、故障和恢复行为。
36
-
37
- ## MUST NOT
38
-
39
- - 不得让不同租户、权限、过滤或版本的数据共享含混 key。
40
-
41
- ## SHOULD
42
-
43
- - 应设计缓存穿透、击穿、雪崩和热 key 的限制与观测。
44
-
45
- ## Contract
46
-
47
- 缓存契约必须包含权威源、schema 版本、读写顺序、陈旧容忍和降级。
48
-
49
- ## Checklist
50
-
51
- - [ ] DB 提交、缓存失败、并发更新、淘汰和重建已测试。
52
-
53
- ## Examples
54
-
55
- - 写库提交后删除版本化缓存,读路径在 miss 时受控回源。
56
-
57
- ## Anti-patterns
58
-
59
- - 先写缓存再写数据库且没有补偿或一致性说明。
60
-
61
- ## Ownership
62
-
63
- 数据 Owner 定义一致性,缓存维护者提供失效与恢复证据。
64
-
65
- ## Change Policy
66
-
67
- value schema 或 key 变化必须版本化并规划旧数据清理。
68
-
@@ -1,68 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/backend-hard-spec/assets/universal/24-external-integration-resilience-protocol.md
3
- seed_source_sha256: e6b0626c9169e9126319bd08ee5d5bdbe38421cfa175509524145aee30ff539a
4
- seed_version: B6C
5
- lane: backend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [backend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- legacy_id: backend:external-integration-resilience-protocol
12
- criticality: critical
13
- injection_mode: triggered
14
- stages: [prepare, implement, check, release]
15
- triggers: [external-integration, resilience]
16
- requires: []
17
- ---
18
-
19
- # 外部集成与韧性协议
20
-
21
- ## Scope
22
-
23
- 规范外部契约、超时、重试、熔断、补偿、对账和供应方故障。
24
-
25
- ## Non-Scope
26
-
27
- 不发明供应方 SLA、字段或错误语义。
28
-
29
- ## Terms
30
-
31
- 补偿用于处理无法由单一原子事务覆盖的已发生副作用。
32
-
33
- ## MUST
34
-
35
- - 每个外部调用必须定义超时、重试条件、幂等、失败映射和恢复路径。
36
-
37
- ## MUST NOT
38
-
39
- - 不得无限重试、重试非幂等操作或在事务内执行无界调用。
40
-
41
- ## SHOULD
42
-
43
- - 应采用隔离、熔断、限流、降级与对账控制故障扩散。
44
-
45
- ## Contract
46
-
47
- 集成契约必须记录版本、认证、请求响应、错误、限额、追踪与所有者。
48
-
49
- ## Checklist
50
-
51
- - [ ] 超时、限流、部分失败、重复响应和供应方中断已测试。
52
-
53
- ## Examples
54
-
55
- - 写入本地意图后异步调用供应方,并通过状态机与对账收敛。
56
-
57
- ## Anti-patterns
58
-
59
- - 捕获外部异常后记录日志并返回业务成功。
60
-
61
- ## Ownership
62
-
63
- 集成 Owner 维护供应方契约,业务 Owner 决定降级与补偿语义。
64
-
65
- ## Change Policy
66
-
67
- 供应方版本或认证变化必须经过兼容窗口和演练。
68
-
@@ -1,68 +0,0 @@
1
- ---
2
- seed_source: pomaster/components/backend-hard-spec/assets/universal/25-async-job-scheduler-protocol.md
3
- seed_source_sha256: 36af3b4466b4e617a9c552a404d98ab74604752b7410e15756d7f132394fb980
4
- seed_version: B6C
5
- lane: backend
6
- status: CURRENT
7
- authority_scope: mixed_required_and_advisory
8
- applies_to: [backend]
9
- related_evidence_specs: []
10
- related_tools: []
11
- legacy_id: backend:async-job-scheduler-protocol
12
- criticality: standard
13
- injection_mode: triggered
14
- stages: [prepare, implement, check, release]
15
- triggers: [async-job, scheduler, import-export]
16
- requires: []
17
- ---
18
-
19
- # 异步任务与调度协议
20
-
21
- ## Scope
22
-
23
- 规范 Job 生命周期、进度、取消、重试、调度锁、结果与保留。
24
-
25
- ## Non-Scope
26
-
27
- 不绑定具体调度器、队列或批处理框架。
28
-
29
- ## Terms
30
-
31
- Job instance 是由稳定业务参数标识的一次可追踪执行意图。
32
-
33
- ## MUST
34
-
35
- - 任务必须定义身份、状态、幂等、重试、取消、超时和结果访问。
36
-
37
- ## MUST NOT
38
-
39
- - 不得用固定 sleep、无主线程或无状态记录的后台执行承载关键任务。
40
-
41
- ## SHOULD
42
-
43
- - 应支持进度、心跳、并发限制、失败恢复和过期清理。
44
-
45
- ## Contract
46
-
47
- 任务契约必须包含触发源、参数、状态机、输出、错误、保留和权限。
48
-
49
- ## Checklist
50
-
51
- - [ ] 重复触发、节点崩溃、接管、取消、重跑与过期已测试。
52
-
53
- ## Examples
54
-
55
- - 导出任务返回 job ID,调用方查询状态并从受权地址下载结果。
56
-
57
- ## Anti-patterns
58
-
59
- - 调度表达式重叠时并发执行同一不可重入任务。
60
-
61
- ## Ownership
62
-
63
- 任务 Owner 定义生命周期,运行平台提供调度与执行证据。
64
-
65
- ## Change Policy
66
-
67
- 参数或状态变化必须兼容历史任务和进行中的执行。
68
-