bailinghub 0.9.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/.dockerignore +6 -0
  2. package/.npmignore +6 -0
  3. package/CONTRIBUTING.md +4 -0
  4. package/GOVERNANCE.md +9 -0
  5. package/README.en.md +7 -6
  6. package/README.md +7 -6
  7. package/SECURITY.md +8 -2
  8. package/THIRD_PARTY_NOTICES.md +17 -17
  9. package/docker-compose.images.yml +2 -2
  10. package/docs/CHANGELOG.en.md +22 -1
  11. package/docs/CHANGELOG.md +22 -1
  12. package/docs/COMPATIBILITY.en.md +4 -0
  13. package/docs/CORE_RELIABILITY.en.md +59 -0
  14. package/docs/CORE_RELIABILITY.md +59 -0
  15. package/docs/DEPLOYMENT_DIAGNOSTICS.en.md +78 -0
  16. package/docs/DEPLOYMENT_DIAGNOSTICS.md +78 -0
  17. package/docs/IMPLEMENTATION_STATUS.en.md +81 -0
  18. package/docs/IMPLEMENTATION_STATUS.md +81 -0
  19. package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
  20. package/docs/INDEPENDENT_VALIDATION.md +4 -4
  21. package/docs/KERNEL_HOST_API.en.md +20 -0
  22. package/docs/KERNEL_HOST_API.md +20 -0
  23. package/docs/MODEL_BILLING.en.md +4 -0
  24. package/docs/MODEL_BILLING.md +4 -0
  25. package/docs/MODEL_PROCESS_RECOVERY.en.md +32 -0
  26. package/docs/MODEL_PROCESS_RECOVERY.md +37 -0
  27. package/docs/README.en.md +8 -0
  28. package/docs/README.md +8 -0
  29. package/docs/RELEASE_NOTES_NEXT.en.md +3 -3
  30. package/docs/RELEASE_NOTES_NEXT.md +3 -3
  31. package/docs/RELEASE_NOTES_v0.9.1.en.md +38 -0
  32. package/docs/RELEASE_NOTES_v0.9.1.md +38 -0
  33. package/docs/RELEASE_NOTES_v0.9.2.en.md +45 -0
  34. package/docs/RELEASE_NOTES_v0.9.2.md +45 -0
  35. package/docs/UPGRADE_v0.9.1.en.md +39 -0
  36. package/docs/UPGRADE_v0.9.1.md +39 -0
  37. package/docs/UPGRADE_v0.9.2.en.md +62 -0
  38. package/docs/UPGRADE_v0.9.2.md +62 -0
  39. package/docs//345/205/274/345/256/271/346/200/247/344/270/216/345/215/207/347/272/247.md +4 -0
  40. package/package.json +10 -5
  41. package/scripts/check-doc-links.mjs +4 -0
  42. package/scripts/check-image-tags.sh +1 -1
  43. package/scripts/check-release-consistency.test.mjs +2 -2
  44. package/scripts/dependency-audit.mjs +134 -0
  45. package/scripts/dependency-audit.test.mjs +125 -0
  46. package/scripts/doctor-deployment.test.ts +419 -0
  47. package/scripts/doctor-deployment.ts +357 -0
  48. package/scripts/doctor.ts +8 -1
  49. package/scripts/install-secrets.test.mjs +185 -0
  50. package/scripts/install.sh +10 -6
  51. package/scripts/osps-results.py +114 -0
  52. package/scripts/publish-images.sh +1 -1
  53. package/scripts/release-audit.mjs +5 -0
  54. package/scripts/verify-github-repo.mjs +5 -0
  55. package/security/dependency-audit-exceptions.json +192 -0
  56. package/sql/065_usage_reconciliation_scan.sql +4 -0
  57. package/sql/066_approval_continuations.sql +15 -0
  58. package/sql/README.md +9 -0
  59. package/src/app/approval-continuations.mysql.test.ts +138 -0
  60. package/src/app/approval-continuations.test.ts +325 -0
  61. package/src/app/approval-continuations.ts +107 -0
  62. package/src/app/http-server.ts +3 -0
  63. package/src/app/kernel-model-process-crash.mysql.test.ts +377 -0
  64. package/src/app/kernel-usage-lifecycle.mysql.test.ts +325 -0
  65. package/src/app/kernel.ts +23 -0
  66. package/src/app/runtime-evidence-maintenance.test.ts +55 -0
  67. package/src/app/runtime-lifecycle-default.ts +7 -0
  68. package/src/app/runtime-lifecycle.ts +39 -0
  69. package/src/core/contracts/approval-continuation.ts +43 -0
  70. package/src/core/contracts/types.ts +2 -0
  71. package/src/core/state/approval-continuation.ts +22 -0
  72. package/src/core/state/state-codec.ts +1 -0
  73. package/src/core/state/state-contracts.ts +3 -0
  74. package/src/infrastructure/config/config-approval-ledger.ts +75 -0
  75. package/src/infrastructure/config/configstore.ts +2 -2
  76. package/src/infrastructure/state/state-jsonl.ts +41 -11
  77. package/src/infrastructure/state/state-mysql.ts +27 -0
  78. package/src/modules/usage/background-work.test.ts +144 -0
  79. package/src/modules/usage/background-work.ts +50 -0
  80. package/src/modules/usage/billing-reconciliation.mysql.test.ts +163 -0
  81. package/src/modules/usage/billing-reconciliation.test.ts +71 -0
  82. package/src/modules/usage/billing-repository.ts +60 -15
  83. package/src/modules/usage/maintenance.test.ts +62 -0
  84. package/src/modules/usage/maintenance.ts +31 -0
  85. package/src/modules/usage/model-gateway.ts +11 -3
  86. package/src/modules/usage/model-tool-gateway.mysql.test.ts +1 -1
  87. package/src/modules/usage/pricing.ts +3 -2
  88. package/src/modules/usage/repository.ts +2 -0
  89. package/src/modules/usage/test-harness.ts +2 -1
  90. package/src/routes/admin-default.ts +2 -2
  91. package/src/routes/admin-runtime-default.ts +2 -2
  92. package/src/routes/admin-runtime.test.ts +1 -1
  93. package/src/routes/admin-runtime.ts +25 -18
  94. package/src/routes/admin.ts +1 -1
  95. package/src/routes/approvals-default.ts +2 -2
  96. package/src/routes/approvals.ts +30 -33
  97. package/src/routes/critical-routes.test.ts +16 -3
  98. package/src/test-support/approval-continuation-crash-child.ts +24 -0
  99. package/src/test-support/model-process-crash-child.ts +78 -0
  100. package/web/console/assets/{Accounts-DnddhY6t.js → Accounts-DKhw_QLr.js} +1 -1
  101. package/web/console/assets/{AgentClients-VInbD7JS.js → AgentClients-CM4_5HaA.js} +1 -1
  102. package/web/console/assets/{AgentTasks-B-1XklBg.js → AgentTasks-CkQgZTU5.js} +1 -1
  103. package/web/console/assets/{Approvals-34qUPHf0.js → Approvals-B9O9TkbO.js} +1 -1
  104. package/web/console/assets/{Audit-BbVgkSm2.js → Audit-2vDC1SPu.js} +1 -1
  105. package/web/console/assets/{BrandLockup-DgscF28e.js → BrandLockup-BgASiRSE.js} +1 -1
  106. package/web/console/assets/{Channels-Bp-yuk8d.js → Channels-A-GvkNBt.js} +1 -1
  107. package/web/console/assets/{ChatEntries-C9Ft60TS.js → ChatEntries-BLxymI67.js} +1 -1
  108. package/web/console/assets/{Clients-NPldD-DD.js → Clients-DeNlmvS6.js} +1 -1
  109. package/web/console/assets/{Cost-DZcuB-EB.js → Cost-CBq_L4Kz.js} +1 -1
  110. package/web/console/assets/{Credentials-RTT7N6zl.js → Credentials-DmtbctNj.js} +1 -1
  111. package/web/console/assets/{Diagnostics-_LeK8cce.js → Diagnostics-BbcRDiA-.js} +1 -1
  112. package/web/console/assets/{Executors-Bi7H8rIm.js → Executors-gGgmQrDt.js} +1 -1
  113. package/web/console/assets/{HelpTip-BfyWrxCE.js → HelpTip-Dtdt2tKR.js} +1 -1
  114. package/web/console/assets/{Kb-BHamz8NP.js → Kb-lgY6OXUz.js} +2 -2
  115. package/web/console/assets/{Login-C1rJR-6w.js → Login-DA6BASZd.js} +1 -1
  116. package/web/console/assets/{Projects-BRA4a48v.js → Projects-DEbmB_sT.js} +1 -1
  117. package/web/console/assets/{Routes-CTC7U-fQ.js → Routes-qS6LLoyS.js} +1 -1
  118. package/web/console/assets/{Runs-B_fa_BlD.js → Runs-DG-VLRSc.js} +1 -1
  119. package/web/console/assets/{Setup-C1_d0mFy.js → Setup-DEpVF5uw.js} +1 -1
  120. package/web/console/assets/{Shell-CHEV6RGC.js → Shell-DgoPgK1E.js} +1 -1
  121. package/web/console/assets/{StorageBuckets-DlG3ojhA.js → StorageBuckets-DJtNN769.js} +1 -1
  122. package/web/console/assets/{SystemSettings-DYo2gg6d.js → SystemSettings-0DEUgeTR.js} +1 -1
  123. package/web/console/assets/{SystemStatus-DKCoUZlq.js → SystemStatus-CR1phiPE.js} +1 -1
  124. package/web/console/assets/{Targets-CdkG6BPR.js → Targets-D65l-IMB.js} +1 -1
  125. package/web/console/assets/{Tools-DVpCt0ox.js → Tools-DqtrINrN.js} +1 -1
  126. package/web/console/assets/{Usage-DWCpLugC.js → Usage-B5njXNjx.js} +1 -1
  127. package/web/console/assets/{UsageAccess-B_Xq7ARW.js → UsageAccess-ChnB4pjb.js} +1 -1
  128. package/web/console/assets/{UsageHelp-t5ZG_f-e.js → UsageHelp-BBKIvbQ5.js} +1 -1
  129. package/web/console/assets/{index-C6W4LWVV.js → index-65JiiUr4.js} +1 -1
  130. package/web/console/assets/{index-H1kfa0Mj.js → index-sLKrJd_p.js} +2 -2
  131. package/web/console/assets/{request-DLsP1_ot.js → request-BpaimqEb.js} +1 -1
  132. package/web/console/assets/{schema-BLOHvAJQ.js → schema-D0Z4kFCZ.js} +1 -1
  133. package/web/console/assets/{util-CGVh2Jvr.js → util-DZYfJ5Zo.js} +1 -1
  134. package/web/console/assets/{vendor-element-BD089KxE.js → vendor-element-8cVcdt5T.js} +1 -1
  135. package/web/console/assets/{vendor-mammoth-Bv-CZhmH.js → vendor-mammoth-CnDA23N0.js} +1 -1
  136. package/web/console/assets/vendor-vue-Co7x2FW6.js +29 -0
  137. package/web/console/index.html +3 -3
  138. package/web-admin/package-lock.json +83 -85
  139. package/web/console/assets/vendor-vue-B2uhHUfE.js +0 -29
@@ -1,5 +1,5 @@
1
- # Current release: Core 0.9.0
1
+ # Current release: Core 0.9.1
2
2
 
3
- Core 0.9.0 introduces an optional model billing gateway, shared USD plans, periodic allowances and text-to-image tools. Release pairing: SDK 0.7.0 / DSH 0.7.0.
3
+ Core 0.9.1 fixes asynchronous usage shutdown, adds a public capability/evidence index, and includes general security governance. No new APIs, SQL, plan rules, or client features are introduced. SDK 0.7.0 / DSH 0.7.0 remain unchanged.
4
4
 
5
- [Core 0.9.0 release notes](RELEASE_NOTES_v0.9.0.en.md) · [Upgrade guide](UPGRADE_v0.9.0.en.md) · [Billing contract](MODEL_BILLING.en.md) · [简体中文](RELEASE_NOTES_NEXT.md)
5
+ [Core 0.9.1 release notes](RELEASE_NOTES_v0.9.1.en.md) · [Upgrade guide](UPGRADE_v0.9.1.en.md) · [Billing contract](MODEL_BILLING.en.md) · [简体中文](RELEASE_NOTES_NEXT.md)
@@ -1,5 +1,5 @@
1
- # 当前版本:Core 0.9.0
1
+ # 当前版本:Core 0.9.1
2
2
 
3
- Core 0.9.0 提供可选模型计费网关、统一 USD 套餐、周期额度与文生图工具。配套为 SDK 0.7.0 / DSH 0.7.0。
3
+ Core 0.9.1 修复异步 usage 工作关闭等待,增加公开能力与证据索引,并纳入通用安全治理。没有新增 API、SQL、套餐或客户端功能;SDK 0.7.0 / DSH 0.7.0 不变。
4
4
 
5
- [Core 0.9.0 版本说明](RELEASE_NOTES_v0.9.0.md) · [升级指南](UPGRADE_v0.9.0.md) · [计费契约](MODEL_BILLING.md) · [English](RELEASE_NOTES_NEXT.en.md)
5
+ [Core 0.9.1 版本说明](RELEASE_NOTES_v0.9.1.md) · [升级指南](UPGRADE_v0.9.1.md) · [计费契约](MODEL_BILLING.md) · [English](RELEASE_NOTES_NEXT.en.md)
@@ -0,0 +1,38 @@
1
+ # v0.9.1: asynchronous model shutdown and public capability evidence
2
+
3
+ [中文版](RELEASE_NOTES_v0.9.1.md)
4
+
5
+ After an assistant requests an image, the Hub promptly returns the original request's pending state. Provider completion and usage settlement follow later. If a host evicts an instance, upgrades, or exits at that point, a finished HTTP request does not mean its background work is finished.
6
+
7
+ Core 0.9.1 fixes that shutdown boundary by waiting for the original instance's usage background work and subsequent settlement before closing resources. It also includes a public capability index and general security governance already on main. This is a patch release with **no new HTTP/API, SQL migration, plan rule, client feature, or SDK/DSH release**.
8
+
9
+ ## Shutdown fix
10
+
11
+ - Each `UsageRepository` separately registers model-tool completion, settlement after ordinary model responses, response cleanup, pending-usage reconciliation, and reference-price refresh through persistence.
12
+ - Kernel stops new HTTP admission and waits for foreground handlers, InHub, and execution queues to finish registering work. It then stops new usage work/maintenance and dynamically drains accepted completion and late settlement children before resource closure.
13
+ - All stages share the original `close(drainMs)` deadline. A usage-drain timeout preserves the original dependencies and closing state for same-instance retry; it does not redispatch a model request or business write.
14
+ - Image requests still promptly return HTTP 202. Ordinary text results also arrive before financial settlement. Original `operation_id` values, separate result/billing states, business authority, approvals, and unknown-outcome handling remain unchanged.
15
+ - Failed background work can retain durable pending/unknown evidence. Completed drain does not guarantee every record is settled or provide process-crash recovery or provider-task recovery.
16
+
17
+ The formal v0.9.0 close path did not explicitly register these usage continuations. Its Tag and existing artifacts remain unchanged; this fix does not rewrite their historical guarantees. See the [Kernel Host API](KERNEL_HOST_API.en.md) and [capability/evidence index](IMPLEMENTATION_STATUS.en.md).
18
+
19
+ ## Public documentation and general security governance
20
+
21
+ The new Chinese/English capability index separates Core, business-system, local-host, and independent-adapter responsibilities, release facts, public test/reproduction paths, and uncovered scope. Thread context, visible conversation audits, and complete user-level long-term memory remain distinct. Existing tests are not presented as production adoption.
22
+
23
+ This release also includes dependency auditing with explicit exception checks, pinned GitHub Actions sources and minimal permissions, dependency-update and repository scanning configuration, plus public security self-assessments and Security Insights metadata. Assessments/metadata are repository governance and excluded from npm runtime packages and Docker build contents. Their existence does not establish that every control passes or that no residual risks remain.
24
+
25
+ ## Upgrade impact
26
+
27
+ - Upgrading public Core 0.9.0 adds no SQL files and changes no existing migrations. Earlier versions still require their outstanding migrations; see the [upgrade guide](UPGRADE_v0.9.1.en.md).
28
+ - USD allowances, the uniform multiplier, periodic price/allowance, model catalogs, and business-governance contracts remain unchanged. This patch does not require new plan grants or replacement request IDs.
29
+ - Continue using **MCP / Agent Client SDK 0.7.0 and DSH 0.7.0**. Independent packages are not republished solely for this patch. Business declarations, signatures, authorization, and approval code need no patch-specific rewrite.
30
+ - Embedded hosts should read the new Core artifact's version and complete manifest, and continue using its public tick/close entry points. A Core artifact upgrade does not establish that hosts or clients have been upgraded, deployed, or accepted.
31
+
32
+ ## Validation scope
33
+
34
+ [Tracker unit tests](../src/modules/usage/background-work.test.ts) check registration/drain mechanisms. [Actual Kernel + MySQL lifecycle tests](../src/app/kernel-usage-lifecycle.mysql.test.ts) check real Kernels, database transactions, and HTTP/standalone shutdown wiring. They cover delayed completion, late settlement, SQL locks, same-instance retry, two-Kernel isolation, ordinary text asynchronous settlement, independent cleanup/reconciliation, price persistence, and failed settlement retaining original results without redispatch.
35
+
36
+ Database cases require `BAILING_USAGE_TEST_MYSQL=1` and their dedicated test MySQL; providers and business data are synthetic. Test source or skipped tests are not passing runs. Real providers, business APIs, and deployments require their own acceptance. This page makes no production-adoption, comprehensive model-quality, or complete failure-recovery claim.
37
+
38
+ [Upgrade guide](UPGRADE_v0.9.1.en.md) · [Changelog](CHANGELOG.en.md) · [Previous release](RELEASE_NOTES_v0.9.0.en.md)
@@ -0,0 +1,38 @@
1
+ # v0.9.1:异步模型工作关闭与公开能力证据
2
+
3
+ [English](RELEASE_NOTES_v0.9.1.en.md)
4
+
5
+ 业务助手请求生成图片后,中枢会先返回原请求的 pending 状态,供应商响应和用量结算随后完成。如果宿主此时淘汰实例、升级或退出进程,不能把 HTTP 请求已经结束当成后台工作也已结束。
6
+
7
+ Core 0.9.1 修复这一关闭边界:在关闭资源前,等待属于原实例的 usage 后台工作及其后续结算。它还纳入公开能力索引和此前主分支的通用安全治理。本版是补丁版本,**没有新增 HTTP/API、SQL 迁移、套餐规则、客户端功能或 SDK/DSH 发行**。
8
+
9
+ ## 关闭修复
10
+
11
+ - 每个 `UsageRepository` 独立登记模型工具完成、普通模型响应后的结算、响应清理、待结算 usage 核对,以及参考价格刷新到持久化结束的工作。
12
+ - Kernel 先停止新 HTTP 接入,等待前台、InHub 和执行队列完成登记,再停止新 usage 工作和维护;动态排空已接纳的完成及晚登记的结算子工作后才关闭资源。
13
+ - 所有阶段共用原 `close(drainMs)` 时限。usage 排空超时会保留原实例依赖和关闭状态,供宿主在同一实例重试;不因此重新派发模型或业务写入。
14
+ - 图片首次响应仍及时返回 HTTP 202;普通文本结果也不等待财务结算再交付。原 `operation_id`、结果/计费状态分离、业务权限、审批和未知结果处理不变。
15
+ - 失败后台工作仍可能留下 durable pending/unknown 证据。排空结束不保证所有记录已经 settled,也不提供进程崩溃恢复或供应商任务恢复保证。
16
+
17
+ 正式 v0.9.0 的关闭路径没有显式登记这些 usage continuation;该 Tag 和已有制品保持原样。修复不回写其历史保证。完整语义见 [Kernel Host API](KERNEL_HOST_API.md) 和 [能力与证据索引](IMPLEMENTATION_STATUS.md)。
18
+
19
+ ## 公开文档与通用安全治理
20
+
21
+ 新增中英能力与证据索引,分别说明 Core、业务系统、本地宿主和独立适配层的职责,以及发行事实、公开测试/复现路径和未覆盖范围。线程上下文、可见对话审计与完整用户级长期记忆分别说明,不把已有测试扩展为生产采用证明。
22
+
23
+ 本版同时纳入依赖审计与显式例外检查、固定 GitHub Actions 来源和最小权限、依赖更新及仓库安全扫描配置,以及公开安全自评和 Security Insights 元数据。自评/元数据属于仓库治理,排除在 npm 运行包和 Docker 构建内容之外;治理资料存在不意味着全部安全控制通过或没有残余风险。
24
+
25
+ ## 升级影响
26
+
27
+ - 从公开 Core 0.9.0 升级,没有新增 SQL 文件,不改变已有迁移内容。更早版本仍须应用其未执行迁移,见 [升级指南](UPGRADE_v0.9.1.md)。
28
+ - 原有 USD 额度、统一倍率、周期售价/额度、模型目录和业务治理契约保持。无需为本补丁重新开通套餐或改变原请求标识。
29
+ - 使用既有 **MCP / Agent Client SDK 0.7.0、DSH 0.7.0**;不机械重发独立包。业务后端的声明、验签、授权和审批代码无须为本补丁改写。
30
+ - 嵌入式宿主应读取新 Core 制品的版本及完整 manifest,并继续调用其公开 tick/close 入口。Core 制品升级不证明宿主或客户端已经升级、部署或验收。
31
+
32
+ ## 验证范围
33
+
34
+ [登记器单元测试](../src/modules/usage/background-work.test.ts) 与 [实际 Kernel + MySQL 生命周期测试](../src/app/kernel-usage-lifecycle.mysql.test.ts) 分别检查内部登记/排空机制和真实 Kernel、数据库事务、HTTP/standalone 关闭接线。后者覆盖延迟完成、晚结算、SQL 锁、同实例重试、双 Kernel 隔离、普通文本异步结算、单独清理/核对、价格持久化,以及失败保留原结果而不重派。
35
+
36
+ 数据库用例需 `BAILING_USAGE_TEST_MYSQL=1` 和其专用测试 MySQL;供应商及业务数据为合成数据。测试源码或被跳过的测试不等于通过记录;真实供应商、业务接口和部署仍各自验收。本页不声称生产采用、全量模型质量或完整故障恢复。
37
+
38
+ [升级指南](UPGRADE_v0.9.1.md) · [版本记录](CHANGELOG.md) · [上一版本](RELEASE_NOTES_v0.9.0.md)
@@ -0,0 +1,45 @@
1
+ # v0.9.2: secure installation and persisted continuation
2
+
3
+ [简体中文](RELEASE_NOTES_v0.9.2.md)
4
+
5
+ Version date: 2026-10-13. A patch update from public Core 0.9.1.
6
+
7
+ A model result has returned, but settlement remains pending. An approval is recorded, but a temporary failure leaves the original job outside the queue. BailingHub 0.9.2 continues checking and recovering these persisted records without waiting for another request, and fixes credential generation when secure randomness fails during installation.
8
+
9
+ ## Fixes
10
+
11
+ ### Stop installation when secure randomness fails
12
+
13
+ When creating configuration, the installer generates its six default credentials independently through secure randomness. Missing OpenSSL, a failed producer or invalid output stops installation before writing a partial `.env` or starting services. Existing `.env` files are preserved, including changed administrator passwords. Operators need a working OpenSSL implementation; timestamps and digests are not randomness substitutes.
14
+
15
+ ### Advance asynchronous settlement without traffic
16
+
17
+ Reconciliation previously depended on requests. standalone now schedules an initial pass and subsequent passes every minute; managed Kernels use their first and subsequent existing `tick()` calls. Pages contain at most 50 records, advance by cursor and wrap at the end. Unpriceable or individually corrupt records no longer repeatedly occupy the first page and block later records.
18
+
19
+ Reconciliation uses the original request's saved metering, reference prices and unified multiplier. It does not read generated bodies, contact providers or redispatch models. Missing authoritative metering remains pending/unknown, rather than becoming an invented zero charge. Work for one owner shares an active pass, with database-failure backoff. Shutdown stops new maintenance and waits for started evidence writes; a timeout retains work for same-instance retry.
20
+
21
+ ### Persist continuation for the original approval decision
22
+
23
+ External callbacks and the console save the decision and continuation record in one transaction. Retrying the original `decision_id` can recover temporary auditing or queue failures; background maintenance also advances unfinished continuations. A saved decision whose continuation fails returns `503` and `decision_recorded=true / continuation_pending=true`. Do not create another approval for recovery.
24
+
25
+ Original-job queue admission and the decision marker are written atomically, with consumed-approval checks repeated inside the admission critical section. Lost queue acknowledgements, process reopening and completed subsequent runs cannot admit the job again for the same decision. Consumed approvals are not requeued; historical decisions without new continuation records are not backfilled. Denials only complete auditing. Direct Agent invocations still require the original Agent to explicitly resume the original `invocation_id`; approval does not start a Core model loop.
26
+
27
+ ## Additional diagnostics and public regressions
28
+
29
+ `npm run doctor -- --deployment --url <Core URL>` adds read-only deployment diagnostics. By default it checks `/health`, `/version` and local artifact identity. Only explicit `--readiness` asks the server to check its database and migration ledger. Diagnostics perform no upgrade, rollback or migration. Matching declarations do not establish artifact integrity, actual database identity or deployment acceptance; see [scope and exit codes](DEPLOYMENT_DIAGNOSTICS.en.md).
30
+
31
+ This release also ships actual child-process `SIGKILL` and lost MySQL COMMIT-acknowledgement model recovery regressions for the first time. They validate existing original-request recovery and settlement semantics, adding test coverage rather than automatic redispatch behavior. Approval acceptance also covers recovery in another PID, lost acknowledgements and concurrent continuation. See [model process recovery regressions](MODEL_PROCESS_RECOVERY.en.md) and [Core reliability regressions](CORE_RELIABILITY.en.md).
32
+
33
+ ## Who should upgrade
34
+
35
+ - **Core operators** using the installer, model billing or external/console approvals should upgrade and apply 065/066. Preserve configuration, databases, original requests and rollback artifacts first.
36
+ - **Embedded and custom-adapter developers** retain fair `tick()` calls and `close(drainMs)`, and supply matching continuation ledger methods plus `RuntimeStateStore.requeueApprovedJobOnce`. New decisions are explicitly unavailable without these implementations; they do not fall back to the old unrecoverable queue path.
37
+ - **Business-backend and client integrators** retain existing declarations, signature verification and final authorization. Approval retries retain the original decision identifier; result recovery retains the original invocation identifier. MCP / Agent Client SDK 0.7.0 and DSH 0.7.0 remain unchanged. ACC, independent Hosts and clients release separately and are not part of this Core patch.
38
+
39
+ ## Upgrade and verify
40
+
41
+ Relative to 0.9.1, this release adds `065_usage_reconciliation_scan.sql` and `066_approval_continuations.sql`. Apply all outstanding files through `npm run db:init` or the official explicit Kernel migration port. Runtime startup does not migrate automatically. Coordinate old writers and verify migration plus adapter support before starting the new version. The [upgrade guide](UPGRADE_v0.9.2.en.md) covers preserved data, original-ID checks, diagnostics and rollback.
42
+
43
+ After verifying artifact identity, migration ledger and health, check settlement without traffic, approval failure recovery and close draining in a dedicated test environment. Public regressions use isolated databases and synthetic providers; they do not establish live-provider or production business acceptance. Queue admission deduplication does not guarantee exactly-once external business effects.
44
+
45
+ [Upgrade guide](UPGRADE_v0.9.2.en.md) · [Full changelog](CHANGELOG.en.md) · [Capability and evidence index](IMPLEMENTATION_STATUS.en.md) · [Previous release](RELEASE_NOTES_v0.9.1.en.md)
@@ -0,0 +1,45 @@
1
+ # v0.9.2:安全安装与原记录补续
2
+
3
+ [English](RELEASE_NOTES_v0.9.2.en.md)
4
+
5
+ 版本日期:2026-10-13。相对公开 Core 0.9.1 的补丁更新。
6
+
7
+ 模型已经返回结果,但结算仍在 pending;审批已经批准,但一次临时故障让原任务停在队列外。百灵中枢(BailingHub)0.9.2 让这些持久记录在没有新请求的情况下继续核对和补续,并修复安装时安全随机源失败仍可能生成凭据的问题。
8
+
9
+ ## 修复了什么
10
+
11
+ ### 安全随机失败时停止安装
12
+
13
+ 新建配置时,默认六项凭据分别通过安全随机源生成。缺少 OpenSSL、随机命令失败或输出不合法时,安装器停止,不写半份 `.env`,不启动服务。已有 `.env` 保留,包括运营者修改的管理员密码。部署方需提供可用的 OpenSSL;不使用时间戳或摘要充当随机源。
14
+
15
+ ### 没有流量也推进异步结算
16
+
17
+ 过去依赖请求触发的核对,现在由 standalone 启动及每分钟维护自动推进;managed Kernel 由首个及后续既有 `tick()` 推进。每页最多 50 条,按游标前进并回绕,无法计价或单条损坏的记录不再反复占据首批、阻塞后面的记录。
18
+
19
+ 核对使用原请求已保存的计量、参考价格与统一倍率,不读取生成正文,不调用供应商或重派模型。缺少可靠计量继续保留 pending/unknown,不猜成零费用。同一 owner 的工作合并,数据库故障退避;关闭先停止新维护,再等待已开始的写账,超时保留同实例工作供重试。
20
+
21
+ ### 原审批决策可持久补续
22
+
23
+ 外部回调和控制台在同一事务保存决策及补续记录。审计或入队临时失败后,可使用原 `decision_id` 重试;后台维护也会推进未完成补续。决策已保存但补续失败返回 `503` 和 `decision_recorded=true / continuation_pending=true`,不要为恢复另造审批单。
24
+
25
+ 原任务入队与决策标记原子保存,并在入队临界区重验审批是否已消费。入队成功但确认丢失、进程重开或后续任务已经完成时,同一决策仍不会再次入队。审批已消费的记录不重排;没有新补续记录的历史决策不自动回填。拒绝仅补审计;Agent 直调仍由原 Agent 使用原 `invocation_id` 显式续执行,批准不会启动中枢模型循环。
26
+
27
+ ## 新增诊断与公开回归
28
+
29
+ `npm run doctor -- --deployment --url <Core URL>` 增加只读部署模式,默认核对 `/health`、`/version` 与本地制品身份。显式 `--readiness` 才让服务端检查数据库和迁移账本;诊断不执行升级、回滚或迁移。声明一致不能代替制品摘要、实际数据库身份或目标部署验收,详见[诊断范围与退出码](DEPLOYMENT_DIAGNOSTICS.md)。
30
+
31
+ 本版还首次发行实际子进程 `SIGKILL` 和 MySQL COMMIT 确认丢失的模型恢复专项。它验证已有原请求恢复和结算语义,属于测试覆盖新增,不是新的自动重派功能。审批专项也覆盖不同 PID 恢复、确认丢失和并发补续。见[模型进程恢复回归](MODEL_PROCESS_RECOVERY.md)与[Core 可靠性回归](CORE_RELIABILITY.md)。
32
+
33
+ ## 谁需要升级
34
+
35
+ - **Core 管理员**:使用安装器、模型计费或外部/控制台审批的部署,建议升级并应用 065/066;升级前保留配置、数据库、原请求与回滚制品。
36
+ - **嵌入式及自定义仓储开发者**:保留公平 `tick()` 与 `close(drainMs)`,配套 continuation ledger 方法和 `RuntimeStateStore.requeueApprovedJobOnce`。缺少配套实现时新审批决策明确 unavailable,不退回旧的不可靠入队方式。
37
+ - **业务后端及客户端接入方**:业务声明、验签和最终权限沿用既有契约;审批重试保留原决策标识,结果恢复保留原调用标识。MCP / Agent Client SDK 0.7.0、DSH 0.7.0 不变。ACC、独立 Host 与客户端各自发布,不包含在本次 Core 补丁中。
38
+
39
+ ## 升级与确认
40
+
41
+ 相对 0.9.1 新增 `065_usage_reconciliation_scan.sql` 与 `066_approval_continuations.sql`。通过 `npm run db:init` 或官方显式 Kernel 迁移入口应用全部未执行文件;运行时不自动迁移。先协调旧写入并核对迁移与仓储配套,再启动新版本。[升级指南](UPGRADE_v0.9.2.md)包含保留数据、原 ID 核对、诊断与回退步骤。
42
+
43
+ 确认新制品身份、迁移账本与健康状态后,在专用测试环境核对无流量结算、审批故障补续和关闭等待。公开回归使用隔离数据库与合成供应商;它们不代表真实供应商或生产业务已验收。队列准入去重也不等于外部业务效果恰好一次。
44
+
45
+ [升级指南](UPGRADE_v0.9.2.md) · [完整版本记录](CHANGELOG.md) · [能力与证据索引](IMPLEMENTATION_STATUS.md) · [上一版本](RELEASE_NOTES_v0.9.1.md)
@@ -0,0 +1,39 @@
1
+ # Core v0.9.1 patch upgrade guide
2
+
3
+ [中文版](UPGRADE_v0.9.1.md)
4
+
5
+ Upgrade public Core 0.9.0 to 0.9.1 to include usage background work in shutdown drain and receive the public capability index and general security-governance updates. There are no new APIs, SQL migrations, plan rules, or client features. MCP / Agent Client SDK and DSH remain at their existing 0.7.0 versions.
6
+
7
+ ## Preserve data and original calls
8
+
9
+ Retain databases, instance configuration/credentials, attachment storage, previous artifacts, and host session/original-call records. Stop new work for the target instance, coordinate writers sharing its state, and reconcile dispatched requests. Do not replace recovery with a new `operation_id`.
10
+
11
+ The 0.9.0 `close()` did not explicitly drain usage background continuations. A finished old-version HTTP request or a returned old `close()` does not establish that image completion, settlement, or price persistence has finished. Reconcile in-flight work using original requests before replacing artifacts.
12
+
13
+ ## Versions and database
14
+
15
+ - Use formal `v0.9.1` source, npm packages, or images. Verify the actual version, source Tag/commit, and artifact digest. Installer and prebuilt-image Compose defaults are updated to 0.9.1.
16
+ - Compared with 0.9.0, there are no new migrations, changes to existing SQL, table clears, or required plan/allowance resets. Earlier versions still apply all outstanding files through the official migrator; see the [0.9.0 upgrade guide](UPGRADE_v0.9.0.en.md).
17
+ - Embedded hosts recheck the complete `BAILINGHUB_CORE_ARTIFACT_V1` manifest. A version change changes artifact identity even when active SQL filenames/checksums are unchanged. Comparing only the latest migration is insufficient.
18
+ - This patch does not require SDK/DSH version bumps or changes to business declarations, signatures, permissions, or approvals.
19
+
20
+ ## Shutdown and acceptance
21
+
22
+ For an ordinary deployment, check `/health`, the console, and existing business smoke paths. Deployments using the usage gateway also check original request results, billing states, and allowance. A complete result is not necessarily settled billing.
23
+
24
+ Embedded hosts continue fair `tick()` calls and use `close(drainMs)` for eviction, upgrades, and shutdown. Within the original budget, 0.9.1 waits for model completion, settlement, cleanup/reconciliation, and price refresh. A **usage-drain-stage timeout** retains the original dependencies and closing state. Wait for original work and retry on the same instance or alert; do not forcibly close its database or treat timeout as permission to redispatch. This does not imply that every subsequent resource-close failure leaves all resources untouched.
25
+
26
+ Public regressions can be reproduced in a dedicated test environment:
27
+
28
+ ```bash
29
+ node --import tsx --test src/modules/usage/background-work.test.ts
30
+ BAILING_USAGE_TEST_MYSQL=1 node --import tsx --test src/app/kernel-usage-lifecycle.mysql.test.ts
31
+ ```
32
+
33
+ The database cases use the fixture's isolated test MySQL, synthetic providers, and synthetic data. Without that environment, or when cases are skipped, record database validation as unexecuted. The cases need no live model calls and do not replace live-provider or deployment acceptance. See the [Kernel Host API](KERNEL_HOST_API.en.md) and [capability index](IMPLEMENTATION_STATUS.en.md) for coverage and limitations.
34
+
35
+ ## Rollback boundary
36
+
37
+ No new schema is introduced, but returning to 0.9.0 removes the usage background-drain fix. Stop new work, retain original results, ledger, configuration, and rollback artifacts, and reconcile in-flight operations before deciding to roll back. Do not delete ledgers, replay original requests, or treat backup restoration as undoing later business effects.
38
+
39
+ [Release notes](RELEASE_NOTES_v0.9.1.en.md) · [Compatibility policy](COMPATIBILITY.en.md)
@@ -0,0 +1,39 @@
1
+ # Core v0.9.1 补丁升级指南
2
+
3
+ [English](UPGRADE_v0.9.1.en.md)
4
+
5
+ 从公开 Core 0.9.0 升级到 0.9.1,目标是补齐 usage 后台工作关闭等待,并取得公开能力索引与通用安全治理更新。没有新增 API、SQL、套餐规则或客户端功能;MCP / Agent Client SDK 与 DSH 继续使用既有 0.7.0。
6
+
7
+ ## 保留数据与原调用
8
+
9
+ 保留数据库、实例配置和凭据、附件存储、旧制品以及宿主的会话/原调用持久记录。停止目标实例的新工作,协调共享状态库的写入方,核对已经派发的原请求;不要通过新 `operation_id` 代替结果恢复。
10
+
11
+ 0.9.0 的 `close()` 没有显式排空 usage 后台 continuation。因此,升级前不能只凭旧版 HTTP 已结束或旧 `close()` 已返回,就认定图片完成、结算或价格写入已经结束。应按原请求核对在途工作,再替换制品。
12
+
13
+ ## 版本与数据库
14
+
15
+ - 使用正式 `v0.9.1` 源码、npm 包或镜像,核对实际版本、来源 Tag/提交和制品摘要;安装器与预构建镜像 Compose 的默认版本同步为 0.9.1。
16
+ - 相对 0.9.0 没有新增迁移,不修改已有 SQL,也不要求清表或重置套餐/额度。更早版本按正式迁移器应用其全部未执行文件,仍可参考 [0.9.0 升级指南](UPGRADE_v0.9.0.md)。
17
+ - 嵌入式宿主使用 `BAILINGHUB_CORE_ARTIFACT_V1` 重新核对完整制品 manifest。版本变更会改变 manifest 身份,即使活动 SQL 名称与摘要不变;不要只比较最后一个迁移文件。
18
+ - 本补丁不要求升级 SDK/DSH 的版本声明,也不改变业务后端的声明、验签、权限或审批。
19
+
20
+ ## 关闭与验收
21
+
22
+ 正常部署先验证 `/health`、控制台和原有业务 smoke。使用 usage 网关的部署另核对原请求结果、计费状态和额度,不把结果 complete 等同于已 settled。
23
+
24
+ 嵌入式宿主继续公平调用 `tick()`,在淘汰、升级或退出时调用 `close(drainMs)`。0.9.1 在原关闭预算内等待模型完成、结算、清理/核对和价格刷新。**usage 排空阶段超时**会保留原实例依赖和 closing 状态;等待原工作后,在同一实例重试或告警,不强行关闭其数据库,也不把超时解释为重派许可。该描述不扩大为任何资源关闭失败都能原封不动回退。
25
+
26
+ 可在专用测试环境复现公开回归:
27
+
28
+ ```bash
29
+ node --import tsx --test src/modules/usage/background-work.test.ts
30
+ BAILING_USAGE_TEST_MYSQL=1 node --import tsx --test src/app/kernel-usage-lifecycle.mysql.test.ts
31
+ ```
32
+
33
+ 数据库用例使用 fixture 要求的隔离测试 MySQL、合成供应商和数据。没有该环境或用例被跳过时,应明确记录数据库验证未执行;这些用例不需要真实模型调用,也不替代真实供应商或部署验收。完整覆盖与限制见 [Kernel Host API](KERNEL_HOST_API.md) 和 [能力索引](IMPLEMENTATION_STATUS.md)。
34
+
35
+ ## 回退边界
36
+
37
+ 本版没有新增 schema,但回退到 0.9.0 会重新失去 usage 后台关闭等待。先停止新工作并保留原结果、账本、配置和回滚制品,核对在途操作后再决定回退。不要删账本、重发原请求或把备份恢复当作撤销备份后业务效果的办法。
38
+
39
+ [版本说明](RELEASE_NOTES_v0.9.1.md) · [兼容策略](兼容性与升级.md)
@@ -0,0 +1,62 @@
1
+ # Core v0.9.2 patch upgrade guide
2
+
3
+ [简体中文](UPGRADE_v0.9.2.md)
4
+
5
+ Upgrade public Core 0.9.1 to 0.9.2 for installation secrets, asynchronous settlement maintenance and approval continuation fixes, plus read-only deployment diagnostics and process recovery regressions. MCP / Agent Client SDK and DSH remain at 0.7.0. This upgrade concerns Core; other components verify and release within their own projects.
6
+
7
+ ## Preserve data and coordinate writers
8
+
9
+ Back up the target database. Preserve configuration and credentials, attachment storage, original requests and approvals, previous artifacts and host persistence. Stop new work and coordinate all writers sharing the state database. Check original in-flight requests and saved decisions before draining and closing instances. Retain original `operation_id`, `invocation_id` and approval `decision_id`; do not replace recovery with a new request.
10
+
11
+ The 0.9.1 usage shutdown drain remains effective. New 0.9.2 maintenance writes also participate in close draining. After a timeout, wait and retry on the same instance; do not force-close stores or redispatch requests.
12
+
13
+ ## Select artifacts and migrate explicitly
14
+
15
+ Use formal `v0.9.2` source, npm packages or images. Verify version, source Tag/commit and artifact digest. Installer and prebuilt-image Compose defaults are updated to 0.9.2; existing `.env` files are preserved. Creating configuration requires working OpenSSL. Repair randomness failures before retrying installation.
16
+
17
+ Apply all outstanding files through the official migrator. For source installations:
18
+
19
+ ```bash
20
+ npm run db:init
21
+ ```
22
+
23
+ Embedded hosts use the explicit official `migrateBailingHubCoreSchema` port and recheck the complete `BAILINGHUB_CORE_ARTIFACT_V1` artifact manifest. Startup does not migrate automatically. The migrator skips recorded files; do not edit historical SQL or migration records manually.
24
+
25
+ | Migration added since 0.9.1 | Purpose |
26
+ | --- | --- |
27
+ | `065_usage_reconciliation_scan.sql` | Add the `(billing_state, updated_at, id)` paging index, without recalculating historical charges |
28
+ | `066_approval_continuations.sql` | Add the continuation table and `bz_jobs.approval_continuation_keys` for original-decision continuation and permanent admission markers, without backfilling historical decisions |
29
+
30
+ Apply 066 before enabling new approval paths. Failed continuation writes roll back the decision rather than leaving an orphaned decision. Earlier versions also apply all missing preceding migrations; see the [0.9.0 guide](UPGRADE_v0.9.0.en.md) for model billing upgrades.
31
+
32
+ ## Match adapters and callers
33
+
34
+ Upgrade official MySQL/JSONL state adapters together with the configuration approval ledger. JSONL serial writes support only one writer; multiple processes must not write the same file. Custom configuration adapters implement `decideWithContinuation`, `getContinuation`, `pendingContinuations`, `markContinuationAuditRecorded` and `completeContinuation`. Custom state adapters implement `RuntimeStateStore.requeueApprovedJobOnce` with matching atomic semantics. Unsupported new decisions return `approval_continuations_unavailable`, without falling back to the old queue path.
35
+
36
+ External retries of the same decision retain its original `decision_id`. A `503` with `decision_recorded=true / continuation_pending=true` means the decision was saved and continuation awaits recovery. Console retries retain the original approval. Historical decisions without new continuation records are not backfilled; consumed approvals are not requeued. Direct Agent invocations still require the local Agent to explicitly resume the original `invocation_id`; approval does not start a Core model loop.
37
+
38
+ Managed hosts continue fair calls to existing `tick()`. The first tick and subsequent minute-based maintenance advance pending settlement and approval continuation; standalone schedules these passes itself. No separate timer per Kernel is needed. Existing contracts continue to control pause, routing, tool permissions and final business authorization.
39
+
40
+ ## Verify the upgrade
41
+
42
+ 1. Check artifact identity, the target database's migration ledger and actual 065/066 structures. Verify `/health`, the console and existing business smoke checks.
43
+ 2. Use read-only deployment diagnostics for public identity and readiness. Read the exit code together with the unchecked scope:
44
+
45
+ ```bash
46
+ npm run --silent doctor -- --deployment --url http://127.0.0.1:18900 --readiness --json
47
+ ```
48
+
49
+ Default diagnostics only read health and version. `--readiness` asks the server to read its database and migration ledger. Diagnostics do not establish image digest or complete database identity, or perform upgrades; see [diagnostics](DEPLOYMENT_DIAGNOSTICS.en.md).
50
+ 3. In a dedicated test environment, retain a meterable original pending request and stop incoming traffic. Verify settlement in its original ledger without another provider dispatch. Records lacking authoritative pricing or metering remain pending/unknown. Check the shared USD allowance and multiplier; result complete does not mean billing settled.
51
+ 4. In a dedicated test environment, check a temporary audit or queue failure after approval. Retrying the original decision or waiting for maintenance should continue the original job. Lost queue acknowledgements, reopening or consumed approvals must not duplicate admission. Direct Agent calls still wait for explicit resume. Lost audit acknowledgements may produce repeated observations with the same `detail.continuation_id`, rather than another queue admission.
52
+ 5. Confirm maintenance drains during shutdown. A timeout retains same-instance work and dependencies for later retry. Do not delete ledgers, clear markers or replace invocation IDs.
53
+
54
+ See [Core reliability](CORE_RELIABILITY.en.md#regression-entry-points-and-limits) for isolated regression commands and [model process recovery](MODEL_PROCESS_RECOVERY.en.md) for actual `SIGKILL` and lost COMMIT-acknowledgement acceptance. These tests use dedicated databases and synthetic providers. Skips are not passes, and regressions do not replace target-deployment or live-business acceptance.
55
+
56
+ ## Rollback boundary
57
+
58
+ 065/066 are additive migrations. A code rollback retains continuation tables, `approval_continuation_keys`, original requests and ledgers. Do not delete markers and resubmit approvals. Returning to 0.9.1 loses this release's automatic maintenance, persisted continuation and admission deduplication guarantees. Stop decision and job writes, then reconcile saved decisions, queue state, markers and in-flight work before assessing compatibility and rollback.
59
+
60
+ Restoring an older backup also requires accounting for requests, charges and external effects after that backup. Queue deduplication does not guarantee exactly-once external effects, and restoring a backup does not undo business actions. Business services retain idempotency and final authorization.
61
+
62
+ [Release notes](RELEASE_NOTES_v0.9.2.en.md) · [Reliability contract](CORE_RELIABILITY.en.md) · [Compatibility policy](COMPATIBILITY.en.md)
@@ -0,0 +1,62 @@
1
+ # Core v0.9.2 补丁升级指南
2
+
3
+ [English](UPGRADE_v0.9.2.en.md)
4
+
5
+ 从公开 Core 0.9.1 升级到 0.9.2,修复安装凭据、异步结算维护与审批补续,并取得只读部署诊断和进程恢复回归。MCP / Agent Client SDK 与 DSH 继续使用 0.7.0。升级仅涉及 Core;其他组件按各自项目核对和发布。
6
+
7
+ ## 先保留数据,协调写入
8
+
9
+ 备份目标数据库,保留配置与凭据、附件存储、原请求及审批记录、旧制品和宿主持久记录。停止新工作并协调所有共用状态库的写入方;核对原在途请求与已经保存的决策,再排空和关闭实例。保留原 `operation_id`、`invocation_id` 与审批 `decision_id`,不以新请求代替恢复。
10
+
11
+ 0.9.1 的 usage 关闭等待继续有效。0.9.2 新增维护写账也纳入关闭等待;超时后在同一实例等待和重试,不据此强行关库或重新派发。
12
+
13
+ ## 选择制品并显式迁移
14
+
15
+ 使用正式 `v0.9.2` 源码、npm 包或镜像,核对版本、来源 Tag/提交与制品摘要。安装器和预构建镜像 Compose 默认版本同步为 0.9.2;已有 `.env` 不覆盖。新建配置需要可用的 OpenSSL,随机生成失败时先修复环境再重试。
16
+
17
+ 通过官方迁移器应用全部未执行文件,源码安装入口为:
18
+
19
+ ```bash
20
+ npm run db:init
21
+ ```
22
+
23
+ 嵌入式宿主使用官方 `migrateBailingHubCoreSchema` 显式入口,并重新核对 `BAILINGHUB_CORE_ARTIFACT_V1` 完整制品 manifest。运行时启动不自动迁移。已记账的迁移由迁移器跳过,不手工改写历史 SQL 或迁移账本。
24
+
25
+ | 相对 0.9.1 新增迁移 | 作用 |
26
+ | --- | --- |
27
+ | `065_usage_reconciliation_scan.sql` | 添加 `(billing_state, updated_at, id)` 分页索引,不重算历史费用 |
28
+ | `066_approval_continuations.sql` | 添加补续表和 `bz_jobs.approval_continuation_keys`,保存原决策补续及持久入队标记,不回填历史决策 |
29
+
30
+ 启用新审批入口前必须应用 066。补续事务写入失败会回滚决策,不能留下仅决策成功的孤立记录。更早版本还须应用全部缺少的前序迁移,模型计费升级另见 [0.9.0 指南](UPGRADE_v0.9.0.md)。
31
+
32
+ ## 仓储和调用方配套
33
+
34
+ 官方 MySQL/JSONL state 仓储与配置审批 ledger 一起升级。JSONL 的顺序写入仅支持一个 writer;不能用多个进程共同写同一文件。自定义配置仓储需提供 `decideWithContinuation`、`getContinuation`、`pendingContinuations`、`markContinuationAuditRecorded`、`completeContinuation`,自定义状态仓储需提供 `RuntimeStateStore.requeueApprovedJobOnce` 及配套原子语义。缺少支持时新决策返回 `approval_continuations_unavailable`,不回退旧入队路径。
35
+
36
+ 外部审批同一决策重试使用原 `decision_id`;`503` 的 `decision_recorded=true / continuation_pending=true` 表示决策已保存,补续待恢复。控制台重试原审批单。历史决策没有新补续记录时不自动回填;已消费审批不重排。Agent 直调仍由本地 Agent 使用原 `invocation_id` 显式 resume,批准不启动 Core 模型循环。
37
+
38
+ managed 宿主继续公平调用既有 `tick()`,首个 tick 和后续每分钟维护推进待结算与审批补续;standalone 自行安排这些维护。无需为每个 Kernel 增加独立定时器。暂停、路由、工具权限与业务最终授权仍由原契约控制。
39
+
40
+ ## 升级后如何确认
41
+
42
+ 1. 核对新制品身份、目标库的迁移账本和 065/066 实际结构;检查 `/health`、控制台与既有业务 smoke。
43
+ 2. 使用只读部署诊断核对公开身份和 readiness;退出码与未检查范围须一起读取:
44
+
45
+ ```bash
46
+ npm run --silent doctor -- --deployment --url http://127.0.0.1:18900 --readiness --json
47
+ ```
48
+
49
+ 默认诊断只读取健康与版本;`--readiness` 会让服务端只读访问数据库及迁移账本。诊断不会确认镜像 digest、完整数据库身份或执行升级,详见[诊断文档](DEPLOYMENT_DIAGNOSTICS.md)。
50
+ 3. 在专用测试环境保留一笔可计价的原 pending 请求,停止新流量,确认维护后原账本结算且没有第二次供应商派发;无法可靠计价的原记录仍为 pending/unknown。核对统一美元额度与倍率,不把结果 complete 等同于已 settled。
51
+ 4. 在专用测试环境核对批准后审计或入队暂时失败,重试原决策或等待维护能继续原任务;入队确认丢失、重开或审批已消费后不会重复入队。Agent 直调仍等待显式续执行。审计确认丢失可产生同 `detail.continuation_id` 的重复观察,不等于第二次队列准入。
52
+ 5. 停止时确认维护被排空。超时保留同实例的工作与依赖,等待后重试;不删账本、不清标记、不换调用 ID。
53
+
54
+ 隔离回归命令见 [Core 可靠性修复](CORE_RELIABILITY.md#回归入口与限制);实际 `SIGKILL` 与 COMMIT 确认丢失专项见 [模型进程恢复](MODEL_PROCESS_RECOVERY.md)。这些用例使用专用测试库和合成供应商,跳过不计为通过,也不替代目标部署或真实业务验收。
55
+
56
+ ## 回退边界
57
+
58
+ 065/066 是增量结构。代码回退保留补续表、`approval_continuation_keys`、原请求与账本;不要删除标记后重投审批。回退到 0.9.1 会失去本版自动维护、持久补续与入队去重保证。先停止决策和任务写入,核对已保存决策、队列、标记及在途工作,再评估兼容性和回退。
59
+
60
+ 恢复旧备份仍需核对备份之后的请求、扣费和外部业务效果。队列去重不保证外部业务恰好一次,备份恢复不撤销已经发生的业务动作。业务方继续维护幂等与最终权限。
61
+
62
+ [版本说明](RELEASE_NOTES_v0.9.2.md) · [可靠性契约](CORE_RELIABILITY.md) · [兼容策略](兼容性与升级.md)
@@ -1,5 +1,9 @@
1
1
  # 百灵中枢 · 兼容性与升级策略
2
2
 
3
+ ## Core 0.9.1 补丁升级
4
+
5
+ 相对 0.9.0 仅修复异步 usage 工作关闭等待并更新公开文档/通用安全治理,没有新增 API、SQL、套餐规则或客户端功能。SDK 0.7.0 / DSH 0.7.0 不变。旧版关闭返回不能证明 usage 后台工作已结束;替换制品前核对原请求,新版 usage 排空超时在原实例重试。见 [0.9.1 升级指南](UPGRADE_v0.9.1.md)。
6
+
3
7
  ## Core 0.9.0 配套升级
4
8
 
5
9
  Core 0.9.0 配套 SDK 0.7.0 / DSH 0.7.0,新增可选模型计费网关;本地宿主继续编排,既有业务权限、审批与原调用恢复保持。从公开 0.8.0 升级应用未执行的 063/064,保留真实数据,不需要清退测试结构。周期套餐的售价与额度独立,原开通快照和账本保留。启用模型套餐的宿主需要显式接入;只使用原业务工具的宿主不必开启计费。详见 [0.9.0 升级指南](UPGRADE_v0.9.0.md)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bailinghub",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Open-source ACC runtime and agent control plane for existing business systems.",
@@ -55,6 +55,7 @@
55
55
  "executor": "tsx src/executor.ts",
56
56
  "executor:watch": "tsx watch src/executor.ts",
57
57
  "typecheck": "tsc --noEmit",
58
+ "installer:secrets:test": "node --test scripts/install-secrets.test.mjs",
58
59
  "test": "node --import tsx --test \"src/**/*.test.ts\"",
59
60
  "db:init": "tsx scripts/init-db.ts",
60
61
  "demo:seed": "tsx scripts/seed-demo.ts",
@@ -81,8 +82,8 @@
81
82
  "client-api:contract": "tsx scripts/client-api-contract-test.ts",
82
83
  "client-api:ecosystem:local": "node scripts/check-client-api-ecosystem.mjs --mode local",
83
84
  "client-api:ecosystem:clone": "node scripts/check-client-api-ecosystem.mjs --mode clone",
84
- "audit:deps": "npm audit --audit-level=low && npm --prefix web-admin audit --audit-level=low",
85
- "web-admin:check": "npm --prefix web-admin run build && npm --prefix web-admin audit --audit-level=low",
85
+ "audit:deps": "node scripts/dependency-audit.mjs",
86
+ "web-admin:check": "npm --prefix web-admin run build && node scripts/dependency-audit.mjs --scope web-admin",
86
87
  "oss:guard": "node scripts/oss-boundary-check.mjs",
87
88
  "oss:export": "node scripts/export-oss.mjs",
88
89
  "oss:verify": "node scripts/verify-oss-export.mjs",
@@ -90,7 +91,7 @@
90
91
  "release:consistency:test": "node --test scripts/check-release-consistency.test.mjs",
91
92
  "release:audit": "npm run release:consistency && npm run release:consistency:test && npm run images:policy:test && npm run public-content:denylist:test && npm run security:scan && npm run oss:guard && node scripts/release-audit.mjs && npm run package:artifact:check",
92
93
  "github:verify": "node scripts/verify-github-repo.mjs",
93
- "release:check": "npm run notices:check && npm run assets:check && npm run audit:deps && npm run client-api:contract && npm run client-api:ecosystem:clone && npm run typecheck && npm test && npm run widget:renderer:test && npm run web-admin:check && npm run docs:check && npm run examples:check && npm run sdk:test && npm run sdk:test7 && npm run sdk:test-node && npm run sdk:test-python && npm run sdk:test-runtime && npm run sdk:test-p1 && npm run release:audit && npm run oss:verify && npm run github:verify",
94
+ "release:check": "npm run notices:check && npm run assets:check && npm run audit:deps && npm run client-api:contract && npm run client-api:ecosystem:clone && npm run typecheck && npm run installer:secrets:test && npm run doctor:deployment:typecheck && npm run doctor:deployment:test && npm test && npm run widget:renderer:test && npm run web-admin:check && npm run docs:check && npm run examples:check && npm run sdk:test && npm run sdk:test7 && npm run sdk:test-node && npm run sdk:test-python && npm run sdk:test-runtime && npm run sdk:test-p1 && npm run release:audit && npm run oss:verify && npm run github:verify",
94
95
  "images:build": "sh scripts/publish-images.sh",
95
96
  "images:publish": "BAILING_PUSH_IMAGES=1 sh scripts/publish-images.sh",
96
97
  "images:publish-mysql": "BAILING_PUSH_IMAGES=1 sh scripts/publish-mysql-image.sh",
@@ -104,7 +105,11 @@
104
105
  "sdk:test-runtime": "node scripts/sdk-runtime-test.mjs",
105
106
  "sdk:test-p1": "node scripts/sdk-p1-check.mjs",
106
107
  "sdk:pack": "COPYFILE_DISABLE=1 tar --no-xattrs -czf web/connect/bailing-connect-php.tgz -s '|^php|bailing-connect-php|' -C sdk php",
107
- "sdk:pack7": "COPYFILE_DISABLE=1 tar --no-xattrs -czf web/connect/bailing-connect-php7.tgz -s '|^php7|bailing-connect-php7|' -C sdk php7"
108
+ "sdk:pack7": "COPYFILE_DISABLE=1 tar --no-xattrs -czf web/connect/bailing-connect-php7.tgz -s '|^php7|bailing-connect-php7|' -C sdk php7",
109
+ "audit:deps:test": "node --test scripts/dependency-audit.test.mjs",
110
+ "doctor:deployment:test": "node --import tsx --test scripts/doctor-deployment.test.ts",
111
+ "doctor:deployment:typecheck": "tsc --noEmit --strict --skipLibCheck --target ES2022 --module ESNext --moduleResolution Bundler --lib ES2022 --types node scripts/doctor.ts scripts/doctor-deployment.ts scripts/doctor-deployment.test.ts",
112
+ "test:model-process-recovery": "node --import tsx --test src/app/kernel-model-process-crash.mysql.test.ts"
108
113
  },
109
114
  "dependencies": {
110
115
  "mammoth": "^1.12.0",
@@ -106,6 +106,10 @@ const englishCompanions = {
106
106
  'docs/RELEASE_NOTES_v0.8.0.md': 'docs/RELEASE_NOTES_v0.8.0.en.md',
107
107
  'docs/RELEASE_NOTES_v0.9.0.md': 'docs/RELEASE_NOTES_v0.9.0.en.md',
108
108
  'docs/UPGRADE_v0.9.0.md': 'docs/UPGRADE_v0.9.0.en.md',
109
+ 'docs/RELEASE_NOTES_v0.9.1.md': 'docs/RELEASE_NOTES_v0.9.1.en.md',
110
+ 'docs/RELEASE_NOTES_v0.9.2.md': 'docs/RELEASE_NOTES_v0.9.2.en.md',
111
+ 'docs/UPGRADE_v0.9.2.md': 'docs/UPGRADE_v0.9.2.en.md',
112
+ 'docs/UPGRADE_v0.9.1.md': 'docs/UPGRADE_v0.9.1.en.md',
109
113
  'docs/MODEL_BILLING.md': 'docs/MODEL_BILLING.en.md',
110
114
  'docs/PERIOD_ALLOWANCE_UPGRADE.md': 'docs/PERIOD_ALLOWANCE_UPGRADE.en.md',
111
115
  'docs/RELEASE_NOTES_v0.7.0.md': 'docs/RELEASE_NOTES_v0.7.0.en.md',
@@ -9,7 +9,7 @@ REGISTRY="${BAILING_IMAGE_REGISTRY:-$DEFAULT_REGISTRY}"
9
9
  NAMESPACE="${BAILING_IMAGE_NAMESPACE:-$DEFAULT_NAMESPACE}"
10
10
  PACKAGE_VERSION="$(sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' package.json | head -1)"
11
11
  TAG="${BAILING_IMAGE_TAG:-$PACKAGE_VERSION}"
12
- [ -n "$TAG" ] || TAG="0.9.0"
12
+ [ -n "$TAG" ] || TAG="0.9.2"
13
13
  MYSQL_TAG="${BAILING_MYSQL_IMAGE_TAG:-8.4}"
14
14
  MYSQL_IMAGE="${BAILING_MYSQL_IMAGE:-$REGISTRY/$NAMESPACE/bailing-mysql:$MYSQL_TAG}"
15
15
  PLATFORM="${BAILING_IMAGE_PLATFORM:-linux/amd64}"
@@ -38,8 +38,8 @@ function updateJson(root, relativePath, update) {
38
38
  test('current release surface is internally consistent', () => {
39
39
  const result = checkReleaseConsistency({ root: repoRoot });
40
40
  assert.deepEqual(result.findings, []);
41
- assert.equal(result.version, '0.9.0');
42
- assert.equal(result.stableVersion, '0.9.0');
41
+ assert.equal(result.version, '0.9.2');
42
+ assert.equal(result.stableVersion, '0.9.2');
43
43
  assert.equal(result.publishTag, 'latest');
44
44
  });
45
45