bailinghub 0.9.1 → 0.9.3

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 (115) hide show
  1. package/README.en.md +6 -6
  2. package/README.md +6 -6
  3. package/docker-compose.images.yml +2 -2
  4. package/docs/CHANGELOG.en.md +23 -1
  5. package/docs/CHANGELOG.md +23 -1
  6. package/docs/CORE_RELIABILITY.en.md +79 -0
  7. package/docs/CORE_RELIABILITY.md +79 -0
  8. package/docs/DEPLOYMENT_DIAGNOSTICS.en.md +78 -0
  9. package/docs/DEPLOYMENT_DIAGNOSTICS.md +78 -0
  10. package/docs/IMPLEMENTATION_STATUS.en.md +27 -15
  11. package/docs/IMPLEMENTATION_STATUS.md +27 -15
  12. package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
  13. package/docs/INDEPENDENT_VALIDATION.md +4 -4
  14. package/docs/KERNEL_HOST_API.en.md +2 -0
  15. package/docs/KERNEL_HOST_API.md +2 -0
  16. package/docs/MODEL_BILLING.en.md +4 -0
  17. package/docs/MODEL_BILLING.md +4 -0
  18. package/docs/MODEL_PROCESS_RECOVERY.en.md +32 -0
  19. package/docs/MODEL_PROCESS_RECOVERY.md +37 -0
  20. package/docs/OPERATIONS.en.md +13 -0
  21. package/docs/OPERATIONS.md +12 -0
  22. package/docs/README.en.md +7 -0
  23. package/docs/README.md +7 -0
  24. package/docs/RELEASE_NOTES_v0.9.2.en.md +45 -0
  25. package/docs/RELEASE_NOTES_v0.9.2.md +45 -0
  26. package/docs/RELEASE_NOTES_v0.9.3.en.md +51 -0
  27. package/docs/RELEASE_NOTES_v0.9.3.md +51 -0
  28. package/docs/TOOLS_DESIGN.md +1 -0
  29. package/docs/UPGRADE_v0.9.2.en.md +62 -0
  30. package/docs/UPGRADE_v0.9.2.md +62 -0
  31. package/docs/UPGRADE_v0.9.3.en.md +63 -0
  32. package/docs/UPGRADE_v0.9.3.md +63 -0
  33. package/package.json +7 -3
  34. package/scripts/check-doc-links.mjs +4 -0
  35. package/scripts/check-image-tags.sh +1 -1
  36. package/scripts/check-release-consistency.test.mjs +2 -2
  37. package/scripts/doctor-deployment.test.ts +419 -0
  38. package/scripts/doctor-deployment.ts +357 -0
  39. package/scripts/doctor.ts +8 -1
  40. package/scripts/install-secrets.test.mjs +185 -0
  41. package/scripts/install.sh +10 -6
  42. package/scripts/publish-images.sh +1 -1
  43. package/scripts/release-audit.mjs +8 -0
  44. package/scripts/verify-github-repo.mjs +8 -0
  45. package/security/dependency-audit-exceptions.json +1 -1
  46. package/sql/065_usage_reconciliation_scan.sql +4 -0
  47. package/sql/066_approval_continuations.sql +15 -0
  48. package/sql/067_delivery_dlq_replay.sql +10 -0
  49. package/sql/README.en.md +6 -0
  50. package/sql/README.md +15 -0
  51. package/src/adapters/llm/file.test.ts +59 -0
  52. package/src/adapters/llm/file.ts +11 -4
  53. package/src/app/agent-tool-invocations.test.ts +3 -1
  54. package/src/app/approval-continuations.mysql.test.ts +138 -0
  55. package/src/app/approval-continuations.test.ts +351 -0
  56. package/src/app/approval-continuations.ts +148 -0
  57. package/src/app/channels-attachments.test.ts +63 -0
  58. package/src/app/channels.ts +7 -4
  59. package/src/app/delivery-dlq-replay.mysql.test.ts +139 -0
  60. package/src/app/delivery-dlq-replay.test.ts +75 -0
  61. package/src/app/delivery-dlq-replay.ts +41 -0
  62. package/src/app/delivery.ts +3 -2
  63. package/src/app/http-server.ts +3 -0
  64. package/src/app/kernel-model-process-crash.mysql.test.ts +377 -0
  65. package/src/app/kernel-notification-lifecycle.test.ts +49 -0
  66. package/src/app/kernel.ts +22 -0
  67. package/src/app/notification-outbound.test.ts +53 -0
  68. package/src/app/operational-metrics.test.ts +37 -1
  69. package/src/app/operational-metrics.ts +25 -2
  70. package/src/app/outbound.ts +13 -2
  71. package/src/app/runtime-evidence-maintenance.test.ts +55 -0
  72. package/src/app/runtime-lifecycle-default.ts +7 -0
  73. package/src/app/runtime-lifecycle.test.ts +89 -0
  74. package/src/app/runtime-lifecycle.ts +52 -11
  75. package/src/app/tool-approvals.ts +2 -1
  76. package/src/core/contracts/approval-continuation.ts +43 -0
  77. package/src/core/contracts/delivery-replay.ts +41 -0
  78. package/src/core/contracts/tools-idempotency.test.ts +121 -5
  79. package/src/core/contracts/tools.ts +21 -11
  80. package/src/core/contracts/types.ts +4 -0
  81. package/src/core/observability/openmetrics.test.ts +28 -0
  82. package/src/core/observability/openmetrics.ts +91 -0
  83. package/src/core/platform/http-body.test.ts +185 -0
  84. package/src/core/platform/http-body.ts +58 -0
  85. package/src/core/runtime/finish-runtime.test.ts +2 -0
  86. package/src/core/runtime/finish-runtime.ts +10 -7
  87. package/src/core/runtime/notification-background-work.test.ts +50 -0
  88. package/src/core/runtime/notification-background-work.ts +101 -0
  89. package/src/core/state/approval-continuation.ts +22 -0
  90. package/src/core/state/delivery-replay.ts +19 -0
  91. package/src/core/state/state-codec.ts +2 -0
  92. package/src/core/state/state-contracts.ts +6 -0
  93. package/src/infrastructure/config/config-approval-ledger.ts +75 -0
  94. package/src/infrastructure/config/config-delivery-dlq-ledger.ts +36 -10
  95. package/src/infrastructure/config/configstore.ts +4 -3
  96. package/src/infrastructure/state/state-jsonl.ts +56 -11
  97. package/src/infrastructure/state/state-mysql.ts +54 -0
  98. package/src/modules/usage/background-work.test.ts +28 -0
  99. package/src/modules/usage/background-work.ts +43 -7
  100. package/src/modules/usage/billing-reconciliation.mysql.test.ts +163 -0
  101. package/src/modules/usage/billing-reconciliation.test.ts +85 -0
  102. package/src/modules/usage/billing-repository.ts +63 -11
  103. package/src/modules/usage/maintenance.test.ts +78 -0
  104. package/src/modules/usage/maintenance.ts +39 -0
  105. package/src/modules/usage/model-gateway.ts +2 -1
  106. package/src/routes/admin-default.ts +2 -2
  107. package/src/routes/admin-runtime-default.ts +2 -2
  108. package/src/routes/admin-runtime.test.ts +1 -1
  109. package/src/routes/admin-runtime.ts +39 -18
  110. package/src/routes/admin.ts +1 -1
  111. package/src/routes/approvals-default.ts +2 -2
  112. package/src/routes/approvals.ts +30 -33
  113. package/src/routes/critical-routes.test.ts +16 -3
  114. package/src/test-support/approval-continuation-crash-child.ts +24 -0
  115. package/src/test-support/model-process-crash-child.ts +78 -0
@@ -6,10 +6,10 @@ This index separates **ownership, release availability, public evidence, and lim
6
6
 
7
7
  ## Version and evidence conventions
8
8
 
9
- - Formal release baseline: [v0.9.1](https://github.com/bailinghub/bailinghub/releases/tag/v0.9.1), with the [v0.9.1 source Tag](https://github.com/bailinghub/bailinghub/tree/v0.9.1). 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.
9
+ - Formal release baseline: [v0.9.3](https://github.com/bailinghub/bailinghub/releases/tag/v0.9.3), with the [v0.9.3 source Tag](https://github.com/bailinghub/bailinghub/tree/v0.9.3). The table's mechanisms are included in this release; versioned fixes retain their first-release identities. This does not mean that every optional feature is enabled by a default installation.
10
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
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.1 release notes](RELEASE_NOTES_v0.9.1.en.md) and [upgrade guide](UPGRADE_v0.9.1.en.md) for release contents and prerequisites. Compatible clients, application migrations, provider credentials, storage, and business authorization still require their own configuration and acceptance.
12
+ - Use the [v0.9.3 release notes](RELEASE_NOTES_v0.9.3.en.md) and [upgrade guide](UPGRADE_v0.9.3.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
13
 
14
14
  ## Ownership and release availability
15
15
 
@@ -17,18 +17,18 @@ Core defaults to one organization's management and audit domain. Clients, routes
17
17
 
18
18
  | Capability and owner | Release availability | Public implementation and evidence | Scope and limitations |
19
19
  |---|---|---|---|
20
- | Declarations, tool discovery, and governed calls: Core parses/governs; the business system executes | Included in Core v0.9.1 | [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.1 | [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.1 | [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.1 | [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.1 (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.1 | [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.1 | [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.1 (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.1 | [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.1 | [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.1 | [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.1 | [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. |
20
+ | Declarations, tool discovery, and governed calls: Core parses/governs; the business system executes | Included in Core v0.9.3 | [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.3 | [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.3 | [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.3 | [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.3 (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.3 | [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.3 | [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.3 (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.3 | [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.3 | [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.3 | [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.3 | [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
32
 
33
33
  ## What the public validation paths establish
34
34
 
@@ -40,7 +40,7 @@ Simulated provider responses establish adapter/protocol behavior for the specifi
40
40
 
41
41
  ### Public demo and independent reproduction task
42
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.
43
+ The [Docker demo](DEMO.en.md) and [independent validation task](INDEPENDENT_VALIDATION.en.md) provide a public path from installing v0.9.3 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
44
 
45
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
46
 
@@ -71,3 +71,15 @@ A version field or this page does not substitute for artifact checks. Evaluate n
71
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
72
 
73
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.
82
+
83
+ ## Core v0.9.3 body and notification fixes
84
+
85
+ The [HTTP and notification fixes](CORE_RELIABILITY.en.md#core-v093-http-and-notification-fixes) index public source and synthetic regression entry points for bounded bodies, UTF-8 views, graceful notification drain, original executor notification DLQ admission deduplication and migration 067. [Operational metrics](OPERATIONS.en.md) document read-only maintenance snapshots. These changes are available from Core v0.9.3, not in historical v0.9.2 artifacts. Graceful-close and storage-interruption tests do not establish complete crash recovery of all notification intents or production receipt. Verify Tag, npm, images and each deployment separately.
@@ -6,10 +6,10 @@
6
6
 
7
7
  ## 版本与阅读口径
8
8
 
9
- - 正式发行基线:[v0.9.1](https://github.com/bailinghub/bailinghub/releases/tag/v0.9.1),对应 [v0.9.1 源码 Tag](https://github.com/bailinghub/bailinghub/tree/v0.9.1)。下表已有机制及后文的关闭修复属于该版本;不代表默认安装后已启用所有可选功能。
9
+ - 正式发行基线:[v0.9.3](https://github.com/bailinghub/bailinghub/releases/tag/v0.9.3),对应 [v0.9.3 源码 Tag](https://github.com/bailinghub/bailinghub/tree/v0.9.3)。下表机制均包含在该版本中,各次修复仍标注首次发行版本;不代表默认安装后已启用所有可选功能。
10
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
11
  - 表中的测试链接是**公开测试代码及其检查范围**,不是本页重新执行所得的通过记录。单元测试、模拟供应商响应、MySQL 集成测试和完整 demo 验证分别说明各自覆盖的条件。未执行或跳过的测试不能写成已通过,也不能据此把已有机制写成“计划实现”。
12
- - 版本发行内容与升级前提以 [v0.9.1 说明](RELEASE_NOTES_v0.9.1.md) 和 [升级指南](UPGRADE_v0.9.1.md) 为准。适配客户端、应用迁移、模型凭据、存储和具体业务授权仍需各自配置、验证。
12
+ - 版本发行内容与升级前提以 [v0.9.3 说明](RELEASE_NOTES_v0.9.3.md) 和 [升级指南](UPGRADE_v0.9.3.md) 为准。适配客户端、应用迁移、模型凭据、存储和具体业务授权仍需各自配置、验证。
13
13
 
14
14
  ## 能力归属与发行状态
15
15
 
@@ -17,18 +17,18 @@ Core 默认是一个组织的管理与审计域。不同 Client、route 或工
17
17
 
18
18
  | 能力与责任方 | 发行状态 | 公开实现与证据入口 | 范围与限制 |
19
19
  |---|---|---|---|
20
- | 能力声明、工具发现、受控调用:Core 解析和治理,业务系统执行 | Core v0.9.1 已包含 | [工具模型](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.1 已包含 | [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.1 已包含 | [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.1 已包含 | [只读回执与恢复](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.1 已包含(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.1 已包含 | [对话审计契约](AGENT_CONVERSATION_AUDIT.md);[运行面测试](../src/core/runtime/agent-conversation-audit.test.ts) | 不采集隐藏推理。确认成员和具备写接口不证明宿主已上传全部历史;审计归档不合并业务授权、会话或运行时记忆。跨绑定仍受同一中枢及各自身份边界约束。 |
26
- | 当前线程上下文和可选滚动摘要:Core 的路由/线程机制 | Core v0.9.1 已包含 | [记忆配置与渲染](../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.1 已包含(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.1 已包含 | [模型计费契约](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.1 已包含 | [工具描述源码](../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.1 已包含 | [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.1 已包含 | [快速开始](QUICKSTART.md);[安装脚本](../scripts/install.sh);[体检脚本](../scripts/smoke.ts);[OpenMetrics 测试](../src/core/observability/openmetrics.test.ts);[独立复现任务卡](INDEPENDENT_VALIDATION.md) | 健康响应不证明全部业务或供应商可用。指标端点需显式启用并保护访问;有安装/诊断入口不等于已建立持续监控、告警值守或完成特定部署验收。 |
20
+ | 能力声明、工具发现、受控调用:Core 解析和治理,业务系统执行 | Core v0.9.3 已包含 | [工具模型](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.3 已包含 | [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.3 已包含 | [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.3 已包含 | [只读回执与恢复](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.3 已包含(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.3 已包含 | [对话审计契约](AGENT_CONVERSATION_AUDIT.md);[运行面测试](../src/core/runtime/agent-conversation-audit.test.ts) | 不采集隐藏推理。确认成员和具备写接口不证明宿主已上传全部历史;审计归档不合并业务授权、会话或运行时记忆。跨绑定仍受同一中枢及各自身份边界约束。 |
26
+ | 当前线程上下文和可选滚动摘要:Core 的路由/线程机制 | Core v0.9.3 已包含 | [记忆配置与渲染](../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.3 已包含(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.3 已包含 | [模型计费契约](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.3 已包含 | [工具描述源码](../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.3 已包含 | [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.3 已包含 | [快速开始](QUICKSTART.md);[安装脚本](../scripts/install.sh);[体检脚本](../scripts/smoke.ts);[OpenMetrics 测试](../src/core/observability/openmetrics.test.ts);[独立复现任务卡](INDEPENDENT_VALIDATION.md) | 健康响应不证明全部业务或供应商可用。指标端点需显式启用并保护访问;有安装/诊断入口不等于已建立持续监控、告警值守或完成特定部署验收。 |
32
32
 
33
33
  ## 公开验证能说明什么
34
34
 
@@ -40,7 +40,7 @@ Core 默认是一个组织的管理与审计域。不同 Client、route 或工
40
40
 
41
41
  ### 公开 demo 与独立复现任务卡
42
42
 
43
- [Docker Demo](DEMO.md) 与 [独立验证任务卡](INDEPENDENT_VALIDATION.md) 提供从 v0.9.1 安装、基础体检到 `npm run demo:e2e` 的公开路径。其订单、工单、退款和故障工具均为仓库 demo 数据;不需要真实模型 Key、客户接口或生产凭据。
43
+ [Docker Demo](DEMO.md) 与 [独立验证任务卡](INDEPENDENT_VALIDATION.md) 提供从 v0.9.3 安装、基础体检到 `npm run demo:e2e` 的公开路径。其订单、工单、退款和故障工具均为仓库 demo 数据;不需要真实模型 Key、客户接口或生产凭据。
44
44
 
45
45
  任务卡要求记录服务、控制台、匿名预览边界、基础体检和完整业务闭环的具体结果。README 的 demo 图像与动画展示同一公开样例,不能当作客户采用证据。任务卡存在也不意味着已有外部开发者完成验证;报告结果应保留验证者实际版本、环境、检查项和失败范围。
46
46
 
@@ -71,3 +71,15 @@ Core v0.9.1 增加了每个 `UsageRepository` 独立拥有的 [后台工作登
71
71
  - 完整用户级长期记忆、未具备执行适配器的媒体工具、未经本页所列公开路径验证的真实供应商/业务系统,均不能写成这里的已验证能力。本索引没有为这些范围建立新的产品时间表。
72
72
 
73
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制品的保证。
82
+
83
+ ## Core v0.9.3 的收包与通知修复
84
+
85
+ [HTTP 与通知修复](CORE_RELIABILITY.md#core-v093-的-http-与通知修复)汇聚有限收包、UTF-8 视图预算、正常关闭通知排空、原执行器通知死信防重复入队与 067 迁移的公开源码和合成回归入口;[运维指标](OPERATIONS.md)记录只读维护快照边界。这些修改从 Core v0.9.3 提供,历史 v0.9.2 制品不包含;正常关闭和仓储断点测试不证明全部通知意图的崩溃补投或生产送达。Tag、npm、镜像与具体部署仍需分别核验。
@@ -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.1`;
10
+ - Stable baseline: `v0.9.3`;
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.1` 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.3` 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.1 https://github.com/bailinghub/bailinghub.git
49
+ git clone --depth 1 --branch v0.9.3 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.1.en.md).
170
+ - [Current stable release notes](RELEASE_NOTES_v0.9.3.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.1`;
10
+ - 稳定基线:`v0.9.3`;
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.1` 官方镜像,生成随机 Token 与后台密码,启动服务并自动运行基础体检。首次管理员只在数据库管理员表为空时创建;对同一持久化数据库进行重启、升级、容器重建或重新安装,不会覆盖已经修改的管理员密码。可选 `/metrics` 端点默认关闭,不影响基础验证。请保留终端输出中的版本、安装模式、耗时和“常用命令”,但不要把密码或 Token 写入反馈。新安装 Docker 后,当前非 root 会话通常仍需使用脚本打印的 `sudo docker compose ...` 命令;重新登录后 Docker 组权限才可能生效。
35
+ 脚本默认拉取 `v0.9.3` 官方镜像,生成随机 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.1 https://github.com/bailinghub/bailinghub.git
49
+ git clone --depth 1 --branch v0.9.3 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.1.md)。
170
+ - [当前稳定版发布说明](RELEASE_NOTES_v0.9.3.md)。
171
171
 
172
172
  扩展验证请在同一 Issue 模板中选择对应路径,并说明是否获得过维护者的直接帮助。
173
173
 
@@ -68,6 +68,8 @@ Multiple Kernels may share `KernelExecutionQueueV1` as a process-wide concurrenc
68
68
 
69
69
  ## Artifact And Schema Upgrades
70
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
+
71
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.
72
74
 
73
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.
@@ -68,6 +68,8 @@ await kernel.close(30_000);
68
68
 
69
69
  ## 制品与数据库升级
70
70
 
71
+ Core 0.9.2 的 [可靠性修复](CORE_RELIABILITY.md)新增 065/066 迁移。新 managed Kernel 在首次既有 tick 启动结算与审批补续维护,以后按周期推进;Host 继续负责公平 tick 和关闭时等待,不需要自行实现 Core 的账本恢复。standalone 新维护先停止再排空。使用新审批决策前须显式迁移 066 并具备配套仓储;它不修改 Kernel API v1 的运行导出,也不自动升级 Host 的部署。
72
+
71
73
  `BAILINGHUB_CORE_ARTIFACT_V1` 包含已安装包版本、官方活动迁移摘要、最新迁移名、退役迁移证据和整体 manifest 摘要。宿主应把这些值写入自己的实例目录,并在加载前逐项匹配。`migrations` 只是可在新 Schema 中执行的活动序列;`retiredMigrations` 只用于识别早期部署的历史账本,`replay: never` 表示不得恢复相应 SQL 文件或在新库中重放。
72
74
 
73
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)
@@ -96,14 +96,24 @@ Primary metrics:
96
96
  | `bailinghub_approvals_pending` | Tool approvals awaiting a decision |
97
97
  | `bailinghub_executors` | Registered executors by online or offline heartbeat state |
98
98
  | `bailinghub_audit_write_failures_total` | Audit-write failures observed by this process |
99
+ | `bailinghub_background_work_in_flight` / `bailinghub_background_work_oldest_pending_age_seconds` | Accepted background work and oldest in-flight age by fixed source / kind |
100
+ | `bailinghub_background_work_finished_total` | Continuation completion/failure outcomes observed by this owner, by fixed outcome |
101
+ | `bailinghub_background_work_last_run_timestamp_seconds` / `bailinghub_background_work_last_run_age_seconds` | Latest started / completed / failed time and age; timestamp=0 and no age sample when never observed |
102
+ | `bailinghub_background_draining` / `bailinghub_background_drain_timeouts_total` | Usage/notification tracker drain state and drain calls that exhausted their budget |
103
+ | `bailinghub_maintenance_last_page_records` / `bailinghub_maintenance_last_page_has_more` | Current/latest usage and approval continuation page progress; usage has_more=1 when the bounded page size is reached |
104
+ | `bailinghub_usage_maintenance_consecutive_failures` / `bailinghub_usage_maintenance_retry_after_seconds` | Bounded usage reconciliation failure streak and remaining retry backoff |
99
105
  | `bailinghub_metrics_collector_available` | Whether each optional collector is implemented |
100
106
  | `bailinghub_metrics_collector_success` | Whether each collector succeeded during this scrape |
101
107
  | `bailinghub_metrics_scrape_duration_seconds` | Collection and rendering duration |
102
108
 
103
109
  Labels are fixed and low-cardinality. They never include job IDs, tenants, principals, route arguments, or business payloads. If an optional collector times out or fails, the endpoint still returns the remaining metrics and sets that collector's `bailinghub_metrics_collector_success` to 0. Logs contain only the collector class and failure class, never exception text or business data. The JSONL state backend can expose job metrics; without the MySQL control-plane aggregation, `control_plane` is reported as unavailable.
104
110
 
111
+ The `maintenance` collector reads owner-local memory only. It does not query records, trigger reconciliation or call a model provider. Fixed sources are `usage`, `notification` and `approval`; kinds cover only existing model completion, settlement, response cleanup, usage reconciliation, reference price refresh, callbacks, delivery, approval notifications, alerts, delivery DLQ and approval continuation work. Completion counters describe Promise/continuation outcomes, not recipient delivery acknowledgements. An approval pass can complete with failed individual records; check the last-page `failed` sample as well. Counters reset when the process/owner is recreated. Last-page progress is not the persisted pending/unknown backlog or its oldest age, and has_more is not an exact backlog size. Unavailable optional modules do not emit invented zero samples.
112
+
105
113
  At minimum, alert on collector failures, expired leases, sustained oldest-queue age above the service objective, increases in audit-write failures, expected executors becoming offline, and abnormal recent error or rejection ratios.
106
114
 
115
+ Also watch increases in failed background continuations or drain timeouts, sustained in-flight age beyond the work/shutdown objective, and recent-run age plus last-page failures to confirm maintenance is progressing.
116
+
107
117
  Metrics feed external monitoring. They do not replace `/health/ready`, final business authorization, the audit ledger, or console diagnostics.
108
118
 
109
119
  ## 4. Concurrency And Database Connections
@@ -160,6 +170,9 @@ Recovery order:
160
170
  - Approval intents remain durable in MySQL.
161
171
  - Tool and model failures are recorded in job trace; retry behavior depends on route policy and error type.
162
172
  - Security-critical tool audit is fail-closed. Best-effort operational audit must still feed metrics and alerts.
173
+ - Graceful close drains accepted callback, delivery, approval-notification, alert and DLQ continuations within the shared Kernel budget before closing database/channel resources. A timeout preserves resources for another close attempt. Background failure logs contain fixed work kinds only.
174
+ - Native delivery DLQs retain channel credentials. Custom `X-notify` DLQs requeue only the original failed notification child; queued acknowledges executor admission, not receipt. A permanent DLQ marker is saved atomically with admission, so repeated calls or lost resolve replies do not admit it again or rerun the business parent. Legacy entries are checked against the original job; binding conflicts return 409 and adapters without replay ports return 503.
175
+ - This drain does not provide a complete SIGKILL-safe notification outbox. Created executor jobs retain durable queue recovery; direct webhooks and the gap between parent termination and child creation remain separate recovery boundaries. Receivers should deduplicate original event identities; partial or unknown receipt must not be blindly resent.
163
176
 
164
177
  ## 8. Security Baseline
165
178
 
@@ -121,18 +121,27 @@ scrape_configs:
121
121
  | `bailinghub_approvals_pending` | 待决策的工具审批数 |
122
122
  | `bailinghub_executors` | 按 online / offline 统计的执行器数 |
123
123
  | `bailinghub_audit_write_failures_total` | 当前进程累计审计写入失败数 |
124
+ | `bailinghub_background_work_in_flight` / `bailinghub_background_work_oldest_pending_age_seconds` | 按固定 source / kind 统计已接纳的后台工作及最老在途年龄 |
125
+ | `bailinghub_background_work_finished_total` | 当前 owner 的 continuation 完成/失败数,按固定 outcome 区分 |
126
+ | `bailinghub_background_work_last_run_timestamp_seconds` / `bailinghub_background_work_last_run_age_seconds` | 最近 started / completed / failed 时间及距今秒数;从未观察到时 timestamp=0,age 不输出 |
127
+ | `bailinghub_background_draining` / `bailinghub_background_drain_timeouts_total` | Usage/通知 tracker 的关闭排空状态及耗尽预算的 drain 调用次数 |
128
+ | `bailinghub_maintenance_last_page_records` / `bailinghub_maintenance_last_page_has_more` | 当前/最近一页 usage、审批续执行处理进度;usage 达到固定扫描页大小时 has_more=1 |
129
+ | `bailinghub_usage_maintenance_consecutive_failures` / `bailinghub_usage_maintenance_retry_after_seconds` | Usage 核对的有界连续失败数和退避剩余秒数 |
124
130
  | `bailinghub_metrics_collector_available` | 状态库/控制面采集器是否实现 |
125
131
  | `bailinghub_metrics_collector_success` | 对应采集器在本次抓取中是否成功 |
126
132
  | `bailinghub_metrics_scrape_duration_seconds` | 本次聚合和渲染耗时 |
127
133
 
128
134
  指标标签是固定、低基数集合,不包含 `job_id`、租户、主体、路由参数或业务载荷。单个可选采集器超时或失败时,端点仍返回其余指标,并把对应 `bailinghub_metrics_collector_success` 置为 0;日志只记录采集器类别和失败类型,不记录异常正文或业务数据。JSONL 状态后端可提供任务指标,但没有 MySQL 控制面聚合时,`control_plane` 会标记为不可用。
129
135
 
136
+ `maintenance` 采集器只读当前 owner 内存,不查询明细、不触发核对或模型请求。固定 source 为 `usage`、`notification`、`approval`;kind 只包含现有模型完成、结算、响应清理、usage 核对、价格刷新、回调、通知送达、审批通知、告警、送达 DLQ 和审批续执行。工作完成数统计 Promise/continuation 的终态,不等于接收方确认送达次数;一轮审批核对可完成但保留失败记录,应同时看 last_page 的 `failed`。进程/owner 重建会重置这些计数。last_page 不是数据库里 pending/unknown 的总数或最老年龄,`has_more=1` 也不是精确积压量;不可用的可选模块不输出伪造零数据。
137
+
130
138
  建议至少告警:
131
139
 
132
140
  - 任一已启用采集器的 `bailinghub_metrics_collector_success == 0`。
133
141
  - `bailinghub_jobs_expired_leases > 0`。
134
142
  - `bailinghub_queue_oldest_queued_age_seconds` 持续超过本业务的最大等待目标。
135
143
  - `bailinghub_audit_write_failures_total` 增长。
144
+ - `bailinghub_background_work_finished_total{outcome="failed"}` 或 drain timeout 增长,后台在途年龄持续超出关闭/任务目标;使用最近运行 age 和 last_page 失败数判断维护是否持续推进。
136
145
  - 预期在线的执行器进入 `offline`,或近期错误/拒绝终态占比异常升高。
137
146
 
138
147
  指标是外部监控输入,不替代 `/health/ready`、业务系统最终授权、审计账本或控制台诊断。
@@ -208,6 +217,9 @@ scrape_configs:
208
217
  - 审批等待:审批意图在数据库中持久化,不依赖实例内存。
209
218
  - 外部工具或模型失败:任务记录错误与 trace,是否重试由路由和错误类型决定。
210
219
  - 审计写入失败:安全关键工具调用按 fail-closed 处理;非关键运行事件不阻塞业务,但应进入运维告警与指标。
220
+ - 正常关闭:Kernel 按同一关闭预算等待已接受的回调、送达派生、审批通知、告警和 DLQ 插入,再释放数据库/渠道资源;排空超时保留资源,宿主可在工作完成后重试 `close()`。后台失败日志只报告固定工作类别。
221
+ - 送达死信重投:内置渠道继续通过渠道凭证发送;自定义 `X-notify` 死信只重排原失败通知子任务,回复 `queued` 表示已进入执行器队列。永久 DLQ 重投标记与原子入队一起保存,重复请求或 resolve 回包丢失不会重复入队,业务父任务不会重跑。旧死信按原 Job 验证承接器,绑定不符返回 409,旧扩展缺少重投端口返回 503;人工可检查原通知子任务。
222
+ - 上述排空不提供 SIGKILL 后的全量通知 outbox:已创建的执行器任务仍由持久队列恢复;直接 webhook 和父终态到通知子任务创建之间的持久补投仍是独立边界。接收方需要按原事件 ID 去重,部分或未知送达不能盲目重发。
211
223
 
212
224
  ## 8. 安全基线
213
225
 
package/docs/README.en.md CHANGED
@@ -7,6 +7,11 @@ This directory contains public documentation for the open-source BailingHub proj
7
7
  | Document | Purpose |
8
8
  |---|---|
9
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.3.en.md](RELEASE_NOTES_v0.9.3.en.md) · [Chinese](RELEASE_NOTES_v0.9.3.md) | v0.9.3: bounded bodies, graceful notification close and original-notification DLQ replay, with maintenance metrics. |
11
+ | [UPGRADE_v0.9.3.en.md](UPGRADE_v0.9.3.en.md) · [Chinese](UPGRADE_v0.9.3.md) | Explicit migration 067, matching DLQ/state adapters, rollback manifests and preserved markers. |
12
+ | [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. |
13
+ | [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. |
14
+ | [CORE_RELIABILITY.en.md](CORE_RELIABILITY.en.md) · [Chinese](CORE_RELIABILITY.md) | Installation credentials, settlement/approval continuation, bounded bodies, notification close/replay and synthetic acceptance boundaries. |
10
15
  | [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. |
11
16
  | [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. |
12
17
  | [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. |
@@ -57,6 +62,7 @@ This directory contains public documentation for the open-source BailingHub proj
57
62
  |---|---|
58
63
  | [ARCHITECTURE.en.md](ARCHITECTURE.en.md) | Architecture overview: layers, runtime path, boundaries, and extension points. |
59
64
  | [KERNEL_HOST_API.en.md](KERNEL_HOST_API.en.md) | Versioned high-level embedding API, managed lifecycle, mount paths, and artifact upgrade boundary. |
65
+ | [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. |
60
66
  | [KERNEL_HOST_API.md](KERNEL_HOST_API.md) | Chinese Kernel Host API guide. |
61
67
  | [PIPELINE.en.md](PIPELINE.en.md) | Runtime pipeline from trigger to dispatch, tools, audit, approval, and delivery. |
62
68
 
@@ -71,6 +77,7 @@ This directory contains public documentation for the open-source BailingHub proj
71
77
  | [SDK.en.md](SDK.en.md) | SDK guide for PHP, Node, Python, Java, Go, .NET, and any-language OpenAPI/HMAC integration. |
72
78
  | [CHANNELS.en.md](CHANNELS.en.md) | Inbound channel model and adapter expectations. |
73
79
  | [OPERATIONS.en.md](OPERATIONS.en.md) | Production topology, readiness, capacity, upgrades, backups, and recovery. |
80
+ | [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. |
74
81
  | [STREAMING.en.md](STREAMING.en.md) | Chat streaming protocol, reconnect behavior, canonical final result, and multi-replica boundary. |
75
82
  | [STREAMING.md](STREAMING.md) | Chinese chat streaming protocol. |
76
83
 
package/docs/README.md CHANGED
@@ -9,6 +9,11 @@
9
9
  | 文档 | 用途 |
10
10
  |---|---|
11
11
  | [IMPLEMENTATION_STATUS.md](IMPLEMENTATION_STATUS.md) · [English](IMPLEMENTATION_STATUS.en.md) | Core 能力归属、正式发行与主分支状态、公开证据和未覆盖范围。 |
12
+ | [RELEASE_NOTES_v0.9.3.md](RELEASE_NOTES_v0.9.3.md) · [English](RELEASE_NOTES_v0.9.3.en.md) | v0.9.3:有限收包、通知关闭与原通知死信重投,含维护指标。 |
13
+ | [UPGRADE_v0.9.3.md](UPGRADE_v0.9.3.md) · [English](UPGRADE_v0.9.3.en.md) | 067 显式迁移、配套 DLQ/state 仓储、回退 manifest 与标记保留。 |
14
+ | [RELEASE_NOTES_v0.9.2.md](RELEASE_NOTES_v0.9.2.md) · [English](RELEASE_NOTES_v0.9.2.en.md) | v0.9.2:安全安装、自动结算与原审批补续,含部署诊断与进程回归。 |
15
+ | [UPGRADE_v0.9.2.md](UPGRADE_v0.9.2.md) · [English](UPGRADE_v0.9.2.en.md) | 065/066显式迁移、配套仓储、原记录核对及回退限制。 |
16
+ | [CORE_RELIABILITY.md](CORE_RELIABILITY.md) · [English](CORE_RELIABILITY.en.md) | 安装凭据、结算/审批补续、有限收包、通知关闭/重投与合成验收边界。 |
12
17
  | [RELEASE_NOTES_v0.9.1.md](RELEASE_NOTES_v0.9.1.md) · [English](RELEASE_NOTES_v0.9.1.en.md) | v0.9.1:异步 usage 关闭修复、公开能力索引与通用安全治理。 |
13
18
  | [UPGRADE_v0.9.1.md](UPGRADE_v0.9.1.md) · [English](UPGRADE_v0.9.1.en.md) | 0.9.0 补丁升级、原请求核对、制品 manifest 与关闭验收;无新增 SQL/API。 |
14
19
  | [RELEASE_NOTES_v0.9.0.md](RELEASE_NOTES_v0.9.0.md) · [English](RELEASE_NOTES_v0.9.0.en.md) | v0.9.0:可选模型计费、统一套餐额度与文生图工具。 |
@@ -64,6 +69,7 @@
64
69
  | [ARCHITECTURE.md](ARCHITECTURE.md) | 当前架构的主说明:分层、核心运行链路、解耦边界和扩展方向。 |
65
70
  | [ARCHITECTURE.en.md](ARCHITECTURE.en.md) | English architecture overview. |
66
71
  | [KERNEL_HOST_API.md](KERNEL_HOST_API.md) | 完整 Core 的版本化高层嵌入 API、托管生命周期和升级边界。 |
72
+ | [MODEL_PROCESS_RECOVERY.md](MODEL_PROCESS_RECOVERY.md) · [English](MODEL_PROCESS_RECOVERY.en.md) | 当前源码的 opt-in 进程崩溃/确认丢失回归;不回写历史 Tag 验证。 |
67
73
  | [KERNEL_HOST_API.en.md](KERNEL_HOST_API.en.md) | English versioned Kernel Host API and lifecycle boundary. |
68
74
  | [PIPELINE.md](PIPELINE.md) | 一次任务从入口到执行、审计、送达的流水线。 |
69
75
  | [PIPELINE.en.md](PIPELINE.en.md) | English runtime pipeline. |
@@ -83,6 +89,7 @@
83
89
  | [CHANNELS.md](CHANNELS.md) | 入站渠道模型,当前包含企微接入。 |
84
90
  | [CHANNELS.en.md](CHANNELS.en.md) | English inbound channel model. |
85
91
  | [OPERATIONS.md](OPERATIONS.md) | 生产部署、多副本、健康检查、容量、备份与恢复。 |
92
+ | [DEPLOYMENT_DIAGNOSTICS.md](DEPLOYMENT_DIAGNOSTICS.md) · [English](DEPLOYMENT_DIAGNOSTICS.en.md) | 只读部署 doctor:公开身份核对、显式 readiness、未知与未检查状态及机器退出码。 |
86
93
  | [OPERATIONS.en.md](OPERATIONS.en.md) | English production operations guide. |
87
94
  | [STREAMING.md](STREAMING.md) | 网页聊天的真实增量输出协议:SSE 事件、断线重放、权威结果和多副本边界。 |
88
95
  | [STREAMING.en.md](STREAMING.en.md) | English chat streaming protocol and operations boundary. |
@@ -0,0 +1,45 @@
1
+ # v0.9.2: secure installation and persisted continuation
2
+
3
+ [简体中文](RELEASE_NOTES_v0.9.2.md)
4
+
5
+ Version date: 2026-10-13. A patch update from public Core 0.9.1.
6
+
7
+ A model result has returned, but settlement remains pending. An approval is recorded, but a temporary failure leaves the original job outside the queue. BailingHub 0.9.2 continues checking and recovering these persisted records without waiting for another request, and fixes credential generation when secure randomness fails during installation.
8
+
9
+ ## Fixes
10
+
11
+ ### Stop installation when secure randomness fails
12
+
13
+ When creating configuration, the installer generates its six default credentials independently through secure randomness. Missing OpenSSL, a failed producer or invalid output stops installation before writing a partial `.env` or starting services. Existing `.env` files are preserved, including changed administrator passwords. Operators need a working OpenSSL implementation; timestamps and digests are not randomness substitutes.
14
+
15
+ ### Advance asynchronous settlement without traffic
16
+
17
+ Reconciliation previously depended on requests. standalone now schedules an initial pass and subsequent passes every minute; managed Kernels use their first and subsequent existing `tick()` calls. Pages contain at most 50 records, advance by cursor and wrap at the end. Unpriceable or individually corrupt records no longer repeatedly occupy the first page and block later records.
18
+
19
+ Reconciliation uses the original request's saved metering, reference prices and unified multiplier. It does not read generated bodies, contact providers or redispatch models. Missing authoritative metering remains pending/unknown, rather than becoming an invented zero charge. Work for one owner shares an active pass, with database-failure backoff. Shutdown stops new maintenance and waits for started evidence writes; a timeout retains work for same-instance retry.
20
+
21
+ ### Persist continuation for the original approval decision
22
+
23
+ External callbacks and the console save the decision and continuation record in one transaction. Retrying the original `decision_id` can recover temporary auditing or queue failures; background maintenance also advances unfinished continuations. A saved decision whose continuation fails returns `503` and `decision_recorded=true / continuation_pending=true`. Do not create another approval for recovery.
24
+
25
+ Original-job queue admission and the decision marker are written atomically, with consumed-approval checks repeated inside the admission critical section. Lost queue acknowledgements, process reopening and completed subsequent runs cannot admit the job again for the same decision. Consumed approvals are not requeued; historical decisions without new continuation records are not backfilled. Denials only complete auditing. Direct Agent invocations still require the original Agent to explicitly resume the original `invocation_id`; approval does not start a Core model loop.
26
+
27
+ ## Additional diagnostics and public regressions
28
+
29
+ `npm run doctor -- --deployment --url <Core URL>` adds read-only deployment diagnostics. By default it checks `/health`, `/version` and local artifact identity. Only explicit `--readiness` asks the server to check its database and migration ledger. Diagnostics perform no upgrade, rollback or migration. Matching declarations do not establish artifact integrity, actual database identity or deployment acceptance; see [scope and exit codes](DEPLOYMENT_DIAGNOSTICS.en.md).
30
+
31
+ This release also ships actual child-process `SIGKILL` and lost MySQL COMMIT-acknowledgement model recovery regressions for the first time. They validate existing original-request recovery and settlement semantics, adding test coverage rather than automatic redispatch behavior. Approval acceptance also covers recovery in another PID, lost acknowledgements and concurrent continuation. See [model process recovery regressions](MODEL_PROCESS_RECOVERY.en.md) and [Core reliability regressions](CORE_RELIABILITY.en.md).
32
+
33
+ ## Who should upgrade
34
+
35
+ - **Core operators** using the installer, model billing or external/console approvals should upgrade and apply 065/066. Preserve configuration, databases, original requests and rollback artifacts first.
36
+ - **Embedded and custom-adapter developers** retain fair `tick()` calls and `close(drainMs)`, and supply matching continuation ledger methods plus `RuntimeStateStore.requeueApprovedJobOnce`. New decisions are explicitly unavailable without these implementations; they do not fall back to the old unrecoverable queue path.
37
+ - **Business-backend and client integrators** retain existing declarations, signature verification and final authorization. Approval retries retain the original decision identifier; result recovery retains the original invocation identifier. MCP / Agent Client SDK 0.7.0 and DSH 0.7.0 remain unchanged. ACC, independent Hosts and clients release separately and are not part of this Core patch.
38
+
39
+ ## Upgrade and verify
40
+
41
+ Relative to 0.9.1, this release adds `065_usage_reconciliation_scan.sql` and `066_approval_continuations.sql`. Apply all outstanding files through `npm run db:init` or the official explicit Kernel migration port. Runtime startup does not migrate automatically. Coordinate old writers and verify migration plus adapter support before starting the new version. The [upgrade guide](UPGRADE_v0.9.2.en.md) covers preserved data, original-ID checks, diagnostics and rollback.
42
+
43
+ After verifying artifact identity, migration ledger and health, check settlement without traffic, approval failure recovery and close draining in a dedicated test environment. Public regressions use isolated databases and synthetic providers; they do not establish live-provider or production business acceptance. Queue admission deduplication does not guarantee exactly-once external business effects.
44
+
45
+ [Upgrade guide](UPGRADE_v0.9.2.en.md) · [Full changelog](CHANGELOG.en.md) · [Capability and evidence index](IMPLEMENTATION_STATUS.en.md) · [Previous release](RELEASE_NOTES_v0.9.1.en.md)