docs: update D601 v03 DB authority

This commit is contained in:
Codex
2026-06-26 07:34:21 +00:00
parent db136bd261
commit 08470168f8
+5 -1
View File
@@ -49,7 +49,9 @@ HWLAB v0.2/v0.3 仓库内 `docs/reference/spec-*`,以及已收编的 `cloud-wo
D601 node-scoped `v0.3` 已按 `pikasTech/HWLAB#1176` 收敛到 Sub2API-style 的最小多用户运营基线。该基线包括 app-local 注册登录、用户自服务 API key/profile/password、admin users 管理、credit adjust、Code Agent reservation/terminal billing、`/v1/billing/summary`、plan/entitlement/quota/concurrency/RPM、admin usage/ledger filter/export、manual credit audit、redeem/manual recharge,以及 subscription/payment 的 provider-agnostic `unconfigured` 占位。审计细节、PR、PipelineRun、public smoke 和 closeout 证据以 #1176 及其 R1-R6 子 issue 为准;长期参考只记录完成态边界和复验入口。
该能力的 authority 仍是 HWLAB `hwlab-user-billing` 和 PK01 外置 PostgreSQL。Cloud API 只做代理和同源 Web session/API key 鉴权,不维护第二套 user、credit、usage、ledger、redeem、subscription 或 payment 状态;Cloud Web 只消费 Cloud API 暴露的正式路径,不直连 user-billing 内部端口。D601 `hwlab-v03` namespace 内不得为了 user-billing 恢复本地 PostgreSQL StatefulSet/PVC 或第二账户库;`localPostgresAbsent=true` 和 PK01 bridge ready 是关闭和复验时的必要状态证据。
该能力的业务 authority 仍是 HWLAB `hwlab-user-billing`。Cloud API 只做代理和同源 Web session/API key 鉴权,不维护第二套 user、credit、usage、ledger、redeem、subscription 或 payment 状态;Cloud Web 只消费 Cloud API 暴露的正式路径,不直连 user-billing 内部端口。
D601 `v0.3` 的 DB 执行面不再硬编码为外置 PostgreSQL,而由 UniDesk YAML `config/hwlab-node-lanes.yaml` 中选中 target 的 `runtimeStore.postgres.mode` 决定。mode 为 `local-k3s` 时,Cloud API、user-billing、workbench-runtime、project-management 和 OpenFGA 消费 `hwlab-v03` namespace 内的本地 `hwlab-v03-postgres`;复验和关闭证据应来自 `hwlab nodes control-plane plan|status``hwlab nodes secret status`、运行面 workload/Secret 摘要和 `external bridge/secrets not-required`,而不是要求本地 PostgreSQL 缺失。`externalPostgres` 与 PK01 platform DB YAML 必须继续保留为 `platform-service` mode 的候选配置;把 mode 切回 `platform-service` 时应重新启用 bridge/Secret 路径,但不得因为当前使用 `local-k3s` 删除外置配置。
复验 D601 `v0.3` user-billing 管理闭环时使用 `https://hwlab.pikapython.com`,不要用 G14 `v0.2``19666/19667` 或旧 D601 legacy 端口替代。最小 smoke 应覆盖:`/health/live` revision 指向目标 source commitadmin Web session 登录;admin 创建/list/disable redeem code;普通用户注册或登录后兑换 code;重复兑换 one-time code 不重复入账;admin redemptions 和 ledger 能查到同一 ledger/redemptionsubscription/payment summary 在没有真实 provider 配置时明确返回 `unconfigured``/billing``/admin/billing` 页面加载且部署 bundle 包含对应 endpoint。验证输出只能记录对象 id、prefix、状态、计数和 redacted presence,不能打印 bootstrap admin password、raw redeem code、API key secret、DB DSN 或 provider token。
@@ -63,6 +65,8 @@ HWLAB node/lane 测试账号、bootstrap admin API key 观测、普通测试用
该入口的输出只能记录 logicalId、role、permissions、workbench、sourceRef、sourceKey、targetKey、对象 id、byte count、prefix、fingerprint、presence、matchesSourceFingerprint 和 mutation 摘要;不得打印完整 `HWLAB_API_KEY`、完整 `DATABASE_URL`、base64 payload 或可复制凭据。D601 `v0.3` T1/T2 类验证如果需要 admin/test 两套身份,先用此 UniDesk YAML/CLI 准备账号,再在目标 HWLAB workspace 使用原 `hwlab-cli` 切换 `HWLAB_API_KEY` 做真实入口复验。
`test-accounts status|sync` 中涉及 DB 的读写也必须跟随选中 node/lane 的 DB authority。D601 `v0.3` 处于 `local-k3s` mode 时,工具不得从指挥机直接连接保留下来的外置 DB sourceRef;只有 mode 明确为 `platform-service` 时才使用外置 DB 路径。若旧 test-accounts DB 探测仍因外置 sourceRef DNS 或网络失败而报错,应登记为 CLI mode-awareness follow-up,不得把它当成 access-control 预置用户或根导航 ACL 的失败证据;这类 ACL 关闭证据应来自受控 preset-user Web/API 验证和 redacted Secret 状态。
身份、权限、workbench、trace/result 和 usage/billing 复验优先使用目标 HWLAB repo 的 typed CLI`client request` 只能作为缺 typed wrapper 时的有界探测或后端路径确认。若 raw request 覆盖了真实用户验收所需的字段,关闭前必须把缺失的 typed CLI 包装登记到对应 HWLAB issue,不能把 raw request 静默当成长期正式用户入口。
### Code Agent TraceResult 展示证据