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.
- package/README.md +102 -183
- package/catalog/catalog-lock.draft.json +117 -117
- package/catalog/policies/policy.ai.change_plan_first.json +1 -1
- package/catalog/policies/policy.ai.fact_inference_separation.json +1 -1
- package/catalog/policies/policy.ai.read_search_verify_before_write.json +1 -1
- package/catalog/policies/policy.ai.rule_relaxation_approval.json +1 -1
- package/catalog/policies/policy.arch.adr_immutable_history.json +1 -1
- package/catalog/policies/policy.arch.no_convenience_over_boundary.json +1 -1
- package/catalog/policies/policy.arch.prefer_verifiable_option.json +2 -2
- package/catalog/policies/policy.authz.no_gating_proxy_trust.json +1 -1
- package/catalog/policies/policy.authz.permission_scope_expansion_gate.json +1 -1
- package/catalog/policies/policy.authz.server_five_factor_verification.json +1 -1
- package/catalog/policies/policy.be.conc.prefer_db_constraints.json +1 -1
- package/catalog/policies/policy.be.db.expand_migrate_contract.json +1 -1
- package/catalog/policies/policy.be.idem.key_payload_conflict.json +1 -1
- package/catalog/policies/policy.be.model.single_boundary_conversion.json +1 -1
- package/catalog/policies/policy.be.sql.index_for_known_queries.json +1 -1
- package/catalog/policies/policy.be.state.single_rule_source.json +1 -1
- package/catalog/policies/policy.be.txn.short_locks_compensation.json +1 -1
- package/catalog/policies/policy.bound.search_first_entry_only.json +1 -1
- package/catalog/policies/policy.boundary.validate_in_encode_out.json +1 -1
- package/catalog/policies/policy.cache.failure_mode_guards.json +1 -1
- package/catalog/policies/policy.cache.schema_versioning.json +1 -1
- package/catalog/policies/policy.cfg.config_attribute_completeness.json +1 -1
- package/catalog/policies/policy.cfg.key_rename_dual_read.json +1 -1
- package/catalog/policies/policy.cfg.no_secret_dispersal.json +1 -1
- package/catalog/policies/policy.cfg.production_safe_defaults.json +1 -1
- package/catalog/policies/policy.cfg.schema_backed_config.json +1 -1
- package/catalog/policies/policy.chg.no_unrelated_changes.json +1 -1
- package/catalog/policies/policy.contract.no_invented_facts.json +1 -1
- package/catalog/policies/policy.dep.build_path_supply_chain.json +1 -1
- package/catalog/policies/policy.dep.no_untrusted_source_no_lock_bypass.json +1 -1
- package/catalog/policies/policy.dep.time_boxed_urgent_exception.json +1 -1
- package/catalog/policies/policy.deploy.no_dev_env_as_production_fact.json +1 -1
- package/catalog/policies/policy.deploy.operational_capabilities.json +1 -1
- package/catalog/policies/policy.deploy.runtime_fact_record.json +1 -1
- package/catalog/policies/policy.err.failure_five_part_mapping.json +1 -1
- package/catalog/policies/policy.err.no_internal_detail_exposure.json +1 -1
- package/catalog/policies/policy.err.published_code_immutable.json +1 -1
- package/catalog/policies/policy.evid.acceptance_binds_verifiable_evidence.json +1 -1
- package/catalog/policies/policy.evid.no_silent_gate_removal.json +1 -1
- package/catalog/policies/policy.evid.no_unverifiable_pass.json +1 -1
- package/catalog/policies/policy.flag.cleanup_after_full_rollout.json +1 -1
- package/catalog/policies/policy.flag.consistent_off_state.json +1 -1
- package/catalog/policies/policy.flag.kill_switch.json +1 -1
- package/catalog/policies/policy.flag.lifecycle_metadata.json +1 -1
- package/catalog/policies/policy.flag.not_a_permission.json +1 -1
- package/catalog/policies/policy.gate.p0_non_bypassable.json +1 -1
- package/catalog/policies/policy.gate.risk_factors_confirmed.json +1 -1
- package/catalog/policies/policy.guard.no_check_weakening.json +2 -2
- package/catalog/policies/policy.integration.call_definition_minimum.json +1 -1
- package/catalog/policies/policy.integration.fault_containment.json +1 -1
- package/catalog/policies/policy.job.lifecycle_definition.json +1 -1
- package/catalog/policies/policy.job.no_unmanaged_execution.json +1 -1
- package/catalog/policies/policy.job.operational_features.json +1 -1
- package/catalog/policies/policy.obs.actionable_signals.json +1 -1
- package/catalog/policies/policy.obs.alert_with_owner.json +1 -1
- package/catalog/policies/policy.obs.context_field_baseline.json +1 -1
- package/catalog/policies/policy.obs.no_sensitive_or_unbounded_logging.json +1 -1
- package/catalog/policies/policy.obs.no_sensitive_raw_values.json +1 -1
- package/catalog/policies/policy.obs.signal_change_impact.json +1 -1
- package/catalog/policies/policy.obs.source_map_access_control.json +1 -1
- package/catalog/policies/policy.obs.telemetry_lifecycle_declared.json +1 -1
- package/catalog/policies/policy.obs.trace_correlation.json +1 -1
- package/catalog/policies/policy.perf.budget_change_retest.json +1 -1
- package/catalog/policies/policy.perf.evidence_binding.json +1 -1
- package/catalog/policies/policy.perf.observation_dimensions.json +1 -1
- package/catalog/policies/policy.proc.checklist_change_policy.json +2 -2
- package/catalog/policies/policy.proc.scope_drift_reclassify.json +1 -1
- package/catalog/policies/policy.prv.processing_scope_re_review.json +1 -1
- package/catalog/policies/policy.prv.sensitive_data_six_facts.json +1 -1
- package/catalog/policies/policy.registry.human_fields_validated_decorrelated.json +1 -1
- package/catalog/policies/policy.rel.no_irreversible_unmonitored_full_release.json +1 -1
- package/catalog/policies/policy.rel.observability_before_ship.json +1 -1
- package/catalog/policies/policy.rel.process_change_needs_drill_audit.json +1 -1
- package/catalog/policies/policy.rel.traceable_build.json +1 -1
- package/catalog/policies/policy.role.human_signs_for_ai.json +1 -1
- package/catalog/policies/policy.sec.authn_policy_unified.json +1 -1
- package/catalog/policies/policy.sec.no_client_side_trust.json +4 -1
- package/catalog/policies/policy.sec.no_longterm_security_disable.json +1 -1
- package/catalog/policies/policy.sec.no_script_readable_credentials.json +1 -1
- package/catalog/policies/policy.sec.no_secrets_in_client_surface.json +2 -2
- package/catalog/policies/policy.sec.relaxation_approval.json +1 -1
- package/catalog/policies/policy.sec.security_relaxation_gate.json +4 -1
- package/catalog/policies/policy.sec.trust_boundary_enforcement.json +4 -1
- package/catalog/policies/policy.sec.upload_download_server_recheck.json +1 -1
- package/catalog/policies/policy.sec.url_source_allowlist.json +1 -1
- package/catalog/policies/policy.spec.family_conflict_precedence.json +1 -1
- package/catalog/policies/policy.spec.freeze_before_use.json +1 -1
- package/catalog/policies/policy.spec.primary_source_basis.json +1 -1
- package/catalog/policies/policy.struct.module_entry_dependency_declared.json +1 -1
- package/catalog/policies/policy.struct.no_unexplained_top_level_dir.json +1 -1
- package/catalog/policies/policy.struct.reuse_proven_structure.json +1 -1
- package/catalog/policies/policy.test.control_nondeterminism_keep_diagnosis.json +1 -1
- package/catalog/policies/policy.test.isolation_and_cleanup.json +1 -1
- package/catalog/policies/policy.test.no_synthetic_stability.json +1 -1
- package/catalog/policies/policy.test.pyramid_and_ci_matrix.json +1 -1
- package/catalog/policies/policy.test.removal_justification.json +1 -1
- package/catalog/policies/policy.test.removal_needs_substitute_evidence.json +1 -1
- package/catalog/policies/policy.test.risk_driven_plan.json +1 -1
- package/catalog/policies/policy.test.stable_observable_assertions.json +1 -1
- package/catalog/policies/policy.tool.discoverable_toolchain.json +1 -1
- package/catalog/policies/policy.tool.no_hand_edit_generated_no_ci_drift.json +1 -1
- package/catalog/policies/policy.tool.no_vendored_body_edits.json +1 -1
- package/catalog/policies/policy.tool.upgrade_verify_lock_rollback.json +1 -1
- package/catalog/policies/policy.web.comp.no_trivial_or_god_component.json +1 -1
- package/catalog/policies/policy.web.comp.public_contract_completeness.json +1 -1
- package/catalog/policies/policy.web.copy.action_object_clarity.json +1 -1
- package/catalog/policies/policy.web.copy.enumerable_placement.json +1 -1
- package/catalog/policies/policy.web.copy.error_next_step.json +1 -1
- package/catalog/policies/policy.web.handoff.state_matrix_full.json +1 -1
- package/catalog/policies/policy.web.i18n.copy_key_discipline.json +1 -1
- package/catalog/policies/policy.web.i18n.raw_value_for_compute.json +1 -1
- package/catalog/policies/policy.web.page.region_consistency.json +1 -1
- package/catalog/policies/policy.web.track.attempt_result_correlation.json +1 -1
- package/catalog/policies/policy.web.track.no_synthetic_actions.json +1 -1
- package/catalog/policies/policy.web.track.typed_client_validation.json +1 -1
- package/catalog/policies/policy.wf.no_planned_as_verified.json +1 -1
- package/catalog/policies/policy.wf.task_facts_preconfirm.json +1 -1
- package/dist/bin.js +11233 -7336
- package/legal/THIRD_PARTY_NOTICES.md +461 -35
- package/package.json +1 -1
- package/seeds/aggregation-manifest.json +691 -0
- package/seeds/manifest.json +466 -1043
- package/seeds/specs/hard/stacks/antdesign/antdesign-ui-overlay.md +48 -0
- package/seeds/specs/hard/stacks/antdesign/index.md +20 -0
- package/seeds/specs/hard/stacks/css/css-system-overlay.md +52 -0
- package/seeds/specs/hard/stacks/css/index.md +20 -0
- package/seeds/specs/hard/stacks/geist/geist-design-system-overlay.md +48 -0
- package/seeds/specs/hard/stacks/geist/index.md +20 -0
- package/seeds/specs/hard/stacks/vue3/index.md +20 -0
- package/seeds/specs/hard/stacks/vue3/vue3-framework-overlay.md +71 -0
- package/seeds/specs/hard/themes/ai-generated-code.md +171 -0
- package/seeds/specs/hard/themes/api-contract-and-error-semantics.md +532 -0
- package/seeds/specs/hard/themes/architecture-and-module-boundaries.md +323 -0
- package/seeds/specs/hard/themes/data-and-transactions.md +582 -0
- package/seeds/specs/hard/themes/engineering-toolchain-and-dependencies.md +333 -0
- package/seeds/specs/hard/themes/environment-and-configuration.md +196 -0
- package/seeds/specs/hard/themes/frontend-state-and-client-data.md +342 -0
- package/seeds/specs/hard/themes/index.md +374 -0
- package/seeds/specs/hard/themes/integration-and-async-runtime.md +331 -0
- package/seeds/specs/hard/{frontend/38-internationalization-protocol.md → themes/internationalization-and-copywriting.md} +112 -5
- package/seeds/specs/hard/themes/observability-and-analytics.md +305 -0
- package/seeds/specs/hard/themes/page-composition-and-browser-environment.md +554 -0
- package/seeds/specs/hard/{frontend/31-performance-protocol.md → themes/performance-and-capacity.md} +95 -6
- package/seeds/specs/hard/themes/permission-and-authorization.md +168 -0
- package/seeds/specs/hard/themes/privacy-and-data-lifecycle.md +176 -0
- package/seeds/specs/hard/themes/release-and-feature-flags.md +237 -0
- package/seeds/specs/hard/{frontend/04-security-protocol.md → themes/security.md} +95 -6
- package/seeds/specs/hard/themes/task-governance-and-acceptance.md +554 -0
- package/seeds/specs/hard/themes/testing-and-verification.md +266 -0
- package/seeds/specs/hard/themes/ui-presentation-and-design.md +670 -0
- package/seeds/specs/hard/themes/value-semantics-and-domain-data.md +339 -0
- package/seeds/specs/hard/backend/01-architecture-governance-protocol.md +0 -68
- package/seeds/specs/hard/backend/02-project-structure-governance-protocol.md +0 -68
- package/seeds/specs/hard/backend/03-directory-boundary-protocol.md +0 -68
- package/seeds/specs/hard/backend/04-layering-architecture-protocol.md +0 -68
- package/seeds/specs/hard/backend/05-task-workflow-protocol.md +0 -68
- package/seeds/specs/hard/backend/06-ai-generated-code-protocol.md +0 -68
- package/seeds/specs/hard/backend/07-evidence-acceptance-protocol.md +0 -68
- package/seeds/specs/hard/backend/08-contract-change-protocol.md +0 -68
- package/seeds/specs/hard/backend/09-role-responsibility-protocol.md +0 -68
- package/seeds/specs/hard/backend/10-security-protocol.md +0 -68
- package/seeds/specs/hard/backend/11-environment-configuration-protocol.md +0 -67
- package/seeds/specs/hard/backend/12-api-contract-protocol.md +0 -68
- package/seeds/specs/hard/backend/13-privacy-data-lifecycle-protocol.md +0 -68
- package/seeds/specs/hard/backend/14-business-rules-state-protocol.md +0 -68
- package/seeds/specs/hard/backend/15-data-model-protocol.md +0 -68
- package/seeds/specs/hard/backend/16-error-code-protocol.md +0 -68
- package/seeds/specs/hard/backend/17-permission-authorization-protocol.md +0 -68
- package/seeds/specs/hard/backend/18-database-schema-migration-protocol.md +0 -68
- package/seeds/specs/hard/backend/19-query-index-sql-protocol.md +0 -68
- package/seeds/specs/hard/backend/20-transaction-boundary-protocol.md +0 -68
- package/seeds/specs/hard/backend/21-concurrency-locking-protocol.md +0 -68
- package/seeds/specs/hard/backend/22-idempotency-protocol.md +0 -68
- package/seeds/specs/hard/backend/23-cache-redis-consistency-protocol.md +0 -68
- package/seeds/specs/hard/backend/24-external-integration-resilience-protocol.md +0 -68
- package/seeds/specs/hard/backend/25-async-job-scheduler-protocol.md +0 -68
- package/seeds/specs/hard/backend/26-engineering-tooling-protocol.md +0 -68
- package/seeds/specs/hard/backend/27-dependency-supply-chain-protocol.md +0 -68
- package/seeds/specs/hard/backend/28-testing-protocol.md +0 -68
- package/seeds/specs/hard/backend/29-observability-logging-tracing-protocol.md +0 -68
- package/seeds/specs/hard/backend/30-performance-capacity-protocol.md +0 -68
- package/seeds/specs/hard/backend/31-runtime-deployment-protocol.md +0 -68
- package/seeds/specs/hard/backend/32-release-versioning-rollback-protocol.md +0 -68
- package/seeds/specs/hard/backend/index.md +0 -177
- package/seeds/specs/hard/frontend/01-development-checklist-protocol.md +0 -86
- package/seeds/specs/hard/frontend/02-ai-generated-code-protocol.md +0 -82
- package/seeds/specs/hard/frontend/03-acceptance-gate-protocol.md +0 -86
- package/seeds/specs/hard/frontend/05-environment-configuration-protocol.md +0 -80
- package/seeds/specs/hard/frontend/06-change-governance-protocol.md +0 -90
- package/seeds/specs/hard/frontend/07-frontend-backend-communication-protocol.md +0 -219
- package/seeds/specs/hard/frontend/08-role-responsibility-protocol.md +0 -80
- package/seeds/specs/hard/frontend/09-module-boundary-protocol.md +0 -81
- package/seeds/specs/hard/frontend/10-engineering-tooling-protocol.md +0 -89
- package/seeds/specs/hard/frontend/11-dependency-package-management-protocol.md +0 -87
- package/seeds/specs/hard/frontend/12-business-rules-protocol.md +0 -79
- package/seeds/specs/hard/frontend/13-monetary-precision-protocol.md +0 -81
- package/seeds/specs/hard/frontend/14-data-model-protocol.md +0 -85
- package/seeds/specs/hard/frontend/15-request-api-protocol.md +0 -87
- package/seeds/specs/hard/frontend/16-error-handling-protocol.md +0 -79
- package/seeds/specs/hard/frontend/17-permission-protocol.md +0 -79
- package/seeds/specs/hard/frontend/18-state-management-protocol.md +0 -88
- package/seeds/specs/hard/frontend/19-cache-protocol.md +0 -79
- package/seeds/specs/hard/frontend/20-testing-protocol.md +0 -88
- package/seeds/specs/hard/frontend/21-design-system-protocol.md +0 -79
- package/seeds/specs/hard/frontend/22-theme-protocol.md +0 -79
- package/seeds/specs/hard/frontend/23-accessibility-protocol.md +0 -189
- package/seeds/specs/hard/frontend/24-component-protocol.md +0 -80
- package/seeds/specs/hard/frontend/25-page-structure-protocol.md +0 -79
- package/seeds/specs/hard/frontend/26-style-layout-protocol.md +0 -80
- package/seeds/specs/hard/frontend/27-rendering-state-protocol.md +0 -81
- package/seeds/specs/hard/frontend/28-form-protocol.md +0 -88
- package/seeds/specs/hard/frontend/29-routing-url-protocol.md +0 -79
- package/seeds/specs/hard/frontend/30-data-grid-protocol.md +0 -83
- package/seeds/specs/hard/frontend/32-file-import-export-protocol.md +0 -80
- package/seeds/specs/hard/frontend/33-release-versioning-protocol.md +0 -79
- package/seeds/specs/hard/frontend/34-monitoring-logging-protocol.md +0 -128
- package/seeds/specs/hard/frontend/35-mock-protocol.md +0 -97
- package/seeds/specs/hard/frontend/36-feature-flag-protocol.md +0 -79
- package/seeds/specs/hard/frontend/37-browser-device-compatibility-protocol.md +0 -83
- package/seeds/specs/hard/frontend/39-copywriting-protocol.md +0 -79
- package/seeds/specs/hard/frontend/40-analytics-protocol.md +0 -98
- package/seeds/specs/hard/frontend/41-design-handoff-protocol.md +0 -80
- package/seeds/specs/hard/frontend/42-browser-runtime-lifecycle-protocol.md +0 -86
- package/seeds/specs/hard/frontend/43-time-temporal-protocol.md +0 -86
- package/seeds/specs/hard/frontend/44-privacy-data-lifecycle-protocol.md +0 -87
- package/seeds/specs/hard/frontend/45-browser-storage-protocol.md +0 -87
- package/seeds/specs/hard/frontend/index.md +0 -308
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
---
|
|
2
|
+
seed_source: packages/cli/seeds/aggregation-manifest.json
|
|
3
|
+
seed_source_sha256: 039b637ccffacdfe3ce30d85e193f4b38928fcdfb16efdc4eb255e35e05af91f
|
|
4
|
+
seed_version: B7-THEME
|
|
5
|
+
lane: [frontend, backend]
|
|
6
|
+
status: CURRENT
|
|
7
|
+
authority_scope: mixed_required_and_advisory
|
|
8
|
+
applies_to: [frontend, backend]
|
|
9
|
+
related_evidence_specs: []
|
|
10
|
+
related_tools: []
|
|
11
|
+
legacy_id: theme:architecture-and-module-boundaries
|
|
12
|
+
criticality: critical # 聚合注记:取源最高;info 性注记非执行语义
|
|
13
|
+
injection_mode: mixed # 聚合注记:来源值混合;info 性注记非执行语义
|
|
14
|
+
stages: [prepare, implement, check] # 聚合注记:来源 stages 并集;info 性注记非执行语义
|
|
15
|
+
triggers: [architecture, technology-baseline, deployment-topology, project-structure, module-layout, layering, module-boundary, domain-design] # 聚合注记:来源 triggers 并集;info 性注记非执行语义
|
|
16
|
+
requires: [] # 聚合注记:来源 requires 并集(全空)
|
|
17
|
+
x-aggregation: # 聚合来源(D6):逐源 vendor pin(sha256 与卡 vendor_pin 同值)
|
|
18
|
+
- seed_source: pomaster/components/frontend-hard-spec/assets/universal/09-module-boundary-protocol.md
|
|
19
|
+
sha256: f9a3c194910bbb31cd322849cb277db5d2ae0fd74773eef7df34197b8ad89c4f
|
|
20
|
+
seed_version: B6B-1
|
|
21
|
+
- seed_source: pomaster/components/backend-hard-spec/assets/universal/01-architecture-governance-protocol.md
|
|
22
|
+
sha256: 726502f4e5a5dcf2e8076fafa943b33de4b7ab9bd0fc2d8551479b43385e7636
|
|
23
|
+
seed_version: B6C
|
|
24
|
+
- seed_source: pomaster/components/backend-hard-spec/assets/universal/02-project-structure-governance-protocol.md
|
|
25
|
+
sha256: add6e21ffa5dd45940dda725e8d4e234c9d2a49775139c895cc7ad5f7caf7bf0
|
|
26
|
+
seed_version: B6C
|
|
27
|
+
- seed_source: pomaster/components/backend-hard-spec/assets/universal/03-directory-boundary-protocol.md
|
|
28
|
+
sha256: 95a917cfe3c929b5a0a40de5f6215b25ef4a358a4e7f1c7cb2daa08defcf6bcc
|
|
29
|
+
seed_version: B6C
|
|
30
|
+
- seed_source: pomaster/components/backend-hard-spec/assets/universal/04-layering-architecture-protocol.md
|
|
31
|
+
sha256: 4a2ab2aa695a7b78136a2fd96076a869c367bb008a417be508756c632ad4ed6e
|
|
32
|
+
seed_version: B6C
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
# 架构与模块边界
|
|
36
|
+
|
|
37
|
+
> **聚合纪律**:本文档 12 节正文规则行逐字取自 frontmatter x-aggregation 所列来源协议(节内按「端 → 源编号升序」以加粗来源行分块,源内标题与层级原样保留),零新增、零改写、零删除;新增文本仅限文档标题、本注记与逐节来源行。
|
|
38
|
+
|
|
39
|
+
## Scope
|
|
40
|
+
|
|
41
|
+
**源:FE 09 模块边界协议(pomaster/components/frontend-hard-spec/assets/universal/09-module-boundary-protocol.md)**
|
|
42
|
+
|
|
43
|
+
P0。定义顶层目录职责、依赖方向、公开入口、shared 下沉和跨模块协作。
|
|
44
|
+
|
|
45
|
+
**源:BE 01 架构治理协议(pomaster/components/backend-hard-spec/assets/universal/01-architecture-governance-protocol.md)**
|
|
46
|
+
|
|
47
|
+
规范系统边界、架构层级、技术决策、ADR 与演进门禁。
|
|
48
|
+
|
|
49
|
+
**源:BE 02 项目结构治理协议(pomaster/components/backend-hard-spec/assets/universal/02-project-structure-governance-protocol.md)**
|
|
50
|
+
|
|
51
|
+
规范消费项目的后端目录分区、模块入口和结构检查。
|
|
52
|
+
|
|
53
|
+
**源:BE 03 目录边界协议(pomaster/components/backend-hard-spec/assets/universal/03-directory-boundary-protocol.md)**
|
|
54
|
+
|
|
55
|
+
约束实现阶段的模块目录、公开入口、依赖方向和越界识别。
|
|
56
|
+
|
|
57
|
+
**源:BE 04 分层架构协议(pomaster/components/backend-hard-spec/assets/universal/04-layering-architecture-protocol.md)**
|
|
58
|
+
|
|
59
|
+
规范 Controller、Application/Service、Domain、Repository 与 Infrastructure 的职责。
|
|
60
|
+
|
|
61
|
+
## Non-Scope
|
|
62
|
+
|
|
63
|
+
**源:FE 09 模块边界协议**
|
|
64
|
+
|
|
65
|
+
不规定具体框架目录名,不替代组件、状态或业务规则协议。
|
|
66
|
+
|
|
67
|
+
**源:BE 01 架构治理协议**
|
|
68
|
+
|
|
69
|
+
不规定具体项目的模块名、部署数量或技术版本。
|
|
70
|
+
|
|
71
|
+
**源:BE 02 项目结构治理协议**
|
|
72
|
+
|
|
73
|
+
不强制所有语言和框架采用同一目录树。
|
|
74
|
+
|
|
75
|
+
**源:BE 03 目录边界协议**
|
|
76
|
+
|
|
77
|
+
不规定某种框架的固定包名。
|
|
78
|
+
|
|
79
|
+
**源:BE 04 分层架构协议**
|
|
80
|
+
|
|
81
|
+
不要求简单系统机械创建所有层或使用特定框架注解。
|
|
82
|
+
|
|
83
|
+
## Terms
|
|
84
|
+
|
|
85
|
+
**源:FE 09 模块边界协议**
|
|
86
|
+
|
|
87
|
+
- Module:有明确职责、Owner 和公开入口的代码边界。
|
|
88
|
+
- Public API:允许其他模块依赖的最小出口。
|
|
89
|
+
- Internal:只允许模块内部使用的实现。
|
|
90
|
+
- Shared:无特定业务所有权且满足复用门槛的能力。
|
|
91
|
+
|
|
92
|
+
**源:BE 01 架构治理协议**
|
|
93
|
+
|
|
94
|
+
架构决策指影响边界、数据所有权、部署单元或公共契约的长期选择。
|
|
95
|
+
|
|
96
|
+
**源:BE 02 项目结构治理协议**
|
|
97
|
+
|
|
98
|
+
公开入口是其他模块被允许依赖的稳定包、接口或构建产物。
|
|
99
|
+
|
|
100
|
+
**源:BE 03 目录边界协议**
|
|
101
|
+
|
|
102
|
+
越界指绕过公开入口依赖其他模块内部实现。
|
|
103
|
+
|
|
104
|
+
**源:BE 04 分层架构协议**
|
|
105
|
+
|
|
106
|
+
依赖方向指高层策略不依赖低层技术细节的约束。
|
|
107
|
+
|
|
108
|
+
## MUST
|
|
109
|
+
|
|
110
|
+
**源:FE 09 模块边界协议 · §MUST**
|
|
111
|
+
|
|
112
|
+
- 顶层目录和模块职责必须文档化。
|
|
113
|
+
- 依赖方向和禁止方向必须可检查。
|
|
114
|
+
- 模块外部只能通过 Public API 引用。
|
|
115
|
+
- 跨模块流程进入明确的 orchestration/feature 层。
|
|
116
|
+
- shared 下沉必须证明稳定复用和低业务耦合。
|
|
117
|
+
- 循环依赖必须被工具检测并阻止。
|
|
118
|
+
|
|
119
|
+
**源:BE 01 架构治理协议 · §MUST**
|
|
120
|
+
|
|
121
|
+
- 架构选择必须记录候选、取舍、风险、ADR 坐标和复审条件。
|
|
122
|
+
|
|
123
|
+
**源:BE 02 项目结构治理协议 · §MUST**
|
|
124
|
+
|
|
125
|
+
- 新目录和模块必须有单一职责、公开入口和明确依赖方向。
|
|
126
|
+
|
|
127
|
+
**源:BE 03 目录边界协议 · §MUST**
|
|
128
|
+
|
|
129
|
+
- 修改前必须搜索现有实现,并保持依赖只指向声明的公开入口。
|
|
130
|
+
|
|
131
|
+
**源:BE 04 分层架构协议 · §MUST**
|
|
132
|
+
|
|
133
|
+
- 业务不变量、事务编排和外部适配必须位于可解释且可测试的边界。
|
|
134
|
+
|
|
135
|
+
## MUST NOT
|
|
136
|
+
|
|
137
|
+
**源:FE 09 模块边界协议 · §MUST NOT**
|
|
138
|
+
|
|
139
|
+
- MUST NOT 引用其他模块内部文件。
|
|
140
|
+
- MUST NOT 把页面代码作为其他模块依赖。
|
|
141
|
+
- MUST NOT 因方便把业务能力放进 shared。
|
|
142
|
+
- MUST NOT 新建无职责说明的顶层目录。
|
|
143
|
+
|
|
144
|
+
**源:BE 01 架构治理协议 · §MUST NOT**
|
|
145
|
+
|
|
146
|
+
- 不得以局部代码便利替代边界、数据所有权或部署约束分析。
|
|
147
|
+
|
|
148
|
+
**源:BE 02 项目结构治理协议 · §MUST NOT**
|
|
149
|
+
|
|
150
|
+
- 不得创建无法解释职责的顶层目录或把业务代码放入通用工具区。
|
|
151
|
+
|
|
152
|
+
**源:BE 03 目录边界协议 · §MUST NOT**
|
|
153
|
+
|
|
154
|
+
- 不得把跨域逻辑塞入共享工具或直接引用其他模块内部文件。
|
|
155
|
+
|
|
156
|
+
**源:BE 04 分层架构协议 · §MUST NOT**
|
|
157
|
+
|
|
158
|
+
- 不得在 Controller、ORM Entity 或基础设施适配器中散落权威业务规则。
|
|
159
|
+
|
|
160
|
+
## SHOULD
|
|
161
|
+
|
|
162
|
+
**源:FE 09 模块边界协议 · §SHOULD**
|
|
163
|
+
|
|
164
|
+
- SHOULD 每个模块维护 contract、owner 和 index/public exports。
|
|
165
|
+
- SHOULD 用依赖图和 lint 自动执行边界。
|
|
166
|
+
|
|
167
|
+
**源:BE 01 架构治理协议 · §SHOULD**
|
|
168
|
+
|
|
169
|
+
- 应优先选择能由现有团队、工具和运行证据持续验证的方案。
|
|
170
|
+
|
|
171
|
+
**源:BE 02 项目结构治理协议 · §SHOULD**
|
|
172
|
+
|
|
173
|
+
- 应沿用仓库已验证的结构模式,并在新增结构前搜索现有实现。
|
|
174
|
+
|
|
175
|
+
**源:BE 03 目录边界协议 · §SHOULD**
|
|
176
|
+
|
|
177
|
+
- 应以最小写集完成任务,并复用已有边界内能力。
|
|
178
|
+
|
|
179
|
+
**源:BE 04 分层架构协议 · §SHOULD**
|
|
180
|
+
|
|
181
|
+
- 应让层间数据转换显式并避免同一校验在多层重复实现。
|
|
182
|
+
|
|
183
|
+
## Contract
|
|
184
|
+
|
|
185
|
+
**源:FE 09 模块边界协议 · §Contract**
|
|
186
|
+
|
|
187
|
+
```text
|
|
188
|
+
Module, Responsibility, Owner, PublicExports[],
|
|
189
|
+
AllowedDependencies[], ForbiddenDependencies[], InternalPaths[]
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**源:BE 01 架构治理协议 · §Contract**
|
|
193
|
+
|
|
194
|
+
架构记录至少输出稳定决策 ID、适用范围、被放弃方案、依赖与验证方式。
|
|
195
|
+
|
|
196
|
+
**源:BE 02 项目结构治理协议 · §Contract**
|
|
197
|
+
|
|
198
|
+
结构变更必须给出目标路径、所有者、入口、消费者和迁移计划。
|
|
199
|
+
|
|
200
|
+
**源:BE 03 目录边界协议 · §Contract**
|
|
201
|
+
|
|
202
|
+
新增依赖必须能说明提供方、消费方、稳定入口与验证方式。
|
|
203
|
+
|
|
204
|
+
**源:BE 04 分层架构协议 · §Contract**
|
|
205
|
+
|
|
206
|
+
每层必须声明输入、输出、失败语义、依赖和测试责任。
|
|
207
|
+
|
|
208
|
+
## Checklist
|
|
209
|
+
|
|
210
|
+
**源:FE 09 模块边界协议 · §Checklist**
|
|
211
|
+
|
|
212
|
+
- [ ] 新文件归属可解释。
|
|
213
|
+
- [ ] 只通过公开入口依赖。
|
|
214
|
+
- [ ] shared 满足下沉条件。
|
|
215
|
+
- [ ] 无循环或越层引用。
|
|
216
|
+
|
|
217
|
+
**源:BE 01 架构治理协议 · §Checklist**
|
|
218
|
+
|
|
219
|
+
- [ ] 边界、依赖方向、部署单元和数据所有权已明确。
|
|
220
|
+
|
|
221
|
+
**源:BE 02 项目结构治理协议 · §Checklist**
|
|
222
|
+
|
|
223
|
+
- [ ] 已搜索同类模块并检查构建、测试和部署发现路径。
|
|
224
|
+
|
|
225
|
+
**源:BE 03 目录边界协议 · §Checklist**
|
|
226
|
+
|
|
227
|
+
- [ ] 写集、入口、依赖方向和受影响消费者已复核。
|
|
228
|
+
|
|
229
|
+
**源:BE 04 分层架构协议 · §Checklist**
|
|
230
|
+
|
|
231
|
+
- [ ] 调用链、转换点、事务所有者和异常映射已明确。
|
|
232
|
+
|
|
233
|
+
## Examples
|
|
234
|
+
|
|
235
|
+
**源:FE 09 模块边界协议 · §Examples**
|
|
236
|
+
|
|
237
|
+
### 内容示例,可删除
|
|
238
|
+
|
|
239
|
+
两个业务域共同参与的导入流程放入 feature/orchestration 层,而不是让域 A 引用域 B 的页面。
|
|
240
|
+
|
|
241
|
+
**源:BE 01 架构治理协议 · §Examples**
|
|
242
|
+
|
|
243
|
+
- 将单体与服务拆分作为候选比较,并记录选择理由和复审触发条件。
|
|
244
|
+
|
|
245
|
+
**源:BE 02 项目结构治理协议 · §Examples**
|
|
246
|
+
|
|
247
|
+
- 为独立领域建立模块,并通过公开接口而不是内部包提供能力。
|
|
248
|
+
|
|
249
|
+
**源:BE 03 目录边界协议 · §Examples**
|
|
250
|
+
|
|
251
|
+
- 通过领域端口调用基础设施适配器,而不是从 Controller 直接访问实现类。
|
|
252
|
+
|
|
253
|
+
**源:BE 04 分层架构协议 · §Examples**
|
|
254
|
+
|
|
255
|
+
- Controller 校验传输格式,应用服务编排用例,领域对象维护不变量。
|
|
256
|
+
|
|
257
|
+
## Anti-patterns
|
|
258
|
+
|
|
259
|
+
**源:FE 09 模块边界协议 · §Anti-patterns**
|
|
260
|
+
|
|
261
|
+
把带客户、订单、成本语义的组件放入 shared,再被多个模块反向耦合。
|
|
262
|
+
|
|
263
|
+
**源:BE 01 架构治理协议 · §Anti-patterns**
|
|
264
|
+
|
|
265
|
+
- 只画理想架构图,不绑定构建产物、部署单元或实际依赖。
|
|
266
|
+
|
|
267
|
+
**源:BE 02 项目结构治理协议 · §Anti-patterns**
|
|
268
|
+
|
|
269
|
+
- 复制相似模块后仅改名,造成规则和修复长期漂移。
|
|
270
|
+
|
|
271
|
+
**源:BE 03 目录边界协议 · §Anti-patterns**
|
|
272
|
+
|
|
273
|
+
- 为绕过循环依赖建立含混的 `common` 目录。
|
|
274
|
+
|
|
275
|
+
**源:BE 04 分层架构协议 · §Anti-patterns**
|
|
276
|
+
|
|
277
|
+
- Service 仅转发,而 Controller 同时处理事务、SQL 和业务判断。
|
|
278
|
+
|
|
279
|
+
## Ownership
|
|
280
|
+
|
|
281
|
+
**源:FE 09 模块边界协议 · §Ownership**
|
|
282
|
+
|
|
283
|
+
架构 Owner 维护顶层边界,模块 Owner 维护公开入口,Reviewer 阻止越层引用。
|
|
284
|
+
|
|
285
|
+
**源:BE 01 架构治理协议 · §Ownership**
|
|
286
|
+
|
|
287
|
+
后端技术负责人维护决策,模块维护者提供实现与运行证据。
|
|
288
|
+
|
|
289
|
+
**源:BE 02 项目结构治理协议 · §Ownership**
|
|
290
|
+
|
|
291
|
+
模块所有者维护结构,评审者检查跨模块依赖和重复实现。
|
|
292
|
+
|
|
293
|
+
**源:BE 03 目录边界协议 · §Ownership**
|
|
294
|
+
|
|
295
|
+
代码作者说明边界影响,模块所有者审批公开入口变化。
|
|
296
|
+
|
|
297
|
+
**源:BE 04 分层架构协议 · §Ownership**
|
|
298
|
+
|
|
299
|
+
架构所有者维护分层约束,各层维护者提供边界测试。
|
|
300
|
+
|
|
301
|
+
## Change Policy
|
|
302
|
+
|
|
303
|
+
**源:FE 09 模块边界协议 · §Change Policy**
|
|
304
|
+
|
|
305
|
+
新增顶层模块、改变依赖方向或扩大 Public API 必须经过架构评审和迁移说明。
|
|
306
|
+
|
|
307
|
+
**源:BE 01 架构治理协议 · §Change Policy**
|
|
308
|
+
|
|
309
|
+
改变已采用架构必须新增或替代 ADR,不得静默改写历史结论。
|
|
310
|
+
|
|
311
|
+
**源:BE 02 项目结构治理协议 · §Change Policy**
|
|
312
|
+
|
|
313
|
+
目录迁移必须同步引用、构建、测试、文档和兼容入口。
|
|
314
|
+
|
|
315
|
+
**源:BE 03 目录边界协议 · §Change Policy**
|
|
316
|
+
|
|
317
|
+
公开入口变化按契约变更处理,迁移完成前保留兼容路径。
|
|
318
|
+
|
|
319
|
+
**源:BE 04 分层架构协议 · §Change Policy**
|
|
320
|
+
|
|
321
|
+
跨层迁移必须记录兼容影响并分阶段消除旧依赖。
|
|
322
|
+
|
|
323
|
+
> **语言节**:本主题无语言节挂点(缺席诚实);规则本体即上文通用节。
|