@plumbus/core 0.8.0-beta.1 → 0.8.0-beta.4
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.
- package/CHANGELOG.md +27 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/ai/ai/provider.d.ts +2 -0
- package/dist/ai/ai-service.d.ts +35 -0
- package/dist/ai/ai-service.d.ts.map +1 -1
- package/dist/ai/ai-service.js +132 -13
- package/dist/ai/ai-service.js.map +1 -1
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/provider.d.ts +2 -0
- package/dist/ai/provider.d.ts.map +1 -1
- package/dist/ai/provider.js +5 -0
- package/dist/ai/provider.js.map +1 -1
- package/dist/approvals/index.d.ts +1 -1
- package/dist/approvals/index.d.ts.map +1 -1
- package/dist/approvals/index.js.map +1 -1
- package/dist/approvals/memory-store.d.ts.map +1 -1
- package/dist/approvals/memory-store.js +22 -0
- package/dist/approvals/memory-store.js.map +1 -1
- package/dist/approvals/schema.d.ts +34 -0
- package/dist/approvals/schema.d.ts.map +1 -1
- package/dist/approvals/schema.js +2 -0
- package/dist/approvals/schema.js.map +1 -1
- package/dist/approvals/service.d.ts.map +1 -1
- package/dist/approvals/service.js +36 -0
- package/dist/approvals/service.js.map +1 -1
- package/dist/approvals/sql-store.d.ts.map +1 -1
- package/dist/approvals/sql-store.js +42 -1
- package/dist/approvals/sql-store.js.map +1 -1
- package/dist/approvals/types.d.ts +11 -0
- package/dist/approvals/types.d.ts.map +1 -1
- package/dist/approvals/types.js +1 -0
- package/dist/approvals/types.js.map +1 -1
- package/dist/audit/service.d.ts.map +1 -1
- package/dist/audit/service.js +16 -1
- package/dist/audit/service.js.map +1 -1
- package/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/dev.js +5 -0
- package/dist/cli/commands/dev.js.map +1 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +7 -0
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/durable/index.d.ts +2 -2
- package/dist/durable/index.d.ts.map +1 -1
- package/dist/durable/index.js +2 -2
- package/dist/durable/index.js.map +1 -1
- package/dist/durable/postgres-persist.d.ts +47 -2
- package/dist/durable/postgres-persist.d.ts.map +1 -1
- package/dist/durable/postgres-persist.js +152 -6
- package/dist/durable/postgres-persist.js.map +1 -1
- package/dist/durable/spine-claim.d.ts +22 -1
- package/dist/durable/spine-claim.d.ts.map +1 -1
- package/dist/durable/spine-claim.js +54 -3
- package/dist/durable/spine-claim.js.map +1 -1
- package/dist/events/dispatcher.d.ts +11 -0
- package/dist/events/dispatcher.d.ts.map +1 -1
- package/dist/events/dispatcher.js +28 -12
- package/dist/events/dispatcher.js.map +1 -1
- package/dist/events/worker.d.ts.map +1 -1
- package/dist/events/worker.js +1 -3
- package/dist/events/worker.js.map +1 -1
- package/dist/execution/capability-executor.d.ts.map +1 -1
- package/dist/execution/capability-executor.js +24 -0
- package/dist/execution/capability-executor.js.map +1 -1
- package/dist/execution/context-factory.d.ts.map +1 -1
- package/dist/execution/context-factory.js +6 -1
- package/dist/execution/context-factory.js.map +1 -1
- package/dist/execution/deferred-flow-service.d.ts.map +1 -1
- package/dist/execution/deferred-flow-service.js +7 -0
- package/dist/execution/deferred-flow-service.js.map +1 -1
- package/dist/flows/dead-letter.d.ts +18 -1
- package/dist/flows/dead-letter.d.ts.map +1 -1
- package/dist/flows/dead-letter.js +17 -1
- package/dist/flows/dead-letter.js.map +1 -1
- package/dist/flows/engine.d.ts +16 -1
- package/dist/flows/engine.d.ts.map +1 -1
- package/dist/flows/engine.js +216 -29
- package/dist/flows/engine.js.map +1 -1
- package/dist/flows/flow-service.d.ts.map +1 -1
- package/dist/flows/flow-service.js +3 -0
- package/dist/flows/flow-service.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime/bootstrap.d.ts +16 -1
- package/dist/runtime/bootstrap.d.ts.map +1 -1
- package/dist/runtime/bootstrap.js +7 -1
- package/dist/runtime/bootstrap.js.map +1 -1
- package/dist/runtime/load-extensions.d.ts.map +1 -1
- package/dist/runtime/load-extensions.js +41 -0
- package/dist/runtime/load-extensions.js.map +1 -1
- package/dist/runtime/start-worker-pool.d.ts.map +1 -1
- package/dist/runtime/start-worker-pool.js +34 -15
- package/dist/runtime/start-worker-pool.js.map +1 -1
- package/dist/server/bootstrap.d.ts +21 -0
- package/dist/server/bootstrap.d.ts.map +1 -1
- package/dist/server/bootstrap.js +52 -4
- package/dist/server/bootstrap.js.map +1 -1
- package/dist/testing/context.d.ts.map +1 -1
- package/dist/testing/context.js +1 -0
- package/dist/testing/context.js.map +1 -1
- package/dist/types/context.d.ts +3 -0
- package/dist/types/context.d.ts.map +1 -1
- package/dist/worker/bootstrap.d.ts +10 -0
- package/dist/worker/bootstrap.d.ts.map +1 -1
- package/dist/worker/bootstrap.js +32 -9
- package/dist/worker/bootstrap.js.map +1 -1
- package/instructions/ai.md +14 -0
- package/instructions/flows.md +6 -0
- package/instructions/framework.md +3 -0
- package/migrations/durable-tenant/0002_approval_cancellation.sql +3 -0
- package/migrations/durable-tenant/meta/_journal.json +7 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @plumbus/core changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.0-beta.4 — 2026-09-17
|
|
4
|
+
|
|
5
|
+
Repository tag `v0.8.0-beta.3` already pointed at the format-only commit and no `0.8.0-beta.3` package was published, so this increment is `beta.4`.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Approval request cancellation.** `ApprovalService.cancel({ requestId, auth, reason })` withdraws a still-pending request after human-actor and host-authorization revalidation, records cancellation actor/reason evidence, and atomically cancels linked open/claimed human tasks without creating an approval decision. Durable tenant migration `0002_approval_cancellation.sql` adds the evidence columns. Docs: [Approvals](../../docs/core-concepts/approvals.md).
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **Tenant flow heartbeats extend the authoritative spine hint.** A long-running tenant-placed step now extends its guarded `opaque_dispatch` lease before extending the tenant `flow_executions` lease. A stale worker cannot extend or acknowledge a hint owned by a peer, so a healthy step is not re-dispatched when the original spine lease duration elapses.
|
|
14
|
+
- **Flow retry policies now schedule their declared backoff.** A failed step with retries remaining moves to `waiting`, releases its lease, and is claimable only at its computed fixed/exponential `wakeAt`. Tenant-placed flows persist `retry-scheduled` execution state, a retry wait, and a future-dated dispatch outbox row in one tenant transaction before acknowledging the inbound spine hint.
|
|
15
|
+
- **Dispatch outbox and execution state use the framework schema.** The event pump and durable writers resolve `dispatch_outbox` / `execution_state` as `frameworkSchema ?? PLUMBUS_FRAMEWORK_SCHEMA ?? FRAMEWORK_SCHEMA` and no longer qualify those tables by the plane handle's `coreSchema` (that name is for tenant entity tables). Server and worker bootstraps pass `frameworkSchema` through to the engine and pump. Audit metadata with NUL bytes is named instead of rejected by jsonb.
|
|
16
|
+
|
|
17
|
+
## 0.8.0-beta.2 — 2026-09-16
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- **Host data-plane resolver exports.** `app/server.ts` may export `dataPlaneResolver`, `listTenantRefs`, `untenantedDataPlane`, `requestDataPlane`, `workerDataPlane` and `resolveTenantRef`; `plumbus dev` / `start` / `worker` pass them to `createServer` and the worker pool. Request-side flow engines then carry `spineDispatch`, so a flow started by a request is written to the tenant plane with an opaque hint on the control plane. `untenantedDataPlane: 'control-plane'` (`FlowSpineDispatchConfig.untenanted`) lets flows with no tenant stay classic spine rows claimed beside the tenant hints (default `'refuse'`); `requestDataPlane: 'control-plane'` keeps request repositories on the boot connection and `workerDataPlane: 'control-plane'` does the same for claimed units (`WorkerPoolConfig.unitDataPlane`; both default to `'resolved'`). Under `'resolved'`, a `tenantScoped: false` capability reads the control plane even for a tenant-bound request. A host that supplies a resolver must not also supply `createDataService`. `retryDeadLetteredFlow` takes an optional `placement` (`{ spineDb, coreSchema? }`) that reopens a tenant-placed execution and publishes a fresh spine hint (`republished` on the result). A host enabling spine dispatch needs the framework's `opaque_dispatch` table on its control plane (`migrations/spine/0000_opaque_dispatch.sql`) and the `core_plumbus` durable tables on each tenant plane. Docs: [Tenant data planes](../../docs/sdk-reference/tenant-data-planes.md).
|
|
22
|
+
- **AI provider admission and trace propagation.** `ServerConfig` (and `app/server.ts` exports, honoured by `dev` / `start` / `worker`) accept `aiProviderConcurrency`, `resolveAIProviderHeaders` and `onAIProviderSpan`; `createAIService` takes the same as `providerConcurrency`, `resolveProviderHeaders` and `onProviderSpan`. The concurrency ceiling is an immediate per-scope admission shared by every identity-bound service — default scope provider + tenant + `costContext.serviceArea`, `resolveScope` overrides it — and saturation throws a `PlumbusError('conflict')` with `failureCode` / `reason` `ai-provider-concurrency-exhausted` and `retryAfterSeconds: 1` instead of queueing. `resolveAIProviderHeaders` runs before every real provider attempt (validation retries and streams included) and its result reaches the adapter as `ProviderRequest.transportHeaders`; `authorization`, `proxy-authorization`, `x-api-key`, `api-key` and `content-type` are reserved and refused. `onAIProviderSpan` receives the completed client span (`AIProviderSpan`: provider, operation, tenant, actor, correlation id, cost context, `startedAt`, `durationMs`, `status`, `traceparent`, `errorType`) and is best effort — hook failures never change the model-call result. `AIService.withContext` accepts `correlationId`, and flow workers bind the persisted flow correlation id so one trace spans request → flow → provider. New exports: `AIProviderCallContext`, `AIProviderConcurrencyConfig`, `AIProviderOperation`, `AIProviderSpan`. Docs: [AI integration](../../docs/ai/ai-integration.md).
|
|
23
|
+
- **`ctx.flows.terminate(executionId)`.** `FlowService` now exposes the engine's `terminate`: it aborts the active step and closes the execution as `cancelled` without running compensations, where `cancel` runs every declared compensation for completed steps. Docs: [Flows — cancellation](../../docs/core-concepts/flows.md).
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- **Event dispatch audit outcomes are valid.** The dispatcher and the event worker recorded `pending` / `retry` / `dead_lettered` / `skipped` as audit outcomes, which `createAuditService` refuses, so with a real audit service every dispatch attempt threw and one plane's rejected poll escaped the timer and ended the worker process. `event.dispatch.attempt`, `event.consumer.attempt` and `event.consumer.skipped` now carry no outcome; `event.dispatch.failed` and `event.consumer.dead_lettered` are `failure` (the former adds `disposition: retry | dead_lettered`). A failing plane's outbox poll is contained and the other planes keep being polled.
|
|
28
|
+
- **Spine hint lifecycle under a data-plane resolver.** The outbox pump publishes only never-published rows (it re-readied every unacknowledged row on each poll, clearing live leases); acknowledged hints close their outbox rows; the follow-up hint between drained steps is published under the running worker's lease; a claim drops the hint of a terminal row instead of reviving it; `engine.cancel` and the runner's failure finaliser close the durable state of a tenant-placed execution; and a hint whose plane fails to resolve is dead-lettered after `FlowSpineDispatchConfig.maxClaimAttempts` (default 10) claims with `privacy_safe_failure_category_id = 'plane-unresolved'` instead of being re-leased forever.
|
|
29
|
+
|
|
3
30
|
## 0.8.0-beta.1 — 2026-09-11
|
|
4
31
|
|
|
5
32
|
### Changed
|