docs(accounts): record p3-t1 remote verification

This commit is contained in:
phamnazage-jpg
2026-05-29 14:58:23 +08:00
parent b5343452cb
commit 82f3636521

View File

@@ -387,6 +387,57 @@
- Phase 2 的控制面、运行态、正式数据面、管理页都已被收敛进固定脚本矩阵
- 后续任何 Phase 2 回归都可以直接在 `remote43` 上复用同一套脚本,而不再依赖临时串命令
- `P2` 已具备可持续回归的最小产品闭环
- 2026-05-29 已完成 Phase 3 / `P3-T1 帐号清单与启停 API`
- 提交:
- `b5343452 feat(accounts): add provider account inventory api`
- 新增 SQLite migration
- `internal/store/migrations/0012_provider_accounts.sql`
- 新增帐号库存 repo / 回填逻辑:
- `internal/store/sqlite/provider_accounts_repo.go`
- `internal/store/sqlite/provider_accounts_sync.go`
- 新增管理 API
- `GET /api/provider-accounts`
- `POST /api/provider-accounts/{account_id}/enable`
- `POST /api/provider-accounts/{account_id}/disable`
- `POST /api/provider-accounts/{account_id}/retire`
- 当前首版设计边界已明确:
- `provider_accounts` 是插件侧帐号资产库存
- 列表接口会先按最新 `reconcilable import batch` 做一次库存回填,避免 remote43 上已有导入结果看不到
- runtime import 完成后会自动把 `managed_resources + import_batch_items` 同步进 `provider_accounts`
- `enable / disable / retire` 当前只更新插件 SQLite 库存状态,不猜测宿主 `/api/v1/admin/accounts/:id` 的写入 payload
- 为避免人工禁用状态被回填覆盖,同步层现在会保留人工 `disabled` / 人工 `deprecated`;只允许 `missing_from_latest_batch` 这种自动弃用在新 batch 命中后被恢复
- 本地门禁已通过:
- `gofmt -l .`
- `go vet ./...`
- `go test -cover ./internal/...`
- `go test ./tests/integration/... -count=1`
- remote43 已原位升级到:
- `repo HEAD = b5343452`
- CRM 实例目录:`/home/ubuntu/sub2api-kimi-patched-auto2-20260525_18169`
- 活跃监听 PID`1771174`
- `http://127.0.0.1:18173/healthz` 返回 `ok`
- remote43 真实 API 验证已通过:
- `GET /api/provider-accounts`
- `count=1`
- 样本帐号:
- `id=1`
- `provider_id=gpt-asxs-shadow-lab`
- `host_account_id=10`
- 初始 `account_status=active`
- `POST /api/provider-accounts/1/disable`
- `reason=p3_t1_remote_verify`
- 返回 `account_status=disabled`
- 再次 `GET /api/provider-accounts`
- 同一条样本仍为 `account_status=disabled`
- 说明列表回填不会把人工禁用状态刷回 `active`
- `POST /api/provider-accounts/1/enable`
- 返回 `account_status=active`
- 再次 `GET /api/provider-accounts`
- 同一条样本恢复为 `account_status=active`
- 当前结论:
- 插件侧已经具备“帐号库存列表 + 人工启停状态”的最小资产闭环
- 首版语义仍然是“插件库存状态”,不是“宿主账号状态联动”
- `P3-T2` 可以直接继续做帐号资产页和 route / shadow group 归属展示
- 2026-05-28 已完成 Phase 1 / `P1-T1 SQLite schema foundation`
- 提交:`7f75d8a6 feat(routing): add logical group schema foundation`
- 新 migration`internal/store/migrations/0010_logical_groups_and_routes.sql`