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
@@ -0,0 +1,78 @@
1
+ # 只读部署诊断
2
+
3
+ 本页部署模式从 Core 0.9.2 提供;历史正式 `v0.9.1` Tag/npm 不包含该模式。请从包含 `scripts/doctor-deployment.ts` 的源码或正式制品执行以下命令。
4
+
5
+ 部署诊断沿用 `npm run doctor`,增加一个面向已安装 Core 的独立模式。原有不带参数的 doctor 继续检查源码、文档、示例和开源边界;部署模式只核对指定实例的公开健康与版本信息,不执行原有 doctor 的检查脚本。
6
+
7
+ 英文版见 [DEPLOYMENT_DIAGNOSTICS.en.md](DEPLOYMENT_DIAGNOSTICS.en.md)。部署与恢复步骤见 [OPERATIONS.md](OPERATIONS.md),能力和证据范围见 [IMPLEMENTATION_STATUS.md](IMPLEMENTATION_STATUS.md)。
8
+
9
+ ## 使用
10
+
11
+ 在 Core 源码、源码安装目录或已解包的 npm 制品目录执行:
12
+
13
+ ```bash
14
+ npm run --silent doctor -- --deployment --url http://127.0.0.1:18900 --json
15
+ ```
16
+
17
+ URL 必须由操作者显式提供,不从 `.env`、`config.json` 或 smoke 环境变量猜测目标。支持受控的 Core 挂载前缀,例如 `https://hub.example.com/core`;输出不显示这个前缀。URL 不能包含用户名、密码、query 或 fragment,诊断不接收 Token 参数,也不自动登录。
18
+
19
+ 默认仅发送 `GET /health` 和 `GET /version`。它不连接数据库、不读配置内容、不调用模型,也不执行迁移、安装、升级、回滚、容器或服务操作。仅检查 `config.json` 和 `.env` 是否存在;文件缺失可能表示由环境或宿主注入配置,因此有效配置仍标为 `unknown`。凭据安全性标为 `not_checked`,不会假装完成默认 Token 或数据库连接串检查。
20
+
21
+ 容器部署可在容器中已安装的 Core 目录执行相同命令,也可在外部解包的 Core 制品目录诊断公开 URL。工具不会运行 `docker inspect`、读取容器环境或推断正在运行的镜像 digest;容器启动、权限和 digest 须由部署流程另行核对。
22
+
23
+ 若本地目录不是要对照的制品,可显式指定受信任发行记录中的版本和提交。下面以核对历史 v0.9.1 实例为例:
24
+
25
+ ```bash
26
+ npm run --silent doctor -- --deployment --url https://hub.example.com \
27
+ --expect-version 0.9.1 --expect-commit f37df6042b390405a5f7b1630636d3017607db9f --json
28
+ ```
29
+
30
+ 本地身份来自 `package.json` 与 Git HEAD;无 Git 时才使用 `build-info.json` 的提交。默认比较本地版本与提交,提交可按至少 12 位十六进制前缀匹配。Git 工作树另行只读检查并标为 `clean`、`dirty` 或 `not_checked`,不会输出文件名,也会禁用 fsmonitor hook 与可选 index 写入。默认对照本地源码时,dirty 或无法检查的 Git 工作树保留不完整结果,不把未提交内容当作 HEAD 对应制品。
31
+
32
+ 安装目录没有可用提交元数据时,source 保留 `unknown`,退出码为 2;显式期待值也不会补造本地源码身份。工具仍会输出已取得的公开结果,后续由部署流程提供缺失的制品证据。
33
+
34
+ 显式期待值只改变对照对象,不将另一个本地制品的 SQL 列表强行视为运行实例的列表。source 的依据是 `local_metadata`,runtime 的依据是 `reported_metadata`;两者的 `artifact_integrity` 均为 `not_checked`。即使工作树 clean、版本和提交完全匹配,也只证明声明一致,不能证明部署制品的内容、签名或 digest。正式升级仍须核验制品清单、完整性、备份和兼容性。
35
+
36
+ ## 健康、readiness 与数据库身份
37
+
38
+ | 证据 | 默认行为 | 能说明什么 |
39
+ |---|---|---|
40
+ | `/health` | 读取 | 实例响应、暂停标记与公开应用身份;暂停标记不等于进程死亡。 |
41
+ | `/version` | 读取 | 实例声明的应用版本、构建提交与制品所带 SQL 最新文件和数量。 |
42
+ | `/health/ready` | `not_checked` | 只有显式 `--readiness` 才读取;服务端会只读检查数据库及迁移账本。 |
43
+ | `/admin/api/version`、`/admin/api/status` | `not_checked`,不发送请求 | 受保护状态和已应用迁移明细需另行取得授权证据。 |
44
+
45
+ 显式检查 readiness:
46
+
47
+ ```bash
48
+ npm run --silent doctor -- --deployment --url http://127.0.0.1:18900 --readiness --json
49
+ ```
50
+
51
+ 此选项会让服务端执行 `SELECT 1` 和迁移账本读取,不应称为“无数据库访问”。工具本身仍不直接连接数据库。报告中 `migrations.readiness` 仅记录服务端公开摘要;`migrations.identity` 始终是 `not_checked`,不会以 pending 为零证明实际数据库身份、全量 checksum 或 SQL 升降级兼容。JSONL 后端跳过数据库检查时保留 `unknown`,不会写成数据库已验证。
52
+
53
+ 公开端点返回 401/403 时记录 `authentication_required` 和 `not_checked`,不尝试绕过权限或调用管理员端点。health 和 version 声明不一致、期待提交不符或 readiness 不就绪均作为失败证据。
54
+
55
+ ## JSON 与退出码
56
+
57
+ JSON 的 `schema` 为 `bailing.deployment-diagnostics.v1`,包含 source、runtime、comparison、configuration、database、migrations、protected_endpoints、upgrade、checks 和请求 scope。身份状态区分 `verified`、`mismatch`、`unknown`、`not_checked`;`verified` 表示取得且核对了对应声明,不是密码学制品认证或生产采用证明。
58
+
59
+ | 退出码 | 含义 |
60
+ |---|---|
61
+ | `0` | 本次选择的检查通过;配置、直接数据库连接、已应用迁移身份和受保护端点仍可能未检查。 |
62
+ | `1` | 实际失败、不可达、非预期响应、拒绝的 URL 或身份不一致。 |
63
+ | `2` | 证据不完整,例如未提供 URL、版本/提交缺失、所选公开端点需认证,或 readiness 跳过数据库。 |
64
+ | `64` | CLI 参数无效。 |
65
+
66
+ `upgrade.state` 始终是 `not_checked`。退出 0 不允许工具自行升级或回滚,也不替代暂停、排空、备份、迁移审批和上线验收。Core 诊断只核对指定 Core 的公开声明;宿主实例管理与客户端任务编排由各自项目负责。
67
+
68
+ 每个请求默认限时 5000 ms,可用 `--timeout-ms 100` 至 `--timeout-ms 30000` 调整;包含响应体读取,最多读取 64 KiB 解码后的内容。所有重定向均拒绝,包括同 origin 跳转,使用最终 Core URL 重试。请求只携带 JSON Accept,不携带登录 Cookie、Authorization 或配置凭据。输出只保留固定白名单字段和原因码,不输出异常正文、响应正文、重定向目标或输入中的凭据;错误 URL 不会原样打印。
69
+
70
+ 不带 `--json` 时输出简短可读结果。自动化应使用 `npm run --silent` 得到纯 JSON,并同时检查退出码与报告范围;`BAILING_DOCTOR_FULL`、`BAILING_DOCTOR_SMOKE` 和 smoke 的 URL/Token 环境变量不影响部署模式。
71
+
72
+ ## 本地验证
73
+
74
+ ```bash
75
+ node --import tsx --test scripts/doctor-deployment.test.ts
76
+ ```
77
+
78
+ 测试使用临时目录、临时 loopback HTTP 服务和现有公共路由,覆盖方法与路径白名单、身份不一致、权限、readiness 区分、超时、响应大小、重定向和凭据脱敏。测试不连接真实数据库、模型或生产服务。测试通过只说明这些诊断边界通过验证,不能替代目标部署的验收。
@@ -0,0 +1,81 @@
1
+ # Core Capabilities and Public Evidence
2
+
3
+ [中文版](IMPLEMENTATION_STATUS.md)
4
+
5
+ This index separates **ownership, release availability, public evidence, and limitations** for BailingHub Core. Source implementation, test coverage, a formal release, and real business adoption are distinct facts, not a progression of maturity labels. This page is not a third-party certification, a complete security guarantee, or evidence of production adoption.
6
+
7
+ ## Version and evidence conventions
8
+
9
+ - Formal release baseline: [v0.9.2](https://github.com/bailinghub/bailinghub/releases/tag/v0.9.2), with the [v0.9.2 source Tag](https://github.com/bailinghub/bailinghub/tree/v0.9.2). The existing mechanisms below and the shutdown fix described later belong to this version. This does not mean that every optional feature is enabled by a default installation.
10
+ - Historical baseline: [v0.9.0](https://github.com/bailinghub/bailinghub/releases/tag/v0.9.0), commit [`dae5260ede6565080d21e94ae63d52f3a7d23556`](https://github.com/bailinghub/bailinghub/tree/dae5260ede6565080d21e94ae63d52f3a7d23556). Its asynchronous shutdown gap remains documented below. Verify source, npm, images, and deployments separately; updated documentation does not fix old artifacts.
11
+ - Test links identify **public test source and the conditions it checks**, not passing runs newly produced by this page. Unit tests, simulated provider responses, MySQL integration tests, and the complete demo have different scopes. Skipped or unexecuted tests are not passing evidence, and do not make an existing mechanism a planned feature.
12
+ - Use the [v0.9.2 release notes](RELEASE_NOTES_v0.9.2.en.md) and [upgrade guide](UPGRADE_v0.9.2.en.md) for release contents and prerequisites. Compatible clients, application migrations, provider credentials, storage, and business authorization still require their own configuration and acceptance.
13
+
14
+ ## Ownership and release availability
15
+
16
+ Core defaults to one organization's management and audit domain. Clients, routes, and tool providers are not organization isolation boundaries. ACC is an independent capability-declaration specification; the business system retains final identity, permission, and business-rule checks. See [Architecture](ARCHITECTURE.en.md), the [wire contract](CONTRACT.en.md), and the [ACC specification repository](https://github.com/agent-capability/agent-capability-contract).
17
+
18
+ | Capability and owner | Release availability | Public implementation and evidence | Scope and limitations |
19
+ |---|---|---|---|
20
+ | Declarations, tool discovery, and governed calls: Core parses/governs; the business system executes | Included in Core v0.9.2 | [Tool model](TOOLS_MODEL.en.md); [tool-index source](../src/services/tools-index.ts) / [tests](../src/services/tools-index.test.ts); [execution governance tests](../src/core/runtime/execution-runtime.test.ts) | Discoverability is not permission to call. The receiving API must verify the signature and recheck the subject, tenant, permissions, and business state. A declaration cannot create authority the caller did not have. |
21
+ | Agent Auth: Core binds client sessions; the business authorization page supplies trusted identity | Included in Core v0.9.2 | [Agent Auth contract](AGENT_AUTH_API.en.md); [route source](../src/routes/agent-auth.ts); [lifecycle HTTP tests](../src/routes/agent-auth-lifecycle-http.test.ts) / [race tests](../src/infrastructure/config/config-agent-auth-lifecycle-race.test.ts) | PKCE, authorization binding, refresh, and revocation are implemented. They do not replace business login, role management, or final authorization, or let the model choose a trusted principal through text. |
22
+ | Agent Client Runtime: Core exposes workspaces, turns, discovery, and tool invocation | Included in Core v0.9.2 | [Runtime API](AGENT_CLIENT_RUNTIME_API.en.md); [runtime source](../src/app/agent-client-runtime.ts) / [tests](../src/app/agent-client-runtime.test.ts); [invocation tests](../src/app/agent-tool-invocations.test.ts) | The local Agent host owns model selection, its reasoning loop, and tool orchestration. Core's existing `/run` pipeline is a separate public integration path; the two must not be presented as one client execution mode. |
23
+ | Approvals, original invocation snapshots, and read-only receipts: Core governs; the business system owns the outcome | Included in Core v0.9.2 | [Receipts versus recovery](INVOCATION_RECEIPTS.md); [invocation source](../src/app/agent-tool-invocations.ts) / [tests](../src/app/agent-tool-invocations.test.ts); [approval-ledger tests](../src/infrastructure/config/config-approval-ledger.test.ts) | Reading an original receipt differs from resume, which may continue execution. Unknown outcomes do not permit replaying a write, and missing historical arguments must not be invented. Approval does not prove business success or guarantee rollback of a distributed business transaction. |
24
+ | Cross-turn task controls: Core persists original members, write-call allowance, and concurrency occupancy | Included in Core v0.9.2 (introduced in v0.8.0) | [Task control contract](AGENT_TASK_CONTROL.en.md); [runtime source](../src/core/runtime/agent-task-control.ts) / [tests](../src/core/runtime/agent-task-control.test.ts); [MySQL journal integration tests](../src/infrastructure/config/config-agent-task-control-journal-mysql.test.ts) | These controls govern business invocations, not model-turn subscriptions. Write-call counts are not refund amounts, successful transactions, or Tokens. Pause/cancel cannot undo a permitted or completed business effect. |
25
+ | Visible conversation audit: the client explicitly uploads; Core validates members and persists events | Included in Core v0.9.2 | [Conversation audit contract](AGENT_CONVERSATION_AUDIT.en.md); [runtime tests](../src/core/runtime/agent-conversation-audit.test.ts) | Hidden reasoning is not collected. Membership confirmation and a write API do not prove all history was uploaded. Audit archives do not merge authorization, sessions, or runtime memory. Cross-binding use retains the same-Hub and individual-identity boundaries. |
26
+ | Current-thread context and optional rolling summaries: Core route/thread mechanisms | Included in Core v0.9.2 | [Memory configuration/rendering](../src/core/runtime/memory.ts); [thread injection source](../src/core/runtime/memory-runtime.ts) / [tests](../src/core/runtime/memory-runtime.test.ts); [summary tests](../src/core/runtime/summary-runtime.test.ts) | Summaries are disabled by default and still read from the original thread when enabled. This is not a complete user-level memory system across new conversations. Visible audit archives do not automatically enter model context. |
27
+ | Attachment space: the host supplies approved images; Core uploads and returns usable URLs | Included in Core v0.9.2 (introduced in v0.8.0) | [Image attachment contract](GENERATED_ARTIFACTS.en.md); [artifact source](../src/app/agent-artifacts.ts) / [tests](../src/app/agent-artifacts.test.ts) | The first increment accepts PNG/JPEG/WebP, not documents or video. Operators configure storage and retention. Core cannot read the client's filesystem. Uploading an image and changing a business record with its URL are separate actions. |
28
+ | Optional model gateway and USD allowance settlement: Core connects/meters; the client host orchestrates | Included in Core v0.9.2 | [Model billing contract](MODEL_BILLING.en.md); [gateway source](../src/modules/usage/model-gateway.ts); [model-gateway MySQL tests](../src/modules/usage/model-gateway.mysql.test.ts); [ledger unit tests](../src/modules/usage/billing-ledger.test.ts) | Shared USD allowances use a uniform multiplier and separate periodic price from allowance. They do not restore turn/step billing. Reference prices are not provider invoices; raw Tokens are not the allowance denominator. Missing authoritative usage does not permit inventing Tokens or fees. |
29
+ | Model-tool directory, text-to-image, and original-request lookup: optional Core gateway extensions | Included in Core v0.9.2 | [Tool-description source](../src/modules/usage/model-tools.ts) / [tests](../src/modules/usage/model-tools.test.ts); [provider adapter tests](../src/modules/usage/model-tool-provider.test.ts); [asynchronous-image MySQL tests](../src/modules/usage/model-tool-gateway.mysql.test.ts) | Executable adapters include Alibaba-compatible Images, native DashScope, and OpenRouter Images. A video, voice, or custom-service directory declaration does not provide an execution adapter. The completion/shutdown boundary is described below. |
30
+ | Kernel Host API, explicit migrations, and managed lifecycle: Core provides an embedding entry point; the Host manages processes and isolation | Included in Core v0.9.2 | [Kernel Host API](KERNEL_HOST_API.en.md); [Kernel source](../src/app/kernel.ts) / [tests](../src/app/kernel.test.ts); [artifact-manifest tests](../src/kernel-api/v1/artifact.test.ts); [migration tests](../src/infrastructure/schema/core-schema-migrator.test.ts) | Separate MySQL schemas/runtimeRoots, trusted instanceKeys, explicit migrations, and Host-owned tick/close calls are prerequisites. The API does not provide tenant signup, platform plans, cluster directories, or multi-replica upgrade orchestration. The optional usage gateway is not the Host's platform billing product. |
31
+ | Installation, smoke checks, and optional operational metrics: Core provides entry points; operators configure and accept deployments | Included in Core v0.9.2 | [Quickstart](QUICKSTART.en.md); [installer](../scripts/install.sh); [smoke script](../scripts/smoke.ts); [OpenMetrics tests](../src/core/observability/openmetrics.test.ts); [independent reproduction task](INDEPENDENT_VALIDATION.en.md) | A health response does not establish that all business operations/providers are available. Metrics require explicit enablement and access protection. Installation/diagnostic entry points do not establish continuous monitoring, staffed alerts, or acceptance of a particular deployment. |
32
+
33
+ ## What the public validation paths establish
34
+
35
+ ### Unit, simulated-provider, and database tests
36
+
37
+ The linked tests check mechanisms such as authorization, frozen arguments, idempotency, unknown outcomes, allowances, and lifecycle behavior. Database integration tests require their public fixtures' dedicated test configuration. For example, usage MySQL tests explicitly require `BAILING_USAGE_TEST_MYSQL=1`. A default test run that skips them does not establish database acceptance.
38
+
39
+ Simulated provider responses establish adapter/protocol behavior for the specified inputs, not live-provider availability, pricing, model quality, or production performance. Tests using real MySQL are still not acceptance of a real business integration.
40
+
41
+ ### Public demo and independent reproduction task
42
+
43
+ The [Docker demo](DEMO.en.md) and [independent validation task](INDEPENDENT_VALIDATION.en.md) provide a public path from installing v0.9.1 through smoke checks and `npm run demo:e2e`. Orders, tickets, refunds, and failure tools use repository demo data. Real model keys, customer APIs, and production credentials are unnecessary.
44
+
45
+ The task requires concrete results for service startup, console access, anonymous-preview boundaries, smoke checks, and the complete business loop. The README's images and animation show that same public fixture, not customer adoption. Publishing a task card does not establish that an external developer completed it. Reports should retain the actual version, environment, checks, and failure scope.
46
+
47
+ ### Asynchronous model-tool shutdown limitation in formal v0.9.0
48
+
49
+ The v0.9.0 [model-tool gateway source](https://github.com/bailinghub/bailinghub/blob/dae5260ede6565080d21e94ae63d52f3a7d23556/src/modules/usage/model-gateway.ts) persists provider dispatch, starts background completion/settlement through `void complete().then(...)`, and promptly returns the original request state. The [Kernel close implementation](https://github.com/bailinghub/bailinghub/blob/dae5260ede6565080d21e94ae63d52f3a7d23556/src/app/kernel.ts) explicitly waits for initialization, managed maintenance, HTTP, InHub, execution queues, and resource closure, but does not explicitly register this usage model-tool continuation as a separate drain participant.
50
+
51
+ Asynchronous-image/original-ID recovery tests in v0.9.0 therefore do not establish that every provider completion is covered by Kernel shutdown acceptance. The public main commit before the fix, [`728899e`](https://github.com/bailinghub/bailinghub/tree/728899e88d89f0ec333684a56640c12154970327), retains the same boundary. This page does not infer observed data loss or duplicate business effects.
52
+
53
+ ### Core v0.9.1 shutdown fix and evidence scope
54
+
55
+ Core v0.9.1 adds a [background-work tracker](../src/modules/usage/background-work.ts) owned separately by each `UsageRepository`, and drains it before resource closure in the [Kernel close path](../src/app/kernel.ts). Actual registration covers model-tool completion and its late settlement child, settlement after ordinary model responses, traffic-triggered response cleanup/usage reconciliation, and reference-price refresh through persistence. See the [Kernel Host API](KERNEL_HOST_API.en.md) for stopped admission, the shared deadline, and same-instance retry after a timeout. Original HTTP 202 delivery and recovery identifiers remain unchanged. Waiting for close does not issue a new provider request or alter business approval authority.
56
+
57
+ The new [tracker unit tests](../src/modules/usage/background-work.test.ts) check registration before execution, dynamic children, stopped maintenance, timeout/retry, owner isolation, and failure-diagnostic boundaries. Owner unit tests are not actual multi-Kernel acceptance. The public [Kernel + MySQL lifecycle tests](../src/app/kernel-usage-lifecycle.mysql.test.ts) use actual Kernels, separate test schemas, and synthetic providers to assert delayed completion/late settlement, SQL-lock waits, resource preservation and same-instance retry after timeouts, original-ID/resource isolation between two Kernels, settlement blocking close after ordinary text-model delivery, and standalone shutdown draining before exit. Separate cases cover cleanup and usage reconciliation independently blocking close; reference-price refresh is checked through persistence and stopped new maintenance. Further assertions cover failed settlement retaining the original result/durable pending, later reconciliation without redispatch, diagnostics excluding raw errors, one original dispatch, and one settlement-ledger record. The database tests explicitly require `BAILING_USAGE_TEST_MYSQL=1`. Source/assertions do not substitute for actual results or establish live-provider, process-crash recovery, or production-deployment acceptance.
58
+
59
+ This fix is available from **Core v0.9.1**, without rewriting the historical guarantees of the v0.9.0 Tag or establishing that a host has been upgraded or deployed. Failed background work may retain durable pending/unknown evidence. Completed drain does not mean every billing record is settled, or provide complete failure-recovery or security assurance.
60
+
61
+ ## General security governance included in v0.9.1
62
+
63
+ Compared with v0.9.0, v0.9.1 includes prior main-branch additions/updates to the [security self-assessment](https://github.com/bailinghub/bailinghub/blob/v0.9.1/SECURITY_SELF_ASSESSMENT.md), its [Chinese companion](https://github.com/bailinghub/bailinghub/blob/v0.9.1/SECURITY_SELF_ASSESSMENT.zh-CN.md), [Security Insights metadata](https://github.com/bailinghub/bailinghub/blob/v0.9.1/security-insights.yml), the [dependency audit script](../scripts/dependency-audit.mjs) and [tests](../scripts/dependency-audit.test.mjs), plus CI, dependency-update, and package/image exclusion settings. These are public repository governance evidence, not new business-runtime features or a claim that every control passes. Assessments/security metadata are excluded from npm runtime packages and Docker build contents; the assessments retain their stated evaluation baselines.
64
+
65
+ A version field or this page does not substitute for artifact checks. Evaluate npm, images, and source Tags against their own commit, artifact, and validation evidence. A Core version also does not establish an independent adapter's or host's release status.
66
+
67
+ ## Independent components and non-Core responsibilities
68
+
69
+ - The [MCP Server and Agent Client SDK](https://github.com/bailinghub/bailinghub-mcp-server), [DeepSeek Harness community plugin](https://github.com/bailinghub/bailinghub-dsh-plugin), [n8n community node](https://github.com/bailinghub/bailinghub-n8n-node), and [executor/OpenClaw adapter](https://github.com/bailinghub/bailinghub-openclaw-skill) are independent projects or adapters consuming public Core interfaces. They have their own versions, configuration, and validation, are excluded from Core artifacts, and do not imply upstream certification, endorsement, or adoption.
70
+ - A local host owns its model loop, client credential storage, UI, and approved file sources. Business systems own real execution, permissions, and business invariants. An independent Host owns its platform identity, tenant directory/isolation, and process/upgrade orchestration. Use the [Agent Client guide](AGENT_CLIENT_QUICKSTART.en.md) and [Kernel Host API](KERNEL_HOST_API.en.md) to assess interface responsibilities; Core tests do not prove these external implementations are complete or deployed.
71
+ - Complete user-level long-term memory, media tools without executable adapters, and real providers/business systems not accepted through the public paths listed here are not validated capabilities of this index. This page creates no new product timetable for them.
72
+
73
+ Keep this page and its Chinese companion aligned. Retain the distinction between formal Tags and main, and update a capability's availability or validation scope only when its corresponding public evidence changes.
74
+
75
+ ## Additional process-recovery regressions in Core v0.9.2
76
+
77
+ [Process crash and lost acknowledgements](MODEL_PROCESS_RECOVERY.en.md) use real SIGKILL, replacement PIDs and withheld MySQL COMMIT acknowledgements to check original requests, provider call counts, results and USD ledgers. These opt-in tests are included in Core v0.9.2, not in the historical v0.9.1 Tag. The link states coverage, not a new execution, real-provider or production-crash acceptance claim.
78
+
79
+ ## Reliability fixes in Core v0.9.2
80
+
81
+ [Installation secrets, settlement maintenance and approval continuation](CORE_RELIABILITY.en.md) covers failing closed without secure installation randomness, settlement without new traffic and durable continuation of approval decisions. It adds incremental migrations 065/066. Public checks include [installer failure tests](../scripts/install-secrets.test.mjs), [settlement MySQL acceptance](../src/modules/usage/billing-reconciliation.mysql.test.ts), [approval continuation tests](../src/app/approval-continuations.test.ts) and [approval MySQL/process acceptance](../src/app/approval-continuations.mysql.test.ts). These describe Core v0.9.2 implementation and coverage; they do not expand the historical v0.9.1 artifact guarantees.
@@ -0,0 +1,81 @@
1
+ # Core 能力与公开证据索引
2
+
3
+ [English](IMPLEMENTATION_STATUS.en.md)
4
+
5
+ 本页把 **BailingHub Core 的能力归属、发行状态、公开证据和限制分别列出**,便于评估和复现。源码实现、测试覆盖、正式发行和真实业务采用是不同事实;它们不构成一套从低到高的等级,也不互相替代。本页不是第三方认证、完整安全保证或生产采用证明。
6
+
7
+ ## 版本与阅读口径
8
+
9
+ - 正式发行基线:[v0.9.2](https://github.com/bailinghub/bailinghub/releases/tag/v0.9.2),对应 [v0.9.2 源码 Tag](https://github.com/bailinghub/bailinghub/tree/v0.9.2)。下表已有机制及后文的关闭修复属于该版本;不代表默认安装后已启用所有可选功能。
10
+ - 历史基线:[v0.9.0](https://github.com/bailinghub/bailinghub/releases/tag/v0.9.0),对应提交 [`dae5260ede6565080d21e94ae63d52f3a7d23556`](https://github.com/bailinghub/bailinghub/tree/dae5260ede6565080d21e94ae63d52f3a7d23556)。原 Tag 的异步关闭缺口在后文保留;源码、npm、镜像和具体部署应分别核验,不能从新版文档推导旧制品已修复。
11
+ - 表中的测试链接是**公开测试代码及其检查范围**,不是本页重新执行所得的通过记录。单元测试、模拟供应商响应、MySQL 集成测试和完整 demo 验证分别说明各自覆盖的条件。未执行或跳过的测试不能写成已通过,也不能据此把已有机制写成“计划实现”。
12
+ - 版本发行内容与升级前提以 [v0.9.2 说明](RELEASE_NOTES_v0.9.2.md) 和 [升级指南](UPGRADE_v0.9.2.md) 为准。适配客户端、应用迁移、模型凭据、存储和具体业务授权仍需各自配置、验证。
13
+
14
+ ## 能力归属与发行状态
15
+
16
+ Core 默认是一个组织的管理与审计域。不同 Client、route 或工具源不是组织隔离边界。ACC 是独立的能力声明规范;业务系统保留最终身份、权限和业务规则判断。参见 [架构](ARCHITECTURE.md)、[网络契约](CONTRACT.md) 和 [ACC 规范仓库](https://github.com/agent-capability/agent-capability-contract)。
17
+
18
+ | 能力与责任方 | 发行状态 | 公开实现与证据入口 | 范围与限制 |
19
+ |---|---|---|---|
20
+ | 能力声明、工具发现、受控调用:Core 解析和治理,业务系统执行 | Core v0.9.2 已包含 | [工具模型](TOOLS_MODEL.md);[工具索引源码](../src/services/tools-index.ts) / [测试](../src/services/tools-index.test.ts);[执行治理测试](../src/core/runtime/execution-runtime.test.ts) | 工具可发现不等于当前调用获准。业务接口还需验签,并重新检查主体、租户、权限和业务状态;声明不能赋予调用方原本没有的权力。 |
21
+ | Agent Auth:Core 绑定客户端会话,业务授权页提供可信身份 | Core v0.9.2 已包含 | [Agent Auth 契约](AGENT_AUTH_API.md);[路由源码](../src/routes/agent-auth.ts);[生命周期 HTTP 测试](../src/routes/agent-auth-lifecycle-http.test.ts) / [竞态测试](../src/infrastructure/config/config-agent-auth-lifecycle-race.test.ts) | PKCE、授权绑定、刷新和撤销有公开实现;不接管业务系统的登录、角色管理或最终授权,也不允许模型从文本指定可信主体。 |
22
+ | Agent Client Runtime:Core 提供工作区、turn、搜索和工具调用接口 | Core v0.9.2 已包含 | [Runtime API](AGENT_CLIENT_RUNTIME_API.md);[运行面源码](../src/app/agent-client-runtime.ts) / [测试](../src/app/agent-client-runtime.test.ts);[调用测试](../src/app/agent-tool-invocations.test.ts) | 本地 Agent 的模型选择、推理循环和工具编排由客户端宿主负责。Core 的原有 `/run` 管线是另一种公开接入路径,不能把两者混为同一客户端执行模式。 |
23
+ | 审批、原调用快照和只读回执:Core 治理,业务系统保留执行结果 | Core v0.9.2 已包含 | [只读回执与恢复](INVOCATION_RECEIPTS.md);[调用源码](../src/app/agent-tool-invocations.ts) / [测试](../src/app/agent-tool-invocations.test.ts);[审批账本测试](../src/infrastructure/config/config-approval-ledger.test.ts) | 原调用回执读取与可能继续业务的 resume 分开。未知结果不构成重发写操作的许可;没有历史参数时不能补造。审批本身不证明业务已成功,也不是分布式业务事务的回滚保证。 |
24
+ | 跨轮任务控制:Core 持久化原成员、写调用预算与并发占用 | Core v0.9.2 已包含(v0.8.0 引入) | [任务控制契约](AGENT_TASK_CONTROL.md);[运行面源码](../src/core/runtime/agent-task-control.ts) / [测试](../src/core/runtime/agent-task-control.test.ts);[MySQL 日志集成测试](../src/infrastructure/config/config-agent-task-control-journal-mysql.test.ts) | 这是受治理业务调用的控制,不是模型轮次套餐。写调用次数不等于退款金额、成功业务数或 Token 数;暂停/取消不能撤回已放行或已完成的业务效果。 |
25
+ | 可见对话审计:客户端显式上传,Core 校验成员和保存事件 | Core v0.9.2 已包含 | [对话审计契约](AGENT_CONVERSATION_AUDIT.md);[运行面测试](../src/core/runtime/agent-conversation-audit.test.ts) | 不采集隐藏推理。确认成员和具备写接口不证明宿主已上传全部历史;审计归档不合并业务授权、会话或运行时记忆。跨绑定仍受同一中枢及各自身份边界约束。 |
26
+ | 当前线程上下文和可选滚动摘要:Core 的路由/线程机制 | Core v0.9.2 已包含 | [记忆配置与渲染](../src/core/runtime/memory.ts);[线程注入源码](../src/core/runtime/memory-runtime.ts) / [测试](../src/core/runtime/memory-runtime.test.ts);[摘要测试](../src/core/runtime/summary-runtime.test.ts) | 摘要默认关闭,启用后仍按原线程读取。它不是完整的用户级跨新会话长期记忆模块;公开的可见对话审计也不会自动变成模型上下文。 |
27
+ | 附件空间:宿主提供获准图片,Core 上传并返回可用 URL | Core v0.9.2 已包含(v0.8.0 引入) | [图片附件契约](GENERATED_ARTIFACTS.md);[附件源码](../src/app/agent-artifacts.ts) / [测试](../src/app/agent-artifacts.test.ts) | 首期 PNG/JPEG/WebP,不接受文档或视频。存储和保留策略需运营者配置;Core 不能读取客户端文件系统。上传图片与使用 URL 改变业务是两个独立动作。 |
28
+ | 可选模型网关与美元额度结算:Core 接入、计量,客户端宿主编排 | Core v0.9.2 已包含 | [模型计费契约](MODEL_BILLING.md);[网关源码](../src/modules/usage/model-gateway.ts);[模型网关 MySQL 测试](../src/modules/usage/model-gateway.mysql.test.ts);[账本单元测试](../src/modules/usage/billing-ledger.test.ts) | 共享 USD 额度、统一倍率、周期售价与额度分离;不恢复按轮次/任务步数收费。参考价格不是供应商实际账单,原始 Token 不是额度分母。未取得权威 usage 的结果不能编造 Token 或费用。 |
29
+ | 模型工具目录、文生图和原请求核对:Core 的可选网关扩展 | Core v0.9.2 已包含 | [工具描述源码](../src/modules/usage/model-tools.ts) / [测试](../src/modules/usage/model-tools.test.ts);[供应商适配测试](../src/modules/usage/model-tool-provider.test.ts);[异步图片 MySQL 测试](../src/modules/usage/model-tool-gateway.mysql.test.ts) | 公开可执行适配器包括阿里云兼容 Images、原生 DashScope 与 OpenRouter Images。视频、语音或自定义服务的目录声明不等于存在可执行适配器;异步完成与关闭边界见下文。 |
30
+ | Kernel Host API、显式迁移和托管生命周期:Core 提供稳定嵌入入口,Host 管理进程与隔离 | Core v0.9.2 已包含 | [Kernel Host API](KERNEL_HOST_API.md);[Kernel 源码](../src/app/kernel.ts) / [测试](../src/app/kernel.test.ts);[制品清单测试](../src/kernel-api/v1/artifact.test.ts);[迁移测试](../src/infrastructure/schema/core-schema-migrator.test.ts) | 独立 MySQL schema 与 runtimeRoot、可信 instanceKey、显式迁移和 Host 的 tick/close 都是前提。此 API 不提供租户注册、平台套餐、集群目录或多副本升级编排;可选 usage 网关也不等于 Host 的平台计费产品。 |
31
+ | 安装、体检与可选运维指标:Core 提供入口,部署者配置和验收 | Core v0.9.2 已包含 | [快速开始](QUICKSTART.md);[安装脚本](../scripts/install.sh);[体检脚本](../scripts/smoke.ts);[OpenMetrics 测试](../src/core/observability/openmetrics.test.ts);[独立复现任务卡](INDEPENDENT_VALIDATION.md) | 健康响应不证明全部业务或供应商可用。指标端点需显式启用并保护访问;有安装/诊断入口不等于已建立持续监控、告警值守或完成特定部署验收。 |
32
+
33
+ ## 公开验证能说明什么
34
+
35
+ ### 单元、模拟与数据库测试
36
+
37
+ 上述测试可用于检查授权、冻结参数、幂等、未知结果、配额和生命周期等机制。带数据库的集成测试需要其公开 fixture 要求的专用测试配置;例如 usage MySQL 测试由 `BAILING_USAGE_TEST_MYSQL=1` 显式启用。只运行默认测试命令而出现 skip,不能据此声称已完成数据库验证。
38
+
39
+ 模拟供应商响应证明适配和协议处理在给定输入下的行为,不证明真实供应商的可用性、价格、模型质量或生产服务表现。包含真实 MySQL 的测试也不自动变成真实业务接入验收。
40
+
41
+ ### 公开 demo 与独立复现任务卡
42
+
43
+ [Docker Demo](DEMO.md) 与 [独立验证任务卡](INDEPENDENT_VALIDATION.md) 提供从 v0.9.2 安装、基础体检到 `npm run demo:e2e` 的公开路径。其订单、工单、退款和故障工具均为仓库 demo 数据;不需要真实模型 Key、客户接口或生产凭据。
44
+
45
+ 任务卡要求记录服务、控制台、匿名预览边界、基础体检和完整业务闭环的具体结果。README 的 demo 图像与动画展示同一公开样例,不能当作客户采用证据。任务卡存在也不意味着已有外部开发者完成验证;报告结果应保留验证者实际版本、环境、检查项和失败范围。
46
+
47
+ ### 正式 v0.9.0 的异步模型工具关闭限制
48
+
49
+ v0.9.0 的 [模型工具网关源码](https://github.com/bailinghub/bailinghub/blob/dae5260ede6565080d21e94ae63d52f3a7d23556/src/modules/usage/model-gateway.ts) 先持久化 provider 派发记录,再通过 `void complete().then(...)` 启动后台完成与结算,立即返回原请求状态。[Kernel 的关闭源码](https://github.com/bailinghub/bailinghub/blob/dae5260ede6565080d21e94ae63d52f3a7d23556/src/app/kernel.ts) 显式等待初始化、托管维护、HTTP、InHub、执行队列及资源关闭,但没有把这段 usage 模型工具 continuation 显式登记为独立的 drain 对象。
50
+
51
+ 因此,v0.9.0 中的异步图片请求/原标识恢复测试不能被扩展为“所有 provider 完成都已经纳入 Kernel 关闭验收”。修复之前的公开主分支 [`728899e`](https://github.com/bailinghub/bailinghub/tree/728899e88d89f0ec333684a56640c12154970327) 也有同一源码边界。本页不据此断言已发生数据丢失或重复业务效果。
52
+
53
+ ### Core v0.9.1 的关闭修复与证据范围
54
+
55
+ Core v0.9.1 增加了每个 `UsageRepository` 独立拥有的 [后台工作登记器](../src/modules/usage/background-work.ts),并在 [Kernel 关闭路径](../src/app/kernel.ts) 的资源关闭前排空。模型工具完成及其晚登记的结算子工作、普通模型响应后的结算、按流量触发的响应清理/usage 核对,以及参考价格刷新到持久化结束,均有实际登记接线。停止新工作、共享关闭时限和超时后同实例重试语义见 [Kernel Host API](KERNEL_HOST_API.md)。原请求的 HTTP 202 与恢复标识不变;关闭等待不发起新的供应商请求,也不改变业务审批权限。
56
+
57
+ 新增 [登记器单元测试](../src/modules/usage/background-work.test.ts) 检查先登记后启动、动态子工作、维护停止、超时重试、owner 隔离和失败诊断边界;owner 单测不等于实际多 Kernel 验证。[Kernel + MySQL 生命周期测试](../src/app/kernel-usage-lifecycle.mysql.test.ts) 使用实际 Kernel、独立测试 schema 和合成供应商,公开断言覆盖延迟完成/晚登记结算、SQL 锁等待、超时保留资源与同实例重试、两个 Kernel 的原标识/资源隔离、普通文本结果交付后结算仍阻挡关闭,以及 standalone shutdown 排空后退出。响应清理与 usage 核对分别有单独阻挡关闭的用例,参考价格刷新覆盖到持久化及新维护停止;结算失败保留原结果/durable pending、后续核对不重派、诊断不带原错误,以及原请求单次派发/单条结算记录也有断言。数据库入口显式依赖 `BAILING_USAGE_TEST_MYSQL=1`;源码与断言不能代替实际测试结果,也不证明真实供应商、进程崩溃恢复或生产部署已验收。
58
+
59
+ 这项修复从 **Core v0.9.1** 提供,不回写 v0.9.0 Tag 的历史保证,也不证明某个宿主已升级或部署。后台工作失败后可能留下 durable pending/unknown 证据;排空完成不等于每条计费记录必然 settled,更不是完整故障恢复或安全保证。
60
+
61
+ ## v0.9.1 纳入的通用安全治理
62
+
63
+ 与 v0.9.0 相比,v0.9.1 纳入此前主分支新增或调整的 [安全自评](https://github.com/bailinghub/bailinghub/blob/v0.9.1/SECURITY_SELF_ASSESSMENT.md)、[中文安全自评](https://github.com/bailinghub/bailinghub/blob/v0.9.1/SECURITY_SELF_ASSESSMENT.zh-CN.md)、[Security Insights 元数据](https://github.com/bailinghub/bailinghub/blob/v0.9.1/security-insights.yml)、[依赖审计脚本](../scripts/dependency-audit.mjs) 及其 [测试](../scripts/dependency-audit.test.mjs),以及 CI、依赖更新和包/镜像排除配置。这些是公开仓治理证据,不是新的业务运行面功能,也不是对全部控制通过的声明。自评与安全元数据不进入 npm 运行包和 Docker 构建内容;自评所注明的评估基线保持原样。
64
+
65
+ 版本字段和本页不能替代具体制品校验。评价 npm、镜像或源码 Tag 时,应核验各自提交、制品和验证结果;从 Core 版本也不能推导独立适配层或宿主的发布状态。
66
+
67
+ ## 独立组件与非 Core 范围
68
+
69
+ - [MCP Server 与 Agent Client SDK](https://github.com/bailinghub/bailinghub-mcp-server)、[DeepSeek Harness 社区插件](https://github.com/bailinghub/bailinghub-dsh-plugin)、[n8n 社区节点](https://github.com/bailinghub/bailinghub-n8n-node) 和 [执行器/OpenClaw 适配](https://github.com/bailinghub/bailinghub-openclaw-skill) 是独立项目或适配层,消费 Core 公共接口。它们有自己的版本、配置和验证,不进入 Core 发行包,也不代表上游认证、背书或采用。
70
+ - 本地宿主负责模型循环、客户端凭据保存、界面与获准文件来源;业务系统负责真实执行、权限与业务不变量;独立 Host 负责其平台身份、租户目录、隔离和进程/升级编排。只按 [Agent Client 接入指南](AGENT_CLIENT_QUICKSTART.md) 和 [Kernel Host API](KERNEL_HOST_API.md) 判断接口责任,不从 Core 的测试推导这些外部实现已完成或已部署。
71
+ - 完整用户级长期记忆、未具备执行适配器的媒体工具、未经本页所列公开路径验证的真实供应商/业务系统,均不能写成这里的已验证能力。本索引没有为这些范围建立新的产品时间表。
72
+
73
+ 后续修改应同步本页与英文版,保留正式 Tag 与主分支的区别;只有对应的公开证据改变后,才更新具体能力的发行状态或验证范围。
74
+
75
+ ## Core v0.9.2 新增的进程恢复回归
76
+
77
+ [进程崩溃与确认丢失专项](MODEL_PROCESS_RECOVERY.md)使用实际SIGKILL、不同PID恢复和MySQL COMMIT回包扣留,核原请求、供应商调用次数、结果与美元账本。此为Core v0.9.2中的独立opt-in测试,历史正式v0.9.1 Tag不含新增专项;链接是测试范围,不代表本页重跑、真实供应商或生产崩溃验收。
78
+
79
+ ## Core v0.9.2 的可靠性修复
80
+
81
+ [安装凭据、结算维护与审批补续](CORE_RELIABILITY.md)记录新安装安全随机源失败关闭、无新流量的结算维护及审批决策的持久补续。配套新增 065/066 增量迁移。公开测试包括[安装器故障回归](../scripts/install-secrets.test.mjs)、[结算 MySQL 回归](../src/modules/usage/billing-reconciliation.mysql.test.ts)、[审批补续回归](../src/app/approval-continuations.test.ts)与[审批 MySQL/进程回归](../src/app/approval-continuations.mysql.test.ts)。这些是Core v0.9.2的实现与检查范围;不扩展历史v0.9.1制品的保证。
@@ -7,7 +7,7 @@ It is not certification, a benchmark, or evidence of production adoption. Passin
7
7
  ## Scope
8
8
 
9
9
  - Target: the open-source BailingHub Docker demo;
10
- - Stable baseline: `v0.9.0`;
10
+ - Stable baseline: `v0.9.2`;
11
11
  - Data: the bundled demo orders, tickets, refunds, and failure probe;
12
12
  - Expected time: about 20 minutes after images and dependencies are available;
13
13
  - Not required: a real model key, production API, production credential, or real business data.
@@ -32,7 +32,7 @@ curl -fsSL https://www.bailinghub.com/install.sh | sh
32
32
  cd "$HOME/bailinghub"
33
33
  ```
34
34
 
35
- The installer pulls the official `v0.9.0` images by default, generates random tokens and an admin password, starts the services, and runs the smoke test. The initial administrator is created only when the administrator table is empty; restarting, upgrading, recreating containers, or reinstalling against the same persistent database does not overwrite a changed password. The optional `/metrics` endpoint remains disabled and does not affect core validation. Keep the reported version, install mode, elapsed time, and the commands printed under `常用命令`, but never include passwords or tokens in your report. After Docker is installed, the current non-root login usually still needs the printed `sudo docker compose ...` commands; Docker group membership may not take effect until the next login.
35
+ The installer pulls the official `v0.9.2` images by default, generates random tokens and an admin password, starts the services, and runs the smoke test. The initial administrator is created only when the administrator table is empty; restarting, upgrading, recreating containers, or reinstalling against the same persistent database does not overwrite a changed password. The optional `/metrics` endpoint remains disabled and does not affect core validation. Keep the reported version, install mode, elapsed time, and the commands printed under `常用命令`, but never include passwords or tokens in your report. After Docker is installed, the current non-root login usually still needs the printed `sudo docker compose ...` commands; Docker group membership may not take effect until the next login.
36
36
 
37
37
  If the default directory is already in use, choose a new empty directory instead of overwriting an existing deployment:
38
38
 
@@ -46,7 +46,7 @@ cd "$HOME/bailinghub-validation"
46
46
  ### Path B: local source reproduction
47
47
 
48
48
  ```bash
49
- git clone --depth 1 --branch v0.9.0 https://github.com/bailinghub/bailinghub.git
49
+ git clone --depth 1 --branch v0.9.2 https://github.com/bailinghub/bailinghub.git
50
50
  cd bailinghub
51
51
  git rev-parse HEAD
52
52
  export BAILING_TOKEN="$(openssl rand -hex 32)"
@@ -167,7 +167,7 @@ After the core task passes, you may continue with:
167
167
  - [Trusted rich rendering and chat reliability](RELEASE_NOTES_v0.1.15.en.md).
168
168
  - [Bounded tool runtime and resilient semantic retrieval](RELEASE_NOTES_v0.1.16.en.md).
169
169
  - [Composable Core and Kernel Host API v1](RELEASE_NOTES_v0.3.0.en.md).
170
- - [Current stable release notes](RELEASE_NOTES_v0.9.0.en.md).
170
+ - [Current stable release notes](RELEASE_NOTES_v0.9.2.en.md).
171
171
 
172
172
  Select the relevant track in the same Issue form and disclose whether you received direct maintainer assistance.
173
173
 
@@ -7,7 +7,7 @@
7
7
  ## 验证范围
8
8
 
9
9
  - 验证对象:BailingHub 开源版 Docker demo;
10
- - 稳定基线:`v0.9.0`;
10
+ - 稳定基线:`v0.9.2`;
11
11
  - 数据范围:仓库自带的 demo 订单、工单、退款和故障工具;
12
12
  - 预计用时:镜像和依赖下载完成后约 20 分钟;
13
13
  - 不需要:真实大模型 Key、生产 API、生产凭据或真实业务数据。
@@ -32,7 +32,7 @@ curl -fsSL https://www.bailinghub.com/install.sh | sh
32
32
  cd "$HOME/bailinghub"
33
33
  ```
34
34
 
35
- 脚本默认拉取 `v0.9.0` 官方镜像,生成随机 Token 与后台密码,启动服务并自动运行基础体检。首次管理员只在数据库管理员表为空时创建;对同一持久化数据库进行重启、升级、容器重建或重新安装,不会覆盖已经修改的管理员密码。可选 `/metrics` 端点默认关闭,不影响基础验证。请保留终端输出中的版本、安装模式、耗时和“常用命令”,但不要把密码或 Token 写入反馈。新安装 Docker 后,当前非 root 会话通常仍需使用脚本打印的 `sudo docker compose ...` 命令;重新登录后 Docker 组权限才可能生效。
35
+ 脚本默认拉取 `v0.9.2` 官方镜像,生成随机 Token 与后台密码,启动服务并自动运行基础体检。首次管理员只在数据库管理员表为空时创建;对同一持久化数据库进行重启、升级、容器重建或重新安装,不会覆盖已经修改的管理员密码。可选 `/metrics` 端点默认关闭,不影响基础验证。请保留终端输出中的版本、安装模式、耗时和“常用命令”,但不要把密码或 Token 写入反馈。新安装 Docker 后,当前非 root 会话通常仍需使用脚本打印的 `sudo docker compose ...` 命令;重新登录后 Docker 组权限才可能生效。
36
36
 
37
37
  如果默认目录已被占用,请使用一个新的空目录,不要覆盖现有部署:
38
38
 
@@ -46,7 +46,7 @@ cd "$HOME/bailinghub-validation"
46
46
  ### 路径 B:本地源码复现
47
47
 
48
48
  ```bash
49
- git clone --depth 1 --branch v0.9.0 https://github.com/bailinghub/bailinghub.git
49
+ git clone --depth 1 --branch v0.9.2 https://github.com/bailinghub/bailinghub.git
50
50
  cd bailinghub
51
51
  git rev-parse HEAD
52
52
  export BAILING_TOKEN="$(openssl rand -hex 32)"
@@ -167,7 +167,7 @@ docker compose exec -T bailinghub npm run demo:e2e
167
167
  - [可信富内容渲染与聊天可靠性](RELEASE_NOTES_v0.1.15.md)。
168
168
  - [工具运行时收敛与语义检索韧性](RELEASE_NOTES_v0.1.16.md)。
169
169
  - [可组合 Core 与 Kernel Host API v1](RELEASE_NOTES_v0.3.0.md)。
170
- - [当前稳定版发布说明](RELEASE_NOTES_v0.9.0.md)。
170
+ - [当前稳定版发布说明](RELEASE_NOTES_v0.9.2.md)。
171
171
 
172
172
  扩展验证请在同一 Issue 模板中选择对应路径,并说明是否获得过维护者的直接帮助。
173
173
 
@@ -46,10 +46,30 @@ await kernel.close(30_000);
46
46
 
47
47
  Managed mode does not create a full timer set per Kernel. The host must call `tick()` fairly and call `close()` during eviction, upgrade, or process shutdown. The 0-600000 ms `close(drainMs)` budget covers initialization, in-flight maintenance/ticks, HTTP, InHub, and execution-queue drain; after drain, Core also clears Kernel-owned transient credential caches such as WeCom access tokens. A timeout preserves the original instance dependencies and reports an error, so the host can retry on that same instance or alert. New `initialize()` and `tick()` calls cannot reopen resources after closing begins.
48
48
 
49
+ ### Usage background drain: Core v0.9.1
50
+
51
+ [Core v0.9.1](RELEASE_NOTES_v0.9.1.en.md) adds usage background work to that close budget. **The formal v0.9.0 Tag does not contain this shutdown fix**. Each Kernel's `UsageRepository` owns a separate [background-work tracker](../src/modules/usage/background-work.ts), covering model-tool completion, settlement, response cleanup, pending-usage reconciliation, and reference-price refresh through persistence.
52
+
53
+ `close()` first blocks new Kernel HTTP admission and waits for accepted HTTP handlers, InHub, and execution queues to finish registering work. It then stops new model requests and maintenance/price refresh for that repository, and dynamically waits for accepted background work. An accepted model-tool completion may register a settlement child after drain starts; that child must also finish before resources close. Asynchronous model tools still promptly return the original pending state/HTTP 202. This revision does not make the first response wait for image-provider completion.
54
+
55
+ All stages share the original `drainMs` deadline rather than receiving a fresh full budget each. A usage-drain timeout reports an error, keeps the Kernel closing and its dependencies intact, and skips subsequent resource closure. The host can wait for the original work and retry `close()` on **the same instance**. A timeout never authorizes a fresh model dispatch or business write. Successful drain establishes that registered work has ended, not that every billing record is settled; failed work may retain durable pending/unknown evidence for later reconciliation. Diagnostics report fixed work categories without provider bodies or raw SQL errors.
56
+
57
+ The [tracker unit tests](../src/modules/usage/background-work.test.ts) check registration before execution, late children, stopped maintenance, timeout/retry, isolation between two owners, and failure cleanup/fixed-category diagnostics. Those two unit-test owners are not two actual Kernels or databases. The public [Kernel + MySQL lifecycle tests](../src/app/kernel-usage-lifecycle.mysql.test.ts) use actual Kernels, separate test schemas, and synthetic providers to assert:
58
+
59
+ - delayed model-tool completion, late settlement, real SQL-lock waits, resource preservation on timeouts, and same-instance retry;
60
+ - ordinary text-model delivery before asynchronous settlement, close waiting for that settlement, and standalone shutdown draining before exit;
61
+ - work/resource isolation between two Kernels using the same original request ID, one original dispatch, and one settlement-ledger record;
62
+ - response cleanup and usage reconciliation each independently blocking close, reference-price refresh through SQL persistence, and stopped new maintenance;
63
+ - settlement failure retaining the original result and durable pending evidence, later reconciliation without provider redispatch, and diagnostics excluding raw errors.
64
+
65
+ The database tests explicitly require `BAILING_USAGE_TEST_MYSQL=1`. Their existence, or a default run that skips them, does not establish a passing database run or live-provider, process-crash recovery, or production-host acceptance. See the [capability/evidence index](IMPLEMENTATION_STATUS.en.md) for the historical v0.9.0 limitation.
66
+
49
67
  Multiple Kernels may share `KernelExecutionQueueV1` as a process-wide concurrency ceiling. This v1 wrapper exposes only `run()` to the Host; admission, statistics, and drain for each Kernel-local queue remain Core-owned. All Kernels in one process currently need the same `display_tz` and `display_tz_label`.
50
68
 
51
69
  ## Artifact And Schema Upgrades
52
70
 
71
+ The [Core reliability fixes](CORE_RELIABILITY.en.md) in Core 0.9.2 add migrations 065/066. A new managed Kernel starts settlement and approval-continuation maintenance on its first existing tick, then advances it periodically. Hosts retain fair tick and close-drain responsibilities without implementing Core ledger recovery. standalone stops new maintenance before draining it. Explicitly migrate 066 and provide matching adapters before using the new decision paths. Kernel API v1 runtime exports remain unchanged, and Host deployments are not automatically upgraded.
72
+
53
73
  `BAILINGHUB_CORE_ARTIFACT_V1` identifies the installed package version, ordered active migration checksums, latest migration, retired-migration evidence, and aggregate manifest checksum. A host should persist these values in its instance directory and match all of them before loading a Kernel. `migrations` is the only sequence that may execute against a new schema. `retiredMigrations` only recognizes ledger history from early deployments; `replay: never` means the corresponding SQL must not be restored or replayed into a new database.
54
74
 
55
75
  `migrateBailingHubCoreSchema()` is the explicit migration entry point. It executes only the installed Core artifact's `sql/*.sql`, uses an advisory lock and migration ledger, and detects historical migration drift with SHA-256. Existing retired-migration ledger rows may receive their checksum from the immutable evidence catalog, but they never enter the execution or fresh-schema ledger sequence. Any unknown history or checksum mismatch fails closed before a new migration runs. Kernel startup never runs DDL implicitly. A host must quiesce the target, drain every replica, migrate with a short-lived schema-only DDL identity, and restore traffic only after the new Kernel passes readiness.
@@ -46,10 +46,30 @@ await kernel.close(30_000);
46
46
 
47
47
  `managed` 模式不为每个 Kernel 创建完整定时器组;宿主必须公平调用 `tick()`,并在淘汰、升级或进程退出时调用 `close()`。`close(drainMs)` 的 0~600000 毫秒时限覆盖初始化、在途维护/tick、HTTP、InHub 与执行队列排空;排空后还会清理 Kernel 自己的企微令牌等瞬时凭证缓存。超时会保留原实例依赖并报错,宿主应在同一实例上重试或告警。`close()` 开始后的新 `initialize()` / `tick()` 不会重开资源。
48
48
 
49
+ ### usage 后台工作排空:Core v0.9.1
50
+
51
+ [Core v0.9.1](RELEASE_NOTES_v0.9.1.md) 在上述关闭时限内增加 usage 后台工作等待;**正式 v0.9.0 Tag 不包含这项关闭修复**。每个 Kernel 所使用的 `UsageRepository` 拥有独立的 [后台工作登记器](../src/modules/usage/background-work.ts),记录模型工具完成、结算、响应清理、待结算 usage 核对,以及参考价格刷新到持久化结束的工作。
52
+
53
+ `close()` 先阻止新的 Kernel HTTP 接入,并等待已接纳的 HTTP、InHub 与执行队列结束登记;随后停止该 repository 的新模型请求及新维护/价格刷新,再动态等待已有后台工作。已接纳的模型工具完成可以在关闭等待开始后登记其结算子工作,该子工作也须结束后才允许关闭资源。异步模型工具仍先返回原请求的 pending/HTTP 202;此修订不会让首次响应等待图片供应商完成。
54
+
55
+ 所有阶段共用原 `drainMs` 时限,而不是为每类工作增加新的完整时限。usage 排空超时会报错,保持 Kernel 的关闭状态并保留其依赖,不调用后续资源关闭。宿主可以等待原工作结束,再对**同一实例**重试 `close()`;不能把超时当作重新派发模型请求或业务写入的许可。成功排空只说明已登记工作已结束,不保证所有账本记录已经 settled;失败工作可保留 durable pending/unknown 证据供后续核对。日志只报告固定工作类别,不附供应商正文或原始 SQL 错误。
56
+
57
+ [登记器单元测试](../src/modules/usage/background-work.test.ts) 检查先登记后启动、晚登记子工作、维护停止、超时重试、两个 owner 的隔离,以及失败清理/固定类别诊断;这些单测的两个 owner 不是两个实际 Kernel 或数据库。[Kernel + MySQL 生命周期测试](../src/app/kernel-usage-lifecycle.mysql.test.ts) 则使用实际 Kernel、独立测试 schema 和模拟供应商,公开断言覆盖:
58
+
59
+ - 延迟模型工具完成、晚登记结算、真实 SQL 锁等待、超时保留资源与同实例重试;
60
+ - 普通文本模型先返回结果、关闭仍等待异步结算,以及 standalone shutdown 排空后才退出;
61
+ - 两个 Kernel 使用同一原请求标识时的工作/资源隔离,原请求单次派发和单条结算记录;
62
+ - 响应清理和 usage 核对分别单独阻挡关闭,以及参考价格刷新到 SQL 持久化、新维护停止;
63
+ - 结算失败仍保留原结果及 durable pending,后续核对不重派供应商请求,诊断不输出原始错误。
64
+
65
+ 数据库入口由 `BAILING_USAGE_TEST_MYSQL=1` 显式启用。测试源码存在或默认运行时被跳过,不代表实际数据库测试通过,也不代表真实供应商、进程崩溃恢复或生产宿主已完成验收。正式 v0.9.0 的历史限制另见 [能力与证据索引](IMPLEMENTATION_STATUS.md)。
66
+
49
67
  多个 Kernel 可以共享 `KernelExecutionQueueV1` 作为进程级并发上限。这个 v1 包装只向宿主暴露 `run()`;每个 Kernel 内部队列的接入、统计和排空仍由 Core 自己管理。当前同进程实例必须使用相同的 `display_tz` / `display_tz_label`。
50
68
 
51
69
  ## 制品与数据库升级
52
70
 
71
+ Core 0.9.2 的 [可靠性修复](CORE_RELIABILITY.md)新增 065/066 迁移。新 managed Kernel 在首次既有 tick 启动结算与审批补续维护,以后按周期推进;Host 继续负责公平 tick 和关闭时等待,不需要自行实现 Core 的账本恢复。standalone 新维护先停止再排空。使用新审批决策前须显式迁移 066 并具备配套仓储;它不修改 Kernel API v1 的运行导出,也不自动升级 Host 的部署。
72
+
53
73
  `BAILINGHUB_CORE_ARTIFACT_V1` 包含已安装包版本、官方活动迁移摘要、最新迁移名、退役迁移证据和整体 manifest 摘要。宿主应把这些值写入自己的实例目录,并在加载前逐项匹配。`migrations` 只是可在新 Schema 中执行的活动序列;`retiredMigrations` 只用于识别早期部署的历史账本,`replay: never` 表示不得恢复相应 SQL 文件或在新库中重放。
54
74
 
55
75
  `migrateBailingHubCoreSchema()` 是显式迁移入口:它只执行当前 Core 制品自带的 `sql/*.sql`,使用命名锁、迁移账本和 SHA-256 检测历史文件漂移。已存在的退役迁移账本行可按固化证据补录摘要,但不进入执行或新库记账序列;任何未知历史文件或摘要不一致都会在新迁移前失败关闭。Kernel 启动不会隐式执行 DDL;宿主应先停止目标实例新流量、排空所有副本,再用短生命周期且仅限目标 Schema 的 DDL 身份迁移,最后通过新 Kernel readiness 后恢复流量。
@@ -121,3 +121,7 @@ Under Account Usage → Usage Details → Reset Allowance, administrators with `
121
121
  - Idempotent replay returns the original receipt. Revision checks prevent duplicate concurrent resets. The receipt records `reset.previousGrantId`, `reset.actor` and `reset.at` to identify the original grant and operator.
122
122
 
123
123
  Existing summaries return the new balance and next reset date. This feature adds no SQL migration and independently requires no SDK/DSH or backend changes.
124
+
125
+ ## Automatic settlement maintenance in Core 0.9.2
126
+
127
+ Core 0.9.2 adds an initial and recurring minute-based settlement pass, fair paging and database-failure backoff without depending on new HTTP requests. It uses original metering, prices and the unified multiplier, without reading generated bodies or dispatching providers. Missing authoritative metering remains pending. See [Core reliability fixes](CORE_RELIABILITY.en.md) for index 065, managed tick and standalone shutdown boundaries. These changes are available from Core 0.9.2 and do not expand the historical v0.9.1 Tag's guarantees.
@@ -123,3 +123,7 @@
123
123
  - 原请求幂等重试只返回原回执;并发变更通过修订号检查,避免重复重置。变更回执记录 `reset.previousGrantId`、`reset.actor`、`reset.at`,可关联原开通与操作人。
124
124
 
125
125
  沿用现有摘要接口返回新的剩余额度及下次重置时间,不新增 SQL 迁移,不需要客户端 SDK/DSH 或业务后端改造。
126
+
127
+ ## Core 0.9.2 的自动结算维护
128
+
129
+ Core 0.9.2 增加首轮及每分钟的后台结算维护、公平分页与数据库故障退避,结算不依赖新 HTTP 请求。仅使用原记录的计量、价格与统一倍率,不读取生成正文或重派供应商;缺少权威计量仍待核对。配套 065 索引及 managed tick/standalone 关闭边界见[Core 可靠性修复](CORE_RELIABILITY.md)。这些修改从 Core 0.9.2 提供,不扩展历史 v0.9.1 Tag 的保证。
@@ -0,0 +1,32 @@
1
+ # Model request process-crash and lost-acknowledgement regressions
2
+
3
+ [简体中文](MODEL_PROCESS_RECOVERY.md)
4
+
5
+ This page describes additional tests included in Core 0.9.2. The historical `v0.9.1` Tag contains original-request recovery and usage shutdown draining, but not these new process tests. Source, executed checks, released artifacts and production acceptance remain separate evidence.
6
+
7
+ ## Fault windows
8
+
9
+ Two distinct Kernel child-process PIDs use the same synthetic schema in a dedicated MySQL instance and an independent synthetic provider. The suite covers admission and dispatch transaction boundaries; a received provider request without a response; a received response without a committed result; a committed result awaiting settlement; and a saved chat result whose HTTP delivery is lost. A protocol proxy also withholds the actual MySQL COMMIT OK packet after committed dispatch, result and settlement transactions.
10
+
11
+ The first process receives a real `SIGKILL`. The replacement process is checked for original operation/request identity, physical provider calls, preserved result/hash, ledger rows and consumed USD. Reading a saved result must not call the provider again, and settlement recovery must not charge twice. An unknown result after durable dispatch retains its original ID for inspection; a network error is not permission to create another generation.
12
+
13
+ A killed admission that never committed and a durable admitted request are different cases. An admitted request that was not dispatched is not automatically dispatched after restart and can be cancelled under its original identity. Recovery may retain pending/unknown records; the suite does not require every record to become settled automatically.
14
+
15
+ ## Run
16
+
17
+ Node.js 22 or newer and Docker are required. Pull the pinned public fixture image, then explicitly enable the suite:
18
+
19
+ ```bash
20
+ docker pull mysql:8.4@sha256:85b9bf2e29cf836ecb8c2a15a935d4ba0c606631dff1dd79531a11983c638f2a
21
+ BAILING_USAGE_PROCESS_CRASH_TEST=1 npm run test:model-process-recovery
22
+ ```
23
+
24
+ Without the flag the tests explicitly skip and create no Docker, database or child-process resources. With the flag enabled, missing Docker or the pinned image fails rather than silently skipping. A default test run is not evidence that this suite executed.
25
+
26
+ The suite creates its own labelled container, randomly publishes MySQL only on `127.0.0.1`, and creates a random schema per case. It does not load deployment configuration, inherit deployment database settings or use real model credentials. Cleanup checks the saved full container ID and ownership label and removes only owned processes, container and temporary data. Fault barriers and the protocol proxy are test facilities, not deployment tools.
27
+
28
+ ## Limits
29
+
30
+ The suite does not establish real-provider retry/billing behavior, host power-loss recovery, database failover, cross-region resilience or exactly-once external business effects. It is not a production database-restore exercise. Hosted instance ownership and tenant isolation, and client task/delivery behavior, require their own checks.
31
+
32
+ [Tests](../src/app/kernel-model-process-crash.mysql.test.ts) · [Isolated child entrypoint](../src/test-support/model-process-crash-child.ts) · [Invocation receipts](INVOCATION_RECEIPTS.md) · [Implementation and public evidence index](IMPLEMENTATION_STATUS.en.md)
@@ -0,0 +1,37 @@
1
+ # 模型请求进程崩溃与确认丢失回归
2
+
3
+ [English](MODEL_PROCESS_RECOVERY.en.md)
4
+
5
+ 本页说明 Core 0.9.2 纳入的专项测试。正式 `v0.9.1` 已有原请求恢复与 usage 后台排空,但该历史 Tag 不包含本页新增的进程测试。测试源码、实际执行、正式发行和生产验收分别核对。
6
+
7
+ ## 验证的窗口
8
+
9
+ 专项以两个不同 PID 的真实 Kernel 子进程、专用 MySQL 和独立合成供应商核对以下边界:
10
+
11
+ - 准入事务提交前后;派发事务提交前后。
12
+ - 供应商已收到请求、尚未返回结果;结果已收到、持久结果尚未提交。
13
+ - 结果提交完成但异步结算尚未完成;普通文本结果已保存但 HTTP 回复丢失。
14
+ - MySQL 已提交派发、结果或结算事务,但协议代理扣留实际 COMMIT OK 回包。
15
+
16
+ 子进程实际收到 `SIGKILL`,随后以新 PID 连接同一合成 schema。断言检查原 `operation_id`、原请求记录、供应商实际调用次数、已保存结果及 hash、美元账本条数与当期消耗。已保存结果的恢复不再次调用供应商;结算恢复不产生重复扣款。持久派发边界之后结果未知仍保留原 ID 核对,不能换 ID 或凭网络错误重新生成。
17
+
18
+ 准入提交前被杀、数据库没有原请求记录的场景与已持久准入分开。尚未派发的持久请求不会因重启自动重新派发,可按原请求取消。成功恢复允许留下 pending/unknown;不是所有记录必须自动 settled。
19
+
20
+ ## 运行
21
+
22
+ 需要 Node.js 22 或更高、Docker,以及下面的固定公开测试镜像。先拉镜像,再显式启用专项:
23
+
24
+ ```bash
25
+ docker pull mysql:8.4@sha256:85b9bf2e29cf836ecb8c2a15a935d4ba0c606631dff1dd79531a11983c638f2a
26
+ BAILING_USAGE_PROCESS_CRASH_TEST=1 npm run test:model-process-recovery
27
+ ```
28
+
29
+ 未设置开关时,本专项明确 skip,不创建 Docker、数据库或子进程;显式启用但缺少 Docker/固定镜像时失败,不回退为跳过。普通默认测试的成功不能代表专项已经执行。
30
+
31
+ 测试自行创建带任务标签的独立容器,MySQL 端口仅随机映射到 `127.0.0.1`,每个场景使用随机 schema。测试不读取部署配置、继承部署数据库参数或使用真实模型凭据。清理按保存的完整容器 ID 和标签核对,仅移除自有容器、子进程与临时数据。请勿将测试夹点或协议代理用于实际部署。
32
+
33
+ ## 范围
34
+
35
+ 这些断言不证明真实供应商的重试或计费语义、主机断电、数据库服务器故障切换、跨地域容灾或外部业务 exactly-once。它们也不代表生产数据库恢复演练。独立宿主的实例管理与租户隔离、本地客户端的任务与交付分别由对应项目验证。
36
+
37
+ [专项测试](../src/app/kernel-model-process-crash.mysql.test.ts) · [隔离子进程夹点](../src/test-support/model-process-crash-child.ts) · [原调用回执](INVOCATION_RECEIPTS.md) · [能力与公开证据索引](IMPLEMENTATION_STATUS.md)
package/docs/README.en.md CHANGED
@@ -6,6 +6,12 @@ This directory contains public documentation for the open-source BailingHub proj
6
6
 
7
7
  | Document | Purpose |
8
8
  |---|---|
9
+ | [IMPLEMENTATION_STATUS.en.md](IMPLEMENTATION_STATUS.en.md) · [Chinese](IMPLEMENTATION_STATUS.md) | Core ownership, formal releases versus main, public evidence, and uncovered scope. |
10
+ | [RELEASE_NOTES_v0.9.2.en.md](RELEASE_NOTES_v0.9.2.en.md) · [Chinese](RELEASE_NOTES_v0.9.2.md) | v0.9.2: secure installation, automatic settlement and original approval continuation, with deployment diagnostics and process tests. |
11
+ | [UPGRADE_v0.9.2.en.md](UPGRADE_v0.9.2.en.md) · [Chinese](UPGRADE_v0.9.2.md) | Explicit migrations 065/066, matching adapters, original-record checks and rollback limits. |
12
+ | [CORE_RELIABILITY.en.md](CORE_RELIABILITY.en.md) · [Chinese](CORE_RELIABILITY.md) | Installation credentials, fair settlement maintenance, approval continuation and synthetic acceptance boundaries. |
13
+ | [RELEASE_NOTES_v0.9.1.en.md](RELEASE_NOTES_v0.9.1.en.md) · [Chinese](RELEASE_NOTES_v0.9.1.md) | v0.9.1: asynchronous usage shutdown fix, public capability index, and general security governance. |
14
+ | [UPGRADE_v0.9.1.en.md](UPGRADE_v0.9.1.en.md) · [Chinese](UPGRADE_v0.9.1.md) | 0.9.0 patch upgrade, original requests, artifact manifests, and shutdown acceptance; no new SQL/APIs. |
9
15
  | [RELEASE_NOTES_v0.9.0.en.md](RELEASE_NOTES_v0.9.0.en.md) · [Chinese](RELEASE_NOTES_v0.9.0.md) | v0.9.0: optional model billing, shared allowances and image tools. |
10
16
  | [UPGRADE_v0.9.0.en.md](UPGRADE_v0.9.0.en.md) · [Chinese](UPGRADE_v0.9.0.md) | Upgrade from public 0.8.0, migrations 063/064 and optional host integration. |
11
17
  | [MODEL_BILLING.en.md](MODEL_BILLING.en.md) · [Chinese](MODEL_BILLING.md) | Models/tools, reference prices, asynchronous settlement, archive and allowance reset contract. |
@@ -54,6 +60,7 @@ This directory contains public documentation for the open-source BailingHub proj
54
60
  |---|---|
55
61
  | [ARCHITECTURE.en.md](ARCHITECTURE.en.md) | Architecture overview: layers, runtime path, boundaries, and extension points. |
56
62
  | [KERNEL_HOST_API.en.md](KERNEL_HOST_API.en.md) | Versioned high-level embedding API, managed lifecycle, mount paths, and artifact upgrade boundary. |
63
+ | [MODEL_PROCESS_RECOVERY.en.md](MODEL_PROCESS_RECOVERY.en.md) · [简体中文](MODEL_PROCESS_RECOVERY.md) | Opt-in process-crash/lost-acknowledgement regressions included in v0.9.2; historical Tag evidence stays separate. |
57
64
  | [KERNEL_HOST_API.md](KERNEL_HOST_API.md) | Chinese Kernel Host API guide. |
58
65
  | [PIPELINE.en.md](PIPELINE.en.md) | Runtime pipeline from trigger to dispatch, tools, audit, approval, and delivery. |
59
66
 
@@ -68,6 +75,7 @@ This directory contains public documentation for the open-source BailingHub proj
68
75
  | [SDK.en.md](SDK.en.md) | SDK guide for PHP, Node, Python, Java, Go, .NET, and any-language OpenAPI/HMAC integration. |
69
76
  | [CHANNELS.en.md](CHANNELS.en.md) | Inbound channel model and adapter expectations. |
70
77
  | [OPERATIONS.en.md](OPERATIONS.en.md) | Production topology, readiness, capacity, upgrades, backups, and recovery. |
78
+ | [DEPLOYMENT_DIAGNOSTICS.en.md](DEPLOYMENT_DIAGNOSTICS.en.md) · [Chinese](DEPLOYMENT_DIAGNOSTICS.md) | Read-only deployment doctor: public identities, explicit readiness, unknown/unchecked evidence and machine exit codes. |
71
79
  | [STREAMING.en.md](STREAMING.en.md) | Chat streaming protocol, reconnect behavior, canonical final result, and multi-replica boundary. |
72
80
  | [STREAMING.md](STREAMING.md) | Chinese chat streaming protocol. |
73
81
 
package/docs/README.md CHANGED
@@ -8,6 +8,12 @@
8
8
 
9
9
  | 文档 | 用途 |
10
10
  |---|---|
11
+ | [IMPLEMENTATION_STATUS.md](IMPLEMENTATION_STATUS.md) · [English](IMPLEMENTATION_STATUS.en.md) | Core 能力归属、正式发行与主分支状态、公开证据和未覆盖范围。 |
12
+ | [RELEASE_NOTES_v0.9.2.md](RELEASE_NOTES_v0.9.2.md) · [English](RELEASE_NOTES_v0.9.2.en.md) | v0.9.2:安全安装、自动结算与原审批补续,含部署诊断与进程回归。 |
13
+ | [UPGRADE_v0.9.2.md](UPGRADE_v0.9.2.md) · [English](UPGRADE_v0.9.2.en.md) | 065/066显式迁移、配套仓储、原记录核对及回退限制。 |
14
+ | [CORE_RELIABILITY.md](CORE_RELIABILITY.md) · [English](CORE_RELIABILITY.en.md) | 安装凭据、公平结算维护、审批补续与合成验收边界。 |
15
+ | [RELEASE_NOTES_v0.9.1.md](RELEASE_NOTES_v0.9.1.md) · [English](RELEASE_NOTES_v0.9.1.en.md) | v0.9.1:异步 usage 关闭修复、公开能力索引与通用安全治理。 |
16
+ | [UPGRADE_v0.9.1.md](UPGRADE_v0.9.1.md) · [English](UPGRADE_v0.9.1.en.md) | 0.9.0 补丁升级、原请求核对、制品 manifest 与关闭验收;无新增 SQL/API。 |
11
17
  | [RELEASE_NOTES_v0.9.0.md](RELEASE_NOTES_v0.9.0.md) · [English](RELEASE_NOTES_v0.9.0.en.md) | v0.9.0:可选模型计费、统一套餐额度与文生图工具。 |
12
18
  | [UPGRADE_v0.9.0.md](UPGRADE_v0.9.0.md) · [English](UPGRADE_v0.9.0.en.md) | 从公开 0.8.0 升级、063/064 迁移及宿主按需接入。 |
13
19
  | [MODEL_BILLING.md](MODEL_BILLING.md) · [English](MODEL_BILLING.en.md) | 模型与工具、参考价格、异步结算、账户归档和额度重置契约。 |
@@ -61,6 +67,7 @@
61
67
  | [ARCHITECTURE.md](ARCHITECTURE.md) | 当前架构的主说明:分层、核心运行链路、解耦边界和扩展方向。 |
62
68
  | [ARCHITECTURE.en.md](ARCHITECTURE.en.md) | English architecture overview. |
63
69
  | [KERNEL_HOST_API.md](KERNEL_HOST_API.md) | 完整 Core 的版本化高层嵌入 API、托管生命周期和升级边界。 |
70
+ | [MODEL_PROCESS_RECOVERY.md](MODEL_PROCESS_RECOVERY.md) · [English](MODEL_PROCESS_RECOVERY.en.md) | 当前源码的 opt-in 进程崩溃/确认丢失回归;不回写历史 Tag 验证。 |
64
71
  | [KERNEL_HOST_API.en.md](KERNEL_HOST_API.en.md) | English versioned Kernel Host API and lifecycle boundary. |
65
72
  | [PIPELINE.md](PIPELINE.md) | 一次任务从入口到执行、审计、送达的流水线。 |
66
73
  | [PIPELINE.en.md](PIPELINE.en.md) | English runtime pipeline. |
@@ -80,6 +87,7 @@
80
87
  | [CHANNELS.md](CHANNELS.md) | 入站渠道模型,当前包含企微接入。 |
81
88
  | [CHANNELS.en.md](CHANNELS.en.md) | English inbound channel model. |
82
89
  | [OPERATIONS.md](OPERATIONS.md) | 生产部署、多副本、健康检查、容量、备份与恢复。 |
90
+ | [DEPLOYMENT_DIAGNOSTICS.md](DEPLOYMENT_DIAGNOSTICS.md) · [English](DEPLOYMENT_DIAGNOSTICS.en.md) | 只读部署 doctor:公开身份核对、显式 readiness、未知与未检查状态及机器退出码。 |
83
91
  | [OPERATIONS.en.md](OPERATIONS.en.md) | English production operations guide. |
84
92
  | [STREAMING.md](STREAMING.md) | 网页聊天的真实增量输出协议:SSE 事件、断线重放、权威结果和多副本边界。 |
85
93
  | [STREAMING.en.md](STREAMING.en.md) | English chat streaming protocol and operations boundary. |