@fabricorg/platform-host 0.5.1 → 0.6.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @fabricorg/platform-host
2
2
 
3
+ ## 0.6.0
4
+
5
+ - Persist governance, Host, provider-bridge, package, and policy-ruleset generations with every new invocation.
6
+ - Add PostgreSQL `runtime_evidence` migration and in-memory/PostgreSQL conformance coverage.
7
+ - Run the shared external-mutation fixture used by the .NET parity suite.
8
+
3
9
  ## 0.5.1 — 2026-07-20
4
10
 
5
11
  - Include the audit-safe, redacted adapter input in execution-attestation extraction so integrations can identify external resources even when provider responses are minimal.
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.7.0 @fabricorg/platform-host@^0.4.1
6
+ pnpm add @fabricorg/platform@^0.9.0 @fabricorg/platform-host@^0.6.0
7
7
  ```
8
8
 
9
9
  Vertical packages register `FabricModule` definitions. Host applications provide tenant authorization,
@@ -98,6 +98,22 @@ The built-in stores persist footprints, delegation, obligations, attestations, a
98
98
  observations. Provider-specific authentication and clients do not belong here. For Databricks, use
99
99
  the optional Platform integration exported by `@fabric-harness/databricks`.
100
100
 
101
+ Every newly submitted invocation also records `runtimeEvidence`. The host always supplies the
102
+ portable governance and host contract generations; applications should add the deployed host
103
+ package version, policy ruleset version, and provider bridge identity. This makes an audit record
104
+ explain which contract and provider adapter governed a mutation after dependencies have moved on.
105
+
106
+ ```ts
107
+ const host = createGovernedActionHost({
108
+ // ...
109
+ runtimeEvidence: {
110
+ hostPackageVersion: "0.6.0",
111
+ policyRulesetVersion: "gtm-rules.v8",
112
+ providerBridge: { name: "@fabric-harness/databricks", version: "1" },
113
+ },
114
+ });
115
+ ```
116
+
101
117
  `MemoryPlatformHostStore` is for tests and local demos. Production control planes use
102
118
  `PostgresPlatformHostStore` with Databricks Lakebase (or standard Postgres), call
103
119
  `ensureSchema()` at startup, and hydrate projections from `listEvents()`.
package/dist/index.cjs CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  var platform = require('@fabricorg/platform');
4
4
 
5
+ // src/host.ts
6
+
7
+ // src/types.ts
8
+ var PLATFORM_HOST_CONTRACT_VERSION = 1;
9
+
5
10
  // src/host.ts
6
11
  var DEFAULT_EXTRACT_EVENTS = (data) => {
7
12
  const value = data._events;
@@ -27,6 +32,12 @@ function createGovernedActionHost(options) {
27
32
  const actionInvocationId = platform.createFabricId("act");
28
33
  const correlationId = input.correlationId ?? platform.createFabricId("corr");
29
34
  const durableParameters = options.redactActionParameters ? options.redactActionParameters(input.actionId, input.parameters) : input.parameters;
35
+ const runtimeEvidence = {
36
+ governanceContractVersion: platform.FABRIC_GOVERNANCE_CONTRACT_VERSION,
37
+ hostContractVersion: PLATFORM_HOST_CONTRACT_VERSION,
38
+ ...options.runtimeEvidence
39
+ };
40
+ platform.assertGovernanceRuntimeEvidence(runtimeEvidence);
30
41
  const durableInvocation = await options.store.createActionInvocation({
31
42
  id: actionInvocationId,
32
43
  tenantId: input.tenantId,
@@ -38,6 +49,7 @@ function createGovernedActionHost(options) {
38
49
  status: "pending",
39
50
  parameters: durableParameters,
40
51
  result: {},
52
+ runtimeEvidence,
41
53
  correlationId,
42
54
  ...input.causationId ? { causationId: input.causationId } : {},
43
55
  ...input.idempotencyKey ? { idempotencyKey: input.idempotencyKey } : {}
@@ -873,7 +885,7 @@ var PostgresPlatformHostStore = class {
873
885
  attempt_count integer NOT NULL DEFAULT 0, lease_owner text,
874
886
  lease_expires_at timestamptz, hitl_route text, hitl_risk_tier text,
875
887
  hitl_reason text, hitl_policy_version text, approval_decision jsonb,
876
- mutation_footprint jsonb, execution_principal jsonb,
888
+ mutation_footprint jsonb, execution_principal jsonb, runtime_evidence jsonb,
877
889
  created_at timestamptz NOT NULL, updated_at timestamptz NOT NULL
878
890
  );
879
891
  ALTER TABLE fabric_platform.action_invocations
@@ -887,7 +899,8 @@ var PostgresPlatformHostStore = class {
887
899
  ADD COLUMN IF NOT EXISTS hitl_policy_version text,
888
900
  ADD COLUMN IF NOT EXISTS approval_decision jsonb,
889
901
  ADD COLUMN IF NOT EXISTS mutation_footprint jsonb,
890
- ADD COLUMN IF NOT EXISTS execution_principal jsonb;
902
+ ADD COLUMN IF NOT EXISTS execution_principal jsonb,
903
+ ADD COLUMN IF NOT EXISTS runtime_evidence jsonb;
891
904
  CREATE UNIQUE INDEX IF NOT EXISTS action_invocations_idempotency_idx
892
905
  ON fabric_platform.action_invocations
893
906
  (tenant_id, space_id, action_id, idempotency_key)
@@ -951,8 +964,8 @@ var PostgresPlatformHostStore = class {
951
964
  const result = await this.sql.query(
952
965
  `INSERT INTO fabric_platform.action_invocations
953
966
  (id,tenant_id,space_id,action_id,action_version,actor_id,actor_type,status,
954
- parameters,result,correlation_id,causation_id,idempotency_key,error,created_at,updated_at)
955
- VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9::jsonb,$10::jsonb,$11,$12,$13,$14,$15,$15)
967
+ parameters,result,correlation_id,causation_id,idempotency_key,error,runtime_evidence,created_at,updated_at)
968
+ VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9::jsonb,$10::jsonb,$11,$12,$13,$14,$15::jsonb,$16,$16)
956
969
  ON CONFLICT (tenant_id,space_id,action_id,idempotency_key)
957
970
  WHERE idempotency_key IS NOT NULL DO UPDATE SET id=fabric_platform.action_invocations.id
958
971
  RETURNING *`,
@@ -971,6 +984,7 @@ var PostgresPlatformHostStore = class {
971
984
  input.causationId ?? null,
972
985
  input.idempotencyKey ?? null,
973
986
  input.error ?? null,
987
+ input.runtimeEvidence ? JSON.stringify(input.runtimeEvidence) : null,
974
988
  now
975
989
  ]
976
990
  );
@@ -1342,6 +1356,7 @@ function toActionRecord(row) {
1342
1356
  ...row.approval_decision ? { approvalDecision: toApprovalDecision(row.approval_decision) } : {},
1343
1357
  ...row.mutation_footprint ? { mutationFootprint: row.mutation_footprint } : {},
1344
1358
  ...row.execution_principal ? { executionPrincipal: row.execution_principal } : {},
1359
+ ...row.runtime_evidence ? { runtimeEvidence: row.runtime_evidence } : {},
1345
1360
  ...row.error ? { error: String(row.error) } : {},
1346
1361
  createdAt: new Date(row.created_at),
1347
1362
  updatedAt: new Date(row.updated_at)
@@ -1476,6 +1491,7 @@ async function abortableDelay(milliseconds, signal) {
1476
1491
  }
1477
1492
 
1478
1493
  exports.MemoryPlatformHostStore = MemoryPlatformHostStore;
1494
+ exports.PLATFORM_HOST_CONTRACT_VERSION = PLATFORM_HOST_CONTRACT_VERSION;
1479
1495
  exports.PostgresPlatformHostStore = PostgresPlatformHostStore;
1480
1496
  exports.createGovernedActionHost = createGovernedActionHost;
1481
1497
  exports.createStoreBackedActionDispatcher = createStoreBackedActionDispatcher;