docs: freeze WAVE0 domain foundation and contract governance

Mark WAVE0 FROZEN CANDIDATE for Human Review; docs + .ai domain/product only — no apps or migrations.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-07 16:20:11 +08:00
co-authored by Cursor
parent d33c8fdfe9
commit 27f27a1cb2
16 changed files with 1322 additions and 3 deletions
+239
View File
@@ -0,0 +1,239 @@
# Bounded Context Boundary Rules
> Wave 0 · **P0 资产** · AI / Engineer 只读;变更须 Architect + Human
> 运行时权威副本:`.ai/domain/boundary-rules.md`
Status: `Draft`Human Review 后 Frozen
---
## 如何读
- **owns**:该 BC **唯一写权威**(修改入口)。
- **does_not_own**:明示禁止「顺手改」。
- **allowed**:允许的依赖(多为读或经门面)。
- **forbidden**:禁止的依赖(含跨 BC 写支付/会员等)。
违反本文件 = Reviewer **BLOCK**(架构回归)。
---
## Admin_Auth_Audit
```yaml
Admin_Auth_Audit:
owns:
- AdminAccount
- AdminSession
- AuditLog
does_not_own:
- UserStatus
- MembershipPlan
- Entitlement
allowed:
- Admin_RBAC.read
forbidden:
- Payment.write
- C端业务聚合根的隐式写入
```
## Admin_RBAC
```yaml
Admin_RBAC:
owns:
- AdminRole
- AdminPermission
does_not_own:
- User
- Profile
- Membership
allowed:
- Admin_Auth_Audit.write_audit
forbidden:
- Payment
- Membership.write
- DeviceAuth.user_token_issue
```
## Identity_Profile
```yaml
Identity_Profile:
owns:
- User
- Profile
- DeviceIdentity
- UserStatus
- BehaviorSnapshot
- PsychologicalTagSet
does_not_own:
- MembershipPlan
- Entitlement
- Order
- Payment
- RedemptionCode
allowed:
- Analytics_OpsB.read
forbidden:
- Payment
- Membership.write
```
## Membership_Orders
```yaml
Membership_Orders:
owns:
- MembershipPlan
- Entitlement
- Membership
- Order
- DeepAccess
- RedemptionCode
- Payment # mock 今;真支付适配器后置,仍归本 BC
does_not_own:
- UserStatus
- AdminRole
- FilterRule
allowed:
- Identity_Profile.read
forbidden:
- Ask_Ops.write_prompt
- Content_Safety.rule_mutate_via_order
```
## Analytics_OpsB
```yaml
Analytics_OpsB:
owns:
- AnalyticsSession
- AnalyticsEvent
does_not_own:
- User
- Membership
allowed:
- Identity_Profile.read_ids_only
forbidden:
- Payment
- 采集 PII 正文(生日/问答全文等)
```
## Ops_Content
```yaml
Ops_Content:
owns:
- HomeTool
- ScalePublishState
does_not_own:
- Scale 题目正文编辑器(未开 ECR 前禁止扩张)
allowed:
- Explore_Reports.publish_gate
forbidden:
- Community
- Payment
```
## Account_Risk
```yaml
Account_Risk:
owns:
- RiskFlag
- BanRecord
does_not_own:
- MembershipPlan
allowed:
- Identity_Profile.UserStatus.transition # 经明确应用服务
- Admin_Auth_Audit.write_audit
forbidden:
- Payment.refund_silent
```
## Content_Safety
```yaml
Content_Safety:
owns:
- FilterRule
- ModerationCase
- BlockPolicy
- CrisisEvent
- CrisisPolicy
does_not_own:
- Membership
- Payment
- AdminRole
allowed:
- Identity_Profile.read
- Ask_Ops.read_session_meta
forbidden:
- Membership.write
- Payment
```
## Ask_Ops
```yaml
Ask_Ops:
owns:
- AskSessionView
- QualityFeedback
- HandoffCase
- SystemPrompt
- KnowledgeSource
- KnowledgeChunk
- ToolDefinition
does_not_own:
- Payment
- MembershipPlan
- UserStatus
allowed:
- Identity_Profile.read
- Content_Safety.evaluate
forbidden:
- Payment
- Membership.write
- Admin_RBAC.write
```
## Ops_CMS_NoUGC
```yaml
Ops_CMS_NoUGC:
owns:
- Banner
- FeedSlot
- ScheduledPublication
does_not_own:
- UGC Post
- CommentGraph
- TrustScore
allowed:
- Admin_RBAC.check
forbidden:
- Community
- 用户生成内容入库为主路径
```
## Community
```yaml
Community:
status: Forbidden
owns: []
note: feature-map UGC 广场 [No];开启须 L3 ADR + 新 Capability
```
---
## 反模式(禁止)
```text
AskService → load User → update Membership → charge Payment
UserService.updateMembership()
Content_Safety 直接改 Entitlement
Ops_CMS 引入「用户帖子」表却声称 NoUGC
```
+32
View File
@@ -0,0 +1,32 @@
# Domain Map — Ops Platform 增量(Wave 0
> 本文件为 Wave 0 归档;**运行时权威**同步至 [`.ai/domain/domain-map.md`](../../../.ai/domain/domain-map.md)「Ops Platform」节。
> P1 工程 BC 表仍冻结;此处**追加**运营平台 BC,不改写 P1 不变量(除非另开 ADR)。
Status: `Draft`
---
## 既有 BC(摘要 · 勿在 Wave 0 修改所有权)
Identity · Profile · Discovery · Relation · Ask · Companion · StarProfile · LifeRhythm · ImageCard · Commerce · Consult — 见 `.ai/domain/domain-map.md`
---
## Ops Platform BCsWave 0 登记)
| Context | Owns(概念级) | Capability | 状态 |
|---------|----------------|------------|------|
| `Admin_Auth_Audit` | AdminAccount · AdminSession · AuditLog | AdminGovernance | **已落地** Ops-A |
| `Admin_RBAC` | AdminRole · AdminPermission | AdminGovernance | **草案** → ECR-013A |
| `Analytics_OpsB` | AnalyticsSession · AnalyticsEvent · 聚合读模型 | GrowthInsights / UserIntelligence(读) | **已落地** Ops-B |
| `Ops_Content` | HomeTool · ScalePublishState | ExploreConfig(部分) | **已落地** Ops-C |
| `Account_Risk` | RiskFlag · BanRecord(与 UserStatus 协作) | AccountLifecycle | 草案 |
| `Content_Safety` | FilterRule · ModerationCase · CrisisEvent | ContentSafety · CrisisCare | 草案 |
| `Ask_Ops` | AskSessionView · QualityFeedback · SystemPrompt… | AskOperations · AICoreConfig | 草案 |
| `Ops_CMS_NoUGC` | Banner · FeedSlot | OpsCMS | 草案 |
| `Community` | — | — | **Forbidden** |
边界细节:[`boundary-rules.md`](boundary-rules.md)。
实体目录:[`entity-catalog.md`](entity-catalog.md)。
词表:[`glossary.yaml`](glossary.yaml)。
+43
View File
@@ -0,0 +1,43 @@
# Entity CatalogWave 0 · 概念级)
> 仅登记名称、归属 BC、Capability、生命周期备注。**不建表、不写 migration。**
> 与 [`glossary.yaml`](glossary.yaml) · [`boundary-rules.md`](boundary-rules.md) 一致。
Status: `Draft`
| Entity | BC | Capability | Notes |
|--------|----|------------|-------|
| AdminAccount | Admin_Auth_Audit | AdminGovernance | 已存在 Ops-A |
| AdminSession | Admin_Auth_Audit | AdminGovernance | 已存在 |
| AuditLog | Admin_Auth_Audit | AdminGovernance | 已存在;只追加 |
| AdminRole | Admin_RBAC | AdminGovernance | **ECR-013A** |
| AdminPermission | Admin_RBAC | AdminGovernance | **ECR-013A** |
| User | Identity_Profile | AccountLifecycle | 已存在 |
| Profile | Identity_Profile | UserIntelligence | 已存在 |
| UserStatus | Identity_Profile | AccountLifecycle | **ECR-013B** 状态机 |
| AccountStateTransition | Identity_Profile | AccountLifecycle | **ECR-013B** |
| BehaviorSnapshot | Identity_Profile | UserIntelligence | 未来读模型 |
| PsychologicalTagSet | Identity_Profile | UserIntelligence | 未来读模型 |
| MembershipPlan | Membership_Orders | CommerceEntitlement | 配置面后置 ECR |
| Entitlement | Membership_Orders | CommerceEntitlement | 后置 |
| RedemptionCode | Membership_Orders | CommerceEntitlement | 后置 |
| Membership | Membership_Orders | CommerceEntitlement | 已存在 |
| Order | Membership_Orders | CommerceEntitlement | 已存在 |
| DeepAccess | Membership_Orders | CommerceEntitlement | 已存在 |
| Payment | Membership_Orders | CommerceEntitlement | mock;真支付最后 |
| HomeTool | Ops_Content | ExploreConfig | 已存在 Ops-C |
| ScalePublishState | Ops_Content | ExploreConfig | 已存在 |
| AnalyticsSession / Event | Analytics_OpsB | GrowthInsights | 已存在 Ops-B |
| FilterRule | Content_Safety | ContentSafety | 后置 |
| ModerationCase | Content_Safety | ContentSafety | 后置 |
| CrisisEvent / CrisisPolicy | Content_Safety | CrisisCare | 后置 |
| SystemPrompt / Knowledge* / ToolDefinition | Ask_Ops | AICoreConfig | 后置 |
| AskSessionView / QualityFeedback | Ask_Ops | AskOperations | 后置 |
| Banner / FeedSlot | Ops_CMS_NoUGC | OpsCMS | 后置 |
| UGC* | Community | — | **Forbidden** |
## 状态机预告(ECR-013B · 仅文档)
`UserStatus`: `active``disabled` | `banned` | `suspended`
`banned` / `disabled` → C 端 DeviceAuth **拒绝**(细则写入 013B AC)。
`deleted` soft-delete **不在 013B**(另开)。
+116
View File
@@ -0,0 +1,116 @@
# domain glossary — engineering / API unique terms
# Wave 0 Draft. Runtime copy: .ai/domain/glossary.yaml
# User-facing copy stays in .ai/product/lexicon.md
# Conflict: Architect + Human resolve; do not invent synonyms in code.
version: "0.1.0"
status: draft
terms:
AdminRole:
zh: 管理员角色
bc: Admin_RBAC
forbidden: [admin_group, privilege_group]
AdminPermission:
zh: 管理员权限点
bc: Admin_RBAC
forbidden: [acl_flag, authz_bit]
AuditLog:
zh: 操作审计日志
bc: Admin_Auth_Audit
forbidden: [admin_history]
UserStatus:
zh: 用户账户状态
bc: Identity_Profile
values: [active, disabled, banned, suspended]
forbidden: [user_flag, account_level]
AccountStateTransition:
zh: 账户状态迁移
bc: Identity_Profile
forbidden: [status_patch_log]
MembershipPlan:
zh: 会员套餐
bc: Membership_Orders
forbidden: [package, vip_level, 订阅档, sku_vip]
Entitlement:
zh: 权益
bc: Membership_Orders
forbidden: [privilege_pack, benefit_bundle]
RedemptionCode:
zh: 兑换码
bc: Membership_Orders
forbidden: [gift_card, activation_key_alias]
DeepAccess:
zh: 深度版
bc: Membership_Orders
forbidden: [Unlock, unlock_report]
BehaviorSnapshot:
zh: 行为快照
bc: Identity_Profile
forbidden: [user_track_dump]
PsychologicalTagSet:
zh: 心理标签集
bc: Identity_Profile
forbidden: [psy_labels_raw]
FilterRule:
zh: 过滤规则
bc: Content_Safety
forbidden: [badword_only]
ModerationCase:
zh: 审核工单
bc: Content_Safety
forbidden: [review_ticket_ugc]
CrisisEvent:
zh: 危机事件
bc: Content_Safety
forbidden: [suicide_flag_public]
CrisisPolicy:
zh: 危机策略
bc: Content_Safety
forbidden: [kill_switch_generic]
SystemPrompt:
zh: 系统提示词
bc: Ask_Ops
forbidden: [god_prompt]
KnowledgeSource:
zh: 知识源
bc: Ask_Ops
forbidden: [rag_file]
KnowledgeChunk:
zh: 知识块
bc: Ask_Ops
forbidden: [embedding_row_ui]
ToolDefinition:
zh: 工具定义
bc: Ask_Ops
forbidden: [function_call_config_loose]
Banner:
zh: 运营横幅
bc: Ops_CMS_NoUGC
forbidden: [story_feed_ugc]
Community:
zh: (禁止能力)
bc: Community
status: forbidden
forbidden: [ugc_plaza, 社区广场]