bailinghub 0.9.4 → 0.10.0

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 (298) hide show
  1. package/README.en.md +6 -6
  2. package/README.md +6 -6
  3. package/THIRD_PARTY_NOTICES.md +1 -1
  4. package/docker-compose.images.yml +2 -2
  5. package/docs/AGENT_CLIENT_QUICKSTART.en.md +1 -3
  6. package/docs/AGENT_CLIENT_QUICKSTART.md +1 -1
  7. package/docs/AGENT_CLIENT_RUNTIME_API.en.md +87 -2
  8. package/docs/AGENT_CLIENT_RUNTIME_API.md +36 -2
  9. package/docs/AGENT_KNOWLEDGE_API.en.md +77 -0
  10. package/docs/AGENT_KNOWLEDGE_API.md +86 -0
  11. package/docs/AGENT_TASK_CONTROL.md +4 -4
  12. package/docs/AGENT_TASK_CONTROL_FOUNDATION.md +1 -1
  13. package/docs/ARCHITECTURE.md +4 -0
  14. package/docs/CHANGELOG.en.md +12 -0
  15. package/docs/CHANGELOG.md +12 -0
  16. package/docs/COMPATIBILITY.en.md +27 -1
  17. package/docs/CONTRACT.en.md +1 -1
  18. package/docs/CONTRACT.md +1 -1
  19. package/docs/IMPLEMENTATION_STATUS.en.md +19 -15
  20. package/docs/IMPLEMENTATION_STATUS.md +19 -15
  21. package/docs/INDEPENDENT_VALIDATION.en.md +6 -4
  22. package/docs/INDEPENDENT_VALIDATION.md +6 -4
  23. package/docs/INTEGRATION_WALKTHROUGH.md +65 -0
  24. package/docs/MODEL_BILLING.en.md +2 -0
  25. package/docs/MODEL_BILLING.md +6 -2
  26. package/docs/MODEL_CONTINUATION.en.md +54 -0
  27. package/docs/MODEL_CONTINUATION.md +54 -0
  28. package/docs/MODEL_OUTPUT_BUDGET.en.md +69 -0
  29. package/docs/MODEL_OUTPUT_BUDGET.md +69 -0
  30. package/docs/OPERATIONS.en.md +16 -4
  31. package/docs/OPERATIONS.md +16 -4
  32. package/docs/QUICKSTART.md +1 -1
  33. package/docs/README.en.md +5 -0
  34. package/docs/README.md +5 -0
  35. package/docs/RELEASE_NOTES_NEXT.en.md +3 -3
  36. package/docs/RELEASE_NOTES_NEXT.md +3 -3
  37. package/docs/RELEASE_NOTES_v0.10.0.en.md +58 -0
  38. package/docs/RELEASE_NOTES_v0.10.0.md +58 -0
  39. package/docs/UPGRADE_PLAN.en.md +118 -0
  40. package/docs/UPGRADE_PLAN.md +124 -0
  41. package/docs/UPGRADE_v0.10.0.en.md +47 -0
  42. package/docs/UPGRADE_v0.10.0.md +47 -0
  43. package/docs//345/205/274/345/256/271/346/200/247/344/270/216/345/215/207/347/272/247.md +38 -22
  44. package/package.json +8 -5
  45. package/schemas/tool-definition.schema.json +13 -0
  46. package/scripts/check-doc-links.mjs +4 -0
  47. package/scripts/check-image-tags.sh +1 -1
  48. package/scripts/check-release-consistency.test.mjs +2 -2
  49. package/scripts/doctor-upgrade-plan.test.ts +205 -0
  50. package/scripts/doctor-upgrade-plan.ts +276 -0
  51. package/scripts/doctor.ts +4 -1
  52. package/scripts/e2e-console-approval-details.mjs +134 -0
  53. package/scripts/e2e-console-config-races.mjs +180 -0
  54. package/scripts/e2e-console-kb-audit.mjs +170 -0
  55. package/scripts/e2e-console-operations-audit.mjs +152 -0
  56. package/scripts/e2e-console-runtime-audit.mjs +179 -0
  57. package/scripts/e2e-console-settings-audit.mjs +125 -0
  58. package/scripts/e2e-console-troubleshooting-extra.mjs +267 -0
  59. package/scripts/e2e-console.mjs +476 -7
  60. package/scripts/install.sh +1 -1
  61. package/scripts/publish-images.sh +1 -1
  62. package/scripts/release-audit.mjs +4 -0
  63. package/scripts/verify-github-repo.mjs +4 -0
  64. package/src/app/agent-client-runtime.test.ts +115 -2
  65. package/src/app/agent-client-runtime.ts +40 -11
  66. package/src/app/agent-knowledge.test.ts +171 -0
  67. package/src/app/agent-knowledge.ts +233 -0
  68. package/src/app/agent-tool-catalog-revision.test.ts +31 -0
  69. package/src/app/agent-tool-invocations.test.ts +7 -2
  70. package/src/app/agent-tool-invocations.ts +67 -7
  71. package/src/app/approval-continuations.test.ts +49 -1
  72. package/src/app/http.test.ts +16 -1
  73. package/src/app/http.ts +3 -3
  74. package/src/app/kernel-boot-recovery.mysql.test.ts +132 -0
  75. package/src/app/kernel-boot-recovery.test.ts +157 -0
  76. package/src/app/kernel.ts +12 -8
  77. package/src/app/readiness.mysql.test.ts +120 -0
  78. package/src/app/readiness.test.ts +111 -26
  79. package/src/app/readiness.ts +26 -22
  80. package/src/app/runtime-lifecycle.ts +34 -3
  81. package/src/app/tool-approvals.test.ts +83 -0
  82. package/src/app/tool-approvals.ts +25 -7
  83. package/src/app/tool-proxy-payload.test.ts +81 -0
  84. package/src/app/tool-proxy.ts +24 -2
  85. package/src/core/config/console-diagnostic-location.test.ts +36 -0
  86. package/src/core/config/console-form-guard.test.ts +69 -0
  87. package/src/core/config/console-task-location.test.ts +64 -0
  88. package/src/core/contracts/openapi-tools.ts +16 -5
  89. package/src/core/contracts/schema-readiness.ts +11 -0
  90. package/src/core/contracts/tool-definition.ts +26 -0
  91. package/src/core/contracts/tool-guidance.test.ts +77 -0
  92. package/src/core/contracts/tool-guidance.ts +31 -0
  93. package/src/core/contracts/tool-input-limits.ts +15 -0
  94. package/src/core/contracts/tools-idempotency.test.ts +90 -0
  95. package/src/core/contracts/tools.ts +52 -9
  96. package/src/core/runtime/agent-execution-memory.test.ts +64 -0
  97. package/src/core/runtime/agent-execution-memory.ts +63 -0
  98. package/src/core/state/state-contracts.ts +3 -0
  99. package/src/infrastructure/config/config-observability-ledger.ts +2 -0
  100. package/src/infrastructure/schema/schema-readiness.ts +29 -0
  101. package/src/infrastructure/state/state-mysql.ts +3 -0
  102. package/src/modules/usage/contracts.ts +7 -0
  103. package/src/modules/usage/http.ts +2 -0
  104. package/src/modules/usage/model-continuation.test.ts +109 -0
  105. package/src/modules/usage/model-gateway.ts +5 -1
  106. package/src/modules/usage/output-budget.mysql.test.ts +84 -0
  107. package/src/modules/usage/output-budget.test.ts +167 -0
  108. package/src/modules/usage/output-budget.ts +73 -0
  109. package/src/modules/usage/provider-stream.test.ts +22 -0
  110. package/src/modules/usage/provider.ts +2 -3
  111. package/src/modules/usage/repository.ts +6 -0
  112. package/src/modules/usage/test-harness.ts +4 -2
  113. package/src/routes/admin-approval-view.test.ts +109 -0
  114. package/src/routes/admin-approval-view.ts +36 -0
  115. package/src/routes/admin-readiness.test.ts +52 -0
  116. package/src/routes/admin-runtime-ux.test.ts +51 -0
  117. package/src/routes/admin-runtime-ux.ts +25 -0
  118. package/src/routes/admin-runtime.ts +36 -8
  119. package/src/routes/admin.ts +9 -0
  120. package/src/routes/agent-api.test.ts +80 -1
  121. package/src/routes/agent-api.ts +63 -4
  122. package/src/routes/agent-tool-detail.test.ts +140 -0
  123. package/src/routes/public-default.ts +1 -1
  124. package/src/services/kb-agent.test.ts +84 -0
  125. package/src/services/kb.ts +73 -0
  126. package/web/console/assets/Accounts-CjIBO3sU.css +1 -0
  127. package/web/console/assets/Accounts-Dhyw-7wF.js +3 -0
  128. package/web/console/assets/AgentClients-BA0M26-I.css +1 -0
  129. package/web/console/assets/AgentClients-DWxb8-ko.js +1 -0
  130. package/web/console/assets/AgentTasks-DOyxANnx.css +1 -0
  131. package/web/console/assets/AgentTasks-DUHD4dzr.js +2 -0
  132. package/web/console/assets/Approvals-Brl-2uJq.css +1 -0
  133. package/web/console/assets/Approvals-CQx1YWxW.js +1 -0
  134. package/web/console/assets/Audit--QcdVlMh.js +1 -0
  135. package/web/console/assets/Audit-DAdmOnIs.css +1 -0
  136. package/web/console/assets/{BrandLockup-CffORQse.js → BrandLockup-DQcaW4Nt.js} +1 -1
  137. package/web/console/assets/Channels-DJJU3ksE.css +1 -0
  138. package/web/console/assets/Channels-cGS5WfQ-.js +105 -0
  139. package/web/console/assets/ChatEntries-BYpji27B.css +1 -0
  140. package/web/console/assets/ChatEntries-nh23Iz5O.js +7 -0
  141. package/web/console/assets/Clients-CX5EeYio.js +3 -0
  142. package/web/console/assets/Clients-CbZAou8E.css +1 -0
  143. package/web/console/assets/Cost-C6oQvz9P.css +1 -0
  144. package/web/console/assets/Cost-DOZfdNS9.js +1 -0
  145. package/web/console/assets/Credentials--aHs57yV.css +1 -0
  146. package/web/console/assets/Credentials-sy6W9Sac.js +1 -0
  147. package/web/console/assets/Diagnostics-CKs27Dnv.css +1 -0
  148. package/web/console/assets/Diagnostics-CyoM1XrZ.js +1 -0
  149. package/web/console/assets/Executors-2Upi6bOS.css +1 -0
  150. package/web/console/assets/Executors-BQqqiFwt.js +1 -0
  151. package/web/console/assets/HelpTip-DLlhaGQp.js +1 -0
  152. package/web/console/assets/HelpTip-bbDEyuqV.css +1 -0
  153. package/web/console/assets/Kb-5R3ce4UU.js +5 -0
  154. package/web/console/assets/Kb-BM_PYi11.css +1 -0
  155. package/web/console/assets/{Login-CGgLGTE1.js → Login-YKeUwdgo.js} +1 -1
  156. package/web/console/assets/Projects-DHwHrPT9.css +1 -0
  157. package/web/console/assets/Projects-Grgb6fOv.js +1 -0
  158. package/web/console/assets/Routes-DR_Yf02e.css +1 -0
  159. package/web/console/assets/Routes-DYgrXlRJ.js +138 -0
  160. package/web/console/assets/Runs-CwTddJJj.js +3 -0
  161. package/web/console/assets/Runs-D4FOvNfu.css +1 -0
  162. package/web/console/assets/Setup-Ca0b1d1-.css +1 -0
  163. package/web/console/assets/Setup-D_xUPNDq.js +1 -0
  164. package/web/console/assets/Shell-BTg8Vw_L.css +1 -0
  165. package/web/console/assets/Shell-Dfam2Uoj.js +1 -0
  166. package/web/console/assets/StorageBuckets-7QLBpV4a.css +1 -0
  167. package/web/console/assets/StorageBuckets-CP6e50wI.js +1 -0
  168. package/web/console/assets/SystemSettings-BRYKyJNa.js +1 -0
  169. package/web/console/assets/SystemSettings-HsXGx0aH.css +1 -0
  170. package/web/console/assets/SystemStatus-B-VfRsQd.css +1 -0
  171. package/web/console/assets/SystemStatus-CbPsDsGt.js +1 -0
  172. package/web/console/assets/Targets-1j4-g6rC.css +1 -0
  173. package/web/console/assets/Targets-C2LkR2AF.js +1 -0
  174. package/web/console/assets/Tools-C9HPJqJb.css +1 -0
  175. package/web/console/assets/Tools-C9JNJUS0.js +2 -0
  176. package/web/console/assets/Usage-D1Mv6vGY.js +1 -0
  177. package/web/console/assets/Usage-DMOzUsqh.css +1 -0
  178. package/web/console/assets/UsageAccess-77LmGCm6.js +1 -0
  179. package/web/console/assets/UsageAccess-C6ZGxEgJ.css +1 -0
  180. package/web/console/assets/{UsageHelp-CzS2gI40.js → UsageHelp-BmuiE1Ew.js} +1 -1
  181. package/web/console/assets/client-route-draft-DxZRxKPT.js +1 -0
  182. package/web/console/assets/console-location-Csv-xsnl.js +1 -0
  183. package/web/console/assets/form-guard-8GrFpry0.js +1 -0
  184. package/web/console/assets/{index-65JiiUr4.js → index-B_5UfiTw.js} +1 -1
  185. package/web/console/assets/index-MjZJEFIN.js +2 -0
  186. package/web/console/assets/{request-DKycpD7z.js → request-rqm6MT0s.js} +1 -1
  187. package/web/console/assets/runtime-feedback-gPfZVNvY.js +1 -0
  188. package/web/console/assets/{schema-SCiNxBlR.js → schema-o3mK4mid.js} +1 -1
  189. package/web/console/assets/task-page-location-DWiGtAln.js +1 -0
  190. package/web/console/assets/use-list-location-FvLFt0Tq.css +1 -0
  191. package/web/console/assets/use-list-location-cIPy2cKM.js +1 -0
  192. package/web/console/assets/use-unsaved-form-DScKD0h9.js +1 -0
  193. package/web/console/assets/{util-DZYfJ5Zo.js → util-B40VqOwl.js} +1 -1
  194. package/web/console/assets/{vendor-element-8cVcdt5T.js → vendor-element-BT8tHCFk.js} +1 -1
  195. package/web/console/assets/{vendor-mammoth-CnDA23N0.js → vendor-mammoth-CVIXVxTN.js} +1 -1
  196. package/web/console/assets/{vendor-vue-Co7x2FW6.js → vendor-vue-DhbG0vd4.js} +7 -7
  197. package/web/console/index.html +3 -3
  198. package/web-admin/package-lock.json +4 -4
  199. package/web-admin/package.json +1 -1
  200. package/web-admin/src/client-route-draft.ts +25 -0
  201. package/web-admin/src/components/AgentSetupPanel.vue +54 -41
  202. package/web-admin/src/components/HelpTip.vue +4 -1
  203. package/web-admin/src/components/ListLocationBar.vue +22 -0
  204. package/web-admin/src/components/NotificationOutboxPanel.vue +35 -7
  205. package/web-admin/src/console-entry.test.ts +26 -0
  206. package/web-admin/src/console-entry.ts +20 -0
  207. package/web-admin/src/console-location.ts +35 -0
  208. package/web-admin/src/form-guard.ts +35 -0
  209. package/web-admin/src/layout/Shell.vue +18 -65
  210. package/web-admin/src/onboarding-state.test.ts +174 -0
  211. package/web-admin/src/onboarding-state.ts +122 -0
  212. package/web-admin/src/pages/Accounts.vue +44 -24
  213. package/web-admin/src/pages/AgentClients.vue +47 -29
  214. package/web-admin/src/pages/AgentTasks.vue +57 -12
  215. package/web-admin/src/pages/Approvals.vue +105 -25
  216. package/web-admin/src/pages/Audit.vue +15 -6
  217. package/web-admin/src/pages/Channels.vue +136 -43
  218. package/web-admin/src/pages/ChatEntries.vue +96 -41
  219. package/web-admin/src/pages/Clients.vue +87 -26
  220. package/web-admin/src/pages/Cost.vue +15 -4
  221. package/web-admin/src/pages/Credentials.vue +63 -32
  222. package/web-admin/src/pages/Diagnostics.vue +103 -54
  223. package/web-admin/src/pages/Executors.vue +103 -40
  224. package/web-admin/src/pages/Kb.vue +278 -128
  225. package/web-admin/src/pages/Projects.vue +44 -16
  226. package/web-admin/src/pages/Routes.vue +168 -247
  227. package/web-admin/src/pages/Runs.vue +163 -91
  228. package/web-admin/src/pages/Setup.vue +182 -291
  229. package/web-admin/src/pages/StorageBuckets.vue +61 -25
  230. package/web-admin/src/pages/SystemSettings.vue +76 -51
  231. package/web-admin/src/pages/SystemStatus.vue +54 -30
  232. package/web-admin/src/pages/Targets.vue +45 -17
  233. package/web-admin/src/pages/Tools.vue +133 -68
  234. package/web-admin/src/pages/Usage.vue +64 -25
  235. package/web-admin/src/pages/UsageAccess.vue +11 -8
  236. package/web-admin/src/route-call-snippets.test.ts +82 -0
  237. package/web-admin/src/route-call-snippets.ts +178 -0
  238. package/web-admin/src/router.ts +11 -29
  239. package/web-admin/src/runtime-feedback.ts +43 -0
  240. package/web-admin/src/task-page-location.ts +66 -0
  241. package/web-admin/src/usage-output-budget.test.ts +26 -0
  242. package/web-admin/src/usage-output-budget.ts +46 -0
  243. package/web-admin/src/use-list-location.ts +24 -0
  244. package/web-admin/src/use-unsaved-form.ts +38 -0
  245. package/web-admin/tests/model-output-budget.browser.mjs +69 -0
  246. package/web/console/assets/Accounts-Bervi5JU.css +0 -1
  247. package/web/console/assets/Accounts-Dhj6PjXP.js +0 -3
  248. package/web/console/assets/AgentClients-CMy8StAH.js +0 -1
  249. package/web/console/assets/AgentClients-i52AI6YV.css +0 -1
  250. package/web/console/assets/AgentTasks-BsG850Il.css +0 -1
  251. package/web/console/assets/AgentTasks-DA1xZdmP.js +0 -2
  252. package/web/console/assets/Approvals-DIsd7R8N.js +0 -1
  253. package/web/console/assets/Approvals-DlTSHl_7.css +0 -1
  254. package/web/console/assets/Audit-AUDABLTX.js +0 -1
  255. package/web/console/assets/Audit-CSu6_3oD.css +0 -1
  256. package/web/console/assets/Channels-B8rjsM0S.js +0 -105
  257. package/web/console/assets/Channels-CCn0L1jg.css +0 -1
  258. package/web/console/assets/ChatEntries-DsYtcXN6.css +0 -1
  259. package/web/console/assets/ChatEntries-iZjJMEUZ.js +0 -7
  260. package/web/console/assets/Clients-CSHIsaWU.css +0 -1
  261. package/web/console/assets/Clients-CwgpGCSD.js +0 -3
  262. package/web/console/assets/Cost-B2tNxu71.js +0 -1
  263. package/web/console/assets/Cost-CjT39DSZ.css +0 -1
  264. package/web/console/assets/Credentials-BuwFB-fV.js +0 -1
  265. package/web/console/assets/Credentials-ioLP0qYN.css +0 -1
  266. package/web/console/assets/Diagnostics-Ya05PTDp.css +0 -1
  267. package/web/console/assets/Diagnostics-z5glms11.js +0 -1
  268. package/web/console/assets/Executors-Bc4SvjeH.js +0 -1
  269. package/web/console/assets/Executors-CjhEM54c.css +0 -1
  270. package/web/console/assets/HelpTip-CA6Bm7Nx.css +0 -1
  271. package/web/console/assets/HelpTip-Dtdt2tKR.js +0 -1
  272. package/web/console/assets/Kb-BRbRHxLy.js +0 -5
  273. package/web/console/assets/Kb-CzIzd9xr.css +0 -1
  274. package/web/console/assets/Projects-Bm8AjsNx.css +0 -1
  275. package/web/console/assets/Projects-CPWw3con.js +0 -1
  276. package/web/console/assets/Routes-CMIaE0Bx.js +0 -124
  277. package/web/console/assets/Routes-CyXV4Pba.css +0 -1
  278. package/web/console/assets/Runs-B8HuE700.js +0 -3
  279. package/web/console/assets/Runs-Bv6CV_Hk.css +0 -1
  280. package/web/console/assets/Setup-D7nxgn-9.css +0 -1
  281. package/web/console/assets/Setup-G8RKzliR.js +0 -1
  282. package/web/console/assets/Shell-DimHgraJ.js +0 -1
  283. package/web/console/assets/Shell-ykb-tUfo.css +0 -1
  284. package/web/console/assets/StorageBuckets-CVgpZRWY.css +0 -1
  285. package/web/console/assets/StorageBuckets-CiVYXIE2.js +0 -1
  286. package/web/console/assets/SystemSettings-BjiHyrXO.css +0 -1
  287. package/web/console/assets/SystemSettings-DF8sZNen.js +0 -1
  288. package/web/console/assets/SystemStatus-BlHywK13.js +0 -1
  289. package/web/console/assets/SystemStatus-I11I67rw.css +0 -1
  290. package/web/console/assets/Targets-BXaoPoAJ.js +0 -1
  291. package/web/console/assets/Targets-DTb5tn6z.css +0 -1
  292. package/web/console/assets/Tools-B22lNHXq.js +0 -2
  293. package/web/console/assets/Tools-DU8ei6sd.css +0 -1
  294. package/web/console/assets/Usage-C02EzoI2.js +0 -1
  295. package/web/console/assets/Usage-CAeDGjrb.css +0 -1
  296. package/web/console/assets/UsageAccess-CGGaWTuj.css +0 -1
  297. package/web/console/assets/UsageAccess-DOb-cyPE.js +0 -1
  298. package/web/console/assets/index-CK0ZCTZv.js +0 -2
@@ -0,0 +1,118 @@
1
+ # Offline, read-only upgrade planning
2
+
3
+ [中文](UPGRADE_PLAN.md)
4
+
5
+ `doctor --upgrade-plan` compares explicit source/target artifacts and a sanitized database snapshot. It never connects to a database, reads `.env` / `config.json`, starts Core, imports code from supplied artifacts, runs SQL, migrates, restores or modifies input files. Unlike `doctor --deployment`, it performs no HTTP probes. Missing evidence remains `incomplete`.
6
+
7
+ ## Prepare artifacts and official manifests
8
+
9
+ Keep separate copies of the actual current artifact and the intended target. Verify their official tag/commit, npm package or image digest using release records first.
10
+
11
+ Existing releases expose `BAILINGHUB_CORE_ARTIFACT_V1` as a runtime object; they do **not** ship a pre-generated JSON manifest. From each trusted artifact root, with its runtime dependencies already installed, export the official object to a file outside the artifact:
12
+
13
+ ```bash
14
+ node --import tsx --input-type=module -e 'import { BAILINGHUB_CORE_ARTIFACT_V1 } from "./src/kernel-api/v1/artifact.ts"; console.log(JSON.stringify(BAILINGHUB_CORE_ARTIFACT_V1, null, 2));' > /absolute/evidence/from-manifest.json
15
+ ```
16
+
17
+ Repeat in the target root as `to-manifest.json`. This preparation command imports the trusted official manifest module; the planner itself never imports supplied artifacts or installs dependencies. Do not fabricate an old manifest with the current retired-migration list if the old artifact lacks this export.
18
+
19
+ The planner validates package name, exact version, complete SQL inventory, each active SQL digest and the v1 manifest digest from [Kernel Host API](KERNEL_HOST_API.md). It also validates migration filenames/numbers, retired evidence (`replay: never`), historical checksum continuity and SemVer direction, including prereleases. A different manifest under the same version blocks the plan. Historical active migrations cannot be silently retired, and retired migrations cannot return to the active SQL sequence. Retired checksum, byte length and `replay: never` evidence must remain unchanged, even when a replacement manifest is internally self-consistent.
20
+
21
+ A manifest covers version and migrations, **not whole-artifact authenticity**. An attacker could replace both SQL and its digest. `release_authenticity` always remains `not_verified`; verify trusted release provenance separately. Artifact file/directory symlinks and traversal filenames are rejected. No npm scripts from artifacts execute.
22
+
23
+ ## Prepare a sanitized snapshot
24
+
25
+ There is no automatic database collector in this version. An operator uses existing authorized read-only connections to establish the effective state/configuration store topology and actual logical database identities. Example configuration files do not prove the effective deployment. Standard OSS MySQL commonly shares one database; hosts may separate stores, and JSONL state does not establish the absence of configuration MySQL.
26
+
27
+ Read each actual schema using existing tools:
28
+
29
+ ```sql
30
+ SELECT DATABASE() AS database_name, @@server_uuid AS server_uuid;
31
+ SELECT COLUMN_NAME FROM information_schema.COLUMNS
32
+ WHERE TABLE_SCHEMA = DATABASE()
33
+ AND TABLE_NAME = 'bz_schema_migrations'
34
+ AND COLUMN_NAME = 'checksum_sha256';
35
+ SELECT filename, checksum_sha256 FROM bz_schema_migrations ORDER BY filename;
36
+ ```
37
+
38
+ For a legacy ledger without the checksum column, read only filenames and record `checksum_sha256: null`, `checksum_column: "absent"`. Never backfill or migrate to prepare a plan. A missing ledger table or insufficient access is not an empty complete ledger.
39
+
40
+ Avoid concurrent migration; capture a consistent read-only snapshot or document a write-stop window. Retain actual database identities privately. Assign a random 64-character lowercase hexadecimal ID to each confirmed logical database for this plan; reuse it for shared roles and use different IDs for distinct databases. `node -e 'console.log(require("node:crypto").randomBytes(32).toString("hex"))'` generates only an opaque ID, not database evidence. Replicas/proxies require an operator to determine the actual logical schema. **These IDs are operator claims, not independent identity proofs.**
41
+
42
+ The JSON schema is:
43
+
44
+ | Field | Meaning |
45
+ | --- | --- |
46
+ | `schema` | `bailing.upgrade-snapshot.v1` |
47
+ | `captured_at` | Actual UTC capture time, e.g. `2026-10-21T04:00:00Z` |
48
+ | `source_manifest_sha256` | Exact digest from the actual current artifact's official manifest |
49
+ | `state` | `{ backend: "mysql" or "jsonl", database_id: ID or null }`; MySQL requires an ID |
50
+ | `configuration` | `{ backend: "mysql" or "file", database_id: ID or null }`; `file` means no database configuration repository, using local configuration files |
51
+ | `databases` | Exactly the 0–2 logical databases required by the two roles, one record each |
52
+ | `databases[].id` | The 64-character lowercase hex opaque identity used by the roles |
53
+ | `ledger_complete` | Boolean indicating whether all ledger rows were captured; partial snapshots produce no definitive pending list |
54
+ | `checksum_column` | `present` or `absent` |
55
+ | `rows` | Full array of `{ filename, checksum_sha256 }`; checksums are 64-character lowercase hex or `null` |
56
+
57
+ This deliberately **incomplete** JSONL + configuration MySQL example is not deployment evidence. Replace the time, source digest, identity and complete ledger before comparison:
58
+
59
+ ```json
60
+ {
61
+ "schema": "bailing.upgrade-snapshot.v1",
62
+ "captured_at": "2026-10-21T04:00:00Z",
63
+ "source_manifest_sha256": "0000000000000000000000000000000000000000000000000000000000000000",
64
+ "state": { "backend": "jsonl", "database_id": null },
65
+ "configuration": {
66
+ "backend": "mysql",
67
+ "database_id": "1111111111111111111111111111111111111111111111111111111111111111"
68
+ },
69
+ "databases": [{
70
+ "id": "1111111111111111111111111111111111111111111111111111111111111111",
71
+ "ledger_complete": false,
72
+ "checksum_column": "present",
73
+ "rows": []
74
+ }]
75
+ }
76
+ ```
77
+
78
+ Never include passwords, connection strings, usernames, host addresses, business rows or raw SQL errors. Output contains only defined safe fields, without input paths or raw parsing errors. A recent timestamp does not prove freshness: recollect after any deployment, configuration or ledger change.
79
+
80
+ ## Generate the plan
81
+
82
+ ```bash
83
+ npm run --silent doctor -- --upgrade-plan \
84
+ --from-artifact /absolute/core-current \
85
+ --from-manifest /absolute/evidence/from-manifest.json \
86
+ --to-artifact /absolute/core-target \
87
+ --to-manifest /absolute/evidence/to-manifest.json \
88
+ --snapshot /absolute/evidence/snapshot.json \
89
+ --json > /absolute/evidence/upgrade-plan.json
90
+ ```
91
+
92
+ `npm run --silent doctor:upgrade-plan -- ...` is equivalent. `--help` reads no inputs. No implicit paths, connection discovery or network targets are used. Missing arguments mean incomplete evidence; explicitly supplied unreadable/invalid files block the plan.
93
+
94
+ | Exit/result | Meaning |
95
+ | --- | --- |
96
+ | `0 / reviewable` | Supplied offline evidence is comparable without detected conflicts; **not deployment readiness or tested recovery** |
97
+ | `1 / blocked` | Artifact/digest/version/snapshot conflict or unknown migration; investigate before proceeding |
98
+ | `2 / incomplete` | Missing artifact, full ledger, database-role identity or legacy checksum evidence |
99
+ | `64 / invalid_arguments` | Unsupported/invalid arguments, including mixed deployment-diagnostics flags |
100
+
101
+ Shared MySQL produces one plan; separate stores are checked independently. Null legacy checksums remain incomplete without backfilling. Retired migrations never enter pending SQL. Missing source migrations are incomplete; records unknown to either source or target block the plan. Pending means the target active sequence minus a complete ledger snapshot, not proof of actual SQL tables/indexes.
102
+
103
+ ## Execution remains separate
104
+
105
+ The plan lists artifact verification, consistent backups and isolated restore rehearsal, stopping intake and all writers, draining every replica, manual per-database migration, acceptance and rollback constraints. `npm run db:init` migrates only `state.mysql`; a separate configuration MySQL requires the official `migrateBailingHubCoreSchema({ mysql: configurationDatabase })` entry, once per distinct database and never concurrently.
106
+
107
+ It does not emit executable connection-bearing commands or authorize deployment. Preserve unknown business results, approvals, notifications, DLQ records and original IDs. Pending migrations unknown to the source manifest set `rollback_after_migration: blocked_by_old_manifest`; all other cases still require validation. Do not remove ledger records or assume old-tag switching is safe. Restoring a database cannot undo an external refund or message.
108
+
109
+ See the [0.9.4 upgrade/rollback guide](UPGRADE_v0.9.4.en.md), [operations](OPERATIONS.md) and [compatibility policy](COMPATIBILITY.en.md). Actual runtime identity, database identity, schema objects, backup restoration and cross-version business acceptance are unverified by this tool.
110
+
111
+ ## Developer checks
112
+
113
+ ```bash
114
+ npm run doctor:upgrade-plan:typecheck
115
+ npm run doctor:upgrade-plan:test
116
+ ```
117
+
118
+ Both checks run in `release:check` and the basic CI job. Tests use synthetic artifacts/snapshots and compare the current official manifest format. They do not connect to databases or replace actual upgrade, recovery or production acceptance.
@@ -0,0 +1,124 @@
1
+ # 离线只读升级计划
2
+
3
+ [English](UPGRADE_PLAN.en.md)
4
+
5
+ `doctor --upgrade-plan` 比较显式提供的当前制品、目标制品及脱敏数据库快照,帮助整理升级步骤与证据缺口。它不会连接数据库、读取 `.env` / `config.json`、启动 Core、执行任何制品代码、运行 SQL、迁移、回退或改写输入文件。
6
+
7
+ 它与 [部署诊断](OPERATIONS.md) 的 `doctor --deployment` 分开:部署诊断可检查公开 HTTP 元数据和 readiness;本工具不访问网络,也不把离线输入称作线上实测。未知信息保留为 `incomplete`。
8
+
9
+ ## 1. 准备两个可信制品与官方 manifest
10
+
11
+ 保留实际正在运行的版本和计划部署的版本,分别解压到独立目录。先按对应发行说明核对 Tag/提交、npm 包或镜像摘要;不要用随意修改版本号的工作目录替代正式制品。
12
+
13
+ 现有发行包中的 `BAILINGHUB_CORE_ARTIFACT_V1` 是运行时导出对象,**没有预先生成的 manifest JSON 文件**。在每个已经信任、安装好运行依赖的制品根目录,使用官方模块导出文件,保存在制品目录之外:
14
+
15
+ ```bash
16
+ node --import tsx --input-type=module -e 'import { BAILINGHUB_CORE_ARTIFACT_V1 } from "./src/kernel-api/v1/artifact.ts"; console.log(JSON.stringify(BAILINGHUB_CORE_ARTIFACT_V1, null, 2));' > /absolute/evidence/from-manifest.json
17
+ ```
18
+
19
+ 在目标制品目录重复一次,输出 `to-manifest.json`。此准备命令由操作员运行,导入的是已信任制品的官方只读 manifest 模块;升级计划工具本身不动态导入外部目录,也不会替你安装依赖或运行导出命令。旧制品如果不支持该 manifest,缺口必须另行确认,不能套用新版退役迁移清单伪造一份“旧 manifest”。
20
+
21
+ 工具验证的内容:
22
+
23
+ - `packageName`、精确版本、完整 SQL 文件清单、每个活动 SQL 的 SHA-256、整体 manifest 摘要;格式复用 [Kernel Host API](KERNEL_HOST_API.md) 的 v1 manifest。
24
+ - 活动迁移文件名/编号、退役迁移 `replay: never`、是否遗漏或篡改已发布迁移证据。历史活动迁移不能直接改成退役,历史退役迁移不能放回活动 SQL;退役记录的摘要、字节长度与 `replay` 必须保持一致,即使重新计算 manifest 摘要也不能绕过。
25
+ - 升级/同版本/降级方向,包含 SemVer 数字比较和预发行版本;同版本不同 manifest 会阻断。
26
+
27
+ manifest 只标识版本与迁移集合,**不是整个包、源码或容器的签名证明**。如果有人同时改写 SQL、manifest 和摘要,离线自洽不能证明发行真实性;该项始终是 `release_authenticity: not_verified`,仍须核对可信发行来源。工具拒绝制品内 SQL/目录符号链接和路径穿越,不运行制品的 npm scripts。
28
+
29
+ ## 2. 采集脱敏快照
30
+
31
+ 这一版不提供自动数据库 collector。操作员在授权范围内使用现有只读连接,确认**实际有效**的状态仓储、配置仓储和它们的数据库身份;不能只从示例配置或目录名称推测。默认开源 MySQL 部署通常共库,扩展宿主可以分库;JSONL 状态也不能证明配置库不存在。
32
+
33
+ 在每个实际 MySQL Schema 内,通过已有工具读取:
34
+
35
+ ```sql
36
+ SELECT DATABASE() AS database_name, @@server_uuid AS server_uuid;
37
+ SELECT COLUMN_NAME FROM information_schema.COLUMNS
38
+ WHERE TABLE_SCHEMA = DATABASE()
39
+ AND TABLE_NAME = 'bz_schema_migrations'
40
+ AND COLUMN_NAME = 'checksum_sha256';
41
+ SELECT filename, checksum_sha256 FROM bz_schema_migrations ORDER BY filename;
42
+ ```
43
+
44
+ 最后一条适用于存在摘要列的账本;旧库无该列时只读取 `filename`,在快照中将摘要填为 `null`、`checksum_column` 填为 `absent`。不要为了生成计划而补账本或运行迁移。表不存在、读权限不足或无法确认读取完整性时,不能填写空数组并声称是完整账本。
45
+
46
+ 采集时避免并发迁移,并使用一致性只读快照或记录停写窗口。数据库真实标识只留在受限操作记录中;为此次计划给每个经过确认的逻辑库生成一个随机 64 位小写十六进制代号,同库复用同一代号,分库使用不同代号。例如 `node -e 'console.log(require("node:crypto").randomBytes(32).toString("hex"))'` 只生成代号,不识别数据库。复制库不能因为内容相同就使用同一代号;复制集/代理连接须由操作员确认是否为同一逻辑 Schema。**代号不是数据库身份的独立证明。**
47
+
48
+ `snapshot.json` 定义:
49
+
50
+ | 字段 | 内容 |
51
+ | --- | --- |
52
+ | `schema` | 固定 `bailing.upgrade-snapshot.v1` |
53
+ | `captured_at` | 实际采集 UTC 时间,例如 `2026-10-21T04:00:00Z` |
54
+ | `source_manifest_sha256` | 从实际当前制品导出的 manifest 中原样取值,用于发现快照与来源选错;这仍是操作员声明 |
55
+ | `state` | `backend` 为 `mysql` 或 `jsonl`;MySQL 必须给 `database_id`,JSONL 为 `null` |
56
+ | `configuration` | `backend` 为 `mysql` 或 `file`;`file` 表示无数据库配置仓储、使用本地配置文件;身份规则同上 |
57
+ | `databases` | 实际涉及的 0–2 个逻辑库,每库一条,必须恰好覆盖两个角色需要的库 |
58
+ | `databases[].id` | 64 位小写十六进制代号,与角色的 `database_id` 对应 |
59
+ | `ledger_complete` | 是否完整读取该库全部账本;不完整填 `false`,工具不会据此伪造确定的 pending 清单 |
60
+ | `checksum_column` | `present` 或 `absent` |
61
+ | `rows` | 全部 `{ "filename": "001_….sql", "checksum_sha256": "64位小写摘要或null" }`;不得填业务记录 |
62
+
63
+ 以下只是**故意不完整**的 JSONL + MySQL 配置库结构示例,不能直接当作环境验收证据。替换时间、真实当前 manifest 摘要、库代号与完整账本后才能进行有意义的比较:
64
+
65
+ ```json
66
+ {
67
+ "schema": "bailing.upgrade-snapshot.v1",
68
+ "captured_at": "2026-10-21T04:00:00Z",
69
+ "source_manifest_sha256": "0000000000000000000000000000000000000000000000000000000000000000",
70
+ "state": { "backend": "jsonl", "database_id": null },
71
+ "configuration": {
72
+ "backend": "mysql",
73
+ "database_id": "1111111111111111111111111111111111111111111111111111111111111111"
74
+ },
75
+ "databases": [{
76
+ "id": "1111111111111111111111111111111111111111111111111111111111111111",
77
+ "ledger_complete": false,
78
+ "checksum_column": "present",
79
+ "rows": []
80
+ }]
81
+ }
82
+ ```
83
+
84
+ 不要将密码、连接串、账号、业务数据、主机地址或未脱敏 SQL 错误放进输入。输出只保留已定义的安全字段,不回显输入路径和解析错误正文。已保存的快照不是实时保证;部署、配置或账本有变化后重新采集,不能仅凭文件时间较近就认定有效。
85
+
86
+ ## 3. 生成计划
87
+
88
+ ```bash
89
+ npm run --silent doctor -- --upgrade-plan \
90
+ --from-artifact /absolute/core-current \
91
+ --from-manifest /absolute/evidence/from-manifest.json \
92
+ --to-artifact /absolute/core-target \
93
+ --to-manifest /absolute/evidence/to-manifest.json \
94
+ --snapshot /absolute/evidence/snapshot.json \
95
+ --json > /absolute/evidence/upgrade-plan.json
96
+ ```
97
+
98
+ 等价专用入口:`npm run --silent doctor:upgrade-plan -- ...`。`--help` 不读取输入。没有隐式路径、数据库发现或网络目标;缺少文件参数返回 `incomplete`,指定了不可读/无效文件则返回 `blocked`。
99
+
100
+ | 退出码 / 结果 | 含义 |
101
+ | --- | --- |
102
+ | `0 / reviewable` | 所给离线证据可比较、无已知冲突;**不是可以上线、备份恢复已验证或实测通过** |
103
+ | `1 / blocked` | 观察到制品/摘要/版本方向/快照冲突,或未知迁移;先查明原因 |
104
+ | `2 / incomplete` | 缺少来源、完整账本、数据库角色或历史摘要等证据 |
105
+ | `64 / invalid_arguments` | 参数错误或混用部署诊断参数 |
106
+
107
+ 共库只输出一个迁移计划,分库逐一比较。旧账本摘要缺失不会自动补录,退役迁移不会列入待执行序列。当前制品应有但库里没有的迁移会标为不完整;账本含当前或目标制品不认识的迁移会阻断。`pending` 是完整快照相对目标活动序列的差集,不是 SQL 表/索引存在性检查。
108
+
109
+ ## 4. 计划之后仍需人工执行与验收
110
+
111
+ 输出固定列出制品身份确认、一致备份及隔离恢复演练、停止新工作与所有写入方、排空、分库显式迁移、验收和回退限制。`npm run db:init` 只覆盖 `state.mysql`;独立配置 MySQL 由部署方通过官方 `migrateBailingHubCoreSchema({ mysql: configurationDatabase })` 单独迁移,共库只执行一次。
112
+
113
+ 只读计划不生成可直接执行的带连接参数命令,也不授权升级。涉及未知业务结果、审批、通知、死信的记录和原 ID 必须保留。新迁移不被旧 manifest 认识时,标记 `rollback_after_migration: blocked_by_old_manifest`;其他情况仍须验证,绝不标为“可安全降级”。数据库恢复不能撤销外部退款或已发送消息。
114
+
115
+ 参考 [0.9.4 升级与回退指南](UPGRADE_v0.9.4.md)、[运维](OPERATIONS.md)及[兼容策略](兼容性与升级.md)。当前没有实际 DB 身份、schema 对象、运行中版本、备份恢复或跨版本业务回归的验证结果;这些仍由目标环境演练提供。
116
+
117
+ ## 开发验证
118
+
119
+ ```bash
120
+ npm run doctor:upgrade-plan:typecheck
121
+ npm run doctor:upgrade-plan:test
122
+ ```
123
+
124
+ 这些检查已接入 `release:check` 和 CI 的基础检查任务。测试使用合成制品与脱敏快照,并检查当前官方 manifest 格式;不连接数据库,不代替真实升级、备份恢复或生产验收。
@@ -0,0 +1,47 @@
1
+ # Core v0.10.0 upgrade guide
2
+
3
+ [简体中文](UPGRADE_v0.10.0.md)
4
+
5
+ This guide upgrades public Core 0.9.4 to 0.10.0. MCP / Agent Client SDK 0.8.0 and DSH 0.8.0 are independent releases. Existing business HTTP integrations, bundled chat and older Agent clients do not need new authorization to retain their existing features. New features depend on each consumer's configuration and version.
6
+
7
+ ## Back up, drain and identify storage
8
+
9
+ Pin source/target Tags, complete commits and npm/image digests. Keep a consistent backup of configuration, secret-management material, attachments, JSONL, actual state/configuration databases, complete migration ledgers, original operations/invocations, approvals, notifications and old artifacts. Coordinate all shared writers, stop admission and drain accepted work. A close timeout does not prove completion; never run old/new JSONL writers concurrently.
10
+
11
+ **No SQL is added or changed relative to 0.9.4, and the migrator is unchanged.** An instance with complete 0.9.4 migrations should not manually add ledger entries for this release. Earlier versions still apply outstanding migrations through the official explicit migrator, including 068 on the 0.9.3→0.9.4 path. Identify actual state/configuration topology; migrate a shared database once. `npm run db:init` handles only the current `state.mysql`; migrate a separate configuration database explicitly through `migrateBailingHubCoreSchema()`. Startup does not execute DDL.
12
+
13
+ The [read-only upgrade planner](UPGRADE_PLAN.en.md) can compare artifacts and redacted ledgers. Offline `reviewable` status is not database inspection, backup recovery proof or permission to deploy.
14
+
15
+ ## Readiness and custom Hosts
16
+
17
+ Readiness now inspects actual state/configuration resources, the artifact migration manifest and full SHA-256 digests. Missing/unknown migrations and digest conflicts remain not-ready. The probe does not repair them; external model/tool-source failures do not remove the whole instance from service.
18
+
19
+ Custom MySQL `RuntimeStateStore` implementations expose the optional `schemaReadinessDb` extension pointing to their actual read-only query resource. Absence now fails closed. Default `MysqlStore` already provides it without another pool. JSONL with a MySQL configuration database still checks that database; only pure JSONL without SQL configuration skips database inspection.
20
+
21
+ Embedded Hosts retain `tick()` and `close(drainMs)` and wait for boot-recovery target refresh, query, audit and requeue work before releasing resources. Deployment health, unchanged API signatures or a typecheck alone do not establish Fleet upgrade acceptance.
22
+
23
+ ## Agent consumer pairing
24
+
25
+ 1. Upgrade Core and check the original protocol first; refresh discovery for new requests only. Preserve saved request bodies/digests, operation/invocation IDs and authority bindings.
26
+ 2. Hosts adopting MCP / Agent Client SDK 0.8.0 and DSH 0.8.0 verify the actual dependency tree, built artifacts and loaded versions. Core, a generic SDK and a complete host product have different audit scopes.
27
+ 3. Larger arguments require every layer's new limit. Core cannot override an older client's independent 4/16 KiB check. Do not remove business meaning, stringify objects or bypass authentication to evade limits.
28
+ 4. Read knowledge capabilities before explicitly selecting `on_demand` on a new turn. Protocol-defined 404/405/501 may fall back to inline; 401/403/5xx and unknown schemas are not success. Hints, references and pagination stay authority/revision/budget-bound. Bundled chat/embed/widget need no opt-in.
29
+ 5. Guidance and execution summaries are references. Deduplication, summarization or omitted bodies must not remove machine constraints or original-result reconciliation.
30
+
31
+ ## Configure model budgets explicitly
32
+
33
+ Old services are not changed automatically. To adopt the policy, set `defaultOutputTokens`, `outputTokenParameter` and `outputBudgetScope` together and keep the default at or below `maxOutputTokens`. Omit unknown `modelMaxOutputTokens` values rather than guessing. Recheck semantics when changing models or credentials. Do not apply chat policy fields to image services.
34
+
35
+ Older clients may use `max_output_tokens` as both default and ceiling. Keep the legacy policy until those clients adapt, or use an intentionally equal default/ceiling transition after confirming the parameter is compatible. A transition does not redefine the new contract. Parameter mismatches and oversize budgets are confirmed pre-dispatch failures, never automatic retries. A prepared but unadmitted old intent may be rejected by a changed policy and needs an explicit new operation; already admitted operations remain recoverable by their original IDs and snapshots.
36
+
37
+ The host adapter interprets output cutoff. Partial stream delivery or a missing final frame requires original-operation inspection first. Only a confirmed cutoff with the original terminal receipt can lead to a new segment under existing task authority. Core does not call the model for upgrade/acceptance automatically and never repeats completed tools. See [output budgets](MODEL_OUTPUT_BUDGET.en.md) and [host continuation](MODEL_CONTINUATION.en.md).
38
+
39
+ ## Acceptance and rollback
40
+
41
+ - Verify exact artifact identity, complete migration ledgers and `/health/ready`; inspect real storage rather than configuration filenames alone.
42
+ - Use isolated data to check examples, unsaved protection, original approval arguments, read-only receipts and diagnostic filters/return paths. Large-argument tests can use read-only validation or a synthetic business system without changing customer pages.
43
+ - Verify new knowledge/budgets only for hosts adopting them; preserve old inline, old policy and original-operation recovery cases. Synthetic output is not real-provider long-answer acceptance or a verified price.
44
+
45
+ Before rollback, stop new writes, drain and preserve new original-call evidence and configuration revisions. No new DDL does not make a tag-only downgrade safe: old Core does not understand new knowledge endpoints or explicit budget policies and may return to its old default parameter. Validate the old consumer's inline fallback, old service policy and persisted records together in isolation; restore code/configuration as a consistent set if needed. Never delete approvals, unknown outcomes, migration entries or operations to bypass checks. Database restoration cannot undo external business actions.
46
+
47
+ [Release notes](RELEASE_NOTES_v0.10.0.en.md) · [Compatibility](COMPATIBILITY.en.md) · [Operations](OPERATIONS.en.md)
@@ -0,0 +1,47 @@
1
+ # Core v0.10.0 升级指南
2
+
3
+ [English](UPGRADE_v0.10.0.en.md)
4
+
5
+ 本指南从公开 Core 0.9.4 升级到 0.10.0。配套 MCP / Agent Client SDK 0.8.0、DSH 0.8.0 独立发行;普通业务 HTTP 接入、自带聊天和旧 Agent 客户端不必为使用原功能重建授权。新功能及具体消费者是否采用,按各自配置和版本决定。
6
+
7
+ ## 备份、排空与存储
8
+
9
+ 固定源/目标 Tag、完整提交、npm 或镜像摘要。保留配置、密钥管理材料、附件、JSONL、实际状态库和配置库的一致备份、完整迁移账本、原 operation/invocation、审批、通知与旧制品。协调全部共库写入方,停止新接单并排空已接受工作。关闭超时不证明工作已经结束;不要让新旧 JSONL writer 并行写入。
10
+
11
+ **相对 0.9.4 无新增 SQL,也未修改既有 SQL 或迁移器。** 已完整应用 0.9.4 的实例不应为本版手动补写账本。更早版本仍须使用官方显式迁移器应用缺失迁移,包括 0.9.3→0.9.4 的 068;分别核对 state/configuration 实际拓扑,共库只执行一次。`npm run db:init` 仅处理当前 `state.mysql`;独立配置库通过 `migrateBailingHubCoreSchema()` 明确迁移,启动不执行 DDL。
12
+
13
+ 可先用 [只读升级计划](UPGRADE_PLAN.md)检查制品及脱敏账本,不能用离线 `reviewable` 代替现场数据库、备份恢复或上线批准。
14
+
15
+ ## Readiness 和自定义 Host
16
+
17
+ 新 readiness 检查实际 state/configuration 池、制品迁移清单和完整 SHA-256。缺迁移、未知迁移或摘要冲突保持 not-ready。它不自动修复,也不以外部模型或工具源故障把整个实例摘除。
18
+
19
+ 自定义 MySQL `RuntimeStateStore` 应提供可选类型扩展 `schemaReadinessDb`,指向实际使用的只读查询资源;缺少时现在失败关闭。默认 `MysqlStore` 已提供,无须额外建池。JSONL 搭配 MySQL 配置库仍检查配置库,纯 JSONL 且无 SQL 配置库才跳过数据库。
20
+
21
+ 嵌入式 Host 保持既有 `tick()` 与 `close(drainMs)`,等待启动恢复的目标刷新、查询、审计和重新排队全部完成后再释放资源。不要把部署健康、API 签名不变或一次 typecheck 当作完整 Fleet 升级证明。
22
+
23
+ ## Agent 客户端配套
24
+
25
+ 1. 先升级 Core 并核对原协议可用;仅准备新调用时刷新目录。保留所有已准备请求的原内容、摘要、operation、invocation 和授权关联。
26
+ 2. 宿主采用 MCP / Agent Client SDK 0.8.0、DSH 0.8.0 后,核对自己的实际依赖树、构建产物与已加载版本。Core、通用 SDK 和完整宿主产品的依赖审计范围不同。
27
+ 3. 大参数需要链路各层都支持新上限;旧客户端的 4/16 KiB 检查不会被 Core 自动覆盖。不要压缩业务语义、改对象为字符串或绕过鉴权来回避限制。
28
+ 4. 先调用知识 capabilities,确认协议后在新 turn 显式选择 `on_demand`。404/405/501 可按协议降级为 inline;401/403/5xx 或未知 schema 不能当作成功。提示、引用和分页都受当前授权/修订/预算约束。自带 chat/embed/widget 无需采用这一选项。
29
+ 5. 指导文字和执行摘要只作参考。业务机器约束和原结果核对不能因为去重、摘要或省略正文而丢失。
30
+
31
+ ## 模型预算按需配置
32
+
33
+ 默认不修改旧服务。采用新策略时,一起显式设置 `defaultOutputTokens`、`outputTokenParameter`、`outputBudgetScope`,并核对默认值不超过 `maxOutputTokens`。供应商实际能力未知时不编造 `modelMaxOutputTokens`。更换模型或凭据后重新核实,图片服务不填这些对话字段。
34
+
35
+ 旧客户端可能把旧 `max_output_tokens` 同时当默认和上限;在它们适配之前可保留旧策略,或在明确核实参数兼容后先用相等的默认/上限过渡,不把这种过渡当作新契约永久语义。参数冲突或超限是明确的派发前错误,不自动重试。已经准备但尚未受理的旧 intent 可能因新策略被拒绝,需要显式准备新 operation;已经受理的原 operation 仍按原 ID 恢复,不改历史快照。
36
+
37
+ 输出截断由宿主适配器判断。只收到流片段或终帧丢失时先查原 operation;明确截断且原回执完整时,宿主才可在原任务授权内建立新续段。中枢不会为升级或验收自动调用模型,也不会重做已完成工具。详见[预算契约](MODEL_OUTPUT_BUDGET.md)和[宿主续段](MODEL_CONTINUATION.md)。
38
+
39
+ ## 验收与回退
40
+
41
+ - 核对精确制品身份、完整迁移账本与 `/health/ready`;检查真实存储而非只看配置文件名。
42
+ - 用独立数据核对调用示例、未保存保护、审批原参数、只读回执、诊断过滤/返回路径;大参数验证可使用只读 validate 或模拟业务系统,不修改客户页面。
43
+ - 新知识和预算只对采用它们的宿主验收;保留旧 inline、旧策略和原 operation 恢复用例。核对真实供应商参数及费用前,不把合成输出当作真实长答案验收。
44
+
45
+ 回退前先停新写入、排空并保存新产生的原调用与配置修订。没有新 DDL 不代表仅换旧 Tag 就安全:旧 Core 不理解新知识端点或显式预算策略,可能重新采用旧默认参数。应在隔离副本验证旧消费者的 inline 降级、旧服务策略与实际持久记录组合,必要时按一致集合恢复代码与配置。不要删除审批、unknown、账本或原 operation 来绕过检查;恢复数据库不能撤销已经发生的外部业务动作。
46
+
47
+ [版本说明](RELEASE_NOTES_v0.10.0.md) · [兼容策略](兼容性与升级.md) · [运维](OPERATIONS.md)
@@ -1,5 +1,13 @@
1
1
  # 百灵中枢 · 兼容性与升级策略
2
2
 
3
+ ## Core 0.10.0 兼容扩展升级
4
+
5
+ Core 0.10.0 配套 MCP / Agent Client SDK 0.8.0、DSH 0.8.0,新增可选 Agent 知识协议、工具指导和显式模型输出预算。相对公开 0.9.4 没有新增 SQL;旧客户端保持 inline,旧模型策略不自动修改。实际 state/configuration 资源与完整迁移摘要现在参与 readiness,自定义 MySQL store 须提供 `schemaReadinessDb`,否则失败关闭。升级、配置回退和独立消费者边界见 [0.10.0 升级指南](UPGRADE_v0.10.0.md)。
6
+
7
+ ## 当前 0.9.x 升级入口
8
+
9
+ Core 0.9.2、0.9.3、0.9.4 分别增加 065/066、067、068 迁移。**补丁版本不等于没有数据库迁移,也不等于只重启即可升级。** 根据当前版本逐项阅读 [0.9.2](UPGRADE_v0.9.2.md)、[0.9.3](UPGRADE_v0.9.3.md)、[0.9.4](UPGRADE_v0.9.4.md) 升级指南,保留原始任务、审批、通知和迁移记录。以下历史配套说明不代替目标版本指南。
10
+
3
11
  ## Core 0.9.1 补丁升级
4
12
 
5
13
  相对 0.9.0 仅修复异步 usage 工作关闭等待并更新公开文档/通用安全治理,没有新增 API、SQL、套餐规则或客户端功能。SDK 0.7.0 / DSH 0.7.0 不变。旧版关闭返回不能证明 usage 后台工作已结束;替换制品前核对原请求,新版 usage 排空超时在原实例重试。见 [0.9.1 升级指南](UPGRADE_v0.9.1.md)。
@@ -10,7 +18,7 @@ Core 0.9.0 配套 SDK 0.7.0 / DSH 0.7.0,新增可选模型计费网关;本
10
18
 
11
19
  > Core 0.8.0 task enrollment persists on original Agent Sessions. Do not downgrade an enrolled deployment to a version that ignores enforcement markers. See [upgrade boundaries](UPGRADE_v0.8.0.md).
12
20
 
13
- > 这份策略用于公开发布后的版本演进。目标是让绝大多数升级都能平滑完成:拉新版、执行数据库结构同步、重启 hub;已配置的路由、凭证、工具源、聊天入口不需要重配。破坏性变更必须显式说明,并提供过渡窗口。
21
+ > 本文说明当前 0.x 的兼容纪律;不宣告已进入 1.0。升级目标是保留已有配置与数据,但每次都须检查制品、实际存储拓扑、迁移及回退条件。公共契约的破坏性变更必须显式说明,提供迁移路径与适用的过渡窗口。
14
22
 
15
23
  ---
16
24
 
@@ -20,53 +28,57 @@ Core 0.9.0 配套 SDK 0.7.0 / DSH 0.7.0,新增可选模型计费网关;本
20
28
 
21
29
  | 面 | 是什么 | 升级时怎么不被入侵 |
22
30
  |---|---|---|
23
- | **hub 服务**(`src/`) | 中枢进程本体 | 拉新版重启即可;无状态逻辑 |
24
- | **官方 SDK**(`sdk/php`·`sdk/php7` + `docs/examples/*`) | 业务系统里嵌的验签/建 spec 代码 | 仅当某次动了 **wire 格式**才需同步更新;有第四节硬约束兜底 |
25
- | **DB 状态库**(`sql/*.sql`) | 路由/凭证/工具源/聊天入口/渠道/页面登记表/知识库/限速账本等**全部运行时配置** | 结构变更账本 + 只增不毁(§三);`db:init` 幂等可反复跑,**绝不重建已存在的表** |
31
+ | **hub 服务**(`src/`) | 中枢进程、在途工作与后台恢复 | 停止接单、排空已接受工作,再替换制品;排空超时不证明工作已结束 |
32
+ | **官方 SDK**(`sdk/` + `docs/examples/*`) | 业务系统里的声明、验签与调用代码 | 按目标能力及配套版本判断是否更新,不将 Core、Agent Client SDK、适配器机械捆绑发版 |
33
+ | **状态与配置存储**(`sql/*.sql`、JSONL 等) | 任务、审批、配置、通知、账本及队列 | 识别实际状态库和配置库,分别备份、核对账本并显式迁移;共库只执行一次,JSONL 仅支持单 writer |
26
34
  | **brain 文件配置**(`brain/`) | executor 大脑的能力档 / agent 提示词 / runbook | `.local` 叠加层(§三):定制写 `.local` 文件,升级只动默认文件、永不冲突 |
27
35
  | **嵌入组件**(`web/widget/widget.js`) | 别人网站里 `<script>` 引的聊天组件 | 受 `WIDGET_API` 约束的稳定嵌入面(§六);hub 升级=嵌入页自动拿新版,故只增不改 |
28
36
 
29
37
  > 关键心智:**配置不在代码里**。路由、凭证、工具源、聊天入口全在 DB(`bz_` 表)、由控制台配;`.env`/密钥管理器/`brain/*.local.*` 是部署方本地材料、已 gitignore。`config.json` 只适合本地开发或非敏感结构配置;生产部署设置 `BAILING_ENV=production` 后,敏感项必须由环境变量或密钥管理器注入。
30
38
 
31
- ## 二、版本语义(SemVer):看一眼版本号就知道升级有多重
39
+ ## 二、版本语义与迁移工作量
40
+
41
+ 版本号描述兼容意图,不能单独证明部署工作量。当前仍为 `0.x`:公共契约可能调整,但必须在发行说明列明;不能把已有 0.x 行为误称为 1.0 稳定承诺。进入 1.0 时需明确稳定 API、支持范围和弃用政策。
32
42
 
33
43
  | 版本位 | 含义 | 部署方要做什么 |
34
44
  |---|---|---|
35
- | **patch**(x.y.**Z**) | 修 bug、补文档,**零 wire / 零 schema 变更** | 拉新版重启 hub,完事 |
36
- | **minor**(x.**Y**.0) | **只增不改**:新可选头 / 新 `x-agent-capability` 注解 / 新信封字段 / 新能力 / 新数据库表或字段 | 拉新版 → `db:init` → 重启 hub;现有业务代码照跑,新能力想用再用 |
37
- | **major**(**X**.0.0) | 含**破坏性变更**:改签名构造/算法、删字段、改语义、改 schema 列含义、bump `WIDGET_API` | 读 CHANGELOG 的 `BREAKING` 段;按第四节过渡窗分步升级,**不强制 hub 与业务系统/SDK 同时切** |
45
+ | **patch**(x.y.**Z**) | 向后兼容的修复和文档修正;可能包含修复所需的增量迁移 | 阅读目标升级指南,核对新增 SQL、备份、排空和回退边界;不能仅重启 |
46
+ | **minor**(x.**Y**.0) | 新能力和兼容扩展;当前 0.x 若调整公共契约须单独说明 | 核对能力协商、客户端配套及实际存储,按指南迁移和验收;可选功能显式启用 |
47
+ | **major**(**X**.0.0) | 1.0 以后公共 API 的不兼容变更使用主版本;1.0 本身需先定义稳定面 | 阅读 `BREAKING`、支持范围和迁移方案;依适用的过渡窗口逐项迁移 |
38
48
 
39
- > DB schema 与嵌入契约都吃这套语义:加表/加列/加可选属性 = minor、drop-in;删列/改列义/改属性名 = major、走过渡窗。
49
+ > SQL 是独立升级检查面。新增表或列可能由兼容修复引入,但 DDL 锁、数据回填、旧制品账本校验和恢复顺序仍需检查;“增量”不等于无需停写或可以直接降级。Widget 等公开契约按其独立版本及过渡规则演进。
40
50
 
41
- ## 三、为什么 minor 升级几乎零入侵:六个内建机制
51
+ ## 三、降低升级成本的机制与边界
42
52
 
43
53
  **wire 面(三个):**
44
54
 
45
55
  1. **签名标签 `sha256=` 是扩展点,不是版本号**。要换签名算法/构造,就**另起一个自描述新标签**(如 `sha256-2=`),绝不复用已有标签语义,也不在协议里堆隐式版本。验签侧靠前缀分派,新增标签天然不冲突。
46
56
  2. **spec 的 `x-agent-capability` 未知字段一律忽略**(CONTRACT §2.4a)。注解注册表加新键时,未升级的 hub 会直接跳过不认识的键——业务按自己节奏采用新注解,不被新版本逼着改。
47
- 3. **信封新增字段都可选**。回调/送达/job 对象里加字段,既有部署方读不到也不报错(JSON 多字段无害)。所以"加能力"永远是 minor。
57
+ 3. **兼容扩展优先使用可选字段**。新增回包字段还需核对消费者 Schema、严格校验器和降级行为;新增能力可能需要显式协商,不能仅凭 JSON 允许多字段就宣称全部消费者兼容。
48
58
 
49
59
  **部署面(三个):**
50
60
 
51
- 4. **数据库结构有账本、只增不毁**。`db:init` 维护 `bz_schema_migrations` 账本:已应用的 `sql` 文件直接跳过、永不重放;新版本只应用新增的编号文件。`CREATE TABLE IF NOT EXISTS` + 只 `ADD COLUMN ... DEFAULT` 保证**绝不重建/清空已配置的表**。详见 `sql/README.md`。
61
+ 4. **数据库结构按官方迁移账本校验**。已记账文件不重放;未知记录或摘要冲突会阻断,不能删账本绕过。新增结构优先采用增量迁移,数据回填单独编号。`npm run db:init` 只处理 `state.mysql`;独立 MySQL 配置库须额外调用 `migrateBailingHubCoreSchema`,同一库不能并行迁移。JSONL 状态不需要 SQL,但其 MySQL 配置库仍须检查。详见 [SQL 说明](../sql/README.md)及 [Kernel Host API](KERNEL_HOST_API.md)。
52
62
  5. **brain 文件走 `.local` 叠加层**。`brain/profiles.json`·`agents/*.md`·`runbooks/*.md` 是仓库默认;部署方定制写进同名 `.local` 文件(已 gitignore)。升级 `git pull` 只动默认文件、永不碰 `.local`——**默认可升级、定制不冲突**。详见 `brain/README.md`。
53
- 6. **部署配置有安全默认**。`loadConfig` 里每个键都 `?? 默认值`,且 `config.json` 缺失回退 `config.example.json`;生产模式由 `BAILING_ENV=production` 显式开启,敏感项必须来自环境变量或密钥管理器。
63
+ 6. **配置校验与密钥隔离**。生产模式由 `BAILING_ENV=production` 显式开启,敏感项必须来自环境变量或密钥管理器。升级保留本地配置,但新增校验可能拒绝不完整或不安全配置;按发行指南事先核对,不能假定所有缺失项都有可运行默认值。
54
64
 
55
- ## 四、破坏性变更的标准流程(major 才会触发,这是"低入侵"的承诺所在)
65
+ ## 四、公共契约破坏性变更的流程
56
66
 
57
67
  真要改签名构造、删/改一个头或一个 schema 列、改嵌入属性名时,**必须**走完整流程,绝不"换个公式/改个列直接发新版":
58
68
 
59
69
  1. **新名不复用已有语义**:引入 `sha256-2=` / 新列名 / 新属性名 / bump `WIDGET_API`,与现存的并存、可区分。
60
70
  2. **过渡窗内双发或双收**:在 ≥ 1 个完整 minor 版本里,hub 能**同时发两种格式**(或同时收两种格式),让部署方**先升 hub、再逐个升业务系统 SDK / 嵌入页**,分步完成、无停机硬切。
61
71
  3. **CHANGELOG 写死时间表**:哪个版本起弃用(deprecated)、哪个版本起移除(removed),白纸黑字。
62
- 4. **永不静默改行为**:hub 见到弃用标签/字段会**记审计 + 告警**,而不是悄悄按新逻辑跑——升级出问题要能一眼看见。
72
+ 4. **提供迁移诊断**:具体弃用功能应提供可验证的告警、审计或检查入口,并在说明中指明。不能把这项演进要求当作所有旧字段都已经具备告警的实现事实。
73
+
74
+ 当前 0.x 若有不兼容调整,也须明确列出影响与迁移办法;不能因为主版本为 0 就静默改变权限或审批含义。对于无法安全双收/双发的安全修复,应说明替代流程,不承诺不存在的无停机窗口。
63
75
 
64
76
  ## 五、DB schema 演进纪律(贡献者必读)
65
77
 
66
78
  写数据库结构文件前先读 **`sql/README.md`**。三条铁律:
67
79
 
68
80
  1. **永远新增编号文件,绝不编辑已发布过的 `sql` 文件**。已部署实例会按账本跳过已应用文件;改已发布文件会造成不同实例之间的 schema 分叉。
69
- 2. **发布后只准 `CREATE TABLE IF NOT EXISTS` 与 `ADD COLUMN ... DEFAULT ...`**(加索引同理可幂等)。这类是纯增量、drop-in。
81
+ 2. **优先增量结构**:`CREATE TABLE IF NOT EXISTS`、带兼容默认值的 `ADD COLUMN` 与索引;必要的数据回填单独编号并依赖账本只执行一次。增量 DDL 仍须评估锁和容量,不能仅靠语句形式推定无中断。
70
82
  3. **禁 `RENAME` / `DROP COLUMN` / `DROP TABLE` / 改列义**。要删要改名 → 走第四节:先加新列双写、过渡窗、下个 major 再删旧列。
71
83
  - 尤其 `RENAME`:它让结构变更只能在特定状态下执行;一旦换库或重置后重放,容易中断初始化——能不用就不用。
72
84
 
@@ -97,14 +109,18 @@ Core 0.9.0 配套 SDK 0.7.0 / DSH 0.7.0,新增可选模型计费网关;本
97
109
 
98
110
  ## 七、部署方升级清单(贴在运维手册里)
99
111
 
100
- 1. `git pull` / 拉新 tag → 看 [CHANGELOG.md](CHANGELOG.md)。
101
- 2. **没有 `BREAKING` 段** → `db:init` + 重启 hub 即可(patch/minor,drop-in),路由/凭证/入口零重配。
102
- 3. **有 `BREAKING` 段** → 按其指引:先升 hub(过渡窗内双发/双收),再依次把各业务系统的 SDK、嵌入页升到新版;用 `docs/examples/bailing-tool-verify.{php,mjs,py}` 跑冻结测试向量自检对齐后再灰度。
103
- 4. 任何时候 hub 日志出现"弃用标签/字段"告警 = 该项在下个 major 会移除,安排升级即可,不影响当前运行。
112
+ 1. 固定当前与目标 Tag、提交和制品摘要,阅读 [CHANGELOG.md](CHANGELOG.md)及路径上每份升级指南;不要在运行目录直接拉取浮动分支。
113
+ 2. 识别状态/配置库是否共库、JSONL、附件及本地配置;保留可恢复的一致备份和旧制品,先在隔离副本验证恢复组合。
114
+ 3. 暂停所有共用存储的写入方,排空在途工作并核对原调用、审批、通知和回执。超时或结果未知时保持原 ID,不能换请求重发业务写。
115
+ 4. 按目标制品 manifest 和各库完整账本核对迁移。对每个实际 MySQL 库串行执行官方迁移器;`db:init` 不覆盖独立配置库。启动本身不执行迁移。
116
+ 5. 核对新版本、readiness、权限/审批/通知恢复、客户端兼容和业务侧去重,再恢复接单。没有 `BREAKING` 段也不能跳过迁移与恢复验证。
117
+ 6. 回退前验证旧制品是否接受新账本和持久状态。不得删除迁移记录、任务强制标记或通知记录来绕过检查;恢复数据库也不能撤销已经发生的外部业务动作。
118
+
119
+ 可先用[只读升级计划](UPGRADE_PLAN.md)比较显式提供的制品及脱敏账本快照。离线比较不是现场数据库核验,也不证明备份可恢复或升级已获放行。
104
120
 
105
121
  ---
106
122
 
107
- **一句话**:加东西走 minor、放下就走;改/删(wire / schema / 嵌入属性)走 major、新名 + 过渡窗、永不硬切、永不静默。运行时配置在 DB、生产密钥在环境变量或密钥管理器、定制在 `.local`、键有默认——代码升级碰不到它们。下游每次跟版的"入侵成本"因此是**可预期**的,而不是每次都得赌。
123
+ 兼容性说明、迁移执行与实际验收分别留证。保留配置是升级目标,制品与备份一致、权限语义不退化才是验证结果。
108
124
 
109
125
  ## 八、每次改动必须同步的开发者说明
110
126
 
@@ -148,6 +164,6 @@ Core 0.9.0 配套 SDK 0.7.0 / DSH 0.7.0,新增可选模型计费网关;本
148
164
  4. `signed_required` 只有“正签 2xx + 无签/错签分别 401/403/404”才是 `protected`;负向 2xx 是 `public`,3xx/429/5xx/网络错误是 `inconclusive`。正签 404 是主请求失败,不是保护证据。
149
165
  5. 核对受保护响应包含 `Cache-Control: private, no-store`,并检查 CDN/反向代理没有缓存或改写受保护清单。
150
166
 
151
- 刷新失败会保留旧缓存;单请求时限为 10 秒,正向正文上限为 5 MiB。最安全的应用回滚方式是恢复旧代码但保留 053 两列和迁移账本,旧版本会忽略新增字段。只有需要完整恢复迁移前状态时才使用部署前数据库快照,并与旧应用一起停机恢复;不要单独删除账本或 DROP 新列。
167
+ 刷新失败会保留旧缓存;单请求时限为 10 秒,正向正文上限为 5 MiB。回退时保留 053 两列、历史配置和迁移账本,但必须先验证具体旧制品能接受该账本及数据;不能只因字段可空就推定旧版可运行。需要恢复迁移前状态时,按一致集合与旧应用停机恢复,并核对备份后的外部动作;不要单独删除账本或 DROP 新列。
152
168
 
153
169
  这组访问策略只治理“谁能读取工具清单”。它不改变 ACC、工具调用签名、路由白名单、审批、幂等或业务系统最终授权。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bailinghub",
3
- "version": "0.9.4",
3
+ "version": "0.10.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Open-source ACC runtime and agent control plane for existing business systems.",
@@ -56,7 +56,7 @@
56
56
  "executor:watch": "tsx watch src/executor.ts",
57
57
  "typecheck": "tsc --noEmit",
58
58
  "installer:secrets:test": "node --test scripts/install-secrets.test.mjs",
59
- "test": "node --import tsx --test \"src/**/*.test.ts\"",
59
+ "test": "node --import tsx --test \"src/**/*.test.ts\" \"web-admin/src/*.test.ts\"",
60
60
  "db:init": "tsx scripts/init-db.ts",
61
61
  "demo:seed": "tsx scripts/seed-demo.ts",
62
62
  "admin:create": "tsx scripts/create-admin.ts",
@@ -66,7 +66,7 @@
66
66
  "build:info": "node scripts/write-build-info.mjs",
67
67
  "demo:e2e": "tsx scripts/demo-e2e.ts",
68
68
  "bootstrap-admin:restart-test": "tsx scripts/verify-bootstrap-admin-restart.ts",
69
- "e2e:console": "node scripts/e2e-console.mjs",
69
+ "e2e:console": "node scripts/e2e-console.mjs && node scripts/e2e-console-approval-details.mjs && node scripts/e2e-console-runtime-audit.mjs && node scripts/e2e-console-settings-audit.mjs && node scripts/e2e-console-operations-audit.mjs && node scripts/e2e-console-kb-audit.mjs",
70
70
  "widget:renderer:test": "node scripts/widget-renderer-test.mjs",
71
71
  "package:build": "npm --prefix web-admin ci --include=dev && npm --prefix web-admin run build",
72
72
  "package:artifact:check": "node scripts/check-package-artifact.mjs",
@@ -91,7 +91,7 @@
91
91
  "release:consistency:test": "node --test scripts/check-release-consistency.test.mjs",
92
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",
93
93
  "github:verify": "node scripts/verify-github-repo.mjs",
94
- "release:check": "npm run notices:check && npm run assets:check && npm run audit:deps && npm run audit:deps:test && npm run docx:vendor:verify-upstream && npm run docx:test && 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 docx:browser:test && npm run notification:console:test && 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 audit:deps:test && npm run docx:vendor:verify-upstream && npm run docx:test && 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 run doctor:upgrade-plan:typecheck && npm run doctor:upgrade-plan:test && npm test && npm run widget:renderer:test && npm run web-admin:check && npm run docx:browser:test && npm run notification:console:test && 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",
95
95
  "images:build": "sh scripts/publish-images.sh",
96
96
  "images:publish": "BAILING_PUSH_IMAGES=1 sh scripts/publish-images.sh",
97
97
  "images:publish-mysql": "BAILING_PUSH_IMAGES=1 sh scripts/publish-mysql-image.sh",
@@ -114,7 +114,10 @@
114
114
  "docx:vendor:verify-upstream": "node scripts/vendor-mammoth.mjs --verify-upstream",
115
115
  "docx:test": "node --import tsx --test scripts/docx-compatibility.test.mjs",
116
116
  "docx:browser:test": "node scripts/docx-browser-test.mjs",
117
- "notification:console:test": "node scripts/notification-console-test.mjs"
117
+ "notification:console:test": "node scripts/notification-console-test.mjs",
118
+ "doctor:upgrade-plan": "tsx scripts/doctor.ts --upgrade-plan",
119
+ "doctor:upgrade-plan:test": "node --import tsx --test scripts/doctor-upgrade-plan.test.ts",
120
+ "doctor:upgrade-plan:typecheck": "tsc --noEmit --strict --noUncheckedIndexedAccess --noUnusedLocals --skipLibCheck --target ES2022 --module ESNext --moduleResolution Bundler --lib ES2022 --types node scripts/doctor-upgrade-plan.ts scripts/doctor-upgrade-plan.test.ts"
118
121
  },
119
122
  "dependencies": {
120
123
  "mammoth": "file:vendor/bailinghub-mammoth-library-1.12.0-bailinghub.1.tgz",
@@ -52,6 +52,8 @@
52
52
  "minLength": 1,
53
53
  "maxLength": 500
54
54
  },
55
+ "descriptionTruncated": { "type": "boolean" },
56
+ "usageGuidance": { "$ref": "#/$defs/usageGuidance" },
55
57
  "scope": {
56
58
  "type": "string",
57
59
  "minLength": 1,
@@ -122,6 +124,17 @@
122
124
  }
123
125
  },
124
126
  "$defs": {
127
+ "usageGuidance": {
128
+ "type": "object",
129
+ "additionalProperties": false,
130
+ "required": ["text", "truncated", "sourceChars", "sourceBytes"],
131
+ "properties": {
132
+ "text": { "type": "string", "minLength": 1, "maxLength": 32768, "description": "Additionally bounded to 65536 UTF-8 bytes by the compiler/runtime validator." },
133
+ "truncated": { "type": "boolean" },
134
+ "sourceChars": { "type": "integer", "minimum": 0 },
135
+ "sourceBytes": { "type": "integer", "minimum": 0 }
136
+ }
137
+ },
125
138
  "confirmCondition": {
126
139
  "type": "object",
127
140
  "additionalProperties": false,
@@ -113,6 +113,10 @@ const englishCompanions = {
113
113
  'docs/UPGRADE_v0.9.3.md': 'docs/UPGRADE_v0.9.3.en.md',
114
114
  'docs/RELEASE_NOTES_v0.9.4.md': 'docs/RELEASE_NOTES_v0.9.4.en.md',
115
115
  'docs/UPGRADE_v0.9.4.md': 'docs/UPGRADE_v0.9.4.en.md',
116
+ 'docs/RELEASE_NOTES_v0.10.0.md': 'docs/RELEASE_NOTES_v0.10.0.en.md',
117
+ 'docs/UPGRADE_v0.10.0.md': 'docs/UPGRADE_v0.10.0.en.md',
118
+ 'docs/MODEL_OUTPUT_BUDGET.md': 'docs/MODEL_OUTPUT_BUDGET.en.md',
119
+ 'docs/MODEL_CONTINUATION.md': 'docs/MODEL_CONTINUATION.en.md',
116
120
  'docs/UPGRADE_v0.9.1.md': 'docs/UPGRADE_v0.9.1.en.md',
117
121
  'docs/MODEL_BILLING.md': 'docs/MODEL_BILLING.en.md',
118
122
  'docs/PERIOD_ALLOWANCE_UPGRADE.md': 'docs/PERIOD_ALLOWANCE_UPGRADE.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.4"
12
+ [ -n "$TAG" ] || TAG="0.10.0"
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.4');
42
- assert.equal(result.stableVersion, '0.9.4');
41
+ assert.equal(result.version, '0.10.0');
42
+ assert.equal(result.stableVersion, '0.10.0');
43
43
  assert.equal(result.publishTag, 'latest');
44
44
  });
45
45