@fabricorg/platform-host 2.0.0 → 3.0.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.
- package/CHANGELOG.md +35 -8
- package/MIGRATION-2-IDEMPOTENCY.md +32 -0
- package/README.md +36 -7
- package/dist/index.cjs +295 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +94 -8
- package/dist/index.d.ts +94 -8
- package/dist/index.js +292 -32
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,43 @@
|
|
|
1
1
|
# @fabricorg/platform-host
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Deliver Phase 1 correctness and contracts: payload-bound idempotency with staged enforcement,
|
|
8
|
+
capture/replay authority evidence, bounded invocation provenance, capability execution and view usage
|
|
9
|
+
semantics, event-schema compatibility classification, and deterministic conformance plans.
|
|
10
|
+
- Default payload-bound conflicts to enforcement in Host 3 and return existing nonterminal invocations
|
|
11
|
+
without redispatch; dispatcher deployments must use the documented store-backed recovery worker.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
- @fabricorg/platform@0.12.0
|
|
17
|
+
|
|
18
|
+
## 2.0.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Close final uplift audit gaps: align Host 2.x documentation and migration evidence, surface every
|
|
23
|
+
compiler/generator API to LLM consumers, make memory outbox egress directly usable, sanitize relay
|
|
24
|
+
failures, validate complete archetype state maps, support recursive JSON Schema generation, reject
|
|
25
|
+
cross-platform path traversal, synchronize artifact version stamps, and include package licenses.
|
|
26
|
+
- Require explicit domain snapshot/restore support before memory stores advertise atomic outbox
|
|
27
|
+
transactions, buffer Host lifecycle commits until success, fail missing transaction capabilities
|
|
28
|
+
before handlers run, sanitize relay failures, and exclude sensitive Host lifecycle events from bus
|
|
29
|
+
egress by default.
|
|
30
|
+
- Prevalidate buffered memory transactions so failed commits cannot append partial event or outbox rows.
|
|
31
|
+
- Qualify result-validation rollback documentation by the configured domain transaction provider.
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
- @fabricorg/platform@0.11.1
|
|
34
|
+
|
|
3
35
|
## 2.0.0
|
|
4
36
|
|
|
5
|
-
###
|
|
37
|
+
### Major Changes
|
|
6
38
|
|
|
39
|
+
- Require `@fabricorg/platform@^0.11.0` and its manifest v2/result-schema contract. Applications
|
|
40
|
+
upgrading from Host 1.x must upgrade Platform in the same deployment and regenerate manifest consumers.
|
|
7
41
|
- Add the optional durable event outbox, PostgreSQL and memory adapters, and at-least-once relay.
|
|
8
42
|
- Add manifest v2 typed entity contracts, v1 reader normalization, optional action result schemas, and
|
|
9
43
|
Host enforcement of result validation before events and adapters.
|
|
@@ -14,13 +48,6 @@
|
|
|
14
48
|
- Updated dependencies
|
|
15
49
|
- @fabricorg/platform@0.11.0
|
|
16
50
|
|
|
17
|
-
## Unreleased
|
|
18
|
-
|
|
19
|
-
- Validate optional action result schemas immediately after handler execution and before events or
|
|
20
|
-
adapters. Invalid results roll back the handler transaction and persist a sanitized failure.
|
|
21
|
-
- Add optional memory and PostgreSQL outbox capabilities with atomic canonical-event records,
|
|
22
|
-
lease-based at-least-once relay, retry, replay, and dead-letter state.
|
|
23
|
-
|
|
24
51
|
## 1.0.0
|
|
25
52
|
|
|
26
53
|
### Minor Changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Payload-bound idempotency rollout
|
|
2
|
+
|
|
3
|
+
`ensureSchema()` adds nullable parameter-digest, actor/binding, provenance, authority, and reconciliation
|
|
4
|
+
columns. Existing rows remain valid. New idempotent submissions always record
|
|
5
|
+
`fabric-canonical-json-sha256-v1`.
|
|
6
|
+
|
|
7
|
+
1. Before adopting Host 3's enforcement default, deploy with `conflictMode: "audit-only"` and capture `onConflict`/`onLegacyRecord` metrics.
|
|
8
|
+
2. Soak until modified-payload key reuse has been removed from callers.
|
|
9
|
+
3. Opt selected applications into `conflictMode: "enforce"`; the same key with different command
|
|
10
|
+
identity now throws `IDEMPOTENCY_CONFLICT`.
|
|
11
|
+
4. Remove the override after upgrading to Host 3; enforcement is its default.
|
|
12
|
+
|
|
13
|
+
Rollback to audit-only is configuration-only. Do not drop digest columns during rollback; they are
|
|
14
|
+
additive evidence and permit enforcement to resume without rebuilding history. Legacy null-digest rows
|
|
15
|
+
continue old-key payload recovery because their original payload identity cannot be reconstructed safely.
|
|
16
|
+
Host 3 still rejects actor, authority-binding, and action-version conflicts for those rows; review these
|
|
17
|
+
identities during the audit-only soak before enabling enforcement.
|
|
18
|
+
|
|
19
|
+
The additive `reconciliation_required` action status is terminal in Phase 1 and requires an operator-
|
|
20
|
+
owned reconciliation path; exhaustive `ActionStatus` consumers must handle it. Custom stores must
|
|
21
|
+
persist the widened invocation fields, including `parameterDigest`, actor/authority binding, provenance,
|
|
22
|
+
and `authorizationReconciliation`. A store that drops them cannot claim payload-bound enforcement or
|
|
23
|
+
durable reconciliation evidence.
|
|
24
|
+
|
|
25
|
+
An action-version change is part of command identity. A retry using a key first recorded under a prior
|
|
26
|
+
action version is reported in audit-only mode and rejected in enforce mode; drain or retain the prior
|
|
27
|
+
action version for the retry window before deploying a breaking action revision.
|
|
28
|
+
|
|
29
|
+
Duplicate submission now returns an existing nonterminal invocation without redispatching it, which
|
|
30
|
+
prevents concurrent callers from driving the same mutation twice. Production asynchronous deployments
|
|
31
|
+
must run the store-backed worker/recovery loop; a dispatcher-only deployment cannot use client retry as
|
|
32
|
+
recovery for a crash between durable creation and dispatch.
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
The canonical host for the `@fabricorg/platform` mutation pipeline.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
pnpm add @fabricorg/platform@^0.
|
|
6
|
+
pnpm add @fabricorg/platform@^0.12.0 @fabricorg/platform-host@^3.0.0
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
## AI agent integration boundary
|
|
@@ -15,7 +15,7 @@ registration, and submit stable idempotent commands. The gateway derives tenant
|
|
|
15
15
|
calls `submitAction()`; an agent must never call handlers, adapters, workflow internals, or database
|
|
16
16
|
writes directly.
|
|
17
17
|
|
|
18
|
-
See the [Platform Host
|
|
18
|
+
See the [Platform Host 3.x agent integration
|
|
19
19
|
guide](https://platform.fabric.pro/docs/platform/reference/platform-host) for application wiring,
|
|
20
20
|
execution-time authorization, the PostgreSQL transaction binder, recovery semantics, and the external
|
|
21
21
|
gateway contract.
|
|
@@ -45,6 +45,12 @@ bounded batches with an atomic lease and `FOR UPDATE SKIP LOCKED`, and an expire
|
|
|
45
45
|
recoverable after interruption. Pass a stable `idempotencyKey` to `submitAction()` so retries resolve
|
|
46
46
|
to the original tenant-scoped invocation instead of creating another mutation.
|
|
47
47
|
|
|
48
|
+
New rows bind that key to the action version, actor/authority binding, and a versioned canonical
|
|
49
|
+
parameter digest. Host 3 defaults to `enforce`, which throws `IdempotencyConflictError`; configure
|
|
50
|
+
`idempotency.conflictMode` as `audit-only` for a preflight soak. Legacy null-digest rows skip only the
|
|
51
|
+
parameter comparison and call `onLegacyRecord`; actor, authority-binding, and action-version mismatches
|
|
52
|
+
still reject in enforce mode. See `MIGRATION-2-IDEMPOTENCY.md`.
|
|
53
|
+
|
|
48
54
|
Lifecycle records use deterministic checkpoint ids. Recovered idempotent actions do not repeat an
|
|
49
55
|
adapter that already reached `succeeded`, and event, policy, and adapter writes are append-safe. A
|
|
50
56
|
stale action that was not declared idempotent fails terminally for manual reconciliation instead of
|
|
@@ -58,6 +64,20 @@ schema-parsed durable parameters, canonical invocation, opaque `authorizationBin
|
|
|
58
64
|
`executionReason` of `initial`, `approval_resume`, or `recovery` immediately before policies and
|
|
59
65
|
mutation code run.
|
|
60
66
|
|
|
67
|
+
`offline_replay` is the extensible evidence value for disconnected commands. Actions with execution
|
|
68
|
+
semantics can declare whether capture, execution, or both govern authority. A denied governed replay
|
|
69
|
+
returns structured `reconciliation_required` evidence.
|
|
70
|
+
|
|
71
|
+
For `execution` and `both`, the Host rejects an expired `AuthorizationBinding` before calling mutation
|
|
72
|
+
code and returns `authorization_expired` reconciliation evidence. `resourceScope` remains an opaque,
|
|
73
|
+
audit-safe scope identifier; the application-owned `authorizeExecution` implementation resolves and
|
|
74
|
+
checks it against current resource state.
|
|
75
|
+
|
|
76
|
+
`InvocationProvenance` carries namespaced trace and audit attributes. Durable audit attributes fail
|
|
77
|
+
closed when no allowlist is configured, pass through `redactAuditAttributes`, and remain bounded.
|
|
78
|
+
Trace attributes go only to the configured trace callback. Restricted outbox payloads omit provenance
|
|
79
|
+
by default; `outbox.includeProvenance` is the explicit classification-aware override.
|
|
80
|
+
|
|
61
81
|
```ts
|
|
62
82
|
const host = createGovernedActionHost({
|
|
63
83
|
store,
|
|
@@ -101,10 +121,11 @@ Stores without this additive capability retain the legacy boundary for compatibi
|
|
|
101
121
|
claim atomic domain-write/event persistence.
|
|
102
122
|
|
|
103
123
|
Actions can optionally declare `resultSchema`. The Host validates public handler result data after
|
|
104
|
-
the handler and before canonical event append or adapter execution. Invalid results
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
through an
|
|
124
|
+
the handler and before canonical event append or adapter execution. Invalid results fail the invocation,
|
|
125
|
+
emit no domain/completion event, invoke no adapter, and persist only a sanitized validation failure.
|
|
126
|
+
Domain writes roll back only when the configured store transaction provider includes those writes.
|
|
127
|
+
This validates the handler result contract; it does not observe arbitrary writes through an
|
|
128
|
+
application-owned `TDb`.
|
|
108
129
|
|
|
109
130
|
## Agent HITL
|
|
110
131
|
|
|
@@ -177,7 +198,7 @@ explain which contract and provider adapter governed a mutation after dependenci
|
|
|
177
198
|
const host = createGovernedActionHost({
|
|
178
199
|
// ...
|
|
179
200
|
runtimeEvidence: {
|
|
180
|
-
hostPackageVersion: "
|
|
201
|
+
hostPackageVersion: "3.0.0",
|
|
181
202
|
policyRulesetVersion: "gtm-rules.v8",
|
|
182
203
|
providerBridge: { name: "@fabric-harness/databricks", version: "1" },
|
|
183
204
|
},
|
|
@@ -196,3 +217,11 @@ the proven event transaction. `runOutboxRelayCycle()` leases and publishes recor
|
|
|
196
217
|
and dead-letter handling. Delivery is at least once: consumers deduplicate on immutable
|
|
197
218
|
`eventId`. Payload classification is metadata, not a redaction mechanism; event payloads must
|
|
198
219
|
already be audit-safe.
|
|
220
|
+
|
|
221
|
+
Adapter and compliance lifecycle events remain canonical but are excluded from bus egress by default.
|
|
222
|
+
Use `shouldPublish` to opt them in only when the application has made their payloads safe for that bus.
|
|
223
|
+
|
|
224
|
+
For deterministic local tests, `MemoryPlatformHostStore` enables governed Host outbox egress only
|
|
225
|
+
when its constructor receives a `MemoryPlatformHostTransactionProvider` with domain `snapshot` and
|
|
226
|
+
`restore` functions. Without that explicit rollback seam, `transactionalOutbox` is false and Host
|
|
227
|
+
construction rejects outbox configuration. PostgreSQL remains the production implementation.
|