pomaster 0.3.0 → 0.4.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 (393) hide show
  1. package/README.md +9 -10
  2. package/catalog/archetypes/archetype.frontend.error_taxonomy.json +13 -5
  3. package/catalog/archetypes/archetype.frontend.feature_oriented.json +1 -1
  4. package/catalog/archetypes/archetype.state.async_command.json +4 -4
  5. package/catalog/catalog-lock.draft.json +1120 -104
  6. package/catalog/gates/gate.be.api.contract_checks.json +2 -1
  7. package/catalog/gates/gate.be.chg.contract_change_checks.json +2 -1
  8. package/catalog/gates/gate.chg.prechange_checks.json +2 -1
  9. package/catalog/gates/gate.web.api.request_checks.json +2 -1
  10. package/catalog/gates/gate.web.grid.checks.json +2 -1
  11. package/catalog/knowledge/knowledge.api.example_stable_error_code.json +2 -1
  12. package/catalog/knowledge/knowledge.chg.example_compat_window.json +2 -1
  13. package/catalog/knowledge/knowledge.chg.example_prop_migration.json +2 -1
  14. package/catalog/knowledge/knowledge.fp.api.field_drift_no_contract.json +2 -1
  15. package/catalog/knowledge/knowledge.fp.api.per_page_http_client.json +2 -1
  16. package/catalog/knowledge/knowledge.fp.be.contract_drift.json +2 -1
  17. package/catalog/knowledge/knowledge.fp.chg.page_local_padding.json +2 -1
  18. package/catalog/knowledge/knowledge.fp.grid.global_td_width.json +2 -1
  19. package/catalog/knowledge/knowledge.web.api.example_get_entity_list.json +2 -1
  20. package/catalog/knowledge/knowledge.web.grid.example_column_preset.json +2 -1
  21. package/catalog/policies/authority.be.api_contract_ownership.json +2 -1
  22. package/catalog/policies/authority.be.contract_ownership.json +2 -1
  23. package/catalog/policies/authority.chg.change_owners.json +2 -1
  24. package/catalog/policies/authority.web.api.request_owners.json +2 -1
  25. package/catalog/policies/authority.web.grid.ownership.json +2 -1
  26. package/catalog/policies/policy.ai.change_plan_first.json +91 -0
  27. package/catalog/policies/policy.ai.fact_inference_separation.json +91 -0
  28. package/catalog/policies/policy.ai.read_search_verify_before_write.json +92 -0
  29. package/catalog/policies/policy.ai.rule_relaxation_approval.json +91 -0
  30. package/catalog/policies/policy.api.backward_compat_defaults.json +2 -1
  31. package/catalog/policies/policy.api.contract_impl_consistency.json +2 -1
  32. package/catalog/policies/policy.api.no_informal_contract.json +2 -1
  33. package/catalog/policies/policy.arch.adr_immutable_history.json +91 -0
  34. package/catalog/policies/policy.arch.decision_tradeoff_record.json +2 -1
  35. package/catalog/policies/policy.arch.no_convenience_over_boundary.json +93 -0
  36. package/catalog/policies/policy.arch.prefer_verifiable_option.json +92 -0
  37. package/catalog/policies/policy.authz.no_gating_proxy_trust.json +99 -0
  38. package/catalog/policies/policy.authz.permission_scope_expansion_gate.json +99 -0
  39. package/catalog/policies/policy.authz.server_five_factor_verification.json +101 -0
  40. package/catalog/policies/policy.be.conc.prefer_db_constraints.json +97 -0
  41. package/catalog/policies/policy.be.db.expand_migrate_contract.json +97 -0
  42. package/catalog/policies/policy.be.idem.key_payload_conflict.json +97 -0
  43. package/catalog/policies/policy.be.model.single_boundary_conversion.json +97 -0
  44. package/catalog/policies/policy.be.sql.index_for_known_queries.json +97 -0
  45. package/catalog/policies/policy.be.state.single_rule_source.json +97 -0
  46. package/catalog/policies/policy.be.txn.short_locks_compensation.json +96 -0
  47. package/catalog/policies/policy.bound.search_first_entry_only.json +91 -0
  48. package/catalog/policies/policy.boundary.validate_in_encode_out.json +92 -0
  49. package/catalog/policies/policy.cache.failure_mode_guards.json +93 -0
  50. package/catalog/policies/policy.cache.lifecycle_definition.json +2 -1
  51. package/catalog/policies/policy.cache.schema_versioning.json +91 -0
  52. package/catalog/policies/policy.cfg.config_attribute_completeness.json +95 -0
  53. package/catalog/policies/policy.cfg.key_rename_dual_read.json +92 -0
  54. package/catalog/policies/policy.cfg.no_secret_dispersal.json +90 -0
  55. package/catalog/policies/policy.cfg.production_safe_defaults.json +92 -0
  56. package/catalog/policies/policy.cfg.schema_backed_config.json +92 -0
  57. package/catalog/policies/policy.chg.affect_templates.json +2 -1
  58. package/catalog/policies/policy.chg.breaking_versioning.json +2 -1
  59. package/catalog/policies/policy.chg.compat_migration_rollback.json +2 -1
  60. package/catalog/policies/policy.chg.deprecate_before_delete.json +2 -1
  61. package/catalog/policies/policy.chg.fix_at_root_cause_level.json +2 -1
  62. package/catalog/policies/policy.chg.no_unrelated_changes.json +91 -0
  63. package/catalog/policies/policy.chg.observable_evolution.json +2 -1
  64. package/catalog/policies/policy.chg.prechange_consumer_scan.json +2 -1
  65. package/catalog/policies/policy.chg.staged_rollout.json +2 -1
  66. package/catalog/policies/policy.chg.sync_contract_docs_tests.json +2 -1
  67. package/catalog/policies/policy.conflict.priority_ladder.json +2 -1
  68. package/catalog/policies/policy.contract.no_invented_facts.json +93 -0
  69. package/catalog/policies/policy.dep.admission_six_dimension_check.json +2 -1
  70. package/catalog/policies/policy.dep.build_path_supply_chain.json +93 -0
  71. package/catalog/policies/policy.dep.change_surface_review.json +2 -1
  72. package/catalog/policies/policy.dep.introduction_review.json +2 -1
  73. package/catalog/policies/policy.dep.no_untrusted_source_no_lock_bypass.json +92 -0
  74. package/catalog/policies/policy.dep.time_boxed_urgent_exception.json +91 -0
  75. package/catalog/policies/policy.deploy.no_dev_env_as_production_fact.json +91 -0
  76. package/catalog/policies/policy.deploy.operational_capabilities.json +93 -0
  77. package/catalog/policies/policy.deploy.runtime_fact_record.json +97 -0
  78. package/catalog/policies/policy.derived.single_implementation.json +2 -1
  79. package/catalog/policies/policy.err.failure_five_part_mapping.json +101 -0
  80. package/catalog/policies/policy.err.no_internal_detail_exposure.json +97 -0
  81. package/catalog/policies/policy.err.published_code_immutable.json +98 -0
  82. package/catalog/policies/policy.evid.acceptance_binds_verifiable_evidence.json +92 -0
  83. package/catalog/policies/policy.evid.no_silent_gate_removal.json +90 -0
  84. package/catalog/policies/policy.evid.no_unverifiable_pass.json +92 -0
  85. package/catalog/policies/policy.flag.cleanup_after_full_rollout.json +94 -0
  86. package/catalog/policies/policy.flag.consistent_off_state.json +92 -0
  87. package/catalog/policies/policy.flag.kill_switch.json +91 -0
  88. package/catalog/policies/policy.flag.lifecycle_metadata.json +93 -0
  89. package/catalog/policies/policy.flag.not_a_permission.json +92 -0
  90. package/catalog/policies/policy.gate.p0_non_bypassable.json +92 -0
  91. package/catalog/policies/policy.gate.risk_factors_confirmed.json +93 -0
  92. package/catalog/policies/policy.guard.no_check_weakening.json +92 -0
  93. package/catalog/policies/policy.integration.call_definition_minimum.json +95 -0
  94. package/catalog/policies/policy.integration.fault_containment.json +94 -0
  95. package/catalog/policies/policy.job.lifecycle_definition.json +96 -0
  96. package/catalog/policies/policy.job.no_unmanaged_execution.json +92 -0
  97. package/catalog/policies/policy.job.operational_features.json +93 -0
  98. package/catalog/policies/policy.obs.actionable_signals.json +93 -0
  99. package/catalog/policies/policy.obs.alert_with_owner.json +91 -0
  100. package/catalog/policies/policy.obs.context_field_baseline.json +91 -0
  101. package/catalog/policies/policy.obs.correlation_context_minimum.json +2 -1
  102. package/catalog/policies/policy.obs.no_sensitive_or_unbounded_logging.json +92 -0
  103. package/catalog/policies/policy.obs.no_sensitive_raw_values.json +93 -0
  104. package/catalog/policies/policy.obs.rum_dimension_whitelist.json +2 -1
  105. package/catalog/policies/policy.obs.signal_change_impact.json +91 -0
  106. package/catalog/policies/policy.obs.source_map_access_control.json +92 -0
  107. package/catalog/policies/policy.obs.telemetry_lifecycle_declared.json +93 -0
  108. package/catalog/policies/policy.obs.trace_correlation.json +91 -0
  109. package/catalog/policies/policy.perf.budget_change_retest.json +91 -0
  110. package/catalog/policies/policy.perf.evidence_binding.json +95 -0
  111. package/catalog/policies/policy.perf.observation_dimensions.json +94 -0
  112. package/catalog/policies/policy.proc.checklist_change_policy.json +91 -0
  113. package/catalog/policies/policy.proc.pre_code_declaration.json +2 -1
  114. package/catalog/policies/policy.proc.scope_drift_reclassify.json +91 -0
  115. package/catalog/policies/policy.prv.processing_scope_re_review.json +97 -0
  116. package/catalog/policies/policy.prv.sensitive_data_six_facts.json +102 -0
  117. package/catalog/policies/policy.registry.human_fields_validated_decorrelated.json +93 -0
  118. package/catalog/policies/policy.rel.no_irreversible_unmonitored_full_release.json +91 -0
  119. package/catalog/policies/policy.rel.observability_before_ship.json +91 -0
  120. package/catalog/policies/policy.rel.pre_release_confirmation.json +2 -1
  121. package/catalog/policies/policy.rel.process_change_needs_drill_audit.json +91 -0
  122. package/catalog/policies/policy.rel.traceable_build.json +93 -0
  123. package/catalog/policies/policy.role.domain_decision_authority.json +2 -1
  124. package/catalog/policies/policy.role.human_signs_for_ai.json +93 -0
  125. package/catalog/policies/policy.sec.authn_policy_unified.json +91 -0
  126. package/catalog/policies/policy.sec.no_client_side_trust.json +92 -0
  127. package/catalog/policies/policy.sec.no_longterm_security_disable.json +91 -0
  128. package/catalog/policies/policy.sec.no_script_readable_credentials.json +91 -0
  129. package/catalog/policies/policy.sec.no_secrets_in_client_surface.json +91 -0
  130. package/catalog/policies/policy.sec.relaxation_approval.json +92 -0
  131. package/catalog/policies/policy.sec.security_relaxation_gate.json +92 -0
  132. package/catalog/policies/policy.sec.third_party_execution_register.json +2 -1
  133. package/catalog/policies/policy.sec.trust_boundary_enforcement.json +93 -0
  134. package/catalog/policies/policy.sec.upload_download_server_recheck.json +91 -0
  135. package/catalog/policies/policy.sec.url_source_allowlist.json +91 -0
  136. package/catalog/policies/policy.spec.admission_criteria.json +2 -1
  137. package/catalog/policies/policy.spec.derived_view_regeneration.json +2 -1
  138. package/catalog/policies/policy.spec.draft_not_baseline.json +2 -1
  139. package/catalog/policies/policy.spec.family_conflict_precedence.json +93 -0
  140. package/catalog/policies/policy.spec.file_structure_contract.json +2 -1
  141. package/catalog/policies/policy.spec.freeze_before_use.json +93 -0
  142. package/catalog/policies/policy.spec.metadata_required.json +2 -1
  143. package/catalog/policies/policy.spec.post_dev_backfill_classify.json +2 -1
  144. package/catalog/policies/policy.spec.primary_source_basis.json +93 -0
  145. package/catalog/policies/policy.spec.procedural_record_not_surrogate.json +2 -1
  146. package/catalog/policies/policy.spec.semantic_identity.json +2 -1
  147. package/catalog/policies/policy.spec.unresolved_ledger_gate.json +2 -1
  148. package/catalog/policies/policy.stack.derived_store_not_authority.json +93 -0
  149. package/catalog/policies/policy.stack.dual_web_stack_boundary.json +93 -0
  150. package/catalog/policies/policy.stack.entry_chain_recorded.json +93 -0
  151. package/catalog/policies/policy.stack.entry_limits_aligned.json +94 -0
  152. package/catalog/policies/policy.stack.local_form_not_prod_fact.json +93 -0
  153. package/catalog/policies/policy.stack.multi_datastore_ownership.json +93 -0
  154. package/catalog/policies/policy.stack.no_implicit_selection.json +2 -1
  155. package/catalog/policies/policy.stack.persistence_coexistence_scope.json +93 -0
  156. package/catalog/policies/policy.stack.toolchain_versions_pinned.json +95 -0
  157. package/catalog/policies/policy.stack.upgrade_compat_verified.json +93 -0
  158. package/catalog/policies/policy.struct.module_entry_dependency_declared.json +92 -0
  159. package/catalog/policies/policy.struct.no_unexplained_top_level_dir.json +91 -0
  160. package/catalog/policies/policy.struct.reuse_proven_structure.json +91 -0
  161. package/catalog/policies/policy.test.control_nondeterminism_keep_diagnosis.json +91 -0
  162. package/catalog/policies/policy.test.isolation_and_cleanup.json +93 -0
  163. package/catalog/policies/policy.test.no_synthetic_stability.json +92 -0
  164. package/catalog/policies/policy.test.pyramid_and_ci_matrix.json +92 -0
  165. package/catalog/policies/policy.test.removal_justification.json +91 -0
  166. package/catalog/policies/policy.test.removal_needs_substitute_evidence.json +91 -0
  167. package/catalog/policies/policy.test.risk_driven_plan.json +92 -0
  168. package/catalog/policies/policy.test.stable_observable_assertions.json +92 -0
  169. package/catalog/policies/policy.tool.discoverable_toolchain.json +92 -0
  170. package/catalog/policies/policy.tool.no_hand_edit_generated_no_ci_drift.json +91 -0
  171. package/catalog/policies/policy.tool.no_vendored_body_edits.json +94 -0
  172. package/catalog/policies/policy.tool.scoped_scan_boundary.json +2 -1
  173. package/catalog/policies/policy.tool.upgrade_verify_lock_rollback.json +92 -0
  174. package/catalog/policies/policy.web.api.auth_app_client_split.json +2 -1
  175. package/catalog/policies/policy.web.api.client_change_impact.json +2 -1
  176. package/catalog/policies/policy.web.api.domain_api_only.json +2 -1
  177. package/catalog/policies/policy.web.api.error_normalization.json +2 -1
  178. package/catalog/policies/policy.web.api.generated_client.json +2 -1
  179. package/catalog/policies/policy.web.api.late_result_guard.json +2 -1
  180. package/catalog/policies/policy.web.api.mutation_idempotency.json +2 -1
  181. package/catalog/policies/policy.web.api.no_network_optimism.json +2 -1
  182. package/catalog/policies/policy.web.api.query_cancel_stale_drop.json +2 -1
  183. package/catalog/policies/policy.web.api.request_infrastructure.json +2 -1
  184. package/catalog/policies/policy.web.api.retry_discipline.json +2 -1
  185. package/catalog/policies/policy.web.api.session_recovery_split.json +2 -1
  186. package/catalog/policies/policy.web.api.single_http_client.json +2 -1
  187. package/catalog/policies/policy.web.api.single_loading_source.json +2 -1
  188. package/catalog/policies/policy.web.api.transport_vs_business.json +2 -1
  189. package/catalog/policies/policy.web.api.trusted_endpoint_source.json +2 -1
  190. package/catalog/policies/policy.web.api.typed_domain_naming.json +2 -1
  191. package/catalog/policies/policy.web.arch.layer_isolation.json +2 -1
  192. package/catalog/policies/policy.web.arch.naming_conventions.json +2 -1
  193. package/catalog/policies/policy.web.arch.public_api_barrel.json +2 -1
  194. package/catalog/policies/policy.web.chg.controlled_change_triggers.json +2 -1
  195. package/catalog/policies/policy.web.comp.no_trivial_or_god_component.json +91 -0
  196. package/catalog/policies/policy.web.comp.public_contract_completeness.json +93 -0
  197. package/catalog/policies/policy.web.copy.action_object_clarity.json +92 -0
  198. package/catalog/policies/policy.web.copy.enumerable_placement.json +91 -0
  199. package/catalog/policies/policy.web.copy.error_next_step.json +92 -0
  200. package/catalog/policies/policy.web.copy.suppression_ledger_discipline.json +2 -1
  201. package/catalog/policies/policy.web.grid.column_schema_fields.json +2 -1
  202. package/catalog/policies/policy.web.grid.config_isolation.json +2 -1
  203. package/catalog/policies/policy.web.grid.freeze_key_columns.json +2 -1
  204. package/catalog/policies/policy.web.grid.interaction_registry.json +2 -1
  205. package/catalog/policies/policy.web.grid.keyboard_clipboard.json +2 -1
  206. package/catalog/policies/policy.web.grid.schema_driven_shell.json +2 -1
  207. package/catalog/policies/policy.web.grid.schema_versioning.json +2 -1
  208. package/catalog/policies/policy.web.grid.server_ops_virtualization.json +2 -1
  209. package/catalog/policies/policy.web.grid.shell_change_matrix.json +2 -1
  210. package/catalog/policies/policy.web.grid.width_fix_ladder.json +2 -1
  211. package/catalog/policies/policy.web.handoff.state_matrix_full.json +94 -0
  212. package/catalog/policies/policy.web.i18n.copy_key_discipline.json +92 -0
  213. package/catalog/policies/policy.web.i18n.raw_value_for_compute.json +91 -0
  214. package/catalog/policies/policy.web.page.region_consistency.json +93 -0
  215. package/catalog/policies/policy.web.perf.budget_skeleton.json +2 -1
  216. package/catalog/policies/policy.web.style.ownership_matrix.json +2 -1
  217. package/catalog/policies/policy.web.track.attempt_result_correlation.json +91 -0
  218. package/catalog/policies/policy.web.track.consent_lifecycle.json +2 -1
  219. package/catalog/policies/policy.web.track.no_synthetic_actions.json +92 -0
  220. package/catalog/policies/policy.web.track.privacy_default_deny.json +2 -1
  221. package/catalog/policies/policy.web.track.stable_event_keys.json +2 -1
  222. package/catalog/policies/policy.web.track.typed_client_validation.json +91 -0
  223. package/catalog/policies/policy.web.uiux.provider_evidence_not_business_truth.json +2 -1
  224. package/catalog/policies/policy.wf.no_planned_as_verified.json +91 -0
  225. package/catalog/policies/policy.wf.task_facts_preconfirm.json +94 -0
  226. package/catalog/policies/profile.baseline.java_enterprise_default.json +96 -0
  227. package/catalog/sensors/sensor.browser.deterministic.json +2 -1
  228. package/catalog/sensors/sensor.browser.interactive.json +2 -1
  229. package/catalog/sensors/sensor.build.static.json +2 -1
  230. package/catalog/sensors/sensor.contract.conformance.json +2 -1
  231. package/catalog/sensors/sensor.performance.budget.json +2 -1
  232. package/catalog/sensors/sensor.production.metric.json +2 -1
  233. package/catalog/tools/seed_b6b_frontend.py +1424 -0
  234. package/catalog/tools/seed_b6c_backend.py +1495 -0
  235. package/catalog/tools/seed_b6d_baseline.py +620 -0
  236. package/catalog/tools/seed_b6e_evidence.py +1305 -0
  237. package/catalog/tools/seed_d3_review.py +1105 -0
  238. package/catalog/tools/seed_v06_batch2_materials.py +27 -18
  239. package/dist/bin.js +23026 -16635
  240. package/package.json +2 -1
  241. package/seeds/baseline/backend/api-contract.md +26 -0
  242. package/seeds/baseline/backend/architecture.md +31 -0
  243. package/seeds/baseline/backend/data-access.md +31 -0
  244. package/seeds/baseline/backend/directory-structure.md +11 -0
  245. package/seeds/baseline/backend/integration-runtime.md +21 -0
  246. package/seeds/baseline/backend/quality.md +31 -0
  247. package/seeds/baseline/backend/stack.yaml +13 -0
  248. package/seeds/baseline/backend/transaction-concurrency.md +26 -0
  249. package/seeds/baseline/data/lineage.md +11 -0
  250. package/seeds/baseline/data/migration.md +11 -0
  251. package/seeds/baseline/data/model.md +31 -0
  252. package/seeds/baseline/data/precision-units.md +31 -0
  253. package/seeds/baseline/data/quality.md +31 -0
  254. package/seeds/baseline/frontend/api-and-error.md +21 -0
  255. package/seeds/baseline/frontend/architecture.md +26 -0
  256. package/seeds/baseline/frontend/design-system.md +21 -0
  257. package/seeds/baseline/frontend/directory-structure.md +16 -0
  258. package/seeds/baseline/frontend/quality.md +26 -0
  259. package/seeds/baseline/frontend/stack.yaml +17 -0
  260. package/seeds/baseline/frontend/state-and-data.md +26 -0
  261. package/seeds/baseline/manifest.yaml +32 -0
  262. package/seeds/baseline/platform/delivery.md +36 -0
  263. package/seeds/baseline/platform/environment.md +11 -0
  264. package/seeds/baseline/platform/observability.md +31 -0
  265. package/seeds/baseline/platform/security.md +26 -0
  266. package/seeds/manifest.json +2006 -0
  267. package/seeds/specs/evidence/accessibility.md +89 -0
  268. package/seeds/specs/evidence/architecture.md +89 -0
  269. package/seeds/specs/evidence/browser-e2e.md +91 -0
  270. package/seeds/specs/evidence/build.md +91 -0
  271. package/seeds/specs/evidence/business-acceptance.md +89 -0
  272. package/seeds/specs/evidence/complexity-crap.md +97 -0
  273. package/seeds/specs/evidence/contract.md +89 -0
  274. package/seeds/specs/evidence/coverage.md +91 -0
  275. package/seeds/specs/evidence/data-migration.md +91 -0
  276. package/seeds/specs/evidence/dead-code-duplicate.md +89 -0
  277. package/seeds/specs/evidence/dependency-supply-chain.md +89 -0
  278. package/seeds/specs/evidence/index.md +55 -0
  279. package/seeds/specs/evidence/mutation.md +89 -0
  280. package/seeds/specs/evidence/performance.md +89 -0
  281. package/seeds/specs/evidence/release.md +91 -0
  282. package/seeds/specs/evidence/runtime-observability.md +91 -0
  283. package/seeds/specs/evidence/security.md +89 -0
  284. package/seeds/specs/evidence/typecheck-lint.md +91 -0
  285. package/seeds/specs/evidence/unit-component-integration.md +91 -0
  286. package/seeds/specs/evidence/visual-regression.md +89 -0
  287. package/seeds/specs/hard/backend/01-architecture-governance-protocol.md +68 -0
  288. package/seeds/specs/hard/backend/02-project-structure-governance-protocol.md +68 -0
  289. package/seeds/specs/hard/backend/03-directory-boundary-protocol.md +68 -0
  290. package/seeds/specs/hard/backend/04-layering-architecture-protocol.md +68 -0
  291. package/seeds/specs/hard/backend/05-task-workflow-protocol.md +68 -0
  292. package/seeds/specs/hard/backend/06-ai-generated-code-protocol.md +68 -0
  293. package/seeds/specs/hard/backend/07-evidence-acceptance-protocol.md +68 -0
  294. package/seeds/specs/hard/backend/08-contract-change-protocol.md +68 -0
  295. package/seeds/specs/hard/backend/09-role-responsibility-protocol.md +68 -0
  296. package/seeds/specs/hard/backend/10-security-protocol.md +68 -0
  297. package/seeds/specs/hard/backend/11-environment-configuration-protocol.md +67 -0
  298. package/seeds/specs/hard/backend/12-api-contract-protocol.md +68 -0
  299. package/seeds/specs/hard/backend/13-privacy-data-lifecycle-protocol.md +68 -0
  300. package/seeds/specs/hard/backend/14-business-rules-state-protocol.md +68 -0
  301. package/seeds/specs/hard/backend/15-data-model-protocol.md +68 -0
  302. package/seeds/specs/hard/backend/16-error-code-protocol.md +68 -0
  303. package/seeds/specs/hard/backend/17-permission-authorization-protocol.md +68 -0
  304. package/seeds/specs/hard/backend/18-database-schema-migration-protocol.md +68 -0
  305. package/seeds/specs/hard/backend/19-query-index-sql-protocol.md +68 -0
  306. package/seeds/specs/hard/backend/20-transaction-boundary-protocol.md +68 -0
  307. package/seeds/specs/hard/backend/21-concurrency-locking-protocol.md +68 -0
  308. package/seeds/specs/hard/backend/22-idempotency-protocol.md +68 -0
  309. package/seeds/specs/hard/backend/23-cache-redis-consistency-protocol.md +68 -0
  310. package/seeds/specs/hard/backend/24-external-integration-resilience-protocol.md +68 -0
  311. package/seeds/specs/hard/backend/25-async-job-scheduler-protocol.md +68 -0
  312. package/seeds/specs/hard/backend/26-engineering-tooling-protocol.md +68 -0
  313. package/seeds/specs/hard/backend/27-dependency-supply-chain-protocol.md +68 -0
  314. package/seeds/specs/hard/backend/28-testing-protocol.md +68 -0
  315. package/seeds/specs/hard/backend/29-observability-logging-tracing-protocol.md +68 -0
  316. package/seeds/specs/hard/backend/30-performance-capacity-protocol.md +68 -0
  317. package/seeds/specs/hard/backend/31-runtime-deployment-protocol.md +68 -0
  318. package/seeds/specs/hard/backend/32-release-versioning-rollback-protocol.md +68 -0
  319. package/seeds/specs/hard/backend/index.md +177 -0
  320. package/seeds/specs/hard/frontend/01-development-checklist-protocol.md +86 -0
  321. package/seeds/specs/hard/frontend/02-ai-generated-code-protocol.md +82 -0
  322. package/seeds/specs/hard/frontend/03-acceptance-gate-protocol.md +86 -0
  323. package/seeds/specs/hard/frontend/04-security-protocol.md +283 -0
  324. package/seeds/specs/hard/frontend/05-environment-configuration-protocol.md +80 -0
  325. package/seeds/specs/hard/frontend/06-change-governance-protocol.md +90 -0
  326. package/seeds/specs/hard/frontend/07-frontend-backend-communication-protocol.md +219 -0
  327. package/seeds/specs/hard/frontend/08-role-responsibility-protocol.md +80 -0
  328. package/seeds/specs/hard/frontend/09-module-boundary-protocol.md +81 -0
  329. package/seeds/specs/hard/frontend/10-engineering-tooling-protocol.md +89 -0
  330. package/seeds/specs/hard/frontend/11-dependency-package-management-protocol.md +87 -0
  331. package/seeds/specs/hard/frontend/12-business-rules-protocol.md +79 -0
  332. package/seeds/specs/hard/frontend/13-monetary-precision-protocol.md +81 -0
  333. package/seeds/specs/hard/frontend/14-data-model-protocol.md +85 -0
  334. package/seeds/specs/hard/frontend/15-request-api-protocol.md +87 -0
  335. package/seeds/specs/hard/frontend/16-error-handling-protocol.md +79 -0
  336. package/seeds/specs/hard/frontend/17-permission-protocol.md +79 -0
  337. package/seeds/specs/hard/frontend/18-state-management-protocol.md +88 -0
  338. package/seeds/specs/hard/frontend/19-cache-protocol.md +79 -0
  339. package/seeds/specs/hard/frontend/20-testing-protocol.md +88 -0
  340. package/seeds/specs/hard/frontend/21-design-system-protocol.md +79 -0
  341. package/seeds/specs/hard/frontend/22-theme-protocol.md +79 -0
  342. package/seeds/specs/hard/frontend/23-accessibility-protocol.md +189 -0
  343. package/seeds/specs/hard/frontend/24-component-protocol.md +80 -0
  344. package/seeds/specs/hard/frontend/25-page-structure-protocol.md +79 -0
  345. package/seeds/specs/hard/frontend/26-style-layout-protocol.md +80 -0
  346. package/seeds/specs/hard/frontend/27-rendering-state-protocol.md +81 -0
  347. package/seeds/specs/hard/frontend/28-form-protocol.md +88 -0
  348. package/seeds/specs/hard/frontend/29-routing-url-protocol.md +79 -0
  349. package/seeds/specs/hard/frontend/30-data-grid-protocol.md +83 -0
  350. package/seeds/specs/hard/frontend/31-performance-protocol.md +137 -0
  351. package/seeds/specs/hard/frontend/32-file-import-export-protocol.md +80 -0
  352. package/seeds/specs/hard/frontend/33-release-versioning-protocol.md +79 -0
  353. package/seeds/specs/hard/frontend/34-monitoring-logging-protocol.md +128 -0
  354. package/seeds/specs/hard/frontend/35-mock-protocol.md +97 -0
  355. package/seeds/specs/hard/frontend/36-feature-flag-protocol.md +79 -0
  356. package/seeds/specs/hard/frontend/37-browser-device-compatibility-protocol.md +83 -0
  357. package/seeds/specs/hard/frontend/38-internationalization-protocol.md +243 -0
  358. package/seeds/specs/hard/frontend/39-copywriting-protocol.md +79 -0
  359. package/seeds/specs/hard/frontend/40-analytics-protocol.md +98 -0
  360. package/seeds/specs/hard/frontend/41-design-handoff-protocol.md +80 -0
  361. package/seeds/specs/hard/frontend/42-browser-runtime-lifecycle-protocol.md +86 -0
  362. package/seeds/specs/hard/frontend/43-time-temporal-protocol.md +86 -0
  363. package/seeds/specs/hard/frontend/44-privacy-data-lifecycle-protocol.md +87 -0
  364. package/seeds/specs/hard/frontend/45-browser-storage-protocol.md +87 -0
  365. package/seeds/specs/hard/frontend/index.md +308 -0
  366. package/seeds/specs/hard/stacks/java/index.md +20 -0
  367. package/seeds/specs/hard/stacks/java/java-language-overlay.md +35 -0
  368. package/seeds/specs/hard/stacks/jpa/index.md +20 -0
  369. package/seeds/specs/hard/stacks/jpa/jpa-persistence-overlay.md +35 -0
  370. package/seeds/specs/hard/stacks/kubernetes-ingress/index.md +20 -0
  371. package/seeds/specs/hard/stacks/kubernetes-ingress/kubernetes-ingress-overlay.md +35 -0
  372. package/seeds/specs/hard/stacks/messaging/index.md +20 -0
  373. package/seeds/specs/hard/stacks/messaging/messaging-reliability-overlay.md +35 -0
  374. package/seeds/specs/hard/stacks/mybatis/index.md +20 -0
  375. package/seeds/specs/hard/stacks/mybatis/mybatis-persistence-overlay.md +35 -0
  376. package/seeds/specs/hard/stacks/mysql/index.md +20 -0
  377. package/seeds/specs/hard/stacks/mysql/mysql-database-overlay.md +35 -0
  378. package/seeds/specs/hard/stacks/nginx/index.md +20 -0
  379. package/seeds/specs/hard/stacks/nginx/nginx-proxy-overlay.md +35 -0
  380. package/seeds/specs/hard/stacks/postgresql/index.md +20 -0
  381. package/seeds/specs/hard/stacks/postgresql/postgresql-database-overlay.md +35 -0
  382. package/seeds/specs/hard/stacks/redis/index.md +20 -0
  383. package/seeds/specs/hard/stacks/redis/redis-cache-overlay.md +35 -0
  384. package/seeds/specs/hard/stacks/spring-batch/index.md +20 -0
  385. package/seeds/specs/hard/stacks/spring-batch/spring-batch-job-overlay.md +35 -0
  386. package/seeds/specs/hard/stacks/spring-boot/index.md +20 -0
  387. package/seeds/specs/hard/stacks/spring-boot/spring-boot-application-overlay.md +35 -0
  388. package/seeds/specs/hard/stacks/spring-mvc/index.md +20 -0
  389. package/seeds/specs/hard/stacks/spring-mvc/spring-mvc-web-overlay.md +35 -0
  390. package/seeds/specs/hard/stacks/spring-webflux/index.md +20 -0
  391. package/seeds/specs/hard/stacks/spring-webflux/spring-webflux-reactive-overlay.md +35 -0
  392. package/seeds/specs/hard/stacks/tomcat/index.md +20 -0
  393. package/seeds/specs/hard/stacks/tomcat/tomcat-runtime-overlay.md +35 -0
@@ -0,0 +1,81 @@
1
+ ---
2
+ seed_source: pomaster/components/frontend-hard-spec/assets/universal/13-monetary-precision-protocol.md
3
+ seed_source_sha256: 4930246c7dfed2751d3a71d617a21e24b46b376131723451b39152582c7a3d4f
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
+ # 13 金额精度协议
14
+
15
+ ## Scope
16
+
17
+ P1。定义金额、单价、成本、汇率、比例和汇总的传输、计算、比较、展示与导出精度。
18
+
19
+ ## Non-Scope
20
+
21
+ 不定义业务公式、税务政策、币种范围或最终结算口径。
22
+
23
+ ## Terms
24
+
25
+ - Amount:十进制定点值。
26
+ - Currency:正式币种标识。
27
+ - Scale:小数位数量。
28
+ - Rounding Mode/Stage:舍入方式与时点。
29
+
30
+ ## MUST
31
+
32
+ - 金额声明 amount、currency、scale 和舍入规则。
33
+ - 传输使用十进制字符串或无歧义最小单位整数。
34
+ - 权威计算使用 Decimal/BigDecimal 等十进制能力。
35
+ - 区分原始、计算、展示和导出值。
36
+ - 汇总按正式顺序计算和舍入。
37
+ - 百分比声明传输倍率。
38
+
39
+ ## MUST NOT
40
+
41
+ - MUST NOT 使用二进制浮点执行正式金额累计、乘除和相等比较。
42
+ - MUST NOT 用 `toFixed` 代替十进制计算。
43
+ - MUST NOT 混合币种直接求和。
44
+ - MUST NOT 页面、报表、导出各自决定精度。
45
+
46
+ ## SHOULD
47
+
48
+ - SHOULD 使用统一 Money/Decimal 类型、parser 和 formatter。
49
+ - SHOULD 测试负数、极值、尾数 5、汇总和跨币种边界。
50
+
51
+ ## Contract
52
+
53
+ ```text
54
+ Money { amount: decimal-string, currency: string, scale: integer }
55
+ Rule { calculationScale, displayScale, roundingMode, roundingStage }
56
+ ```
57
+
58
+ ## Checklist
59
+
60
+ - [ ] amount/currency/scale/rounding 完整。
61
+ - [ ] 未使用浮点做正式计算。
62
+ - [ ] 展示、汇总和导出一致。
63
+ - [ ] 比例和跨币种语义明确。
64
+
65
+ ## Examples
66
+
67
+ ### 内容示例,可删除
68
+
69
+ 保留接口金额字符串,通过统一 formatter 展示,不先转为浮点数。
70
+
71
+ ## Anti-patterns
72
+
73
+ 用 `parseFloat` 累加成本,再 `toFixed(2)` 生成正式报表。
74
+
75
+ ## Ownership
76
+
77
+ 业务/财务定义口径,后端负责权威计算,前端负责无损传输,QA 验证边界。
78
+
79
+ ## Change Policy
80
+
81
+ 精度、币种、舍入或比例语义变化属于破坏性契约变更,必须同步全链路。
@@ -0,0 +1,85 @@
1
+ ---
2
+ seed_source: pomaster/components/frontend-hard-spec/assets/universal/14-data-model-protocol.md
3
+ seed_source_sha256: 7d4e31ef04a1f57d88e982c01dabc22c421bafc850b7295a73d084ec3c6fc838
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
+ # 14 数据模型协议
14
+
15
+ ## Scope
16
+
17
+ P1。定义 API DTO、Adapter、Domain Model、ViewModel、FormModel 和 RowModel 的分层。
18
+
19
+ ## Non-Scope
20
+
21
+ 不定义接口传输协议或具体业务公式,不允许模型层承担页面布局。
22
+
23
+ ## Terms
24
+
25
+ - DTO:接口原始结构。
26
+ - Adapter:边界转换函数。
27
+ - Domain Model:稳定业务语义模型。
28
+ - ViewModel:面向展示或交互的模型。
29
+
30
+ ## MUST
31
+
32
+ - 使用 `DTO -> Adapter -> Domain Model -> View/Form/Row Model` 链路。
33
+ - 明确类型命名、位置、Owner 和公开边界。
34
+ - 空值、未知枚举、日期、金额和单位在边界统一处理。
35
+ - API、浏览器存储、跨窗口消息、运行时配置和第三方 SDK 等外部数据必须在信任边界执行 schema 校验后再转换;失败时保守降级并产生安全监控。
36
+ - opaque ID、超出 JavaScript safe integer 的整数和高精度数值必须使用不会静默丢失精度的传输与模型类型。
37
+ - 后端字段变化优先只影响契约和 adapter。
38
+ - adapter 有正常、空值、未知值和边界测试。
39
+
40
+ ## MUST NOT
41
+
42
+ - MUST NOT 让 DTO 穿透公共组件、模板或列定义。
43
+ - MUST NOT 在页面重复字段转换和兜底。
44
+ - MUST NOT 使用万能对象代替类型。
45
+ - MUST NOT 在模型转换中隐藏正式业务计算。
46
+ - MUST NOT 用 TypeScript 类型、类型断言或生成类型替代运行时外部数据校验。
47
+ - MUST NOT 把 opaque ID 或大整数转成可能丢失精度的 `number`。
48
+
49
+ ## SHOULD
50
+
51
+ - SHOULD 使用 schema 校验外部数据。
52
+ - SHOULD 为未知枚举保留安全兜底和监控。
53
+
54
+ ## Contract
55
+
56
+ ```text
57
+ SourceDTO, RuntimeSchema, Adapter, DomainModel, ConsumerModel,
58
+ NullPolicy, EnumPolicy, IdentifierPolicy, PrecisionPolicy, FormatPolicy, Owner
59
+ ```
60
+
61
+ ## Checklist
62
+
63
+ - [ ] 模型层次明确。
64
+ - [ ] 外部数据已校验转换。
65
+ - [ ] 组件只消费稳定模型。
66
+ - [ ] adapter 测试完整。
67
+ - [ ] 外部数据校验失败和大整数/opaque ID 已覆盖。
68
+
69
+ ## Examples
70
+
71
+ ### 内容示例,可删除
72
+
73
+ API 的 snake_case DTO 经 adapter 转成稳定 Domain Model,再生成表格 RowModel。
74
+
75
+ ## Anti-patterns
76
+
77
+ 模板直接访问后端字段并在多个单元格各自处理 null 和枚举。
78
+
79
+ ## Ownership
80
+
81
+ API Owner 维护 DTO,领域 Owner 维护 Domain Model,前端模块 Owner 维护 adapter/ViewModel。
82
+
83
+ ## Change Policy
84
+
85
+ 模型字段变化必须说明兼容、迁移和受影响消费者;公共模型不得静默改语义。
@@ -0,0 +1,87 @@
1
+ ---
2
+ seed_source: pomaster/components/frontend-hard-spec/assets/universal/15-request-api-protocol.md
3
+ seed_source_sha256: b9489d69e35a19b8d5ba2442108190e7b99989ef471c8cf413d9e4e408ca2969
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
+ # 15 请求与 API 协议
14
+
15
+ ## Scope
16
+
17
+ P1。定义正式契约进入前端后的请求封装、取消、重试、loading、错误归一化和 API 函数。
18
+
19
+ ## Non-Scope
20
+
21
+ 不定义后端接口本身,不负责页面错误文案和缓存业务规则。
22
+
23
+ ## Terms
24
+
25
+ - HTTP Client:统一传输基础设施。
26
+ - Domain API:面向业务语义的请求函数。
27
+ - Request Context:认证、语言、trace、幂等等上下文。
28
+
29
+ ## MUST
30
+
31
+ - 页面只调用封装的 Domain API。
32
+ - HTTP Client 统一处理 base URL、认证、超时、取消、trace 和 envelope。
33
+ - 请求函数使用稳定领域动词命名并有类型。
34
+ - 查询可取消和丢弃过期响应。
35
+ - mutation 明确幂等和重试边界。
36
+ - 错误转换为统一结构。
37
+ - 传输成功与业务成功必须分别判断;HTTP 非成功状态、契约解析失败、取消、超时、离线和业务错误不得混为一类。
38
+ - 重试必须服从幂等性、服务端 `Retry-After` 或受控退避,并能取消;取消或已被替代的请求不得提示为用户错误。
39
+ - 请求结果提交前必须验证身份、租户、权限、参数和请求版本,防止旧上下文结果写回。
40
+ - endpoint、redirect 和 base URL 只能来自受控配置或契约,不得由不可信 URL 参数直接拼接。
41
+
42
+ ## MUST NOT
43
+
44
+ - MUST NOT 在页面直接写 fetch/axios 或拼 endpoint。
45
+ - MUST NOT 多处重复 token、错误码和重试逻辑。
46
+ - MUST NOT 对非幂等 mutation 默认自动重试。
47
+ - MUST NOT 让组件解析原始响应 envelope。
48
+ - MUST NOT 把“网络在线”提示当成请求成功证明,或假设 HTTP 404/500 一定以 Promise rejection 表现。
49
+
50
+ ## SHOULD
51
+
52
+ - SHOULD 通过生成客户端或 typed adapter 对接正式契约。
53
+ - SHOULD 让 loading 来源唯一,避免重复状态。
54
+
55
+ ## Contract
56
+
57
+ ```text
58
+ FunctionName, InputType, OutputType, ErrorType,
59
+ StatusPolicy, Cancellation, Retry, RetryAfter, Idempotency,
60
+ ContextVersion, LateResultGuard, Trace
61
+ ```
62
+
63
+ ## Checklist
64
+
65
+ - [ ] 页面只使用 Domain API。
66
+ - [ ] 类型和错误统一。
67
+ - [ ] 取消、重试、幂等明确。
68
+ - [ ] 无重复 loading/认证逻辑。
69
+ - [ ] 状态判断、旧结果防护和 endpoint 来源明确。
70
+
71
+ ## Examples
72
+
73
+ ### 内容示例,可删除
74
+
75
+ `getEntityList(query, signal)` 返回稳定分页模型,调用方不认识 endpoint 和 envelope。
76
+
77
+ ## Anti-patterns
78
+
79
+ 每个页面各自创建请求实例、刷新 token 并比较 message。
80
+
81
+ ## Ownership
82
+
83
+ 平台 Owner 维护 HTTP Client,领域 Owner 维护 Domain API,契约 Owner 维护类型来源。
84
+
85
+ ## Change Policy
86
+
87
+ 客户端公共行为变化必须评估全部请求;函数破坏性变化提供迁移和弃用期。
@@ -0,0 +1,79 @@
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、监控和测试。
@@ -0,0 +1,79 @@
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
+ 权限码和数据范围变化必须同步菜单、路由、缓存、接口、测试和审计。
@@ -0,0 +1,88 @@
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
+ 状态位置或持久化变化必须提供迁移、清理和兼容策略,尤其是用户隔离数据。
@@ -0,0 +1,79 @@
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 改变必须版本化并提供迁移/清理。
@@ -0,0 +1,88 @@
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
+ 删除测试必须证明行为已删除或由等价测试覆盖;门禁测试降级需批准。