lili fa9dae84ce test(p1r): 验收债批8 account 用量/外部调用可观测读端真实 PG IT(3 op,4/4 绿)
新增 P1rAccountUsageObservabilityCompletedApprovalIT,经真实 HTTP 入口 +
真实 PostgreSQL(muse_p1r_account_usage_observability_test,独立复跑两次 4/4 绿)
覆盖 getAppUsage / appGetIntegrationCallByCorrelation /
adminGetIntegrationCallByCorrelation 三个只读 operation:

- getAppUsage:按 owner 聚合(token 输入/输出求和、pending/anomaly 计数、
  byModel、byAttribution)+ 跨用户隔离(他人用量不计入)+ period 规范化/白名单;
- 外部调用读:app 侧 owner 守卫(越权 ACCOUNT_RESOURCE_FORBIDDEN)、
  admin 侧无 owner 限制可跨用户读 + RBAC(muse:account:query),status/
  requestType/attributionStatus/retryGroup 归一化;
- 三 op 纯读全程 no-write(member_user/usage_record/integration_call/
  command/audit 快照前后一致);fail-closed:缺用户/not-found/API version/
  RBAC deny 全部经真实 GlobalExceptionHandler 命中;
- 控制器附带依赖(权益/绑定/配额/归因 service)用抛错 mock 反假绿越界;
- 仅对专属 _test 库缺库自动创建,保留 _test/密码仅 env/凭据 query 守卫。

同步 §五B(剩余 account 15→12)+ muse-module-member/.agent。
证据就绪,completed 待人工批(不自批台账=反假绿)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 23:26:24 -07:00

10 lines
2.4 KiB
Plaintext

# .agent — muse-module-member(账户/个人中心 · Account BC 物理承载)
> 模块跨会话记忆。真实现状权威见 [现状基线 §四/§五](../../docs/agent-specs/2026-06-13-项目目标与模块现状基线.md);进度见 [总账](../../docs/mvp/进度总账.md)。本文件只记目标/边界/out-of-scope/现状指针/TODO,过时即更。
- **目标(owner 职责)**:Account/Usage/Audit BC——Profile / Entitlement-Quota / Usage Record / Personal Center Summary / 记录总览 / Security Event / New-API Binding / Audit Log / Download Credential。**member = Account BC 物理承载,不新增 account 模块**。
- **边界(不可违反)**:是用户可见权益的聚合**读模型**与跳转入口,**不是消费账本事实源,不能反写**作品/知识/智能体/市场事实;高危审计 append-only + WORM/哈希链;Entitlement/Quota/Usage/Security/Binding 唯一写入 authority;守 BC 边界不碰他域 `.dal`([bc-boundaries](../../.agents/rules/bc-boundaries.md))。
- **out-of-scope**:他域事实写入。
- **现状**:只读评估 68%。**2026-06-15 活体订正**:单体内 `MarketAccountProjectionFacade` 由 market 的 `MarketAccountProjectionProvider` 真实提供,purchases/licenses/publish-records 三端可读投影,不是 `*_UNAVAILABLE` 缺口。**2026-06-16 补真实 PG 验收证据**:`P1rAccountMarketRecordsCompletedApprovalIT` 覆盖 appListPurchases/appListLicenses/appListPublishRecords,真实 PG 3/3 绿;`P1rAccountQuotaRequestCompletedApprovalIT` 覆盖 appCreateQuotaRequest/appGetQuotaRequest/adminCreateQuotaRequest(命令幂等+commandId 冲突回滚+owner/tenant 隔离+RBAC+类型白名单),真实 PG 5/5 绿(独立复跑);`P1rAccountUsageObservabilityCompletedApprovalIT` 覆盖 getAppUsage/appGetIntegrationCallByCorrelation/adminGetIntegrationCallByCorrelation(用量按 owner 聚合 token/pending/anomaly/byModel+跨用户隔离+period 白名单、外部调用 app owner 守卫/admin 无 owner 限制+RBAC、三 op 纯读 no-write、缺用户/not-found/API version/RBAC fail-closed),真实 PG 4/4 绿(独立复跑);证据就绪,completed 仍待人工批准。
- **关键风险 / TODO**:剩余 account 验收债 12 op(quota-request 3 op 批7 + usage/integration-call 3 op 批8 已补证):exports/downloads/new-api recheck 属对象存储/New-API 外部依赖未配置的正确 fail-closed;new-api-binding/admin 用量记录/security event 等需按批补真实 PG 或失败关闭证据。前端仍有深页未全覆盖真实后端。