新增 P1rAccountAdminReadsCompletedApprovalIT,经真实 HTTP 入口 + 真实 PostgreSQL(muse_p1r_account_admin_reads_test,独立复跑两次 3/3 绿)覆盖 adminListUsageRecords / adminGetCallAttributionJob: - adminListUsageRecords:以账户用户为分页主表在库内聚合(token 输入 150/ 输出 230/合计 380 求和、pending 计数 1/failed 0、attributionStatus=pending), 非法 period→BAD_REQUEST; - adminGetCallAttributionJob:按 jobId 读 job+items 并归一状态(completed)+ 分桶计数(attributed 1/failed 1/pending 0),not-found→ ACCOUNT_INTEGRATION_CALL_NOT_EXISTS; - 两 op 均 RBAC(muse:account:query)fail-closed、API version 守卫、纯读 no-write(命令/审计/外部调用表保持为空);归因写路外部来源 facade 用抛错 mock 反假绿越界; - 仅对专属 _test 库缺库自动创建,保留 _test/密码仅 env/凭据 query 守卫。 同步 §五B(剩余 account 6→4)+ muse-module-member/.agent。 证据就绪,completed 待人工批(不自批台账=反假绿)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
10 lines
3.8 KiB
Plaintext
10 lines
3.8 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 绿(独立复跑);`P1rAccountNewApiBindingClusterCompletedApprovalIT` 覆盖 getAppNewApiBinding/adminListNewApiBindings/appRecheckNewApiBinding(绑定摘要 owner 读 + active→bound 归一、admin 列表以账户用户为分页主表 + EXISTS/NOT EXISTS 状态筛选 + RBAC、两读 no-write、recheck 单体 New-API 不可用正确 fail-closed:命令预占回滚但失败调用 REQUIRES_NEW 独立落库),真实 PG 4/4 绿(独立复跑);`P1rAccountExportDownloadClusterCompletedApprovalIT` 覆盖 appCreateExportTask/appGetExportTask/appDownloadExport(FileService 未接入时非敏感导出落 queued 任务+命令+审计、不伪造 completed/凭证、敏感类型缺 step-up fail-closed、命令幂等;get owner 读 + 跨 owner not found + no-write;download 凭证门禁 + FileService 不可用正确 fail-closed:@Transactional 回滚一次性消费、不写审计),真实 PG 4/4 绿(独立复跑);`P1rAccountAdminReadsCompletedApprovalIT` 覆盖 adminListUsageRecords/adminGetCallAttributionJob(用量以账户用户为分页主表库内聚合 token/pending/failed/attributionStatus、调用归因 job 按 jobId 读 job+items 归一状态+分桶计数、RBAC+API version fail-closed、纯读 no-write),真实 PG 3/3 绿(独立复跑);证据就绪,completed 仍待人工批准。
|
|
- **关键风险 / TODO**:剩余 account 验收债 4 op(quota-request 批7 + usage/integration-call 批8 + new-api 绑定簇 批9 + 导出/下载簇 批10 + admin usage/call-attribution-job 读 批11 已补证):adminCreateNewApiBinding/adminCreateCallAttributionJob 属 New-API/SSE 外部依赖(写路 fail-closed)、adminListPurchaseRecords 需跨模块 market 投影 provider、appAcknowledgeSecurityEvent 内部写,需按批补真实 PG 证据。前端仍有深页未全覆盖真实后端。
|