AMR 生产发布影响报告
当前生产发布点(EKS 实态 + workflow 记录)
Web、API、Link、Admin 的发布点来自 Grafana / Prometheus(datasource prometheus,namespace nexu)观察到的 Ready EKS Pod 镜像,已排除带 deletionTimestamp 的终止中 Pod;DB migration 的发布点来自对应 workflow 最近一次成功运行。越新的发布点意味着该维度已上线越多内容,feature 表里只允许列出发布点之后的变更;
发布点之前的 commit 属于已生效,归入「已在生产生效」一节,不得重复出现在 feature 表。目标 commit 均为
a30eb9fc3
([OPEND-3102] feat: 集成席位放开一期,持续补齐验收与回归 (#467))。
nexu/amr-web · container web568b89812sha256:6ea7628ac08f36e9bbcd31cd79a5f56eee08c512d00745fe09f7cb4f19bb2478568b89812...a30eb9fc3):11 commitsapps/web 的只有 #467、#579 与 #673 的一个浏览器测试;#582/#610/#619/#634/#635/#642/#677 均无 Web 代码nexu/amr-api · container apibfc134eadsha256:8504c7cc098ca4c56c8b241b1fa74161d8ffc63e7395bafb5bc6d8c8bc540fcbbfc134ead...a30eb9fc3):7 commitsnexu/amr-link · container linka96663290sha256:43cd3fd0d67bf723cf4d131e518eca1d08409cdef246dcf7239c4e7f3153490da96663290...a30eb9fc3):2 commitsnexu/amr-admin · container admine05a7065dsha256:34fc0425128f95c2edaf576eef9db19da6bd05d44d080433611212f512fb6a44e05a7065d...a30eb9fc3):3 commitsa96663290a96663290...a30eb9fc3):2 commitsdb/migrations 127 个 SQL(至 20261028083959_add_video_admissions_v2.sql)db/migration-rollout.json,即 5 阶段 production-forward 机制尚未在生产运行过此次发布真正新增的 feature 和影响面
| Feature / Author / Commits | Web | API | Link | Admin | DB schema / migration |
|---|---|---|---|---|---|
|
XXL工作空间共享额度与共享计费运行时
席位放开一期主干:工作空间级共享订阅额度、充值余额、Design Plan 用量与用量明细(倍率/贡献额度)、自动充值、退款与资金归属;控制台余额总览、钱包、用量明细、账单记录统一改为共享口径。覆盖用户钱包、订阅页与工作空间计费运行时的整条链路。 Author:杨瑾龙(lefarcen,PR #467 集成分支,含线内多作者提交) |
发布点之后 apps/web 共 397 个文件(191 个非测试文件):新增 src/routes/seats-console.tsx,改造 wallet.tsx、workspace-usage-detail.tsx、usage-cost-detail.tsx、billing-records.tsx;src/components/commerce 76 个文件(余额总览 overview-card、quota-window、seats-auto-recharge、coding-plan-usage-card、plan-change-confirm-modal 等)与 src/lib/use-seats-billing-snapshot 等 hooks。 |
计费运行时与工作空间商业:src/billing/workspace-commerce(75 个文件:checkout、升级/降级、优惠券、退款、恢复、webhook、portal)、usage-wallet-resolution*.ts(6)、shared-settlement-*、shared-funding-projection*、workspace-runtime-billing-mode.ts、workspace-auto-recharge-runtime.ts、src/payment-analytics.ts;另 billing/infra/postgres.ts 等数据访问改造。 |
新增 internal/usage/workspace_credit.go、workspace_admission.go、workspace_projection.go、request_concurrency_snapshot.go;改造 usage/limits.go、credit.go、pricing_snapshot.go、repositories/workspace_credit*.go、shared_model_funding.go、admission_pipeline.go(按 v2 计费作用域分流)。 |
新增 lib/server/admin/billing-runtime-switch.ts(计费运行时开关)与对应后台 API 路由;entitlements 页面适配共享额度。 |
expand 阶段:20261018200641_workspace_shared_expand_structure.sql + 13 个 2026101820070x_workspace_shared_expand_constraints_*_install.sql + 20261018200719_..._checks_validate.sql;contract 阶段:20261018200727_workspace_shared_contract.sql;另有 usage_wallet_resolution_structure、..._check_link_usage_events_install、..._check_checks_validate、20261028073210_payment_analytics_outbox.sql、20261017163630_workspace_auto_recharge_default_active.sql;db/schema 的 public.hcl(+325)、billing_runtime.hcl、payment_analytics.hcl。 |
|
XL席位控制台、成员与邀请流程
新的 Author:杨瑾龙(PR #467) |
新增 src/routes/seats-console-settings.tsx、seats-console-copy.ts、team-members-visual.module.css、workspace-invite-landing.module.css 与 public/invite/* 资源;改造 team.tsx、team-dashboard.tsx、team-seat-action.ts、workspace-settings.tsx、workspace-invite-preview.tsx、api-keys.tsx、register.tsx;src/components/console 21 个文件、src/components/team 6 个文件。 |
src/workspaces(6)、src/workspace-events(5)、src/team-projects(3):工作空间上下文/目录、邀请接受与成员变更事务、成员 key 撤销、workspace-task-limit-configuration.ts 与 workspace-task-leases.ts。 |
internal/membership/client.go(+128)、task_lease.go、middleware/auth.go(+94):按 v2 计费作用域解析工作空间与成员归属,任务租约随请求下发;成员并发身份测试补齐。 |
app/[locale]/(protected)/entitlements/page.tsx;新增 test/membership-task-limit-router.test.ts(成员限制路由)。 |
workspace_shared_expand_constraints_public_workspaces_install、..._public_current_subscriptions_install、..._public_membership_entitlements_install/..._checks_validate;20261020030930_members_registration_invite_signal.sql、20261022112034_member_removal_owner_fact.sql、20261018030555_workspace_member_key_revocation.sql;public.workspace_members 结构在 expand / runtime_ready 阶段生成;migration-rollout.json 固定了阶段边界。 |
|
XL旧团队订阅迁移与保留计费(legacy / retained migration)
旧 Team 订阅迁移到工作空间共享计费:迁移运行与批次调度、迁移兼容性检查、retained(保留原订阅)计费与计费日历、过期/免费/付费切流证明、迁移期间原调用与视频任务计费、迁移结果分析与运营提示。面向存量 Team 客户与运营。 Author:杨瑾龙(PR #467) |
迁移提示与迁移态控制台:components/console/seats-migration-notice.tsx、seats-console-migration-host.tsx、seats-migration-copy.ts、lib/use-seats-migration-notice.ts。 |
src/billing/migration-jobs(28)、shared-migration-plan/apply/resume/inventory/debt/debt-import、legacy-call-admission.ts、original-call-*(覆盖/资金/财务完成)、workspace-migration-result-analytics.ts、team-renewal-operation.ts 等。 |
internal/membership/legacy_migration.go、original_call_coverage.go;domain/legacy_migration_call.go、signup_gift_funding.go、usage_settlement.go;repositories/legacy_migration_call.go、legacy_migration_video.go、legacy_model_funding.go、legacy_funding_*(7)、legacy_team_runtime_projection.go、legacy_video_observation.go、cmd/migration-admission-probe。 |
新增 billing-migration-runs 列表/详情页与 app/api/admin/billing-migration-runs/*(含 compatibility 与按工作空间查询);features/billing-migration(批次选择、准备、运行、retained 与 member addon 预览)、lib/server/admin/billing-migration.ts。 |
本范围 migration 的主体:legacy_team_migration_preparation、legacy_team_{free,paid,covered}_cutover_shape、legacy_team_composite_prepare_shape、legacy_team_cutover_quota_continuity_v2_compatible、retained_team_{grant_ledger,cutover_shape,calendar_source,calendar_epochs}、legacy_team_retained_composite_source、legacy_team_retained_original_price_basis、legacy_team_retained_flat_seat_fee、legacy_team_expired_composite_free、legacy_expired_paid_free_cutover_proof、expired_free_journal、expired_basic_free_cutover_proof、legacy_root_runtime_lifecycle、funded_period_*、workspace_legacy_call_admissions、workspace_migration_authority_index、workspace_billing_migration_job_coordination、workspace_migration_source2_and_personal_price_execution、aligned_funded_retained_cutover、source_only_composite_retained_cutover、bind_source_only_composite_fingerprint;db/schema 的 billing_migration_jobs.hcl、billing_retained_team.hcl、billing_data_jobs.hcl、workspace-legacy-call-admissions.hcl。分布在 legacy_team_prepare(5) / application_ready(20) / runtime_ready(25) 三个阶段。 |
|
LCoding Plan 与模型限制策略的工作空间化
Coding Plan 的模型清单与限制策略按工作空间配置;Link 准入写入 v2 许可表并带工作空间/成员维度,完成与回放证据、贡献倍率快照进入用量链路;控制台展示 Design Plan 用量。 Author:杨瑾龙(PR #467) |
components/commerce/coding-plan-usage-card.tsx、pricing-design-plan-usage.tsx、lib/use-coding-plan-events.ts、use-seats-settings-authority.ts。 |
新增 src/billing/coding-plan-usage.ts(用量快照)、workspace-commerce/upgrade-coding-plan-proof.ts;usage-pricing-snapshot.ts 与 usage-discount-context.ts 适配倍率。 |
modellimit/model_limit.go(+168):准入只写 link.model_limit_admissions_v2,完成许可对旧表/v2 双表读取;workspace_coding_plan 证据与 video_task_billing.go 工作空间归属。 |
features/coding-plan 7 个文件(limit-policies-panel、limit-policy-fields、models-panel、product-control、audience-context、coding-plan-tabs、inclusion-preset-fields);lib/server/admin/coding-plan-workspace-configuration.ts、coding-plan-limit-policies.ts、coding-plan-model-set.ts。 |
workspace_shared_expand_constraints_link_model_limit_{admissions,pool_anchors,windows}_install(expand);link.model_limit_admissions_v2 结构在 runtime_ready 阶段生成;20261028143447_video_admission_v2_workspace_scope.sql;db/schema/link.hcl(+122)。 |
|
L公开分享上传的服务端统一裁定与恢复回收
客户端前置分享检查改为服务端统一裁定:公开上传回执与租约、真实对象大小校验(20 MiB)、中断上传的幂等恢复与受控 GC、公开评论文件身份严格匹配;工作区可见性仍走独立成员/owner 策略。 Author:zhangchi(PR #579)
|
src/lib/share-contract.gen.ts(生成契约)、tests/browser-agent/share-app-auth-live.spec.ts、tests/unit/shared-artifact-public.test.ts;无页面级改动。 |
新增 src/resources/public-uploads.ts、src/resources/public-share-policy.ts;改造 resources/{auth,blob-store,persistence,routes,semaphore}.ts、collab/{comment-file-facts,project-share-status,publication-authority}.ts、app.ts、metrics.ts;BLOB_VERIFICATION_CONCURRENCY 控制重上传校验并发(超出返回 503)。 |
无。 | 无。 | 20261028094201_public_upload_recovery.sql(resource_hub.public_uploads、resource_hub.blob_upload_leases 及过期索引);db/schema/resource_hub.hcl(+72)。该文件是 manifest 中唯一一条 pendingMainSources,落在 runtime_ready 阶段。 |
|
M用量金额与支付事件可观测
支付事件 outbox 与用量金额/折扣快照的可观测链路:支付事件写入 outbox 供分析消费,用量金额、结算资格与折扣上下文进入同一快照口径,Link 侧补流量观测。 Author:杨瑾龙(PR #467) |
src/lib/workspace-analytics.ts、use-workspace-page-tracking.ts、workspace-action-analytics.ts。 |
src/payment-analytics.ts、usage-pricing-snapshot.ts、usage-settlement-eligibility.ts、usage-discount-context.ts、metrics.ts。 |
internal/usage/pricing_snapshot.go、analytics_notify.go、traffic.go、server/traffic.go、third_party/bifrost-core/schemas/traffic_request_observer.go。 |
无。 | 20261028073210_payment_analytics_outbox.sql(runtime_ready 阶段);db/schema/payment_analytics.hcl(+30)。 |
已在生产生效(发布点之前,本次不重复发布)
以下 feature 的 commit 均在对应生产发布点之前,已在生产运行。四个服务以 EKS Pod 实态为基线,DB migration 以 workflow 记录为基线。若从 main 重新发布,只分析各自基线之后的净新增;基线之前的内容从 feature 表挪到这里。
- DB migration(BASE_DB
a96663290,run #20415 已生效):发布点内共 127 个 migration,含 #673 的20261028083959_add_video_admissions_v2.sql、#634 的20261027031902_drop_contribution_admission_foreign_key.sql与20261027093246_contribution_multiplier_snapshot.sql,以及 #677、#642、#635、#619、#610、#582 相关 schema 变更。 - API(BASE_API
bfc134ead= #634 已生效):#634 贡献倍率字段与快照双写、#619 删除 admission 外键并清理 Admin 诊断查询、#610 删除已停用的usage_events查询场景。 - Link(BASE_LINK
a96663290= #673 已生效):#673 内存传递普通请求许可 + 视频准入迁移到admissions_v2(双表完成/回放、usage Recorder 透传)、#677 限制用户 API 只调用有权限的 public model、#642 DeepSeek Flash Responses 忽略 hosted web_search、#634 倍率快照、#619 删除 admission 外键、#582 Echo 四点流量采集与可信回放。 - Admin(BASE_ADMIN
e05a7065d= #677 已生效):#635 批量封禁单事务 + 轻量用户查询隔离、#619 Admin 诊断查询删除。 - Web(BASE_WEB
568b89812已生效):Web 发布点比 API/Link 更旧,但568b89812..a96663290之间的 #582/#610/#619/#634/#635/#642/#673/#677 均未改动apps/web,因此 Web 侧没有额外的「已上线但未在 Web 生效」积压,本次 Web 净新增全部来自上表 #467 与 #579。 - 范围内已回退(净变更归零,本次不发布):五个维度的 range 内没有 revert 提交,无需要特殊处理的回退 migration。
发布建议
-
Migration 判断:必须先跑 deploy-db-migrations-prod.yml,且是 5 次分阶段 dispatch。
BASE_DB 之后
db/migrations新增 53 个 SQL(#467 52 个 + #579 1 个)。这些文件不是一次atlas apply就能执行:db/migration-rollout.json指定了 production-forward manifestretained-team-production-forward-production125-pending-upload-20261028, 该 manifest 以a96663290为基线(prefix 127 个已应用 migration),把增量整理为 108 个生产 SQL、5 个阶段:expand 57 / contract 1 / legacy_team_prepare 5 / application_ready 20 / runtime_ready 25。 已核对 manifest 与当前 main 的 180 个 migration、14 个 schema 源文件、108 个阶段文件哈希一致,基线之前 run #20415 的 commit 不含migration-rollout.json,即这 5 个阶段尚未由该 workflow 运行过。 -
阻断点(发布前必须先澄清,不能直接宣布可发布):
- contract 阶段当前会硬失败:
contract走require_live_writer_fleet→verify_bridge_compatibility(scripts/prod-db-migration-workflow.py:945-948),要求 manifest 内有bridgeCompatibility.approved=true与 8 项 expand-only bridge smoke 结果;当前 manifest 没有bridgeCompatibility字段,precheck 会以 “No approved expand-only bridge smoke is bound to this manifest yet” 失败。补齐并评审 bridge 证据前,contract 及其之后的 legacy_team_prepare / application_ready / runtime_ready 都无法通过(后三者还要求前阶段边界已完成,:1214)。 - contract 的 writer 前置与 API 的 schema 前置互相咬住:contract 要求
writers_ready_revision等于本次 dispatch 的GITHUB_SHA,且amr-api/amr-link/amr-admin/amr-web四个 Deployment 全部健康运行prod-a30eb9fc3(:1219-1230、:897-940);而 API 的 prod workflow 无条件执行api-schema-precheck(.forgejo/workflows/deploy-api-eks-prod.yml:97-107),按db/migration-rollout.json的api_required_stage=runtime_ready,未完成 runtime_ready 就拒绝发布 API(scripts/prod-db-migration-workflow.py:1387)。即 contract 需要 API 已是新版本,API 又要求 contract 之后的阶段全部完成——按现有配置这是环形依赖,不能按「一次发布会」顺序执行。 - expand / 各阶段 precheck 依赖生产数据:每阶段都要通过
preflight.sql的有界数据检查(openPurchaseComplete、defaultComplete、personalIntentComplete、checkoutReferenceComplete为 true,重复/孤儿计数为 0,:1216-1217),异常即中止。这一步需要现场核验生产数据,报告无法替代。
- contract 阶段当前会硬失败:
-
服务发布顺序(解决上面阻断后):DB expand → contract → legacy_team_prepare → application_ready → runtime_ready(每阶段单独 dispatch,且 contract 期间
sharedBillingEnabled必须保持 false,:1224)→ API(7 commits,硬门槛为 runtime_ready)→ Link(2 commits,新代码会写link.model_limit_admissions_v2并读public.workspace_billing_fund_origins,同样依赖 runtime_ready)→ Admin(3 commits,新增迁移运行管理台,依赖 API 的迁移接口)→ Web(11 commits,最后发布:新控制台调用的/v1/workspaces/*/billing/*接口由本次 API 提供)。 另:#579 要求 DB → API + 匹配的 CLI → Open Design 客户端(#9025)顺序,客户端不得先上线。 -
发布后观测:
- DB:每次 dispatch 的 precheck/apply 结果与
db:status无 pending;18 个 online index 的 valid/ready;preflight 计数持续为 0。 - API:workspace-commerce checkout/订阅变更 5xx 与 P95、迁移任务队列积压、
payment_analytics_outbox堆积、blob_upload_leases回收任务。 - Link:准入 pipeline 错误(legacyMigration / workspace credit)、
usage_events.settlement_ready_at积压、model_limit_admissions_v2写入失败、请求并发快照。 - Admin:billing-migration-runs 批次状态与兼容性检查、计费运行时开关保持预期状态。
- Web:
/seats-console、钱包、用量明细、账单记录、邀请落地页的可用性与关键请求成功率。
- DB:每次 dispatch 的 precheck/apply 结果与
-
跨维度已知缺口(本次范围内没有 API 侧修复,需上线前确认):
工作空间用量明细的 Plan 倍率/贡献额度仍按旧表关联:API 侧
services/api/src/billing/infra/postgres.ts:9265仍join link.model_limit_admissions admission on admission.id = contribution.admission_id,而 Link 新准入只写link.model_limit_admissions_v2(services/link/internal/repositories/model_limit.go:379,已在生产),并把permit.ID(v2 id)写入model_limit_contributions.admission_id。加上 #619 已删除该外键约束,新 Coding Plan 请求在用量明细里的plan_multiplier/plan_contribution_credits会取不到值。本次五元组内 API 变更没有消除该缺口,发布判断需按「已知降级」处理或先补齐 API 读取切换。
备注:所有 workflow、commit、PR 或 compare range 均使用 Forgejo 链接。四个服务的 compare range 基于 EKS Pod 观察到的 BASE(Web 568b89812、API bfc134ead、Link a96663290、Admin e05a7065d),DB migration 的 compare range 基于 migration workflow 的 BASE a96663290;未统一使用最旧基线,也没有用四个服务最近成功 workflow 的 SHA 替代 Pod 实态(本次四份 workflow 记录与 Pod 实态一致,仅作审计对照)。