@decionis/mcp 0.3.0 → 0.4.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.
@@ -29,9 +29,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  mod
30
30
  ));
31
31
 
32
- // ../../node_modules/.pnpm/fastify-plugin@6.0.0/node_modules/fastify-plugin/lib/getPluginName.js
32
+ // ../../../Decionis/node_modules/.pnpm/fastify-plugin@6.0.0/node_modules/fastify-plugin/lib/getPluginName.js
33
33
  var require_getPluginName = __commonJS({
34
- "../../node_modules/.pnpm/fastify-plugin@6.0.0/node_modules/fastify-plugin/lib/getPluginName.js"(exports, module) {
34
+ "../../../Decionis/node_modules/.pnpm/fastify-plugin@6.0.0/node_modules/fastify-plugin/lib/getPluginName.js"(exports, module) {
35
35
  "use strict";
36
36
  var fpStackTracePattern = /at\s(?:.*\.)?plugin\s.*\n\s*(.*)/;
37
37
  var fileNamePattern = /(\w*(\.\w*)*)\..*/;
@@ -54,9 +54,9 @@ var require_getPluginName = __commonJS({
54
54
  }
55
55
  });
56
56
 
57
- // ../../node_modules/.pnpm/fastify-plugin@6.0.0/node_modules/fastify-plugin/lib/toCamelCase.js
57
+ // ../../../Decionis/node_modules/.pnpm/fastify-plugin@6.0.0/node_modules/fastify-plugin/lib/toCamelCase.js
58
58
  var require_toCamelCase = __commonJS({
59
- "../../node_modules/.pnpm/fastify-plugin@6.0.0/node_modules/fastify-plugin/lib/toCamelCase.js"(exports, module) {
59
+ "../../../Decionis/node_modules/.pnpm/fastify-plugin@6.0.0/node_modules/fastify-plugin/lib/toCamelCase.js"(exports, module) {
60
60
  "use strict";
61
61
  module.exports = function toCamelCase(name) {
62
62
  if (name[0] === "@") {
@@ -69,9 +69,9 @@ var require_toCamelCase = __commonJS({
69
69
  }
70
70
  });
71
71
 
72
- // ../../node_modules/.pnpm/fastify-plugin@6.0.0/node_modules/fastify-plugin/index.js
72
+ // ../../../Decionis/node_modules/.pnpm/fastify-plugin@6.0.0/node_modules/fastify-plugin/index.js
73
73
  var require_fastify_plugin = __commonJS({
74
- "../../node_modules/.pnpm/fastify-plugin@6.0.0/node_modules/fastify-plugin/index.js"(exports, module) {
74
+ "../../../Decionis/node_modules/.pnpm/fastify-plugin@6.0.0/node_modules/fastify-plugin/index.js"(exports, module) {
75
75
  "use strict";
76
76
  var getPluginName = require_getPluginName();
77
77
  var toCamelCase = require_toCamelCase();
@@ -119,9 +119,9 @@ var require_fastify_plugin = __commonJS({
119
119
  }
120
120
  });
121
121
 
122
- // ../../node_modules/.pnpm/toad-cache@3.7.0/node_modules/toad-cache/dist/toad-cache.cjs
122
+ // ../../../Decionis/node_modules/.pnpm/toad-cache@3.7.0/node_modules/toad-cache/dist/toad-cache.cjs
123
123
  var require_toad_cache = __commonJS({
124
- "../../node_modules/.pnpm/toad-cache@3.7.0/node_modules/toad-cache/dist/toad-cache.cjs"(exports) {
124
+ "../../../Decionis/node_modules/.pnpm/toad-cache@3.7.0/node_modules/toad-cache/dist/toad-cache.cjs"(exports) {
125
125
  "use strict";
126
126
  var FifoMap = class {
127
127
  constructor(max = 1e3, ttlInMsecs = 0) {
@@ -802,9 +802,9 @@ var require_toad_cache = __commonJS({
802
802
  }
803
803
  });
804
804
 
805
- // ../../node_modules/.pnpm/@fastify+cors@11.3.0/node_modules/@fastify/cors/vary.js
805
+ // ../../../Decionis/node_modules/.pnpm/@fastify+cors@11.3.0/node_modules/@fastify/cors/vary.js
806
806
  var require_vary = __commonJS({
807
- "../../node_modules/.pnpm/@fastify+cors@11.3.0/node_modules/@fastify/cors/vary.js"(exports, module) {
807
+ "../../../Decionis/node_modules/.pnpm/@fastify+cors@11.3.0/node_modules/@fastify/cors/vary.js"(exports, module) {
808
808
  "use strict";
809
809
  var { FifoMap: FifoCache } = require_toad_cache();
810
810
  var validFieldnameRE = /^[!#$%&'*+\-.^\w`|~]+$/u;
@@ -883,9 +883,9 @@ var require_vary = __commonJS({
883
883
  }
884
884
  });
885
885
 
886
- // ../../node_modules/.pnpm/@fastify+cors@11.3.0/node_modules/@fastify/cors/index.js
886
+ // ../../../Decionis/node_modules/.pnpm/@fastify+cors@11.3.0/node_modules/@fastify/cors/index.js
887
887
  var require_cors = __commonJS({
888
- "../../node_modules/.pnpm/@fastify+cors@11.3.0/node_modules/@fastify/cors/index.js"(exports, module) {
888
+ "../../../Decionis/node_modules/.pnpm/@fastify+cors@11.3.0/node_modules/@fastify/cors/index.js"(exports, module) {
889
889
  "use strict";
890
890
  var fp = require_fastify_plugin();
891
891
  var {
@@ -1129,14 +1129,14 @@ var require_cors = __commonJS({
1129
1129
  }
1130
1130
  });
1131
1131
 
1132
- // ../protocol/src/app.ts
1132
+ // ../../../Decionis/apps/protocol/src/app.ts
1133
1133
  var import_cors = __toESM(require_cors(), 1);
1134
1134
  import Fastify from "fastify";
1135
1135
 
1136
- // ../protocol/src/store/MemoryProtocolStore.ts
1136
+ // ../../../Decionis/apps/protocol/src/store/MemoryProtocolStore.ts
1137
1137
  import { randomUUID } from "crypto";
1138
1138
 
1139
- // ../../packages/shared/src/Domain/DomainEnums.ts
1139
+ // ../../../Decionis/packages/shared/src/Domain/DomainEnums.ts
1140
1140
  var Band = {
1141
1141
  NONE: "NONE",
1142
1142
  LOW: "LOW",
@@ -1225,7 +1225,7 @@ var TopFrictionArea = {
1225
1225
  ORIGIN_TRACKING: "ORIGIN_TRACKING"
1226
1226
  };
1227
1227
 
1228
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
1228
+ // ../../../Decionis/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
1229
1229
  var external_exports = {};
1230
1230
  __export(external_exports, {
1231
1231
  BRAND: () => BRAND,
@@ -1337,7 +1337,7 @@ __export(external_exports, {
1337
1337
  void: () => voidType
1338
1338
  });
1339
1339
 
1340
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
1340
+ // ../../../Decionis/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
1341
1341
  var util;
1342
1342
  (function(util2) {
1343
1343
  util2.assertEqual = (_) => {
@@ -1471,7 +1471,7 @@ var getParsedType = (data) => {
1471
1471
  }
1472
1472
  };
1473
1473
 
1474
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js
1474
+ // ../../../Decionis/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js
1475
1475
  var ZodIssueCode = util.arrayToEnum([
1476
1476
  "invalid_type",
1477
1477
  "invalid_literal",
@@ -1589,7 +1589,7 @@ ZodError.create = (issues) => {
1589
1589
  return error;
1590
1590
  };
1591
1591
 
1592
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
1592
+ // ../../../Decionis/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
1593
1593
  var errorMap = (issue, _ctx) => {
1594
1594
  let message;
1595
1595
  switch (issue.code) {
@@ -1692,7 +1692,7 @@ var errorMap = (issue, _ctx) => {
1692
1692
  };
1693
1693
  var en_default = errorMap;
1694
1694
 
1695
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js
1695
+ // ../../../Decionis/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js
1696
1696
  var overrideErrorMap = en_default;
1697
1697
  function setErrorMap(map) {
1698
1698
  overrideErrorMap = map;
@@ -1701,7 +1701,7 @@ function getErrorMap() {
1701
1701
  return overrideErrorMap;
1702
1702
  }
1703
1703
 
1704
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
1704
+ // ../../../Decionis/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
1705
1705
  var makeIssue = (params) => {
1706
1706
  const { data, path, errorMaps, issueData } = params;
1707
1707
  const fullPath = [...path, ...issueData.path || []];
@@ -1811,14 +1811,14 @@ var isDirty = (x) => x.status === "dirty";
1811
1811
  var isValid = (x) => x.status === "valid";
1812
1812
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
1813
1813
 
1814
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
1814
+ // ../../../Decionis/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
1815
1815
  var errorUtil;
1816
1816
  (function(errorUtil2) {
1817
1817
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
1818
1818
  errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
1819
1819
  })(errorUtil || (errorUtil = {}));
1820
1820
 
1821
- // ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
1821
+ // ../../../Decionis/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
1822
1822
  var ParseInputLazyPath = class {
1823
1823
  constructor(parent, value, path, key) {
1824
1824
  this._cachedPath = [];
@@ -5266,7 +5266,7 @@ var coerce = {
5266
5266
  };
5267
5267
  var NEVER = INVALID;
5268
5268
 
5269
- // ../../packages/shared/src/Domain/DomainSchemas.ts
5269
+ // ../../../Decionis/packages/shared/src/Domain/DomainSchemas.ts
5270
5270
  var SignalExtractionSchema = external_exports.object({
5271
5271
  team_size: external_exports.enum(["SOLO", "SMALL", "MID", "LARGE"]),
5272
5272
  revenue: external_exports.enum(["PRE_REVENUE", "UNPREDICTABLE", "PREDICTABLE", "PROFITABLE"]),
@@ -5350,7 +5350,7 @@ var SignalSetDbShape = external_exports.object({
5350
5350
  cognitive_load: external_exports.nativeEnum(Band)
5351
5351
  }).strict();
5352
5352
 
5353
- // ../../packages/shared/src/Decisioning/AiIntentContracts.ts
5353
+ // ../../../Decionis/packages/shared/src/Decisioning/AiIntentContracts.ts
5354
5354
  var AIIntentSurfaceSchema = external_exports.enum([
5355
5355
  "webex",
5356
5356
  "power_automate",
@@ -5451,7 +5451,7 @@ var AIIntentInterceptionResultContractSchema = external_exports.object({
5451
5451
  handoff: AIIntentHandoffContractSchema
5452
5452
  }).strict();
5453
5453
 
5454
- // ../../packages/shared/src/Decisioning/ExecutionBinding.ts
5454
+ // ../../../Decionis/packages/shared/src/Decisioning/ExecutionBinding.ts
5455
5455
  var EXECUTION_BINDING_SCHEMA_VERSION = "1.0";
5456
5456
  var EXECUTION_BINDING_DIGEST_ALGORITHM = "SHA-256";
5457
5457
  var JCS_CANONICALIZATION_PROFILE = "RFC8785/JCS";
@@ -5787,7 +5787,7 @@ function assertUnicodeScalarString(value) {
5787
5787
  }
5788
5788
  }
5789
5789
 
5790
- // ../../packages/shared/src/Decisioning/DecisionDossierIntegrity.ts
5790
+ // ../../../Decionis/packages/shared/src/Decisioning/DecisionDossierIntegrity.ts
5791
5791
  var DOSSIER_CONTENT_DIGEST_PROFILE = "DECIONIS_DOSSIER_CONTENT_V2";
5792
5792
  var DOSSIER_CONTENT_DIGEST_CANONICALIZATION = "RFC8785/JCS";
5793
5793
  var DECISION_DOSSIER_PROOF_ARTIFACT_SHAPES = {
@@ -5960,7 +5960,7 @@ function computeDecisionDossierContentSha256(dossierPayload) {
5960
5960
  return DecisionDossierIntegrity.computeContentSha256(dossierPayload);
5961
5961
  }
5962
5962
 
5963
- // ../../packages/shared/src/Decisioning/DecisioningContracts.ts
5963
+ // ../../../Decionis/packages/shared/src/Decisioning/DecisioningContracts.ts
5964
5964
  var EvidenceRefSchema = external_exports.object({
5965
5965
  tool_event_id: external_exports.string().min(1).max(200),
5966
5966
  output_hash: external_exports.string().min(16).max(128),
@@ -6042,7 +6042,7 @@ var EvidenceBackedClaimSchema = external_exports.object({
6042
6042
  evidence: external_exports.array(EvidenceRefSchema).min(1)
6043
6043
  }).strict();
6044
6044
 
6045
- // ../../packages/shared/src/Decisioning/SnapshotValidity.ts
6045
+ // ../../../Decionis/packages/shared/src/Decisioning/SnapshotValidity.ts
6046
6046
  var SnapshotValidity = class _SnapshotValidity {
6047
6047
  /** Default snapshot lifetime (24h). */
6048
6048
  static DEFAULT_TTL_MS = 24 * 60 * 60 * 1e3;
@@ -6110,7 +6110,7 @@ function withRollingValidity(template, options = {}) {
6110
6110
  return SnapshotValidity.withRollingValidity(template, options);
6111
6111
  }
6112
6112
 
6113
- // ../../packages/shared/src/Decisioning/EnforcementMode.ts
6113
+ // ../../../Decionis/packages/shared/src/Decisioning/EnforcementMode.ts
6114
6114
  var ENFORCEMENT_SPELLINGS = /* @__PURE__ */ new Set(["enforce", "enforced", "enforcement"]);
6115
6115
  function normalizeEnforcementMode(value, fallback = "SHADOW") {
6116
6116
  if (typeof value !== "string") return fallback;
@@ -6121,7 +6121,7 @@ function normalizeEnforcementMode(value, fallback = "SHADOW") {
6121
6121
  return fallback;
6122
6122
  }
6123
6123
 
6124
- // ../../packages/shared/src/Decisioning/PolicyResolution.ts
6124
+ // ../../../Decionis/packages/shared/src/Decisioning/PolicyResolution.ts
6125
6125
  var EVALUATE_DECISION_POLICY_RESOLUTIONS = [
6126
6126
  /** A policy guard stopped the evaluation before rules ran. */
6127
6127
  "policy_guard_blocked",
@@ -6156,7 +6156,7 @@ var RESERVED_REQUEST_FACTS = [
6156
6156
  "requested_policy_version"
6157
6157
  ];
6158
6158
 
6159
- // ../../packages/shared/src/Decisioning/EffectEvidence.ts
6159
+ // ../../../Decionis/packages/shared/src/Decisioning/EffectEvidence.ts
6160
6160
  var EFFECT_EVIDENCE_VERSION = "1.0";
6161
6161
  var EffectObservationMethodSchema = external_exports.enum([
6162
6162
  "DOWNSTREAM_ACK",
@@ -6228,7 +6228,7 @@ var EffectEvidenceSchema = external_exports.object({
6228
6228
  }
6229
6229
  });
6230
6230
 
6231
- // ../../packages/shared/src/Decisioning/SemanticSignals.ts
6231
+ // ../../../Decionis/packages/shared/src/Decisioning/SemanticSignals.ts
6232
6232
  var SEMANTIC_SIGNAL_SCHEMA_VERSION = "1.0";
6233
6233
  var BUILT_IN_SEMANTIC_SIGNAL_KINDS = [
6234
6234
  "intent_risk",
@@ -6404,7 +6404,7 @@ function stringOrNull(value) {
6404
6404
  return typeof value === "string" && value.trim() ? value.trim() : null;
6405
6405
  }
6406
6406
 
6407
- // ../../packages/shared/src/Decisioning/UpstreamAuthorization.ts
6407
+ // ../../../Decionis/packages/shared/src/Decisioning/UpstreamAuthorization.ts
6408
6408
  var AUTHZEN_PROTOCOL = "authzen/1.0";
6409
6409
  var sha256Digest3 = external_exports.string().regex(/^sha256:[0-9a-f]{64}$/);
6410
6410
  var bounded = external_exports.string().trim().min(1).max(200);
@@ -6438,7 +6438,7 @@ var UpstreamAuthorizationValueSchema = external_exports.object({
6438
6438
  reasons: external_exports.array(bounded).max(50).optional()
6439
6439
  }).strict();
6440
6440
 
6441
- // ../../packages/shared/src/Decisioning/AuthoritySemantics.ts
6441
+ // ../../../Decionis/packages/shared/src/Decisioning/AuthoritySemantics.ts
6442
6442
  var DECIONIS_PROTOCOL_AUTHORITY_VERSION = "1.1";
6443
6443
  var DECIONIS_EVALUATOR_VERSION = "policy-graph/1.1";
6444
6444
  var DECIONIS_POLICY_SCHEMA_VERSION = "1.0";
@@ -6677,7 +6677,7 @@ function buildAuthorityEvidence(input) {
6677
6677
  });
6678
6678
  }
6679
6679
 
6680
- // ../../packages/shared/src/Decisioning/ExecutionRevalidation.ts
6680
+ // ../../../Decionis/packages/shared/src/Decisioning/ExecutionRevalidation.ts
6681
6681
  var EXECUTION_REVALIDATION_REASON_CODES = [
6682
6682
  "EXECUTION_BINDING_VALID",
6683
6683
  "PAYLOAD_BINDING_MISMATCH",
@@ -6815,7 +6815,142 @@ var ExecutionCommitEvidenceSchema = external_exports.object({
6815
6815
  }
6816
6816
  });
6817
6817
 
6818
- // ../../packages/shared/src/Decisioning/ReasonCodes.ts
6818
+ // ../../../Decionis/packages/shared/src/Decisioning/RuntimeSignals.ts
6819
+ var token = external_exports.string().trim().min(1).max(200).regex(/^[a-z0-9][\w.:/-]*$/i);
6820
+ var bounded2 = (max) => external_exports.string().trim().min(1).max(max);
6821
+ var RUNTIME_SIGNAL_ROOTS = ["enforcement_boundary", "workload"];
6822
+ var RUNTIME_ATTRIBUTION_FACT = "runtime_attribution";
6823
+ var WORKLOAD_TRUST_LEVELS = ["unverified", "supplied", "observed", "verified"];
6824
+ var BoundaryPlacementSchema = external_exports.object({
6825
+ cluster_id: token.optional(),
6826
+ namespace: token.optional(),
6827
+ region: token.optional(),
6828
+ workload_id: token.optional()
6829
+ }).strict();
6830
+ var EnforcementBoundarySignalSchema = external_exports.object({
6831
+ boundary_id: token,
6832
+ agentsafe_version: bounded2(80),
6833
+ protocol_version: external_exports.literal("agent-safe.intent/1"),
6834
+ deployment_type: token,
6835
+ environment: token.optional(),
6836
+ conformance_version: bounded2(120).optional(),
6837
+ placement: BoundaryPlacementSchema.optional()
6838
+ }).strict();
6839
+ var WorkloadProvenanceSchema = external_exports.object({
6840
+ source: token,
6841
+ trust_level: external_exports.enum(WORKLOAD_TRUST_LEVELS)
6842
+ }).strict();
6843
+ var WorkloadSignalSchema = external_exports.object({
6844
+ runtime: token.optional(),
6845
+ artifact_type: token.optional(),
6846
+ // An OCI reference and a publisher name, held to the character classes a
6847
+ // reference and a name actually use. The producer constrains these where
6848
+ // it reads them, but Decionis receives this shape from any producer, and
6849
+ // these values reach signed evidence and an operator's console: free text
6850
+ // arriving here would be free text leaving there.
6851
+ image: external_exports.string().trim().min(1).max(500).regex(/^[\w.:/@-]+$/).optional(),
6852
+ digest: external_exports.string().regex(/^sha256:[0-9a-f]{64}$/).optional(),
6853
+ publisher: external_exports.string().trim().min(1).max(200).regex(/^[\w .:/@-]+$/).optional(),
6854
+ provenance: WorkloadProvenanceSchema
6855
+ }).strict();
6856
+ var RuntimeSignals = class _RuntimeSignals {
6857
+ static parse(context) {
6858
+ const boundaryRaw = context.enforcement_boundary;
6859
+ const workloadRaw = context.workload;
6860
+ let boundary = null;
6861
+ let workload = null;
6862
+ if (boundaryRaw !== void 0 && boundaryRaw !== null) {
6863
+ const parsed = EnforcementBoundarySignalSchema.safeParse(boundaryRaw);
6864
+ if (!parsed.success) {
6865
+ return {
6866
+ ok: false,
6867
+ path: "context.enforcement_boundary",
6868
+ message: _RuntimeSignals.messageOf(parsed.error)
6869
+ };
6870
+ }
6871
+ boundary = parsed.data;
6872
+ }
6873
+ if (workloadRaw !== void 0 && workloadRaw !== null) {
6874
+ const parsed = WorkloadSignalSchema.safeParse(workloadRaw);
6875
+ if (!parsed.success) {
6876
+ return {
6877
+ ok: false,
6878
+ path: "context.workload",
6879
+ message: _RuntimeSignals.messageOf(parsed.error)
6880
+ };
6881
+ }
6882
+ workload = parsed.data;
6883
+ }
6884
+ return { ok: true, boundary, workload };
6885
+ }
6886
+ /**
6887
+ * The first problem, named by its own path. Bounded and structural: it
6888
+ * repeats no value the caller sent, so a refusal cannot echo a payload back
6889
+ * into a log.
6890
+ */
6891
+ static messageOf(error) {
6892
+ const issue = error.issues[0];
6893
+ if (!issue) return "invalid";
6894
+ const where = issue.path.length > 0 ? issue.path.join(".") : "(root)";
6895
+ return `${where}: ${issue.code}`;
6896
+ }
6897
+ /** What Decionis says about the report, computed from the parsed signals alone. */
6898
+ static attributionOf(input) {
6899
+ const { boundary, workload } = input;
6900
+ const placement = boundary?.placement;
6901
+ return {
6902
+ reported: boundary !== null || workload !== null,
6903
+ boundary_id: boundary?.boundary_id ?? null,
6904
+ deployment_type: boundary?.deployment_type ?? null,
6905
+ environment: boundary?.environment ?? null,
6906
+ cluster_id: placement?.cluster_id ?? null,
6907
+ namespace: placement?.namespace ?? null,
6908
+ region: placement?.region ?? null,
6909
+ workload_digest: workload?.digest ?? null,
6910
+ workload_image: workload?.image ?? null,
6911
+ workload_publisher: workload?.publisher ?? null,
6912
+ workload_runtime: workload?.runtime ?? null,
6913
+ trust_level: workload?.provenance.trust_level ?? null,
6914
+ trust_source: workload?.provenance.source ?? null,
6915
+ // Nothing in this chain verified an artifact. When something does, it
6916
+ // sets this, and every policy written against it starts meaning more
6917
+ // without being rewritten.
6918
+ platform_verified: false
6919
+ };
6920
+ }
6921
+ /**
6922
+ * What reaches signed evidence: the boundary that admitted the action and
6923
+ * the artifact that proposed it, with the platform's own statement about
6924
+ * how far that goes.
6925
+ *
6926
+ * The placement is included because an operator's own cluster and namespace
6927
+ * are theirs and are what a policy means by "production in eu". The
6928
+ * instance is not, and never arrives: the producer leaves the container,
6929
+ * pod and node out of what it binds.
6930
+ */
6931
+ static evidenceOf(attribution) {
6932
+ if (!attribution.reported) return null;
6933
+ return {
6934
+ boundary_id: attribution.boundary_id,
6935
+ deployment_type: attribution.deployment_type,
6936
+ environment: attribution.environment,
6937
+ cluster_id: attribution.cluster_id,
6938
+ namespace: attribution.namespace,
6939
+ region: attribution.region,
6940
+ workload_digest: attribution.workload_digest,
6941
+ workload_image: attribution.workload_image,
6942
+ workload_publisher: attribution.workload_publisher,
6943
+ trust_level: attribution.trust_level,
6944
+ trust_source: attribution.trust_source,
6945
+ platform_verified: attribution.platform_verified
6946
+ };
6947
+ }
6948
+ };
6949
+ var parseRuntimeSignals = RuntimeSignals.parse.bind(RuntimeSignals);
6950
+ var runtimeAttributionOf = RuntimeSignals.attributionOf.bind(RuntimeSignals);
6951
+ var runtimeAttributionEvidence = RuntimeSignals.evidenceOf.bind(RuntimeSignals);
6952
+
6953
+ // ../../../Decionis/packages/shared/src/Decisioning/ReasonCodes.ts
6819
6954
  var ReasonCodes = class _ReasonCodes {
6820
6955
  static codes = [
6821
6956
  "PROTOCOL_OUTCOME_APPROVE",
@@ -7134,7 +7269,7 @@ function buildProtocolDecisionReasonCodes(response) {
7134
7269
  return ReasonCodes.buildProtocolDecisionReasonCodes(response);
7135
7270
  }
7136
7271
 
7137
- // ../../packages/shared/src/Authority/AuthorityRequirement.ts
7272
+ // ../../../Decionis/packages/shared/src/Authority/AuthorityRequirement.ts
7138
7273
  var AUTHORITY_REQUIREMENT_VERSION = "decionis.authority_requirement/1";
7139
7274
  var SYSTEM_APPROVER_ROLE_ID = "APPROVER";
7140
7275
  var AuthoritySelectorSchema = external_exports.discriminatedUnion("kind", [
@@ -7297,7 +7432,7 @@ var AuthorityRequirementSchema = external_exports.object({
7297
7432
  }
7298
7433
  });
7299
7434
 
7300
- // ../../packages/shared/src/Marketplaces.ts
7435
+ // ../../../Decionis/packages/shared/src/Marketplaces.ts
7301
7436
  var Marketplaces = class {
7302
7437
  static targets = [
7303
7438
  "atlassian",
@@ -7340,8 +7475,10 @@ var Marketplaces = class {
7340
7475
  launch_state: "pilot_ready"
7341
7476
  },
7342
7477
  aws: {
7343
- // EventBridge + Bedrock guards, PrivateLink endpoint, and Marketplace
7344
- // metering/entitlement are built (docs/brief/decionis.aws.md Phase 0-2); listing not yet GA.
7478
+ // The AWS adapter is Commerce Gate's AgentSaaS (API-based SaaS) and
7479
+ // AgentOps (its container for Bedrock AgentCore), built in the Commerce
7480
+ // repository; they replaced the customer-VPC Lambda and Bedrock guards,
7481
+ // retired on 2026-09-26. Listing not yet GA.
7345
7482
  adapter_state: "available",
7346
7483
  workflow_state: "available",
7347
7484
  docs_state: "available",
@@ -7424,10 +7561,11 @@ var Marketplaces = class {
7424
7561
  // classic checkout, core COGS, HPOS order CRUD, and the signed dossier were
7425
7562
  // verified end to end on a staging store with real credentials — including
7426
7563
  // an admin-enabled ENFORCEMENT block — before the listing went live.
7564
+ // Production (Festus, 2026-09-26); each store still starts in Shadow Mode.
7427
7565
  adapter_state: "available",
7428
7566
  workflow_state: "available",
7429
7567
  docs_state: "available",
7430
- launch_state: "pilot_ready"
7568
+ launch_state: "production"
7431
7569
  },
7432
7570
  tiktok: {
7433
7571
  // Post-purchase fulfillment circuit breaker: OAuth + refresh, signed Open API,
@@ -7453,19 +7591,23 @@ var Marketplaces = class {
7453
7591
  // referral fee + shipping), and Acknowledge-Order release/hold are built and
7454
7592
  // unit-tested. Production Solution Provider credentials are issued and every
7455
7593
  // previously guessed API detail is verified against the Walmart Developer Portal
7456
- // (2026-08-16; decionis/Commerce docs/walmart/ConfirmBeforeLive.md). A live
7457
- // seller verification remains before per-seller enforcement (shadow-first).
7594
+ // (2026-08-16; decionis/Commerce docs/walmart/ConfirmBeforeLive.md). On
7595
+ // 2026-09-16 Walmart approved Decionis, Inc. as a Marketplace Solution
7596
+ // Provider (Specialty Partner — Orders) and the Decionis Commerce Gate app
7597
+ // passed review and was published in the Seller Center App Store, where
7598
+ // sellers install it in one click. Production since then (Festus,
7599
+ // 2026-09-26); each seller still starts in Shadow Mode.
7458
7600
  adapter_state: "available",
7459
7601
  workflow_state: "available",
7460
7602
  docs_state: "partial",
7461
- launch_state: "pilot_ready"
7603
+ launch_state: "production"
7462
7604
  }
7463
7605
  };
7464
7606
  };
7465
7607
  var MARKETPLACE_TARGETS = Marketplaces.targets;
7466
7608
  var MARKETPLACE_READINESS_BY_TARGET = Marketplaces.readinessByTarget;
7467
7609
 
7468
- // ../../packages/shared/src/Patterns/ExecutionPatternClassifier.ts
7610
+ // ../../../Decionis/packages/shared/src/Patterns/ExecutionPatternClassifier.ts
7469
7611
  var EXECUTION_PATTERN_RULES = [
7470
7612
  {
7471
7613
  pattern: "mcp-egress",
@@ -7572,7 +7714,7 @@ var EXECUTION_PATTERN_RECIPE_TAGS = Object.fromEntries(
7572
7714
  EXECUTION_PATTERN_RULES.map((rule) => [rule.pattern, rule.recipeTags])
7573
7715
  );
7574
7716
 
7575
- // ../../packages/shared/src/PolicyPacks/PolicyPackRegistry.ts
7717
+ // ../../../Decionis/packages/shared/src/PolicyPacks/PolicyPackRegistry.ts
7576
7718
  var DISCOUNT_GUARDRAILS = {
7577
7719
  id: "discount-guardrails",
7578
7720
  name: "Discount Guardrails",
@@ -7676,7 +7818,7 @@ var POLICY_PACKS = [
7676
7818
  ];
7677
7819
  var POLICY_PACK_IDS = POLICY_PACKS.map((pack) => pack.id);
7678
7820
 
7679
- // ../../packages/shared/src/capital/CapitalContracts.ts
7821
+ // ../../../Decionis/packages/shared/src/capital/CapitalContracts.ts
7680
7822
  var defaultCapitalPolicySnapshot = withRollingValidity({
7681
7823
  policyVersion: "capital-multiplier-v1",
7682
7824
  // Shadow by default: observe and quantify before anything moves money.
@@ -7709,7 +7851,7 @@ var defaultCapitalPolicySnapshot = withRollingValidity({
7709
7851
  }
7710
7852
  });
7711
7853
 
7712
- // ../../packages/shared/src/capital/CapitalCopy.ts
7854
+ // ../../../Decionis/packages/shared/src/capital/CapitalCopy.ts
7713
7855
  var CapitalCopy = class _CapitalCopy {
7714
7856
  static defaultCopy = {
7715
7857
  early_payment_yield: {
@@ -7881,7 +8023,7 @@ var CapitalCopy = class _CapitalCopy {
7881
8023
  };
7882
8024
  var CAPITAL_COPY_BY_PLATFORM = CapitalCopy.copyByPlatform;
7883
8025
 
7884
- // ../../packages/shared/src/capital/CapitalCards.ts
8026
+ // ../../../Decionis/packages/shared/src/capital/CapitalCards.ts
7885
8027
  var CapitalCards = class _CapitalCards {
7886
8028
  static actionVerbs = {
7887
8029
  approve: "capital.recommendation.approve",
@@ -7999,7 +8141,7 @@ ${rec.disposition.replace(/_/g, " ")}` }
7999
8141
  };
8000
8142
  var capitalRecommendationActionVerbs = CapitalCards.actionVerbs;
8001
8143
 
8002
- // ../../packages/shared/src/Microsoft/MicrosoftDecisionDossier.ts
8144
+ // ../../../Decionis/packages/shared/src/Microsoft/MicrosoftDecisionDossier.ts
8003
8145
  var MicrosoftDecisionDossierFactory = class _MicrosoftDecisionDossierFactory {
8004
8146
  static actionVerbs = {
8005
8147
  approve: "decision.dossier.approve",
@@ -8337,7 +8479,7 @@ ${dossier.reason}`,
8337
8479
  };
8338
8480
  var microsoftTeamsDecisionDossierActionVerbs = MicrosoftDecisionDossierFactory.actionVerbs;
8339
8481
 
8340
- // ../../packages/shared/src/Procure/ProcureContracts.ts
8482
+ // ../../../Decionis/packages/shared/src/Procure/ProcureContracts.ts
8341
8483
  var ProcureDisposition = {
8342
8484
  APPROVE: "APPROVE",
8343
8485
  REJECT: "REJECT",
@@ -8387,7 +8529,7 @@ var ProcureDecisionStepOutputSchema = external_exports.object({
8387
8529
  referral_id: external_exports.string().uuid().optional()
8388
8530
  }).strict();
8389
8531
 
8390
- // ../../packages/shared/src/Procure/ProcureDsl.ts
8532
+ // ../../../Decionis/packages/shared/src/Procure/ProcureDsl.ts
8391
8533
  var PrimitiveSchema = external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean(), external_exports.null()]);
8392
8534
  var ProcureDslConditionSchema = external_exports.lazy(
8393
8535
  () => external_exports.union([
@@ -8448,7 +8590,7 @@ var ProcureDslSchema = external_exports.object({
8448
8590
  fallback: ProcureDslThenSchema
8449
8591
  }).strict();
8450
8592
 
8451
- // ../../packages/shared/src/Sidecar/SidecarContracts.ts
8593
+ // ../../../Decionis/packages/shared/src/Sidecar/SidecarContracts.ts
8452
8594
  var ReaderArtifactTypeSchema = external_exports.enum([
8453
8595
  "DECISION_DOSSIER",
8454
8596
  "DECISION_CHAIN",
@@ -8648,8 +8790,10 @@ var ExtensionConfigResponseSchema = external_exports.object({
8648
8790
  generated_at: external_exports.string()
8649
8791
  }).strict();
8650
8792
 
8651
- // ../protocol/src/ledger/LedgerChain.ts
8793
+ // ../../../Decionis/apps/protocol/src/ledger/LedgerChain.ts
8652
8794
  import { createHash } from "crypto";
8795
+ var LEDGER_FORK_RESOLVED_EVENT_TYPE = "LEDGER_FORK_RESOLVED";
8796
+ var LEDGER_ORPHAN_ISSUE_INDEX = -1;
8653
8797
  var LedgerChain = class _LedgerChain {
8654
8798
  static computeLedgerEntryHash(input) {
8655
8799
  const canonicalPayload = {
@@ -8781,6 +8925,87 @@ var LedgerChain = class _LedgerChain {
8781
8925
  issues
8782
8926
  };
8783
8927
  }
8928
+ /**
8929
+ * Verify registered fork orphans. Each must be a well-formed entry whose
8930
+ * hash recomputes over its own predecessor, whose predecessor is a real
8931
+ * entry, and which a non-orphaned LEDGER_FORK_RESOLVED entry commits to (by
8932
+ * id, entry hash and predecessor hash) — so the registry can exclude only
8933
+ * what the hash chain itself records as excluded.
8934
+ */
8935
+ static verifyLedgerOrphans(orgId, candidates) {
8936
+ const issues = [];
8937
+ const orphaned = [];
8938
+ for (const candidate of candidates) {
8939
+ const registration = candidate.registration;
8940
+ const issuesBefore = issues.length;
8941
+ const issue = (reason, expected, actual) => issues.push({
8942
+ ledger_entry_id: registration.ledger_entry_id,
8943
+ index: LEDGER_ORPHAN_ISSUE_INDEX,
8944
+ reason,
8945
+ ...expected !== void 0 ? { expected } : {},
8946
+ ...actual !== void 0 ? { actual } : {}
8947
+ });
8948
+ const entry = candidate.entry;
8949
+ if (!entry || entry.ledger_entry_id !== registration.ledger_entry_id) {
8950
+ issue("ORPHAN_REGISTRY_MISMATCH");
8951
+ orphaned.push(_LedgerChain.orphanReport(registration, null, false));
8952
+ continue;
8953
+ }
8954
+ const own = _LedgerChain.verifyLedgerChainPage(orgId, [entry], {
8955
+ checked: 0,
8956
+ expected_prev_hash: entry.prev_hash,
8957
+ tail_hash: null,
8958
+ head_hash: null,
8959
+ issues: []
8960
+ });
8961
+ for (const found of own.issues) {
8962
+ issues.push({ ...found, index: LEDGER_ORPHAN_ISSUE_INDEX });
8963
+ }
8964
+ const entryHash = _LedgerChain.normalizeHash(entry.entry_hash);
8965
+ const prevHash = _LedgerChain.normalizeHash(entry.prev_hash);
8966
+ if (_LedgerChain.normalizeHash(registration.entry_hash) !== entryHash || _LedgerChain.normalizeHash(registration.fork_prev_hash) !== prevHash) {
8967
+ issue("ORPHAN_REGISTRY_MISMATCH", registration.entry_hash, entry.entry_hash);
8968
+ }
8969
+ if (!prevHash || !candidate.predecessor_exists) {
8970
+ issue("ORPHAN_PREDECESSOR_MISSING", null, entry.prev_hash);
8971
+ }
8972
+ if (!registration.resolution_entry_id) {
8973
+ issue("ORPHAN_UNRESOLVED");
8974
+ } else if (!_LedgerChain.resolutionCommitsToOrphan(orgId, registration, entry, candidate.resolution)) {
8975
+ issue("ORPHAN_RESOLUTION_MISMATCH", registration.resolution_entry_id, null);
8976
+ }
8977
+ orphaned.push(_LedgerChain.orphanReport(registration, entry, issues.length === issuesBefore));
8978
+ }
8979
+ return { orphaned, issues };
8980
+ }
8981
+ static resolutionCommitsToOrphan(orgId, registration, entry, resolution) {
8982
+ if (!resolution || resolution.orphaned) return false;
8983
+ const envelope = resolution.entry.payload;
8984
+ if (resolution.entry.ledger_entry_id !== registration.resolution_entry_id || envelope.event_type !== LEDGER_FORK_RESOLVED_EVENT_TYPE || envelope.org_id !== orgId) {
8985
+ return false;
8986
+ }
8987
+ const committed = _LedgerChain.asRecord(envelope.payload);
8988
+ const canonicalHead = _LedgerChain.asRecord(committed.canonical_head);
8989
+ if (committed.org_id !== orgId || _LedgerChain.normalizeHash(canonicalHead.entry_hash) !== _LedgerChain.normalizeHash(resolution.entry.prev_hash)) {
8990
+ return false;
8991
+ }
8992
+ const orphans = Array.isArray(committed.orphans) ? committed.orphans : [];
8993
+ return orphans.some((item) => {
8994
+ const orphan = _LedgerChain.asRecord(item);
8995
+ return orphan.ledger_entry_id === entry.ledger_entry_id && _LedgerChain.normalizeHash(orphan.entry_hash) === _LedgerChain.normalizeHash(entry.entry_hash) && _LedgerChain.normalizeHash(orphan.prev_hash) === _LedgerChain.normalizeHash(entry.prev_hash);
8996
+ });
8997
+ }
8998
+ static orphanReport(registration, entry, verified) {
8999
+ return {
9000
+ ledger_entry_id: registration.ledger_entry_id,
9001
+ entry_hash: entry?.entry_hash ?? registration.entry_hash,
9002
+ prev_hash: entry ? entry.prev_hash : registration.fork_prev_hash,
9003
+ status: "orphaned",
9004
+ reason: registration.reason,
9005
+ resolution_entry_id: registration.resolution_entry_id,
9006
+ verified
9007
+ };
9008
+ }
8784
9009
  static normalizeHash(value) {
8785
9010
  if (typeof value !== "string") return null;
8786
9011
  const hash = value.trim();
@@ -8827,19 +9052,26 @@ function bindLedgerEntryToPrevious(payload, previousHash) {
8827
9052
  function verifyLedgerChain(orgId, entries) {
8828
9053
  return LedgerChain.verifyLedgerChain(orgId, entries);
8829
9054
  }
9055
+ function verifyLedgerOrphans(orgId, candidates) {
9056
+ return LedgerChain.verifyLedgerOrphans(orgId, candidates);
9057
+ }
8830
9058
 
8831
- // ../protocol/src/store/StoreContracts.ts
9059
+ // ../../../Decionis/apps/protocol/src/store/StoreContracts.ts
8832
9060
  var DECISION_CHAIN_PROJECTION_LIMIT = 500;
9061
+ var AUDIT_LEDGER_NOT_APPENDABLE = "AUDIT_LEDGER_NOT_APPENDABLE";
8833
9062
  var ProtocolStoreValidationError = class extends Error {
8834
9063
  issues;
8835
- constructor(message, issues) {
9064
+ /** Stable machine-readable code for failures callers must tell apart. */
9065
+ code;
9066
+ constructor(message, issues, options) {
8836
9067
  super(message);
8837
9068
  this.name = "ProtocolStoreValidationError";
8838
9069
  this.issues = issues;
9070
+ if (options?.code) this.code = options.code;
8839
9071
  }
8840
9072
  };
8841
9073
 
8842
- // ../protocol/src/store/DecisionDossierImmutability.ts
9074
+ // ../../../Decionis/apps/protocol/src/store/DecisionDossierImmutability.ts
8843
9075
  function evaluationCommitmentFromInput(input, evaluationId) {
8844
9076
  return {
8845
9077
  id: evaluationId,
@@ -8921,7 +9153,7 @@ function assertCanonicalDecisionDossierRetry(input) {
8921
9153
  return committedEvaluation;
8922
9154
  }
8923
9155
 
8924
- // ../protocol/src/store/StoreHelpers.ts
9156
+ // ../../../Decionis/apps/protocol/src/store/StoreHelpers.ts
8925
9157
  var UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
8926
9158
  var ARTIFACT_ID_FIELDS = {
8927
9159
  signal_envelope: "envelope_id",
@@ -9004,7 +9236,7 @@ function getOccurredAt(kind, payload) {
9004
9236
  return StoreHelpers.getOccurredAt(kind, payload);
9005
9237
  }
9006
9238
 
9007
- // ../protocol/src/store/MemoryProtocolStore.ts
9239
+ // ../../../Decionis/apps/protocol/src/store/MemoryProtocolStore.ts
9008
9240
  var DECISION_CHAIN_LEDGER_ACTION_ORDER = {
9009
9241
  "protocol.execution.precommit_revalidated": 0,
9010
9242
  "protocol.execution.dispatched": 1,
@@ -9027,6 +9259,8 @@ function compareDecisionChainLedgerRows(left, right) {
9027
9259
  var MemoryProtocolStore = class _MemoryProtocolStore {
9028
9260
  byKey = /* @__PURE__ */ new Map();
9029
9261
  auditLedgerChainById = /* @__PURE__ */ new Map();
9262
+ /** Mirror of `decionis_protocol.audit_ledger_orphans`. */
9263
+ auditLedgerOrphans = /* @__PURE__ */ new Map();
9030
9264
  auditLedgerAppendOrdinal = 0n;
9031
9265
  orgVerticalPacks = /* @__PURE__ */ new Map();
9032
9266
  evaluationById = /* @__PURE__ */ new Map();
@@ -9128,8 +9362,18 @@ var MemoryProtocolStore = class _MemoryProtocolStore {
9128
9362
  entry_hash: existingLedgerRow.entry_hash
9129
9363
  };
9130
9364
  }
9131
- const currentHead = Array.from(this.auditLedgerChainById.values()).filter((row) => row.org_id === orgId).sort(_MemoryProtocolStore.compareCanonicalLedgerRows).at(-1);
9132
- const bound = bindLedgerEntryToPrevious(payload, currentHead?.entry_hash ?? null);
9365
+ const orgRows = Array.from(this.auditLedgerChainById.values()).filter(
9366
+ (row) => row.org_id === orgId
9367
+ );
9368
+ const heads = this.candidateAuditLedgerHeads(orgRows);
9369
+ if (orgRows.length === 0 && heads.length !== 0 || orgRows.length > 0 && heads.length !== 1) {
9370
+ throw new ProtocolStoreValidationError(
9371
+ "Audit ledger is not appendable",
9372
+ [{ path: "chain.prev_hash", message: "canonical ledger has no unique head" }],
9373
+ { code: AUDIT_LEDGER_NOT_APPENDABLE }
9374
+ );
9375
+ }
9376
+ const bound = bindLedgerEntryToPrevious(payload, heads[0]?.entry_hash ?? null);
9133
9377
  persistedPayload = bound.payload;
9134
9378
  const chain = persistedPayload.chain && typeof persistedPayload.chain === "object" && !Array.isArray(persistedPayload.chain) ? persistedPayload.chain : {};
9135
9379
  const entryHash = typeof chain.entry_hash === "string" ? chain.entry_hash.toLowerCase() : "";
@@ -9177,8 +9421,101 @@ var MemoryProtocolStore = class _MemoryProtocolStore {
9177
9421
  }).slice(0, input.limit);
9178
9422
  return rows.map((row) => row.payload);
9179
9423
  }
9424
+ candidateAuditLedgerHeads(orgRows) {
9425
+ const predecessors = new Set(
9426
+ orgRows.map((row) => row.prev_hash).filter((hash) => hash !== null)
9427
+ );
9428
+ return orgRows.filter(
9429
+ (row) => !predecessors.has(row.entry_hash) && !this.auditLedgerOrphans.has(row.ledger_entry_id)
9430
+ );
9431
+ }
9432
+ withLedgerMembership(row) {
9433
+ const orphan = this.auditLedgerOrphans.get(row.ledger_entry_id);
9434
+ return orphan && orphan.org_id === row.org_id ? {
9435
+ ...row,
9436
+ ledger_membership: "orphaned",
9437
+ orphan_resolution_entry_id: orphan.resolution_entry_id
9438
+ } : row;
9439
+ }
9440
+ auditLedgerOrphanCandidates(orgId) {
9441
+ const orgRows = Array.from(this.auditLedgerChainById.values()).filter(
9442
+ (row) => row.org_id === orgId
9443
+ );
9444
+ const hashes = new Set(orgRows.map((row) => row.entry_hash));
9445
+ const occurredAt = (id) => this.auditLedgerChainById.get(id)?.occurred_at ?? "";
9446
+ return Array.from(this.auditLedgerOrphans.values()).filter((orphan) => orphan.org_id === orgId).sort(
9447
+ (left, right) => occurredAt(left.ledger_entry_id).localeCompare(occurredAt(right.ledger_entry_id)) || left.ledger_entry_id.localeCompare(right.ledger_entry_id)
9448
+ ).map((orphan) => {
9449
+ const entry = this.auditLedgerChainById.get(orphan.ledger_entry_id);
9450
+ const resolution = orphan.resolution_entry_id ? this.auditLedgerChainById.get(orphan.resolution_entry_id) : void 0;
9451
+ return {
9452
+ registration: {
9453
+ ledger_entry_id: orphan.ledger_entry_id,
9454
+ entry_hash: orphan.entry_hash,
9455
+ fork_prev_hash: orphan.fork_prev_hash,
9456
+ reason: orphan.reason,
9457
+ resolution_entry_id: orphan.resolution_entry_id
9458
+ },
9459
+ entry: entry && entry.org_id === orgId ? structuredClone(entry) : null,
9460
+ predecessor_exists: entry?.prev_hash ? hashes.has(entry.prev_hash) : false,
9461
+ resolution: resolution && resolution.org_id === orgId ? {
9462
+ entry: structuredClone(resolution),
9463
+ orphaned: this.auditLedgerOrphans.has(resolution.ledger_entry_id)
9464
+ } : null
9465
+ };
9466
+ });
9467
+ }
9468
+ /**
9469
+ * Mirror of the operator registry insert (`audit_ledger_orphans`) with the
9470
+ * same integrity rules its trigger enforces: the entry exists in this org's
9471
+ * ledger, the recorded hashes are the entry's own, and nothing is registered
9472
+ * twice. The chain itself is never modified.
9473
+ */
9474
+ async registerAuditLedgerOrphans(input) {
9475
+ const staged = [];
9476
+ for (const orphan of input.orphans) {
9477
+ const entry = this.auditLedgerChainById.get(orphan.ledger_entry_id);
9478
+ if (!entry || entry.org_id !== input.orgId) {
9479
+ throw new ProtocolStoreValidationError("Audit ledger orphan is not a ledger entry", [
9480
+ { path: "ledger_entry_id", message: "must name an entry of this org's ledger" }
9481
+ ]);
9482
+ }
9483
+ if (this.auditLedgerOrphans.has(orphan.ledger_entry_id) || staged.some((row) => row.ledger_entry_id === orphan.ledger_entry_id)) {
9484
+ throw new ProtocolStoreValidationError("Audit ledger orphan is already registered", [
9485
+ { path: "ledger_entry_id", message: "an orphan is registered once" }
9486
+ ]);
9487
+ }
9488
+ staged.push({
9489
+ ledger_entry_id: entry.ledger_entry_id,
9490
+ org_id: input.orgId,
9491
+ entry_hash: entry.entry_hash,
9492
+ fork_prev_hash: entry.prev_hash,
9493
+ reason: orphan.reason,
9494
+ resolution_entry_id: null,
9495
+ recorded_at: (/* @__PURE__ */ new Date()).toISOString(),
9496
+ recorded_by: input.recordedBy
9497
+ });
9498
+ }
9499
+ for (const row of staged) this.auditLedgerOrphans.set(row.ledger_entry_id, row);
9500
+ }
9501
+ /** Mirror of the one permitted registry update: name the resolution entry, once. */
9502
+ async setAuditLedgerOrphanResolution(input) {
9503
+ const resolution = this.auditLedgerChainById.get(input.resolutionEntryId);
9504
+ if (!resolution || resolution.org_id !== input.orgId) {
9505
+ throw new ProtocolStoreValidationError("Audit ledger resolution entry is unknown", [
9506
+ { path: "resolution_entry_id", message: "must name an entry of this org's ledger" }
9507
+ ]);
9508
+ }
9509
+ const rows = input.ledgerEntryIds.map((id) => this.auditLedgerOrphans.get(id));
9510
+ if (rows.some((row) => !row || row.org_id !== input.orgId || row.resolution_entry_id !== null)) {
9511
+ throw new ProtocolStoreValidationError("Audit ledger orphan resolution is immutable", [
9512
+ { path: "resolution_entry_id", message: "set once, on a registered unresolved orphan" }
9513
+ ]);
9514
+ }
9515
+ for (const row of rows) row.resolution_entry_id = input.resolutionEntryId;
9516
+ }
9180
9517
  async getLatestAuditLedgerHead(orgId) {
9181
- const latest = Array.from(this.auditLedgerChainById.values()).filter((row) => row.org_id === orgId).sort(_MemoryProtocolStore.compareCanonicalLedgerRows).at(-1);
9518
+ const latest = Array.from(this.auditLedgerChainById.values()).filter((row) => row.org_id === orgId && !this.auditLedgerOrphans.has(row.ledger_entry_id)).sort(_MemoryProtocolStore.compareCanonicalLedgerRows).at(-1);
9182
9519
  if (!latest) return null;
9183
9520
  return {
9184
9521
  ledger_entry_id: latest.ledger_entry_id,
@@ -9188,7 +9525,7 @@ var MemoryProtocolStore = class _MemoryProtocolStore {
9188
9525
  }
9189
9526
  async getAuditLedgerEntry(input) {
9190
9527
  const row = this.auditLedgerChainById.get(input.ledgerEntryId);
9191
- return row?.org_id === input.orgId ? structuredClone(row) : null;
9528
+ return row?.org_id === input.orgId ? structuredClone(this.withLedgerMembership(row)) : null;
9192
9529
  }
9193
9530
  async listSignalEnvelopes(input) {
9194
9531
  const wanted = new Set(input.signalIds);
@@ -9206,12 +9543,12 @@ var MemoryProtocolStore = class _MemoryProtocolStore {
9206
9543
  return Array.from(latest.values()).map((row) => row.payload);
9207
9544
  }
9208
9545
  async verifyAuditLedgerChain(input) {
9209
- const rows = Array.from(this.byKey.values()).filter((row) => row.kind === "audit_ledger_entry").filter((row) => row.org_id === input.orgId).sort((left, right) => {
9546
+ const rows = Array.from(this.byKey.values()).filter((row) => row.kind === "audit_ledger_entry").filter((row) => row.org_id === input.orgId).filter((row) => !this.auditLedgerOrphans.has(row.artifact_id)).sort((left, right) => {
9210
9547
  const leftTs = left.occurred_at?.getTime() ?? 0;
9211
9548
  const rightTs = right.occurred_at?.getTime() ?? 0;
9212
9549
  return leftTs - rightTs;
9213
9550
  }).slice(0, Math.max(1, Math.min(input.limit, 5e3)));
9214
- return verifyLedgerChain(
9551
+ const verification = verifyLedgerChain(
9215
9552
  input.orgId,
9216
9553
  rows.map((row) => {
9217
9554
  const chain = row.payload.chain ?? {};
@@ -9223,10 +9560,21 @@ var MemoryProtocolStore = class _MemoryProtocolStore {
9223
9560
  };
9224
9561
  })
9225
9562
  );
9563
+ const candidates = this.auditLedgerOrphanCandidates(input.orgId);
9564
+ if (candidates.length === 0) return verification;
9565
+ const verifiedOrphans = verifyLedgerOrphans(input.orgId, candidates);
9566
+ const issues = [...verification.issues, ...verifiedOrphans.issues];
9567
+ return {
9568
+ ...verification,
9569
+ broken_links: issues.length,
9570
+ valid: issues.length === 0,
9571
+ issues,
9572
+ orphaned: verifiedOrphans.orphaned
9573
+ };
9226
9574
  }
9227
9575
  async verifyAuditLedgerContinuity(input) {
9228
9576
  const rows = Array.from(this.auditLedgerChainById.values()).filter(
9229
- (row) => row.org_id === input.orgId
9577
+ (row) => row.org_id === input.orgId && !this.auditLedgerOrphans.has(row.ledger_entry_id)
9230
9578
  );
9231
9579
  rows.sort(_MemoryProtocolStore.compareCanonicalLedgerRows);
9232
9580
  const maxEntries = input.maxEntries === void 0 ? rows.length : Number.isFinite(input.maxEntries) ? Math.max(1, Math.min(Math.floor(input.maxEntries), Number.MAX_SAFE_INTEGER)) : 1;
@@ -9239,14 +9587,19 @@ var MemoryProtocolStore = class _MemoryProtocolStore {
9239
9587
  algorithm: typeof row.payload.chain?.algorithm === "string" ? row.payload.chain.algorithm : void 0
9240
9588
  }))
9241
9589
  );
9590
+ const verifiedOrphans = verifyLedgerOrphans(
9591
+ input.orgId,
9592
+ this.auditLedgerOrphanCandidates(input.orgId)
9593
+ );
9242
9594
  return {
9243
9595
  org_id: verification.org_id,
9244
9596
  checked: verification.checked,
9245
- valid: complete && verification.valid,
9597
+ valid: complete && verification.valid && verifiedOrphans.issues.length === 0,
9246
9598
  complete,
9247
- broken_links: verification.broken_links,
9599
+ broken_links: verification.broken_links + verifiedOrphans.issues.length,
9248
9600
  head_hash: verification.head_hash,
9249
- tail_hash: verification.tail_hash
9601
+ tail_hash: verification.tail_hash,
9602
+ ...verifiedOrphans.orphaned.length > 0 ? { orphaned: verifiedOrphans.orphaned } : {}
9250
9603
  };
9251
9604
  }
9252
9605
  async listPolicyBundles(input) {
@@ -9455,7 +9808,7 @@ var MemoryProtocolStore = class _MemoryProtocolStore {
9455
9808
  const matching = Array.from(this.auditLedgerChainById.values()).filter((row) => row.org_id === input.orgId).filter((row) => {
9456
9809
  const payload = row.payload.payload;
9457
9810
  return payload !== null && typeof payload === "object" && !Array.isArray(payload) && payload.chain_id === input.chainId;
9458
- }).sort(compareDecisionChainLedgerRows);
9811
+ }).sort(compareDecisionChainLedgerRows).map((row) => this.withLedgerMembership(row));
9459
9812
  return {
9460
9813
  entries: matching.slice(0, limit),
9461
9814
  limit,
@@ -9532,7 +9885,7 @@ function createMemoryProtocolStore() {
9532
9885
  return new MemoryProtocolStore();
9533
9886
  }
9534
9887
 
9535
- // ../protocol/src/auth/McpAuth.ts
9888
+ // ../../../Decionis/apps/protocol/src/auth/McpAuth.ts
9536
9889
  import { createHash as createHash2 } from "crypto";
9537
9890
  var McpAuth = class _McpAuth {
9538
9891
  static hashApiKey(rawKey, env = process.env) {
@@ -9602,7 +9955,7 @@ function hasAnyScope(grantedScopes, requiredScopes) {
9602
9955
  return McpAuth.hasAnyScope(grantedScopes, requiredScopes);
9603
9956
  }
9604
9957
 
9605
- // ../protocol/src/mcp/McpContracts.ts
9958
+ // ../../../Decionis/apps/protocol/src/mcp/McpContracts.ts
9606
9959
  var MCP_PROTOCOL_VERSIONS = [
9607
9960
  "2025-11-25",
9608
9961
  "2025-06-18",
@@ -9616,7 +9969,7 @@ var MCP_OAUTH_USER_EMAIL_ARGUMENT = "__decionis_oauth_user_email";
9616
9969
  var DEFAULT_PUBLIC_BASE_URL = "https://protocol.decionis.com";
9617
9970
  var MCP_HTTP_PATHS = ["/mcp", "/v1/protocol/mcp"];
9618
9971
 
9619
- // ../protocol/src/http/InternalAccessGuard.ts
9972
+ // ../../../Decionis/apps/protocol/src/http/InternalAccessGuard.ts
9620
9973
  import { timingSafeEqual } from "crypto";
9621
9974
  var MCP_DISCOVERY_SUFFIXES = [
9622
9975
  "/.well-known/oauth-protected-resource",
@@ -9708,7 +10061,7 @@ function registerInternalAccessGuard(app, env = process.env, tenantAuthLookup =
9708
10061
  });
9709
10062
  }
9710
10063
 
9711
- // ../protocol/src/http/InternalRouteInvoker.ts
10064
+ // ../../../Decionis/apps/protocol/src/http/InternalRouteInvoker.ts
9712
10065
  function injectInternalProtocolRoute(app, input) {
9713
10066
  const internalSecret = resolveInternalSecret();
9714
10067
  return app.inject({
@@ -9722,7 +10075,7 @@ function injectInternalProtocolRoute(app, input) {
9722
10075
  });
9723
10076
  }
9724
10077
 
9725
- // ../protocol/src/mcp/McpSupport.ts
10078
+ // ../../../Decionis/apps/protocol/src/mcp/McpSupport.ts
9726
10079
  var McpSupport = class {
9727
10080
  static asRecord(value) {
9728
10081
  if (!value || typeof value !== "object" || Array.isArray(value)) return null;
@@ -9834,10 +10187,11 @@ function withQuery(path, query) {
9834
10187
  return McpSupport.withQuery(path, query);
9835
10188
  }
9836
10189
 
9837
- // ../protocol/src/mcp/McpAuthGuard.ts
10190
+ // ../../../Decionis/apps/protocol/src/mcp/McpAuthGuard.ts
9838
10191
  var orgScopedToolNames = /* @__PURE__ */ new Set([
9839
10192
  "decionis.get_started",
9840
10193
  "get_started",
10194
+ "explore",
9841
10195
  "decionis.evaluate_decision",
9842
10196
  "evaluate_decision",
9843
10197
  "decionis.explain_decision",
@@ -9860,6 +10214,8 @@ var orgScopedToolNames = /* @__PURE__ */ new Set([
9860
10214
  "list_enforcement_rollouts",
9861
10215
  "decionis.upsert_enforcement_rollout",
9862
10216
  "upsert_enforcement_rollout",
10217
+ "decionis.seed_policy_pack",
10218
+ "seed_policy_pack",
9863
10219
  "decionis.resolve_vertical_pack",
9864
10220
  "resolve_vertical_pack",
9865
10221
  "decionis.run_shadow_decisioning",
@@ -9985,6 +10341,10 @@ var McpAuthGuard = class _McpAuthGuard {
9985
10341
  if (!_McpAuthGuard.isOAuthClientAuth(auth)) return prompts;
9986
10342
  return prompts.filter((prompt) => conversationalOAuthPromptNames.has(prompt.name));
9987
10343
  }
10344
+ /** Whether an org API key is confined to its own organization for this tool. */
10345
+ static isOrgScopedTool(name) {
10346
+ return orgScopedToolNames.has(name);
10347
+ }
9988
10348
  static findTargetOrgIdForTool(name, args) {
9989
10349
  if (orgScopedToolNames.has(name)) {
9990
10350
  return asString(args.org_id);
@@ -10035,6 +10395,9 @@ var McpAuthGuard = class _McpAuthGuard {
10035
10395
  if (name === "decionis.upsert_enforcement_rollout" || name === "upsert_enforcement_rollout") {
10036
10396
  return ["decision:write", "decision:*", "org:*"];
10037
10397
  }
10398
+ if (name === "decionis.seed_policy_pack" || name === "seed_policy_pack") {
10399
+ return ["policy:write", "policy:*", "org:*"];
10400
+ }
10038
10401
  return [];
10039
10402
  }
10040
10403
  static readAuthorizationForResource(uri) {
@@ -10141,10 +10504,10 @@ function authorizeResourceRead(auth, uri) {
10141
10504
  return McpAuthGuard.authorizeResourceRead(auth, uri);
10142
10505
  }
10143
10506
 
10144
- // ../protocol/src/mcp/McpRoutes.ts
10507
+ // ../../../Decionis/apps/protocol/src/mcp/McpRoutes.ts
10145
10508
  import { createHash as createHash4, randomUUID as randomUUID2 } from "crypto";
10146
10509
 
10147
- // ../../packages/shared/src/Connectors/ConnectorRegistry.ts
10510
+ // ../../../Decionis/packages/shared/src/Connectors/ConnectorRegistry.ts
10148
10511
  var SITE = "https://decionis.com";
10149
10512
  var connectors = [
10150
10513
  // ── Commerce ──────────────────────────────────────────────────────────
@@ -10178,6 +10541,14 @@ var connectors = [
10178
10541
  distribution: { download: false, guidedInstall: true, remoteInstall: false },
10179
10542
  activation: { method: "marketplace_install", requiresWorkspace: true },
10180
10543
  presenceSupport: "planned",
10544
+ failurePosture: {
10545
+ posture: "STRICT",
10546
+ whenUnavailable: "Checkout keeps enforcing the signed policy snapshot already pushed to the store, so an outage changes nothing until that snapshot expires after seven days. After that, or if the snapshot is missing, checkout is blocked.",
10547
+ configurable: 'Each rule has an "If Decionis is unreachable" setting in the app, fail closed by default.',
10548
+ ungovernedMarker: null,
10549
+ evidence: "decionis/Commerce: apps/shopify/extensions/*-hard-gate; app/lib/policies/RuleEnforcement.server.ts",
10550
+ knownGap: "Only the net-margin rule's setting reaches checkout today; the other rules' settings are stored but not applied. A product with no cost on file is margin-checked as if its cost were zero."
10551
+ },
10181
10552
  marketplaceListingId: "shopify-app",
10182
10553
  providerId: "SHOPIFY"
10183
10554
  },
@@ -10212,6 +10583,14 @@ var connectors = [
10212
10583
  distribution: { download: false, guidedInstall: true, remoteInstall: false },
10213
10584
  activation: { method: "api_key", requiresWorkspace: true },
10214
10585
  presenceSupport: "planned",
10586
+ failurePosture: {
10587
+ posture: "BOUNDED_CONTINUITY",
10588
+ whenUnavailable: "If the store cannot reach Decionis, checkout continues by default.",
10589
+ configurable: '"If Decionis is unreachable" in the plugin settings: fail open (the default) or fail closed.',
10590
+ ungovernedMarker: "The order records the decision as bypassed, with the reason.",
10591
+ evidence: "decionis/Commerce: connectors/woo/plugin/includes/checkout/RuntimeClient.php; includes/orders/DossierMetadata.php",
10592
+ knownGap: "An error inside the gate is still answered as allow, so the order proceeds even when fail closed is set. An order with no cost on file proceeds without a margin check."
10593
+ },
10215
10594
  marketplaceTarget: "woo",
10216
10595
  marketplaceListingId: "woo-plugin",
10217
10596
  providerId: "WOO"
@@ -10228,7 +10607,7 @@ var connectors = [
10228
10607
  vendor: "eBay",
10229
10608
  category: "commerce",
10230
10609
  status: "installable",
10231
- summary: "Margin and promo-hygiene guardrails for eBay Sell-API listings, orders, and promotions \u2014 eBay OAuth connect, production-approved, shadow-mode dossiers with enforcement pending write-scope approval.",
10610
+ summary: "Margin and promotion guardrails for your eBay listings, orders and promotions. Connect with eBay sign-in; it starts in Shadow Mode, with a signed Decision Dossier for every decision.",
10232
10611
  capabilities: ["margin-guardrails", "promo-hygiene", "shadow-mode", "signed-decision-dossier"],
10233
10612
  decisionsSupported: ["listing-change", "order-fulfillment", "promotion"],
10234
10613
  installation: [
@@ -10247,6 +10626,13 @@ var connectors = [
10247
10626
  distribution: { download: false, guidedInstall: true, remoteInstall: false },
10248
10627
  activation: { method: "oauth", requiresWorkspace: true },
10249
10628
  presenceSupport: "planned",
10629
+ failurePosture: {
10630
+ posture: "BOUNDED_CONTINUITY",
10631
+ whenUnavailable: "Listings are left as they are; the monitor never reprices or withdraws a listing without an answer.",
10632
+ configurable: null,
10633
+ ungovernedMarker: "The sweep result reports the listing as observed, with the enforcement error.",
10634
+ evidence: "decionis/Commerce: connectors/adapters/ebay/src/enforcement/Enforcer.ts; connectors/ebay/src/Monitor.ts"
10635
+ },
10250
10636
  marketplaceTarget: "ebay",
10251
10637
  providerId: "EBAY"
10252
10638
  },
@@ -10299,6 +10685,14 @@ var connectors = [
10299
10685
  distribution: { download: true, guidedInstall: false, remoteInstall: false },
10300
10686
  activation: { method: "enrollment_token", requiresWorkspace: true },
10301
10687
  presenceSupport: "planned",
10688
+ failurePosture: {
10689
+ posture: "BOUNDED_CONTINUITY",
10690
+ whenUnavailable: "Checkout continues: the Magento hook is optional with a two-second timeout, and an engine error is answered as success.",
10691
+ configurable: null,
10692
+ ungovernedMarker: "Log lines at checkout; the post-placement sweep records orders it could not check.",
10693
+ evidence: "decionis/Commerce: connectors/adobe/magento-module/etc/webhooks.xml; connectors/adobe/src/App.ts",
10694
+ knownGap: "A skipped checkout check is only logged, not stored as a decision record."
10695
+ },
10302
10696
  marketplaceTarget: "adobe-commerce",
10303
10697
  providerId: "ADOBE_COMMERCE"
10304
10698
  },
@@ -10310,7 +10704,7 @@ var connectors = [
10310
10704
  vendor: "Amazon",
10311
10705
  category: "commerce",
10312
10706
  status: "validated",
10313
- summary: "Margin and pricing guardrails for Amazon SP-API listings and orders \u2014 Login with Amazon connect, shadow-mode first while live seller validation completes.",
10707
+ summary: "Margin and pricing guardrails for your Amazon listings and orders. Connect with Login with Amazon; it starts in Shadow Mode.",
10314
10708
  capabilities: ["margin-guardrails", "shadow-mode", "signed-decision-dossier"],
10315
10709
  decisionsSupported: ["listing-change", "order"],
10316
10710
  installation: [],
@@ -10318,6 +10712,13 @@ var connectors = [
10318
10712
  distribution: { download: false, guidedInstall: false, remoteInstall: false },
10319
10713
  activation: { method: "oauth", requiresWorkspace: true },
10320
10714
  presenceSupport: "planned",
10715
+ failurePosture: {
10716
+ posture: "OBSERVE_ONLY",
10717
+ whenUnavailable: "Amazon has no way to hold an order, so Commerce Gate records decisions only. During an outage the order ships untouched.",
10718
+ configurable: null,
10719
+ ungovernedMarker: "The sweep is recorded as failed.",
10720
+ evidence: "decionis/Commerce: connectors/amazon/src/orders/AmazonOrderGate.ts"
10721
+ },
10321
10722
  marketplaceTarget: "amazon",
10322
10723
  providerId: "AMAZON"
10323
10724
  },
@@ -10339,6 +10740,14 @@ var connectors = [
10339
10740
  distribution: { download: false, guidedInstall: false, remoteInstall: false },
10340
10741
  activation: { method: "oauth", requiresWorkspace: true },
10341
10742
  presenceSupport: "planned",
10743
+ failurePosture: {
10744
+ posture: "BOUNDED_CONTINUITY",
10745
+ whenUnavailable: "Orders are released without a margin check, after the buyer-remorse hold where one applies.",
10746
+ configurable: null,
10747
+ ungovernedMarker: null,
10748
+ evidence: "decionis/Commerce: connectors/tiktok/src/interception/OrderInterceptor.ts",
10749
+ knownGap: "Nothing is stored for an order released this way, and the returned detail reads as a missing cost rather than an outage."
10750
+ },
10342
10751
  marketplaceTarget: "tiktok",
10343
10752
  providerId: "TIKTOK_SHOP"
10344
10753
  },
@@ -10347,19 +10756,46 @@ var connectors = [
10347
10756
  // verification, margin gate, Acknowledge-Order release/hold — built and
10348
10757
  // unit-tested; Solution Provider approval and live seller verification
10349
10758
  // remain (shared readiness provenance).
10759
+ // Approved Walmart Marketplace Solution Provider (Specialty Partner —
10760
+ // Orders) with the Decionis Commerce Gate app reviewed and published in
10761
+ // the Seller Center App Store on 2026-09-16 (Walmart's notices). The
10762
+ // Sellers install it in one click from the listing; Walmart sends them to
10763
+ // the registered App Login URL and they authorize the app. The listing
10764
+ // sits behind a seller login and no public directory page exists (checked
10765
+ // 2026-09-22), so the channel names Seller Center itself — which resolves
10766
+ // publicly to Walmart's seller sign-in — and the listing by its name.
10350
10767
  slug: "walmart",
10351
- name: "Decionis for Walmart Marketplace",
10768
+ name: "Decionis Commerce Gate for Walmart Marketplace",
10352
10769
  vendor: "Walmart",
10353
10770
  category: "commerce",
10354
- status: "validated",
10355
- summary: "Post-purchase fulfillment circuit breaker for Walmart Marketplace \u2014 purchase orders clear a margin gate (COGS + referral fee + shipping) before Acknowledge-Order release.",
10771
+ status: "installable",
10772
+ summary: "Stop loss-making Walmart orders before you acknowledge them: every purchase order clears a margin check (cost of goods, referral fee and shipping) first. Install Decionis Commerce Gate in one click from the Seller Center App Store.",
10356
10773
  capabilities: ["fulfillment-circuit-breaker", "margin-guardrails", "signed-decision-dossier"],
10357
10774
  decisionsSupported: ["order-acknowledgement"],
10358
- installation: [],
10775
+ installation: [
10776
+ {
10777
+ kind: "marketplace",
10778
+ url: "https://seller.walmart.com/",
10779
+ label: "Walmart Marketplace App Store in Seller Center (seller login): Decionis Commerce Gate \u2014 Policy Controls for Walmart Marketplace"
10780
+ }
10781
+ ],
10359
10782
  documentation: `${SITE}/marketplace/walmart`,
10783
+ verification: {
10784
+ validatedBy: "Walmart Marketplace (Solution Provider approval; app review and publication)",
10785
+ evidence: "Decionis, Inc. approved as a Walmart Marketplace Solution Provider (Specialty Partner \u2014 Orders) and the Decionis Commerce Gate app validated by the Developer Portal review and published to the Seller Center App Store, all on 2026-09-16 per Walmart's notices. Sellers install it in one click from the listing. The listing is inside Seller Center (seller login); no public directory page on 2026-09-22.",
10786
+ lastValidated: "2026-09-16"
10787
+ },
10360
10788
  distribution: { download: false, guidedInstall: false, remoteInstall: false },
10361
- activation: { method: "oauth", requiresWorkspace: true },
10789
+ activation: { method: "marketplace_install", requiresWorkspace: true },
10362
10790
  presenceSupport: "planned",
10791
+ failurePosture: {
10792
+ posture: "BOUNDED_CONTINUITY",
10793
+ whenUnavailable: "Orders are acknowledged without a margin check. Refunds up to the fallback limit proceed, and larger refunds are held until the check is back.",
10794
+ configurable: "The refund fallback limit is set per deployment (1,000 by default); order acknowledgment behaviour is fixed.",
10795
+ ungovernedMarker: "Order Guard records the order as released without a margin check.",
10796
+ evidence: "decionis/Commerce: connectors/walmart/src/interception/OrderInterceptor.ts; src/policy/RefundPolicyGate.ts",
10797
+ knownGap: "An engine fault is recorded with the same wording as a missing cost, and the refund record does not say the fallback limit was used."
10798
+ },
10363
10799
  marketplaceTarget: "walmart",
10364
10800
  providerId: "WALMART_MARKETPLACE"
10365
10801
  },
@@ -10381,6 +10817,13 @@ var connectors = [
10381
10817
  distribution: { download: false, guidedInstall: false, remoteInstall: false },
10382
10818
  activation: { method: "oauth", requiresWorkspace: true },
10383
10819
  presenceSupport: "planned",
10820
+ failurePosture: {
10821
+ posture: "STRICT",
10822
+ whenUnavailable: "Commerce Gate does not release the order; it stays in the seller's own Jumia workflow.",
10823
+ configurable: "release_mode decides whether Commerce Gate releases orders at all (advisory by default).",
10824
+ ungovernedMarker: "The intercept is recorded as observed, or as failed when a release attempt fails.",
10825
+ evidence: "decionis/Commerce: connectors/jumia/src/interception/OrderInterceptor.ts; connectors/adapters/jumia/src/settings/JumiaSettings.ts"
10826
+ },
10384
10827
  marketplaceTarget: "jumia",
10385
10828
  providerId: "JUMIA"
10386
10829
  },
@@ -10392,7 +10835,7 @@ var connectors = [
10392
10835
  vendor: "BigCommerce",
10393
10836
  category: "commerce",
10394
10837
  status: "validated",
10395
- summary: "Checkout margin gate for BigCommerce headless and Open Checkout storefronts \u2014 built and unit-tested, pending validation against a live store.",
10838
+ summary: "Checkout margin gate for BigCommerce headless and Open Checkout storefronts. It fails open, so an engine error never blocks a sale.",
10396
10839
  capabilities: ["margin-floor-enforcement", "checkout-policy-enforcement"],
10397
10840
  decisionsSupported: ["checkout-order"],
10398
10841
  installation: [],
@@ -10400,6 +10843,14 @@ var connectors = [
10400
10843
  distribution: { download: false, guidedInstall: false, remoteInstall: false },
10401
10844
  activation: { method: "api_key", requiresWorkspace: true },
10402
10845
  presenceSupport: "planned",
10846
+ failurePosture: {
10847
+ posture: "BOUNDED_CONTINUITY",
10848
+ whenUnavailable: "An engine error is answered as allow and the order proceeds.",
10849
+ configurable: null,
10850
+ ungovernedMarker: "The response says bypassed; nothing is stored.",
10851
+ evidence: "decionis/Commerce: connectors/bigcommerce/src/App.ts",
10852
+ knownGap: "How the storefront handles a timeout is outside the connector repository and is not stated here."
10853
+ },
10403
10854
  marketplaceTarget: "bigcommerce"
10404
10855
  },
10405
10856
  {
@@ -10411,7 +10862,7 @@ var connectors = [
10411
10862
  vendor: "Shopware",
10412
10863
  category: "commerce",
10413
10864
  status: "validated",
10414
- summary: "Fail-open synchronous checkout gate for Shopware 6 \u2014 App System registration handshake, shop-signed webhooks, and promo-hygiene checks, pending validation against a live store.",
10865
+ summary: "Fail-open checkout gate for Shopware 6, with signed webhooks and promotion checks.",
10415
10866
  capabilities: [
10416
10867
  "margin-floor-enforcement",
10417
10868
  "checkout-policy-enforcement",
@@ -10424,6 +10875,14 @@ var connectors = [
10424
10875
  distribution: { download: false, guidedInstall: false, remoteInstall: false },
10425
10876
  activation: { method: "api_key", requiresWorkspace: true },
10426
10877
  presenceSupport: "planned",
10878
+ failurePosture: {
10879
+ posture: "BOUNDED_CONTINUITY",
10880
+ whenUnavailable: "An engine error is answered as allow and the order proceeds.",
10881
+ configurable: null,
10882
+ ungovernedMarker: "The response says bypassed; nothing is stored.",
10883
+ evidence: "decionis/Commerce: connectors/shopware/src/App.ts",
10884
+ knownGap: "How the storefront handles a timeout is outside the connector repository and is not stated here."
10885
+ },
10427
10886
  marketplaceTarget: "shopware"
10428
10887
  },
10429
10888
  // ── Enterprise ────────────────────────────────────────────────────────
@@ -10471,12 +10930,20 @@ var connectors = [
10471
10930
  documentation: `${SITE}/marketplace/sap`,
10472
10931
  verification: {
10473
10932
  validatedBy: "SAP PartnerEdge Solution Review",
10474
- evidence: "Solution Review completed and approved 2026-06-22 (SAP PartnerEdge solution id 2004368); SAP Store content listing is the next, contract-gated step.",
10933
+ evidence: "SAP PartnerEdge Solution Review completed and approved on 22 June 2026 (solution 2004368).",
10475
10934
  lastValidated: "2026-06-22"
10476
10935
  },
10477
10936
  distribution: { download: true, guidedInstall: false, remoteInstall: false },
10478
10937
  activation: { method: "enrollment_token", requiresWorkspace: true },
10479
10938
  presenceSupport: "planned",
10939
+ failurePosture: {
10940
+ posture: "CUSTOM",
10941
+ whenUnavailable: "If the Decionis gate cannot be reached, a local fallback gate decides with fixed rules (allow, block, delay or escalate), and a request missing required fields is blocked.",
10942
+ configurable: "Set DECIONIS_PROTOCOL_FAIL_CLOSED=1 to block instead.",
10943
+ ungovernedMarker: "The dossier is marked federated: false, with a local id.",
10944
+ evidence: "decionis/Commerce: apps/sap/srv/decionis-client.js; apps/sap/docs/runtime-config.md",
10945
+ knownGap: "The call to the Decionis gate has no timeout."
10946
+ },
10480
10947
  providerId: "SAP"
10481
10948
  },
10482
10949
  {
@@ -10515,6 +10982,13 @@ var connectors = [
10515
10982
  distribution: { download: false, guidedInstall: false, remoteInstall: false },
10516
10983
  activation: { method: "enrollment_token", requiresWorkspace: true },
10517
10984
  presenceSupport: "planned",
10985
+ failurePosture: {
10986
+ posture: "STRICT",
10987
+ whenUnavailable: "The governed Flow action stops and downstream updates are halted, in every mode. The shadow observers only record, after the record is saved.",
10988
+ configurable: null,
10989
+ ungovernedMarker: null,
10990
+ evidence: "apps/servicenow/app/script-includes/DecionisControlPlaneUtils.script.js; DecionisVerifyIntentAction.script.js"
10991
+ },
10518
10992
  marketplaceTarget: "servicenow",
10519
10993
  providerId: "SERVICENOW"
10520
10994
  },
@@ -10528,7 +11002,7 @@ var connectors = [
10528
11002
  vendor: "Salesforce",
10529
11003
  category: "enterprise",
10530
11004
  status: "installable",
10531
- summary: "Pre-execution Action Gate for Salesforce \u2014 Flow, Apex, and Agentforce actions checked before they run (allow / hold / escalate) with signed Decision Dossiers on the record. Customer-deployed starter package, shadow-first rollout.",
11005
+ summary: "Check Salesforce Flow, Apex and Agentforce actions before they run (allow, hold or escalate), with signed Decision Dossiers on the record. Install the starter package in your org; it starts in Shadow Mode.",
10532
11006
  capabilities: [
10533
11007
  "pre-execution-action-gate",
10534
11008
  "shadow-mode",
@@ -10552,6 +11026,13 @@ var connectors = [
10552
11026
  distribution: { download: true, guidedInstall: false, remoteInstall: false },
10553
11027
  activation: { method: "api_key", requiresWorkspace: true },
10554
11028
  presenceSupport: "planned",
11029
+ failurePosture: {
11030
+ posture: "CUSTOM",
11031
+ whenUnavailable: "The action returns an error message and no decision. A Flow that requires continueAction to be true stops; a Flow that does not check it continues.",
11032
+ configurable: "Your Flow's condition on continueAction.",
11033
+ ungovernedMarker: "errorMessage is set and continueAction is empty.",
11034
+ evidence: "docs/marketplace/salesforce/starter-package/force-app/main/default/classes/DecionisActionGate.cls"
11035
+ },
10555
11036
  marketplaceTarget: "salesforce",
10556
11037
  marketplaceListingId: "salesforce-app",
10557
11038
  providerId: "SALESFORCE"
@@ -10579,6 +11060,13 @@ var connectors = [
10579
11060
  distribution: { download: false, guidedInstall: true, remoteInstall: false },
10580
11061
  activation: { method: "oauth", requiresWorkspace: true },
10581
11062
  presenceSupport: "planned",
11063
+ failurePosture: {
11064
+ posture: "STRICT",
11065
+ whenUnavailable: "The step retries once, then Zapier replays it; later steps in the Zap do not run until Decionis answers.",
11066
+ configurable: null,
11067
+ ungovernedMarker: null,
11068
+ evidence: "packages/zapier-decionis/creates/DecisionDossierClient.js"
11069
+ },
10582
11070
  marketplaceListingId: "zapier"
10583
11071
  },
10584
11072
  {
@@ -10604,31 +11092,45 @@ var connectors = [
10604
11092
  documentation: `${SITE}/docs/automation-connectors#make`,
10605
11093
  distribution: { download: false, guidedInstall: false, remoteInstall: false },
10606
11094
  activation: { method: "oauth", requiresWorkspace: true },
10607
- presenceSupport: "planned"
11095
+ presenceSupport: "planned",
11096
+ failurePosture: {
11097
+ posture: "CUSTOM",
11098
+ whenUnavailable: "Make connects through its HTTP module. Decionis answers 502, and your scenario's error handling decides whether the next module runs.",
11099
+ configurable: "The error handler on your scenario's HTTP module.",
11100
+ ungovernedMarker: null,
11101
+ evidence: "apps/web/app/docs/automation-connectors/page.tsx (Make recipe); apps/api/src/routes/ProtocolRoutes.ts"
11102
+ }
10608
11103
  },
10609
11104
  {
10610
- // Community node published on npm (registry sweep 2026-08-10:
10611
- // n8n-nodes-decionis@0.1.0).
11105
+ // The n8n community node (n8n-nodes-decionis) was retired on 2026-09-26.
11106
+ // n8n stays a recipe: an HTTP Request node calls the same gate, and the
11107
+ // four example workflows under /examples/n8n use only built-in nodes.
10612
11108
  slug: "n8n",
10613
11109
  name: "Decionis for n8n",
10614
11110
  vendor: "n8n",
10615
11111
  category: "automation",
10616
- status: "production",
10617
- version: "0.1.0",
10618
- summary: "Every automation step asks permission before it executes \u2014 install the n8n community node from npm, or start from the HTTP Request recipe and four importable example workflows.",
11112
+ status: "installable",
11113
+ summary: "Every automation step asks permission before it executes \u2014 add an HTTP Request node before the protected step, or start from four importable example workflows that use only built-in nodes.",
10619
11114
  capabilities: ["automation-step-governance", "signed-decision-dossier"],
10620
11115
  decisionsSupported: ["automation-step"],
10621
11116
  installation: [
10622
11117
  {
10623
- kind: "npm",
10624
- url: "https://www.npmjs.com/package/n8n-nodes-decionis",
10625
- label: "n8n community node on npm"
11118
+ kind: "docs",
11119
+ url: `${SITE}/docs/automation-connectors#n8n`,
11120
+ label: "HTTP Request recipe and example workflows"
10626
11121
  }
10627
11122
  ],
10628
11123
  documentation: `${SITE}/docs/automation-connectors#n8n`,
10629
11124
  distribution: { download: false, guidedInstall: false, remoteInstall: false },
10630
11125
  activation: { method: "api_key", requiresWorkspace: true },
10631
- presenceSupport: "planned"
11126
+ presenceSupport: "planned",
11127
+ failurePosture: {
11128
+ posture: "CUSTOM",
11129
+ whenUnavailable: "n8n connects through its HTTP Request node. Decionis answers 502, and your workflow's error handling decides whether the next node runs.",
11130
+ configurable: "The HTTP Request node's On Error setting, and the IF branch on the outcome.",
11131
+ ungovernedMarker: null,
11132
+ evidence: "apps/web/app/docs/automation-connectors/page.tsx (n8n recipe); apps/api/src/routes/ProtocolRoutes.ts"
11133
+ }
10632
11134
  },
10633
11135
  // ── Platform ──────────────────────────────────────────────────────────
10634
11136
  {
@@ -10653,6 +11155,13 @@ var connectors = [
10653
11155
  distribution: { download: false, guidedInstall: false, remoteInstall: false },
10654
11156
  activation: { method: "api_key", requiresWorkspace: true },
10655
11157
  presenceSupport: "planned",
11158
+ failurePosture: {
11159
+ posture: "OBSERVE_ONLY",
11160
+ whenUnavailable: "Webhooks carry signals in and decisions out; they never hold an action themselves. Senders should retry 5xx answers and timeouts with backoff.",
11161
+ configurable: null,
11162
+ ungovernedMarker: null,
11163
+ evidence: "apps/web/app/docs/webhooks/page.tsx"
11164
+ },
10656
11165
  providerId: "WEBHOOK"
10657
11166
  },
10658
11167
  {
@@ -10676,10 +11185,17 @@ var connectors = [
10676
11185
  label: "Docker Hub"
10677
11186
  }
10678
11187
  ],
10679
- documentation: `${SITE}/docs/protocol-mcp`,
11188
+ documentation: "https://decionis.ai/mcp",
10680
11189
  distribution: { download: false, guidedInstall: true, remoteInstall: false },
10681
11190
  activation: { method: "enrollment_token", requiresWorkspace: true },
10682
- presenceSupport: "planned"
11191
+ presenceSupport: "planned",
11192
+ failurePosture: {
11193
+ posture: "OBSERVE_ONLY",
11194
+ whenUnavailable: "The extension shows decisions and verifies records offline; it does not hold container actions.",
11195
+ configurable: null,
11196
+ ungovernedMarker: null,
11197
+ evidence: "Registry scope (visibility and offline verification); extension source at github.com/decionis/docker"
11198
+ }
10683
11199
  // No providerId: like zapier/make, this surface connects through
10684
11200
  // connector_enrollments, never an org_integrations row.
10685
11201
  },
@@ -10708,14 +11224,21 @@ var connectors = [
10708
11224
  },
10709
11225
  {
10710
11226
  kind: "docs",
10711
- url: `${SITE}/docs/protocol-mcp#try-hosted`,
11227
+ url: "https://decionis.ai/mcp#hosted",
10712
11228
  label: "Hosted connector guide"
10713
11229
  }
10714
11230
  ],
10715
- documentation: `${SITE}/docs/protocol-mcp`,
11231
+ documentation: "https://decionis.ai/mcp",
10716
11232
  distribution: { download: false, guidedInstall: true, remoteInstall: false },
10717
11233
  activation: { method: "oauth", requiresWorkspace: true },
10718
- presenceSupport: "planned"
11234
+ presenceSupport: "planned",
11235
+ failurePosture: {
11236
+ posture: "OBSERVE_ONLY",
11237
+ whenUnavailable: "The connector never runs the action itself. If Decionis cannot answer, the tool returns an error and no authority card; what the assistant does next is up to the assistant and you.",
11238
+ configurable: null,
11239
+ ungovernedMarker: "The tool result is marked as an error.",
11240
+ evidence: "apps/protocol/src/mcp/McpTools.ts"
11241
+ }
10719
11242
  },
10720
11243
  {
10721
11244
  // ChatGPT connects through the same hosted MCP OAuth connector: the
@@ -10743,14 +11266,67 @@ var connectors = [
10743
11266
  },
10744
11267
  {
10745
11268
  kind: "docs",
10746
- url: `${SITE}/docs/protocol-mcp#try-hosted`,
11269
+ url: "https://decionis.ai/mcp#hosted",
10747
11270
  label: "Hosted connector guide"
10748
11271
  }
10749
11272
  ],
10750
- documentation: `${SITE}/docs/protocol-mcp`,
11273
+ documentation: "https://decionis.ai/mcp",
10751
11274
  distribution: { download: false, guidedInstall: true, remoteInstall: false },
10752
11275
  activation: { method: "oauth", requiresWorkspace: true },
10753
- presenceSupport: "planned"
11276
+ presenceSupport: "planned",
11277
+ failurePosture: {
11278
+ posture: "OBSERVE_ONLY",
11279
+ whenUnavailable: "The connector never runs the action itself. If Decionis cannot answer, the tool returns an error and no authority card; what the assistant does next is up to the assistant and you.",
11280
+ configurable: null,
11281
+ ungovernedMarker: "The tool result is marked as an error.",
11282
+ evidence: "apps/protocol/src/mcp/McpTools.ts"
11283
+ }
11284
+ },
11285
+ {
11286
+ // Not a vendor connector: the Node SDK's AuthZEN input adapter, which
11287
+ // carries an enterprise policy decision point's answer into evaluation
11288
+ // as a material signal. `validated` = exercised against a real AuthZEN
11289
+ // 1.0 PDP (Cerbos PDP 0.55.0) on 2026-09-22 with the exchange recorded
11290
+ // and replayed through the starter bundle. The npm channel was added
11291
+ // once @decionis/sdk 0.3.0 (the first version carrying the provider)
11292
+ // was confirmed on the registry: published 2026-09-22T07:23Z, tarball
11293
+ // shasum 37d6915a7a7e273eb51f4baa7b67987d62595b3f.
11294
+ slug: "authzen",
11295
+ name: "AuthZEN input adapter (Node SDK)",
11296
+ vendor: "OpenID AuthZEN 1.0 policy decision points",
11297
+ category: "platform",
11298
+ status: "validated",
11299
+ summary: "Carry an enterprise policy decision point's OpenID AuthZEN 1.0 answer into a Decionis evaluation as a material signal: the PDP decides access, Decionis decides whether this exact execution has authority, and the answer travels inside the signed inputs snapshot.",
11300
+ capabilities: [
11301
+ "upstream-authorization-signal",
11302
+ "authzen-1-0-evaluation",
11303
+ "allow-listed-discovery",
11304
+ "signed-decision-dossier"
11305
+ ],
11306
+ decisionsSupported: ["any-evaluate-decision-request", "payment.release (starter bundle)"],
11307
+ installation: [
11308
+ {
11309
+ kind: "npm",
11310
+ url: "https://www.npmjs.com/package/@decionis/sdk",
11311
+ label: "npm install @decionis/sdk (0.3.0 or later)"
11312
+ }
11313
+ ],
11314
+ documentation: `${SITE}/docs/authzen-interoperability`,
11315
+ verification: {
11316
+ validatedBy: "Decionis engineering (recorded interoperability run, self-attested)",
11317
+ evidence: "AuthZEN 1.0 discovery and evaluation against Cerbos PDP 0.55.0 recorded on 2026-09-22 (packages/sdk-node/test/fixtures/authzen-cerbos-interop.json) and replayed verbatim through the starter bundle by apps/protocol/test/UpstreamAuthorizationRecordedPdp.test.ts: permit \u2192 ALLOW within the desk limit / ESCALATE above it, deny \u2192 BLOCK; SDK and Protocol digests agree on the real material. Cerbos is the decision point used, not a partner. The provider ships in @decionis/sdk 0.3.0, on npm since 2026-09-22.",
11318
+ lastValidated: "2026-09-22"
11319
+ },
11320
+ distribution: { download: false, guidedInstall: false, remoteInstall: false },
11321
+ activation: { method: "api_key", requiresWorkspace: true },
11322
+ presenceSupport: "planned",
11323
+ failurePosture: {
11324
+ posture: "CUSTOM",
11325
+ whenUnavailable: "AuthZEN feeds Decionis a signal; it is not a gate. If Decionis is down, the SDK call it feeds decides, strict by default. If your PDP is down, no signal is sent and your policy's rule for a missing signal applies; the starter policy holds the action for review.",
11326
+ configurable: "required_signals and on_failure in your policy, and the PDP timeout (five seconds by default).",
11327
+ ungovernedMarker: null,
11328
+ evidence: "packages/sdk-node/src/AuthZenEntitlementProvider.ts; docs/architecture/authzen-input-adapter.md"
11329
+ }
10754
11330
  }
10755
11331
  ];
10756
11332
  var ConnectorRegistry = class {
@@ -10772,7 +11348,36 @@ var CONNECTOR_REGISTRY = ConnectorRegistry.connectors;
10772
11348
  var getConnector = ConnectorRegistry.bySlug;
10773
11349
  var CONNECTOR_SLUGS = ConnectorRegistry.slugs();
10774
11350
 
10775
- // ../protocol/src/mcp/McpResources.ts
11351
+ // ../../../Decionis/packages/shared/src/Connectors/FailurePosture.ts
11352
+ var FAILURE_POSTURES = {
11353
+ STRICT: {
11354
+ label: "Strict",
11355
+ meaning: "If Decionis cannot be reached, the action does not run. It is refused or held until an evaluation can happen.",
11356
+ appropriateFor: [
11357
+ "Payments and treasury releases",
11358
+ "Privileged infrastructure changes",
11359
+ "Machine-initiated actions with no natural limit on loss"
11360
+ ]
11361
+ },
11362
+ BOUNDED_CONTINUITY: {
11363
+ label: "Bounded continuity",
11364
+ meaning: "If Decionis cannot be reached, the action may continue without an evaluation. It is ungoverned, not approved, and it is available only where a surface was configured for it.",
11365
+ appropriateFor: ["A shopper at checkout, where the exposure per order is small and bounded"]
11366
+ },
11367
+ CUSTOM: {
11368
+ label: "Custom",
11369
+ meaning: "The institution sets the behaviour per rule or per signal, for example holding an action for review when one input is unavailable.",
11370
+ appropriateFor: ["Institution-defined rules"]
11371
+ }
11372
+ };
11373
+ var SURFACE_POSTURE_LABEL = {
11374
+ STRICT: FAILURE_POSTURES.STRICT.label,
11375
+ BOUNDED_CONTINUITY: FAILURE_POSTURES.BOUNDED_CONTINUITY.label,
11376
+ CUSTOM: FAILURE_POSTURES.CUSTOM.label,
11377
+ OBSERVE_ONLY: "Observe only"
11378
+ };
11379
+
11380
+ // ../../../Decionis/apps/protocol/src/mcp/McpResources.ts
10776
11381
  var McpResources = class {
10777
11382
  static buildStaticResources(publicBaseUrl, serviceName, serviceVersion) {
10778
11383
  return [
@@ -11135,7 +11740,7 @@ function readResource(app, uri, options) {
11135
11740
  return McpResources.readResource(app, uri, options);
11136
11741
  }
11137
11742
 
11138
- // ../protocol/src/mcp/McpPrompts.ts
11743
+ // ../../../Decionis/apps/protocol/src/mcp/McpPrompts.ts
11139
11744
  var McpPrompts = class {
11140
11745
  static buildPrompts(publicBaseUrl, authDescription) {
11141
11746
  return [
@@ -11471,7 +12076,7 @@ function buildPrompts(publicBaseUrl, authDescription) {
11471
12076
  return McpPrompts.buildPrompts(publicBaseUrl, authDescription);
11472
12077
  }
11473
12078
 
11474
- // ../protocol/src/support/Parsing.ts
12079
+ // ../../../Decionis/apps/protocol/src/support/Parsing.ts
11475
12080
  var Parsing = class {
11476
12081
  static asRecord(value) {
11477
12082
  if (!value || typeof value !== "object" || Array.isArray(value)) return {};
@@ -11566,7 +12171,7 @@ function parseInstantMs(value) {
11566
12171
  return Parsing.parseInstantMs(value);
11567
12172
  }
11568
12173
 
11569
- // ../protocol/src/mcp/DecisionConversation.ts
12174
+ // ../../../Decionis/apps/protocol/src/mcp/DecisionConversation.ts
11570
12175
  var INTERNAL_CONTEXT_KEYS = /* @__PURE__ */ new Set([
11571
12176
  "source_surface",
11572
12177
  "source_protocol",
@@ -11827,7 +12432,7 @@ function buildAuthoritySummary(input) {
11827
12432
  return DecisionConversation.buildAuthoritySummary(input);
11828
12433
  }
11829
12434
 
11830
- // ../protocol/src/mcp/PresenceMcpIntegration.ts
12435
+ // ../../../Decionis/apps/protocol/src/mcp/PresenceMcpIntegration.ts
11831
12436
  import { createHash as createHash3, createHmac, timingSafeEqual as timingSafeEqual2 } from "crypto";
11832
12437
  var DEFAULT_PRESENCE_BASE_URL = "https://presence.decionis.com";
11833
12438
  var DEFAULT_TIMEOUT_MS = 1e4;
@@ -12184,7 +12789,7 @@ function sanitizePresenceDecisionContext(input) {
12184
12789
  };
12185
12790
  }
12186
12791
 
12187
- // ../protocol/src/mcp/McpTools.ts
12792
+ // ../../../Decionis/apps/protocol/src/mcp/McpTools.ts
12188
12793
  var GET_STARTED_SCENARIOS = [
12189
12794
  {
12190
12795
  user_question: "Can you send a $250,000 wire to Northstar Components?",
@@ -13336,7 +13941,7 @@ function findTool(tools, name) {
13336
13941
  return McpTools.findTool(tools, name);
13337
13942
  }
13338
13943
 
13339
- // ../protocol/src/mcp/McpOriginPolicy.ts
13944
+ // ../../../Decionis/apps/protocol/src/mcp/McpOriginPolicy.ts
13340
13945
  var DEFAULT_MCP_ALLOWED_ORIGINS = [
13341
13946
  "https://claude.ai",
13342
13947
  "https://chatgpt.com",
@@ -13370,7 +13975,7 @@ function isMcpOriginAllowed(origin2, allowedOrigins) {
13370
13975
  return parsed !== null && allowedOrigins.has(parsed);
13371
13976
  }
13372
13977
 
13373
- // ../protocol/src/mcp/McpRoutes.ts
13978
+ // ../../../Decionis/apps/protocol/src/mcp/McpRoutes.ts
13374
13979
  function buildMcpOriginGuard(publicBaseUrl) {
13375
13980
  const allowedOrigins = buildMcpAllowedOrigins(publicBaseUrl);
13376
13981
  return async (req, reply) => {
@@ -13578,7 +14183,7 @@ async function handleJsonRpcRequest(app, requestBody, options) {
13578
14183
  }
13579
14184
  const toolStartedAt = process.hrtime.bigint();
13580
14185
  const args = asRecord2(params.arguments) ?? {};
13581
- const authError = authorizeToolInvocation(options.auth, name, args);
14186
+ const authError = authorizeToolInvocation(options.auth, tool.name, args);
13582
14187
  if (authError) {
13583
14188
  const toolDurationMs2 = durationMs(toolStartedAt);
13584
14189
  await recordTelemetryBatch(app, options.telemetry, [
@@ -13615,7 +14220,10 @@ async function handleJsonRpcRequest(app, requestBody, options) {
13615
14220
  payload: jsonRpcError(id, authError.code, authError.message)
13616
14221
  };
13617
14222
  }
13618
- const result = await handleToolCall(tool, bindAuthenticatedOrgId(options.auth, name, args));
14223
+ const result = await handleToolCall(
14224
+ tool,
14225
+ bindAuthenticatedOrgId(options.auth, tool.name, args)
14226
+ );
13619
14227
  const outcome = canonicalAuthorizationOutcome(result.structuredContent);
13620
14228
  const toolDurationMs = durationMs(toolStartedAt);
13621
14229
  const terminalEvents = [
@@ -13826,7 +14434,7 @@ async function handleLegacyToolCall(app, store, auth, body) {
13826
14434
  };
13827
14435
  }
13828
14436
  const args = asRecord2(body.input) ?? {};
13829
- const authError = authorizeToolInvocation(auth, body.tool_name, args);
14437
+ const authError = authorizeToolInvocation(auth, tool.name, args);
13830
14438
  if (authError) {
13831
14439
  return {
13832
14440
  error: "FORBIDDEN",
@@ -13835,7 +14443,7 @@ async function handleLegacyToolCall(app, store, auth, body) {
13835
14443
  is_error: true
13836
14444
  };
13837
14445
  }
13838
- const result = await handleToolCall(tool, bindAuthenticatedOrgId(auth, body.tool_name, args));
14446
+ const result = await handleToolCall(tool, bindAuthenticatedOrgId(auth, tool.name, args));
13839
14447
  return {
13840
14448
  output: result.structuredContent ?? { text: result.content[0]?.text ?? "" },
13841
14449
  event: {
@@ -14010,7 +14618,7 @@ function registerProtocolMcpRoutes(app, options) {
14010
14618
  authorization_servers: [authorizationServerBaseUrl],
14011
14619
  bearer_methods_supported: ["header"],
14012
14620
  scopes_supported: ["decision:read", "decision:run", "decision:write"],
14013
- resource_documentation: "https://decionis.com/docs/protocol-mcp"
14621
+ resource_documentation: "https://decionis.ai/mcp"
14014
14622
  };
14015
14623
  const oauthAuthorizationServer = {
14016
14624
  issuer: authorizationServerBaseUrl,
@@ -14062,7 +14670,7 @@ function registerProtocolMcpRoutes(app, options) {
14062
14670
  }
14063
14671
  }
14064
14672
 
14065
- // ../protocol/src/execution-gating/ExecutionGatingSupport.ts
14673
+ // ../../../Decionis/apps/protocol/src/execution-gating/ExecutionGatingSupport.ts
14066
14674
  import { createHash as createHash5, createHmac as createHmac2, randomUUID as randomUUID3, timingSafeEqual as timingSafeEqual3 } from "crypto";
14067
14675
  var DEFAULT_POLICY_LIMITS = {
14068
14676
  max_single_payment_usd: 2,
@@ -14189,7 +14797,7 @@ function hashLedgerEntry(input) {
14189
14797
  return sha256(input);
14190
14798
  }
14191
14799
 
14192
- // ../protocol/src/execution-gating/ExecutionGatingService.ts
14800
+ // ../../../Decionis/apps/protocol/src/execution-gating/ExecutionGatingService.ts
14193
14801
  var ExecutionGatingService = class {
14194
14802
  secret;
14195
14803
  tokenTtlSeconds;
@@ -14430,15 +15038,15 @@ var ExecutionGatingService = class {
14430
15038
  };
14431
15039
  const payload = base64UrlEncode(stableStringify(claims));
14432
15040
  const signature = sign(payload, this.secret);
14433
- const token = `exec_tok_${payload}.${signature}`;
14434
- const tokenHash = sha256(token);
15041
+ const token2 = `exec_tok_${payload}.${signature}`;
15042
+ const tokenHash = sha256(token2);
14435
15043
  this.tokens.set(claims.jti, {
14436
15044
  claims,
14437
15045
  token_hash: tokenHash,
14438
15046
  consumed_at: null
14439
15047
  });
14440
15048
  return {
14441
- token,
15049
+ token: token2,
14442
15050
  claims,
14443
15051
  token_hash: tokenHash,
14444
15052
  expires_at: new Date(claims.exp * 1e3).toISOString()
@@ -14473,11 +15081,11 @@ var ExecutionGatingService = class {
14473
15081
  this.dossiers.set(dossier.dossier_id, dossier);
14474
15082
  return dossier;
14475
15083
  }
14476
- parseToken(token) {
14477
- if (!token.startsWith("exec_tok_")) {
15084
+ parseToken(token2) {
15085
+ if (!token2.startsWith("exec_tok_")) {
14478
15086
  return { valid: false, reason_codes: ["MALFORMED_EXECUTION_TOKEN"], claims: null };
14479
15087
  }
14480
- const compact = token.slice("exec_tok_".length);
15088
+ const compact = token2.slice("exec_tok_".length);
14481
15089
  const [payload, signature] = compact.split(".");
14482
15090
  if (!payload || !signature) {
14483
15091
  return { valid: false, reason_codes: ["MALFORMED_EXECUTION_TOKEN"], claims: null };
@@ -14517,7 +15125,7 @@ var ExecutionGatingService = class {
14517
15125
  const evaluation = this.evaluatePolicy(request);
14518
15126
  const shadow = request.mode === "SHADOW";
14519
15127
  const status = evaluation.status;
14520
- const token = bindExecution && !shadow && status === "ALLOW" ? this.issueToken({ request, decision_id, chain_id, action_hash }) : null;
15128
+ const token2 = bindExecution && !shadow && status === "ALLOW" ? this.issueToken({ request, decision_id, chain_id, action_hash }) : null;
14521
15129
  const ledgerEntry = this.appendLedger({
14522
15130
  tenant_id: request.tenant_id,
14523
15131
  event_type: status === "ALLOW" ? "tool.execution.allowed" : "tool.execution.blocked",
@@ -14532,10 +15140,10 @@ var ExecutionGatingService = class {
14532
15140
  metadata: {
14533
15141
  action_hash,
14534
15142
  target: request.downstream_target,
14535
- token_issued: Boolean(token)
15143
+ token_issued: Boolean(token2)
14536
15144
  }
14537
15145
  });
14538
- if (token) {
15146
+ if (token2) {
14539
15147
  this.appendLedger({
14540
15148
  tenant_id: request.tenant_id,
14541
15149
  event_type: "execution.token.issued",
@@ -14547,7 +15155,7 @@ var ExecutionGatingService = class {
14547
15155
  amount: request.action.amount,
14548
15156
  status: "ISSUED",
14549
15157
  reason_codes: ["EXECUTION_TOKEN_ISSUED"],
14550
- metadata: { token_hash: token.token_hash, expires_at: token.expires_at }
15158
+ metadata: { token_hash: token2.token_hash, expires_at: token2.expires_at }
14551
15159
  });
14552
15160
  }
14553
15161
  this.decisions.set(decision_id, {
@@ -14567,7 +15175,7 @@ var ExecutionGatingService = class {
14567
15175
  status,
14568
15176
  reason_codes: evaluation.reason_codes,
14569
15177
  telemetry: evaluation.telemetry,
14570
- token_hash: token?.token_hash ?? null
15178
+ token_hash: token2?.token_hash ?? null
14571
15179
  });
14572
15180
  const responseBase = {
14573
15181
  decision_id,
@@ -14578,15 +15186,15 @@ var ExecutionGatingService = class {
14578
15186
  should_execute: shadow ? true : status === "ALLOW",
14579
15187
  evaluation_mode: request.mode,
14580
15188
  authority_classification: shadow ? "OBSERVATIONAL" : "AUTHORITATIVE",
14581
- execution_eligible: token !== null,
15189
+ execution_eligible: token2 !== null,
14582
15190
  reason_codes: evaluation.reason_codes,
14583
15191
  policy_snapshot: POLICY_SNAPSHOT,
14584
15192
  risk_score: evaluation.risk_score,
14585
15193
  blast_radius: request.action.amount && request.action.amount > 1 ? "medium" : "low",
14586
15194
  required_escalation: null,
14587
15195
  action_hash,
14588
- execution_token: token?.token ?? null,
14589
- execution_token_expires_at: token?.expires_at ?? null,
15196
+ execution_token: token2?.token ?? null,
15197
+ execution_token_expires_at: token2?.expires_at ?? null,
14590
15198
  dossier_id: dossier.dossier_id,
14591
15199
  dossier_url: `/v1/authority/dossiers/${dossier.dossier_id}`,
14592
15200
  ledger_entry_id: ledgerEntry.event_id
@@ -14604,7 +15212,7 @@ function createExecutionGatingService(options = {}) {
14604
15212
  return new ExecutionGatingService(options);
14605
15213
  }
14606
15214
 
14607
- // ../protocol/src/execution-gating/ExecutionGatingRoutes.ts
15215
+ // ../../../Decionis/apps/protocol/src/execution-gating/ExecutionGatingRoutes.ts
14608
15216
  function verificationInputFromBody(body, tokenFallback) {
14609
15217
  const input = asRecord4(body);
14610
15218
  const target = asRecord4(input.downstream_target);
@@ -14845,7 +15453,7 @@ function registerExecutionGatingRoutes(app, options) {
14845
15453
  ExecutionGatingRoutes.register(app, options);
14846
15454
  }
14847
15455
 
14848
- // ../protocol/src/authority/AuthorityPolicyParser.ts
15456
+ // ../../../Decionis/apps/protocol/src/authority/AuthorityPolicyParser.ts
14849
15457
  var ROLE_ID = /^[A-Z][A-Z0-9_]{1,63}$/;
14850
15458
  var REASON_CODE = /^[A-Z][A-Z0-9_]{1,119}$/;
14851
15459
  var METHODS = /* @__PURE__ */ new Set(["WEBAUTHN", "MOBILE_DEVICE", "ACTIVE_LIVENESS"]);
@@ -15018,10 +15626,10 @@ var AuthorityPolicyParser = class _AuthorityPolicyParser {
15018
15626
  }
15019
15627
  };
15020
15628
 
15021
- // ../protocol/src/support/Hashing.ts
15629
+ // ../../../Decionis/apps/protocol/src/support/Hashing.ts
15022
15630
  import { createHash as createHash6 } from "crypto";
15023
15631
 
15024
- // ../protocol/src/integrity/DossierIntegrity.ts
15632
+ // ../../../Decionis/apps/protocol/src/integrity/DossierIntegrity.ts
15025
15633
  var DECISION_DOSSIER_JWKS_PATH2 = "/.well-known/decision-dossier-jwks.json";
15026
15634
  var DossierIntegrity = class _DossierIntegrity {
15027
15635
  static stableJsonStringify(value) {
@@ -15131,7 +15739,7 @@ function buildDecisionDossierVerificationStatus(input) {
15131
15739
  return DossierIntegrity.buildDecisionDossierVerificationStatus(input);
15132
15740
  }
15133
15741
 
15134
- // ../protocol/src/support/Hashing.ts
15742
+ // ../../../Decionis/apps/protocol/src/support/Hashing.ts
15135
15743
  var Hashing = class {
15136
15744
  static sha256Hex(input) {
15137
15745
  return createHash6("sha256").update(input, "utf8").digest("hex");
@@ -15159,7 +15767,7 @@ function canonicalizeForHash(value) {
15159
15767
  return Hashing.canonicalizeForHash(value);
15160
15768
  }
15161
15769
 
15162
- // ../protocol/src/policy-graph/PolicyGraph.ts
15770
+ // ../../../Decionis/apps/protocol/src/policy-graph/PolicyGraph.ts
15163
15771
  var PolicyGraph = class _PolicyGraph {
15164
15772
  static sortPolicyBundlesNewestFirst(left, right) {
15165
15773
  const leftEffective = parseInstantMs(left.effective_from) ?? Number.MIN_SAFE_INTEGER;
@@ -15464,6 +16072,14 @@ var PolicyGraph = class _PolicyGraph {
15464
16072
  * a dotted path is used as-is, so history facts (`history.window`) and
15465
16073
  * top-level facts can be required too. Deterministic: derived from the
15466
16074
  * bundle alone.
16075
+ *
16076
+ * The one exception is a bare name that IS a reserved root — the runtime
16077
+ * signals an enforcement boundary reports, and the attribution the platform
16078
+ * computes from them. Those live at the top of the fact set, not under
16079
+ * `signals.`, so resolving `workload` to `signals.workload` would make it
16080
+ * permanently missing and every evaluation a fail-safe ESCALATE. A bundle
16081
+ * that means "refuse unless a workload was reported" writes `workload`, and
16082
+ * gets what it meant.
15467
16083
  */
15468
16084
  static resolveRequiredSignalPaths(bundle) {
15469
16085
  const declared = asRecord3(bundle.payload).required_signals;
@@ -15473,7 +16089,8 @@ var PolicyGraph = class _PolicyGraph {
15473
16089
  for (const entry of entries.slice(0, 50)) {
15474
16090
  const raw = asString2(entry)?.trim();
15475
16091
  if (!raw) continue;
15476
- const path = raw.includes(".") ? raw : `signals.${raw}`;
16092
+ const reservedRoot = raw === RUNTIME_ATTRIBUTION_FACT || RUNTIME_SIGNAL_ROOTS.includes(raw);
16093
+ const path = raw.includes(".") || reservedRoot ? raw : `signals.${raw}`;
15477
16094
  if (!paths.includes(path)) paths.push(path);
15478
16095
  }
15479
16096
  return paths;
@@ -15551,6 +16168,10 @@ var PolicyGraph = class _PolicyGraph {
15551
16168
  signals[key] = normalized.value;
15552
16169
  if (normalized.provenance) signalProvenance[key] = normalized.provenance;
15553
16170
  }
16171
+ const runtimeSignals = RuntimeSignals.parse(context);
16172
+ const runtimeAttribution = RuntimeSignals.attributionOf(
16173
+ runtimeSignals.ok ? runtimeSignals : { boundary: null, workload: null }
16174
+ );
15554
16175
  const history = asRecord3(context.history);
15555
16176
  const override = asRecord3(context.override);
15556
16177
  const evidence = asRecord3(context.evidence);
@@ -15574,7 +16195,15 @@ var PolicyGraph = class _PolicyGraph {
15574
16195
  intake: context,
15575
16196
  // Reserved fact namespaces — these keys shadow same-named context keys
15576
16197
  // (the spread above runs first): signals, signal_provenance, history,
15577
- // override, evidence, attachments, attachment_count, policy.
16198
+ // override, evidence, attachments, attachment_count, policy,
16199
+ // runtime_attribution.
16200
+ //
16201
+ // `runtime_attribution` is the platform's own statement about the
16202
+ // boundary's report, and `platform_verified` on it is the field that
16203
+ // means "Decionis established this" rather than "our gateway said so".
16204
+ // It is computed here and shadows anything of that name a caller sent,
16205
+ // which the request parser refuses outright anyway.
16206
+ [RUNTIME_ATTRIBUTION_FACT]: runtimeAttribution,
15578
16207
  signals,
15579
16208
  signal_provenance: signalProvenance,
15580
16209
  signal_admission: {
@@ -16001,7 +16630,7 @@ function toEvaluatePolicySnapshot(input) {
16001
16630
  return PolicyGraph.toEvaluatePolicySnapshot(input);
16002
16631
  }
16003
16632
 
16004
- // ../protocol/src/agent-gateway/AgentTaskPolicyResolver.ts
16633
+ // ../../../Decionis/apps/protocol/src/agent-gateway/AgentTaskPolicyResolver.ts
16005
16634
  var PolicyGraphAgentTaskPolicyResolver = class {
16006
16635
  constructor(store) {
16007
16636
  this.store = store;
@@ -16169,7 +16798,7 @@ var PolicyGraphAgentTaskPolicyResolver = class {
16169
16798
  }
16170
16799
  };
16171
16800
 
16172
- // ../protocol/src/agent-gateway/MemoryAgentTaskReservationStore.ts
16801
+ // ../../../Decionis/apps/protocol/src/agent-gateway/MemoryAgentTaskReservationStore.ts
16173
16802
  import { randomUUID as randomUUID4 } from "crypto";
16174
16803
  var MemoryAgentTaskReservationStore = class {
16175
16804
  reservations = /* @__PURE__ */ new Map();
@@ -16329,7 +16958,7 @@ function createMemoryAgentTaskReservationStore() {
16329
16958
  return new MemoryAgentTaskReservationStore();
16330
16959
  }
16331
16960
 
16332
- // ../protocol/src/agent-gateway/AgentTaskCostEstimator.ts
16961
+ // ../../../Decionis/apps/protocol/src/agent-gateway/AgentTaskCostEstimator.ts
16333
16962
  var TOKENS_PER_MILLION = 1e6;
16334
16963
  var AgentTaskCostEstimator = class {
16335
16964
  project(intent, policy) {
@@ -16391,7 +17020,7 @@ var AgentTaskCostEstimator = class {
16391
17020
  }
16392
17021
  };
16393
17022
 
16394
- // ../protocol/src/agent-gateway/AgentTaskIntentParser.ts
17023
+ // ../../../Decionis/apps/protocol/src/agent-gateway/AgentTaskIntentParser.ts
16395
17024
  import { createHash as createHash7 } from "crypto";
16396
17025
  var AgentTaskIntentParser = class _AgentTaskIntentParser {
16397
17026
  static parse(input) {
@@ -16495,7 +17124,7 @@ var AgentTaskIntentParser = class _AgentTaskIntentParser {
16495
17124
  }
16496
17125
  };
16497
17126
 
16498
- // ../protocol/src/agent-gateway/AgentTaskGatewayService.ts
17127
+ // ../../../Decionis/apps/protocol/src/agent-gateway/AgentTaskGatewayService.ts
16499
17128
  var AgentTaskGatewayService = class {
16500
17129
  constructor(store, policyResolver, authority, estimator = new AgentTaskCostEstimator(), options = {}) {
16501
17130
  this.store = store;
@@ -16681,7 +17310,7 @@ var AgentTaskGatewayService = class {
16681
17310
  }
16682
17311
  };
16683
17312
 
16684
- // ../protocol/src/agent-gateway/AgentGatewayAuthGuard.ts
17313
+ // ../../../Decionis/apps/protocol/src/agent-gateway/AgentGatewayAuthGuard.ts
16685
17314
  import { timingSafeEqual as timingSafeEqual4 } from "crypto";
16686
17315
  var AgentGatewayAuthGuard = class {
16687
17316
  constructor(lookup, env = process.env) {
@@ -16734,7 +17363,7 @@ var AgentGatewayAuthGuard = class {
16734
17363
  }
16735
17364
  };
16736
17365
 
16737
- // ../protocol/src/agent-gateway/AgentProviderProxy.ts
17366
+ // ../../../Decionis/apps/protocol/src/agent-gateway/AgentProviderProxy.ts
16738
17367
  var AgentProviderProxy = class {
16739
17368
  constructor(gateway, options = {}) {
16740
17369
  this.gateway = gateway;
@@ -16939,10 +17568,10 @@ var AgentProviderProxy = class {
16939
17568
  }
16940
17569
  };
16941
17570
 
16942
- // ../protocol/src/agent-gateway/providers/AnthropicProviderAdapter.ts
17571
+ // ../../../Decionis/apps/protocol/src/agent-gateway/providers/AnthropicProviderAdapter.ts
16943
17572
  import { createHash as createHash8 } from "crypto";
16944
17573
 
16945
- // ../protocol/src/agent-gateway/providers/AgentProviderAdapter.ts
17574
+ // ../../../Decionis/apps/protocol/src/agent-gateway/providers/AgentProviderAdapter.ts
16946
17575
  var AgentProviderValues = class _AgentProviderValues {
16947
17576
  static asRecord(value) {
16948
17577
  if (!value || typeof value !== "object" || Array.isArray(value)) return {};
@@ -16983,7 +17612,7 @@ var AgentProviderValues = class _AgentProviderValues {
16983
17612
  }
16984
17613
  };
16985
17614
 
16986
- // ../protocol/src/agent-gateway/providers/AnthropicProviderAdapter.ts
17615
+ // ../../../Decionis/apps/protocol/src/agent-gateway/providers/AnthropicProviderAdapter.ts
16987
17616
  var AnthropicProviderAdapter = class {
16988
17617
  provider = "anthropic";
16989
17618
  operation = "messages.create";
@@ -17070,7 +17699,7 @@ var AnthropicProviderAdapter = class {
17070
17699
  }
17071
17700
  };
17072
17701
 
17073
- // ../protocol/src/agent-gateway/providers/OpenAiProviderAdapter.ts
17702
+ // ../../../Decionis/apps/protocol/src/agent-gateway/providers/OpenAiProviderAdapter.ts
17074
17703
  import { createHash as createHash9 } from "crypto";
17075
17704
  var OpenAiProviderAdapter = class {
17076
17705
  provider = "openai";
@@ -17169,7 +17798,7 @@ var OpenAiProviderAdapter = class {
17169
17798
  }
17170
17799
  };
17171
17800
 
17172
- // ../protocol/src/agent-gateway/providers/AgentProviderRegistry.ts
17801
+ // ../../../Decionis/apps/protocol/src/agent-gateway/providers/AgentProviderRegistry.ts
17173
17802
  var AgentProviderRegistry = class {
17174
17803
  adapters;
17175
17804
  constructor(adapters = [
@@ -17183,7 +17812,7 @@ var AgentProviderRegistry = class {
17183
17812
  }
17184
17813
  };
17185
17814
 
17186
- // ../protocol/src/agent-gateway/AgentTaskGatewayRoutes.ts
17815
+ // ../../../Decionis/apps/protocol/src/agent-gateway/AgentTaskGatewayRoutes.ts
17187
17816
  var AgentTaskGatewayRoutes = class {
17188
17817
  static register(app, options) {
17189
17818
  const auth = new AgentGatewayAuthGuard(options.authLookup);
@@ -17334,11 +17963,11 @@ var AgentTaskGatewayRoutes = class {
17334
17963
  }
17335
17964
  };
17336
17965
 
17337
- // ../protocol/src/ProtocolInfo.ts
17966
+ // ../../../Decionis/apps/protocol/src/ProtocolInfo.ts
17338
17967
  var PROTOCOL_SERVICE = "decionis-protocol";
17339
17968
  var PROTOCOL_VERSION = "1.0.0";
17340
17969
 
17341
- // ../protocol/src/discovery/GlamaClaimRoutes.ts
17970
+ // ../../../Decionis/apps/protocol/src/discovery/GlamaClaimRoutes.ts
17342
17971
  var GlamaClaimRoutes = class {
17343
17972
  register(app) {
17344
17973
  app.get(
@@ -17351,7 +17980,7 @@ var GlamaClaimRoutes = class {
17351
17980
  }
17352
17981
  };
17353
17982
 
17354
- // ../protocol/src/health/HealthRoutes.ts
17983
+ // ../../../Decionis/apps/protocol/src/health/HealthRoutes.ts
17355
17984
  function registerHealthRoutes(app, deps) {
17356
17985
  const { store } = deps;
17357
17986
  app.get("/v1/protocol/health", async () => ({
@@ -17376,14 +18005,14 @@ function registerHealthRoutes(app, deps) {
17376
18005
  });
17377
18006
  }
17378
18007
 
17379
- // ../protocol/src/finance-overrides/FinanceOverrideRoutes.ts
18008
+ // ../../../Decionis/apps/protocol/src/finance-overrides/FinanceOverrideRoutes.ts
17380
18009
  import { randomUUID as randomUUID6 } from "crypto";
17381
18010
 
17382
- // ../protocol/src/validation/ProtocolArtifacts.ts
18011
+ // ../../../Decionis/apps/protocol/src/validation/ProtocolArtifacts.ts
17383
18012
  import Ajv2020 from "ajv/dist/2020.js";
17384
18013
  import addFormats from "ajv-formats";
17385
18014
 
17386
- // ../../docs/decionis.protocol.schemas/v1/audit-ledger-entry.schema.json
18015
+ // ../../../Decionis/docs/decionis.protocol.schemas/v1/audit-ledger-entry.schema.json
17387
18016
  var audit_ledger_entry_schema_default = {
17388
18017
  $schema: "https://json-schema.org/draft/2020-12/schema",
17389
18018
  $id: "https://decionis.io/protocol/schemas/v1/audit-ledger-entry.schema.json",
@@ -17413,7 +18042,8 @@ var audit_ledger_entry_schema_default = {
17413
18042
  "EXECUTION_STATUS_CHANGED",
17414
18043
  "EXPORT_GENERATED",
17415
18044
  "ACCESS_GRANTED",
17416
- "ACCESS_REVOKED"
18045
+ "ACCESS_REVOKED",
18046
+ "LEDGER_FORK_RESOLVED"
17417
18047
  ]
17418
18048
  },
17419
18049
  occurred_at: {
@@ -17544,7 +18174,7 @@ var audit_ledger_entry_schema_default = {
17544
18174
  ]
17545
18175
  };
17546
18176
 
17547
- // ../../docs/decionis.protocol.schemas/v1/context-snapshot.schema.json
18177
+ // ../../../Decionis/docs/decionis.protocol.schemas/v1/context-snapshot.schema.json
17548
18178
  var context_snapshot_schema_default = {
17549
18179
  $schema: "https://json-schema.org/draft/2020-12/schema",
17550
18180
  $id: "https://decionis.io/protocol/schemas/v1/context-snapshot.schema.json",
@@ -17699,7 +18329,7 @@ var context_snapshot_schema_default = {
17699
18329
  ]
17700
18330
  };
17701
18331
 
17702
- // ../../docs/decionis.protocol.schemas/v1/decision-resolution.schema.json
18332
+ // ../../../Decionis/docs/decionis.protocol.schemas/v1/decision-resolution.schema.json
17703
18333
  var decision_resolution_schema_default = {
17704
18334
  $schema: "https://json-schema.org/draft/2020-12/schema",
17705
18335
  $id: "https://decionis.io/protocol/schemas/v1/decision-resolution.schema.json",
@@ -17872,7 +18502,7 @@ var decision_resolution_schema_default = {
17872
18502
  ]
17873
18503
  };
17874
18504
 
17875
- // ../../docs/decionis.protocol.schemas/v1/execution-dispatch.schema.json
18505
+ // ../../../Decionis/docs/decionis.protocol.schemas/v1/execution-dispatch.schema.json
17876
18506
  var execution_dispatch_schema_default = {
17877
18507
  $schema: "https://json-schema.org/draft/2020-12/schema",
17878
18508
  $id: "https://decionis.io/protocol/schemas/v1/execution-dispatch.schema.json",
@@ -17991,7 +18621,7 @@ var execution_dispatch_schema_default = {
17991
18621
  ]
17992
18622
  };
17993
18623
 
17994
- // ../../docs/decionis.protocol.schemas/v1/policy-bundle.schema.json
18624
+ // ../../../Decionis/docs/decionis.protocol.schemas/v1/policy-bundle.schema.json
17995
18625
  var policy_bundle_schema_default = {
17996
18626
  $schema: "https://json-schema.org/draft/2020-12/schema",
17997
18627
  $id: "https://decionis.io/protocol/schemas/v1/policy-bundle.schema.json",
@@ -18683,7 +19313,7 @@ var policy_bundle_schema_default = {
18683
19313
  required: ["protocol_version", "bundle_id", "org_id", "version", "effective_from", "rules"]
18684
19314
  };
18685
19315
 
18686
- // ../../docs/decionis.protocol.schemas/v1/signal-envelope.schema.json
19316
+ // ../../../Decionis/docs/decionis.protocol.schemas/v1/signal-envelope.schema.json
18687
19317
  var signal_envelope_schema_default = {
18688
19318
  $schema: "https://json-schema.org/draft/2020-12/schema",
18689
19319
  $id: "https://decionis.io/protocol/schemas/v1/signal-envelope.schema.json",
@@ -18897,7 +19527,7 @@ var signal_envelope_schema_default = {
18897
19527
  ]
18898
19528
  };
18899
19529
 
18900
- // ../protocol/src/validation/ProtocolArtifacts.ts
19530
+ // ../../../Decionis/apps/protocol/src/validation/ProtocolArtifacts.ts
18901
19531
  var ajv = new Ajv2020({ allErrors: true, strict: false });
18902
19532
  addFormats(ajv);
18903
19533
  var ProtocolArtifacts = class _ProtocolArtifacts {
@@ -18932,7 +19562,7 @@ function validateProtocolArtifact(artifact, payload) {
18932
19562
  return ProtocolArtifacts.validate(artifact, payload);
18933
19563
  }
18934
19564
 
18935
- // ../protocol/src/finance-overrides/FinanceOverrideContracts.ts
19565
+ // ../../../Decionis/apps/protocol/src/finance-overrides/FinanceOverrideContracts.ts
18936
19566
  var FINANCE_OVERRIDE_REASON_CODES = [
18937
19567
  "POLICY_EXCEPTION",
18938
19568
  "RISK_THRESHOLD_OVERRIDE",
@@ -18944,7 +19574,7 @@ var FINANCE_OVERRIDE_REASON_CODES = [
18944
19574
  "MANUAL_VERIFICATION_REQUIRED"
18945
19575
  ];
18946
19576
 
18947
- // ../protocol/src/finance-overrides/FinanceOverrides.ts
19577
+ // ../../../Decionis/apps/protocol/src/finance-overrides/FinanceOverrides.ts
18948
19578
  import { createHash as createHash10, randomUUID as randomUUID5 } from "crypto";
18949
19579
  var FinanceOverrides = class {
18950
19580
  static parseActorType(value) {
@@ -19247,7 +19877,7 @@ function appendFinanceOverrideLedgerEvent(store, input) {
19247
19877
  return FinanceOverrides.appendFinanceOverrideLedgerEvent(store, input);
19248
19878
  }
19249
19879
 
19250
- // ../protocol/src/finance-overrides/FinanceOverrideRoutes.ts
19880
+ // ../../../Decionis/apps/protocol/src/finance-overrides/FinanceOverrideRoutes.ts
19251
19881
  function registerFinanceOverrideRoutes(app, deps) {
19252
19882
  const { store } = deps;
19253
19883
  app.get("/v1/protocol/finance/override-reason-codes", async () => ({
@@ -19453,10 +20083,10 @@ function registerFinanceOverrideRoutes(app, deps) {
19453
20083
  });
19454
20084
  }
19455
20085
 
19456
- // ../protocol/src/evaluate-decision/EvaluateDecisionRoutes.ts
20086
+ // ../../../Decionis/apps/protocol/src/evaluate-decision/EvaluateDecisionRoutes.ts
19457
20087
  import { createHash as createHash14, randomUUID as randomUUID10 } from "crypto";
19458
20088
 
19459
- // ../protocol/src/support/Performance.ts
20089
+ // ../../../Decionis/apps/protocol/src/support/Performance.ts
19460
20090
  var ProtocolPerformance = class {
19461
20091
  static durationMs(startedAt) {
19462
20092
  return Number(process.hrtime.bigint() - startedAt) / 1e6;
@@ -19516,7 +20146,7 @@ function toProtocolPerformanceSnapshot(value) {
19516
20146
  return ProtocolPerformance.toProtocolPerformanceSnapshot(value);
19517
20147
  }
19518
20148
 
19519
- // ../protocol/src/verticals/affiliate-rewards/AffiliateRewardsPack.ts
20149
+ // ../../../Decionis/apps/protocol/src/verticals/affiliate-rewards/AffiliateRewardsPack.ts
19520
20150
  var affiliateRewardsVerticalPack = {
19521
20151
  key: "affiliate_rewards",
19522
20152
  display_name: "Affiliate Rewards",
@@ -19601,7 +20231,7 @@ var affiliateRewardsVerticalPack = {
19601
20231
  }
19602
20232
  };
19603
20233
 
19604
- // ../protocol/src/verticals/commerce/CommercePack.ts
20234
+ // ../../../Decionis/apps/protocol/src/verticals/commerce/CommercePack.ts
19605
20235
  var commerceVerticalPack = {
19606
20236
  key: "commerce",
19607
20237
  display_name: "Commerce Gate",
@@ -19766,7 +20396,7 @@ var commerceVerticalPack = {
19766
20396
  }
19767
20397
  };
19768
20398
 
19769
- // ../protocol/src/verticals/core/CorePack.ts
20399
+ // ../../../Decionis/apps/protocol/src/verticals/core/CorePack.ts
19770
20400
  var coreVerticalPack = {
19771
20401
  key: "core",
19772
20402
  display_name: "Core Operations",
@@ -19845,7 +20475,7 @@ var coreVerticalPack = {
19845
20475
  }
19846
20476
  };
19847
20477
 
19848
- // ../protocol/src/verticals/devops/DevopsPack.ts
20478
+ // ../../../Decionis/apps/protocol/src/verticals/devops/DevopsPack.ts
19849
20479
  var devopsVerticalPack = {
19850
20480
  key: "devops",
19851
20481
  display_name: "DevOps & CI",
@@ -19971,7 +20601,7 @@ var devopsVerticalPack = {
19971
20601
  }
19972
20602
  };
19973
20603
 
19974
- // ../protocol/src/verticals/finance/FinancePack.ts
20604
+ // ../../../Decionis/apps/protocol/src/verticals/finance/FinancePack.ts
19975
20605
  var financeVerticalPack = {
19976
20606
  key: "finance",
19977
20607
  display_name: "Financial Decision Authority",
@@ -20124,7 +20754,7 @@ var financeVerticalPack = {
20124
20754
  }
20125
20755
  };
20126
20756
 
20127
- // ../protocol/src/verticals/hospitality/HospitalityPack.ts
20757
+ // ../../../Decionis/apps/protocol/src/verticals/hospitality/HospitalityPack.ts
20128
20758
  var hospitalityVerticalPack = {
20129
20759
  key: "hospitality",
20130
20760
  display_name: "Hospitality Operations",
@@ -20222,7 +20852,7 @@ var hospitalityVerticalPack = {
20222
20852
  }
20223
20853
  };
20224
20854
 
20225
- // ../../packages/shared/src/Verticals/OpsDualGate.ts
20855
+ // ../../../Decionis/packages/shared/src/Verticals/OpsDualGate.ts
20226
20856
  var OpsDualGate = class _OpsDualGate {
20227
20857
  static requiredSpendFields = ["amount", "currency", "vendor_id"];
20228
20858
  static authorizedRoles = /* @__PURE__ */ new Set([
@@ -20702,7 +21332,7 @@ function cleanOpsReason(gate) {
20702
21332
  return OpsDualGate.cleanReason(gate);
20703
21333
  }
20704
21334
 
20705
- // ../protocol/src/verticals/personal/PersonalPack.ts
21335
+ // ../../../Decionis/apps/protocol/src/verticals/personal/PersonalPack.ts
20706
21336
  var personalVerticalPack = {
20707
21337
  key: "personal_productivity",
20708
21338
  display_name: "Personal Productivity",
@@ -20808,7 +21438,7 @@ var personalVerticalPack = {
20808
21438
  }
20809
21439
  };
20810
21440
 
20811
- // ../protocol/src/verticals/salesforce/SalesforcePack.ts
21441
+ // ../../../Decionis/apps/protocol/src/verticals/salesforce/SalesforcePack.ts
20812
21442
  var salesforceVerticalPack = {
20813
21443
  key: "salesforce",
20814
21444
  display_name: "Salesforce Revenue Execution",
@@ -21073,7 +21703,7 @@ var salesforceVerticalPack = {
21073
21703
  }
21074
21704
  };
21075
21705
 
21076
- // ../protocol/src/verticals/sap/SapPack.ts
21706
+ // ../../../Decionis/apps/protocol/src/verticals/sap/SapPack.ts
21077
21707
  var sapVerticalPack = {
21078
21708
  key: "sap",
21079
21709
  display_name: "SAP Execution Authority",
@@ -21339,7 +21969,7 @@ var sapVerticalPack = {
21339
21969
  }
21340
21970
  };
21341
21971
 
21342
- // ../protocol/src/verticals/template/TemplatePack.ts
21972
+ // ../../../Decionis/apps/protocol/src/verticals/template/TemplatePack.ts
21343
21973
  var templateVerticalPack = {
21344
21974
  key: "template",
21345
21975
  display_name: "Template Vertical Pack",
@@ -21392,7 +22022,7 @@ var templateVerticalPack = {
21392
22022
  }
21393
22023
  };
21394
22024
 
21395
- // ../protocol/src/verticals/workday/WorkdayPack.ts
22025
+ // ../../../Decionis/apps/protocol/src/verticals/workday/WorkdayPack.ts
21396
22026
  var workdayVerticalPack = {
21397
22027
  key: "workday",
21398
22028
  display_name: "Workday HR Governance",
@@ -21692,7 +22322,7 @@ var workdayVerticalPack = {
21692
22322
  }
21693
22323
  };
21694
22324
 
21695
- // ../protocol/src/verticals/workday-financials/WorkdayFinancialsPack.ts
22325
+ // ../../../Decionis/apps/protocol/src/verticals/workday-financials/WorkdayFinancialsPack.ts
21696
22326
  var workdayFinancialsVerticalPack = {
21697
22327
  key: "workday_financials",
21698
22328
  display_name: "Workday Financials Circuit Breaker",
@@ -21913,7 +22543,7 @@ var workdayFinancialsVerticalPack = {
21913
22543
  }
21914
22544
  };
21915
22545
 
21916
- // ../protocol/src/verticals/workflows/WorkflowPacks.ts
22546
+ // ../../../Decionis/apps/protocol/src/verticals/workflows/WorkflowPacks.ts
21917
22547
  var WorkflowPackFactory = class {
21918
22548
  static create(config) {
21919
22549
  return {
@@ -22558,7 +23188,7 @@ var workflowVerticalPacks = [
22558
23188
  })
22559
23189
  ];
22560
23190
 
22561
- // ../protocol/src/verticals/VerticalRegistry.ts
23191
+ // ../../../Decionis/apps/protocol/src/verticals/VerticalRegistry.ts
22562
23192
  var DEFAULT_VERTICAL_PACK_KEY = "core";
22563
23193
  var packRegistry = new Map([
22564
23194
  [coreVerticalPack.key, coreVerticalPack],
@@ -22618,7 +23248,7 @@ function requireVerticalPack(key) {
22618
23248
  return VerticalRegistry.require(key);
22619
23249
  }
22620
23250
 
22621
- // ../protocol/src/verticals/VerticalResolver.ts
23251
+ // ../../../Decionis/apps/protocol/src/verticals/VerticalResolver.ts
22622
23252
  var VerticalResolver = class _VerticalResolver {
22623
23253
  static async resolveForRequest(input) {
22624
23254
  const requested = getVerticalPack(input.requestedPackKey);
@@ -22664,13 +23294,13 @@ async function resolveVerticalPackForRequest(input) {
22664
23294
  return VerticalResolver.resolveForRequest(input);
22665
23295
  }
22666
23296
 
22667
- // ../protocol/src/decision-chains/DecisionChains.ts
23297
+ // ../../../Decionis/apps/protocol/src/decision-chains/DecisionChains.ts
22668
23298
  import { randomUUID as randomUUID7 } from "crypto";
22669
23299
 
22670
- // ../protocol/src/integrity/DossierProofVerifier.ts
23300
+ // ../../../Decionis/apps/protocol/src/integrity/DossierProofVerifier.ts
22671
23301
  import { createHash as createHash12, verify } from "crypto";
22672
23302
 
22673
- // ../protocol/src/integrity/DossierProofBundle.ts
23303
+ // ../../../Decionis/apps/protocol/src/integrity/DossierProofBundle.ts
22674
23304
  import {
22675
23305
  createHash as createHash11,
22676
23306
  createPrivateKey,
@@ -22905,7 +23535,7 @@ function buildDecisionDossierPersistedProofBundle(input) {
22905
23535
  return DossierProofBundle.buildDecisionDossierPersistedProofBundle(input);
22906
23536
  }
22907
23537
 
22908
- // ../protocol/src/integrity/DossierProofVerifier.ts
23538
+ // ../../../Decionis/apps/protocol/src/integrity/DossierProofVerifier.ts
22909
23539
  var PROOF_ARTIFACT_SHAPES = {
22910
23540
  portable_artifact: {
22911
23541
  document_path: "/portable_artifact",
@@ -23155,7 +23785,7 @@ function verifyDecisionDossierProofBundle(bundle, dossierPayload) {
23155
23785
  return DossierProofVerifier.verifyDecisionDossierProofBundle(bundle, dossierPayload);
23156
23786
  }
23157
23787
 
23158
- // ../protocol/src/decision-chains/DecisionChains.ts
23788
+ // ../../../Decionis/apps/protocol/src/decision-chains/DecisionChains.ts
23159
23789
  var DECISION_CHAIN_EVIDENCE_LIMIT = DECISION_CHAIN_PROJECTION_LIMIT;
23160
23790
  var SHA256_HEX = /^[0-9a-f]{64}$/;
23161
23791
  var LEDGER_ACTION_ORDER = {
@@ -23659,7 +24289,8 @@ var DecisionChains = class {
23659
24289
  valid: input.ledgerVerification.valid,
23660
24290
  complete: input.ledgerVerification.complete,
23661
24291
  checked: input.ledgerVerification.checked,
23662
- max_entries: input.ledgerVerification.maxEntries
24292
+ max_entries: input.ledgerVerification.maxEntries,
24293
+ ...input.ledgerVerification.orphaned?.length ? { orphaned: input.ledgerVerification.orphaned } : {}
23663
24294
  }
23664
24295
  } : {},
23665
24296
  links,
@@ -23859,7 +24490,7 @@ function finalizeDecisionChainLinkInput(input) {
23859
24490
  return DecisionChains.finalizeDecisionChainLinkInput(input);
23860
24491
  }
23861
24492
 
23862
- // ../protocol/src/support/PanDetection.ts
24493
+ // ../../../Decionis/apps/protocol/src/support/PanDetection.ts
23863
24494
  var PanDetection = class _PanDetection {
23864
24495
  static UUID_SHAPE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
23865
24496
  static toDigits(value) {
@@ -23939,7 +24570,7 @@ function findRawPanPath(value, path, visited = /* @__PURE__ */ new Set()) {
23939
24570
  return PanDetection.findRawPanPath(value, path, visited);
23940
24571
  }
23941
24572
 
23942
- // ../protocol/src/support/ProtocolUrls.ts
24573
+ // ../../../Decionis/apps/protocol/src/support/ProtocolUrls.ts
23943
24574
  var ProtocolUrls = class {
23944
24575
  static getProtocolPublicBaseUrl() {
23945
24576
  const raw = process.env.DECIONIS_PROTOCOL_PUBLIC_BASE_URL?.trim() ?? process.env.DECIONIS_PROTOCOL_BASE_URL?.trim() ?? "https://protocol.decionis.com";
@@ -23950,7 +24581,7 @@ function getProtocolPublicBaseUrl() {
23950
24581
  return ProtocolUrls.getProtocolPublicBaseUrl();
23951
24582
  }
23952
24583
 
23953
- // ../protocol/src/evaluate-decision/EvaluateDecisionParsing.ts
24584
+ // ../../../Decionis/apps/protocol/src/evaluate-decision/EvaluateDecisionParsing.ts
23954
24585
  var EvaluateDecisionParsing = class {
23955
24586
  static parseEvaluateMode(value) {
23956
24587
  return normalizeEnforcementMode(value);
@@ -23999,6 +24630,19 @@ var EvaluateDecisionParsing = class {
23999
24630
  message: "context.authority_requirement is reserved for Decionis-issued policy output"
24000
24631
  };
24001
24632
  }
24633
+ if (Object.prototype.hasOwnProperty.call(context, RUNTIME_ATTRIBUTION_FACT)) {
24634
+ return {
24635
+ ok: false,
24636
+ message: `context.${RUNTIME_ATTRIBUTION_FACT} is reserved: Decionis computes it from the reported runtime signals, so a caller cannot assert what the platform established`
24637
+ };
24638
+ }
24639
+ const runtimeSignals = RuntimeSignals.parse(context);
24640
+ if (!runtimeSignals.ok) {
24641
+ return {
24642
+ ok: false,
24643
+ message: `${runtimeSignals.path} is invalid (${runtimeSignals.message})`
24644
+ };
24645
+ }
24002
24646
  const verticalPack = asString2(record.vertical_pack) ?? asString2(context.vertical_pack);
24003
24647
  const workflowKey = asString2(record.workflow_key) ?? asString2(context.workflow_key);
24004
24648
  const parsedDecisionChain = parseDecisionChainRequest(record.decision_chain);
@@ -24230,7 +24874,7 @@ function hydrateCachedEvaluateResponse(existing) {
24230
24874
  return EvaluateDecisionParsing.hydrateCachedEvaluateResponse(existing);
24231
24875
  }
24232
24876
 
24233
- // ../protocol/src/webex/WebexGovernance.ts
24877
+ // ../../../Decionis/apps/protocol/src/webex/WebexGovernance.ts
24234
24878
  var WebexGovernance = class {
24235
24879
  static parseWebexAgentIntentRequest(input, idempotencyHeader) {
24236
24880
  const record = asRecord3(input);
@@ -24568,7 +25212,7 @@ function buildWebexDossierEnhancements(input, response, generatedAt) {
24568
25212
  return WebexGovernance.buildWebexDossierEnhancements(input, response, generatedAt);
24569
25213
  }
24570
25214
 
24571
- // ../protocol/src/dossiers/DossierBuilder.ts
25215
+ // ../../../Decionis/apps/protocol/src/dossiers/DossierBuilder.ts
24572
25216
  var DossierBuilder = class _DossierBuilder {
24573
25217
  /**
24574
25218
  * One canonical, public-safe snapshot shared by proof and authority evidence.
@@ -24578,6 +25222,7 @@ var DossierBuilder = class _DossierBuilder {
24578
25222
  */
24579
25223
  static buildInputsSnapshot(input, evaluationId) {
24580
25224
  const context = input.context ?? {};
25225
+ const runtimeAttribution = _DossierBuilder.resolveRuntimeAttribution(input);
24581
25226
  return {
24582
25227
  decision_type: input.decision_type,
24583
25228
  channel: input.channel,
@@ -24591,6 +25236,7 @@ var DossierBuilder = class _DossierBuilder {
24591
25236
  transaction_type: input.transaction_type,
24592
25237
  amount: input.amount,
24593
25238
  risk_score: input.risk_score,
25239
+ ...runtimeAttribution ? { runtime_attribution: runtimeAttribution } : {},
24594
25240
  context_commitment: {
24595
25241
  version: "1.0",
24596
25242
  canonicalization: "RFC8785/JCS",
@@ -24680,11 +25326,44 @@ var DossierBuilder = class _DossierBuilder {
24680
25326
  };
24681
25327
  return Object.keys(refs).length > 0 ? refs : null;
24682
25328
  }
25329
+ /**
25330
+ * How many signals the decision was evaluated against, for the signed
25331
+ * portable artifact.
25332
+ *
25333
+ * The excluded keys are routing and identity, not inputs to a verdict:
25334
+ * counting them would overstate, in a claim an auditor reads, how much
25335
+ * evidence the decision actually had. The runtime signals an enforcement
25336
+ * boundary reports are the same kind of thing — they say which door the
25337
+ * action came through and what software proposed it, which the artifact
25338
+ * records in its own right rather than as two more signals.
25339
+ */
24683
25340
  static resolvePortableSignalsEvaluated(input) {
24684
25341
  const context = asRecord3(input.context);
24685
- return asNumber(context.signals_evaluated) ?? Object.keys(context).filter(
24686
- (key) => key !== "workflow_key" && key !== "vertical_pack" && key !== "trust_context"
24687
- ).length;
25342
+ const excluded = /* @__PURE__ */ new Set([
25343
+ "workflow_key",
25344
+ "vertical_pack",
25345
+ "trust_context",
25346
+ ...RUNTIME_SIGNAL_ROOTS
25347
+ ]);
25348
+ return asNumber(context.signals_evaluated) ?? Object.keys(context).filter((key) => !excluded.has(key)).length;
25349
+ }
25350
+ /**
25351
+ * The boundary that admitted the action and the artifact that proposed it,
25352
+ * as the report reached the authority, with the platform's own statement
25353
+ * about how far that report goes.
25354
+ *
25355
+ * This is the one place raw context values enter the dossier, and it is
25356
+ * deliberate: the evidence chain the Decision Dossier exists to carry runs
25357
+ * from artifact provenance through workload identity to the effect, and a
25358
+ * digest of the whole context cannot answer *which boundary admitted this*
25359
+ * offline. Every field here is an identifier, a digest or a level the
25360
+ * operator's own manifest set; the producer keeps the container, pod and
25361
+ * node out of what it binds, so none of them can arrive.
25362
+ */
25363
+ static resolveRuntimeAttribution(input) {
25364
+ const parsed = RuntimeSignals.parse(asRecord3(input.context));
25365
+ if (!parsed.ok) return null;
25366
+ return RuntimeSignals.evidenceOf(RuntimeSignals.attributionOf(parsed));
24688
25367
  }
24689
25368
  static buildPortableDecisionDossierCore(input) {
24690
25369
  const protocolEnvelope = classifyAuthorityProtocolEnvelope(
@@ -24957,7 +25636,7 @@ function buildDecisionInputsSnapshot(input, evaluationId) {
24957
25636
  return DossierBuilder.buildInputsSnapshot(input, evaluationId);
24958
25637
  }
24959
25638
 
24960
- // ../protocol/src/reproduce/ReproduceDecision.ts
25639
+ // ../../../Decionis/apps/protocol/src/reproduce/ReproduceDecision.ts
24961
25640
  var POLICY_GRAPH_1_1_SEMANTICS = {
24962
25641
  protocol_version: "1.1",
24963
25642
  evaluator_version: "policy-graph/1.1",
@@ -25388,7 +26067,7 @@ async function reproduceDecisionFromDossierPayload(input) {
25388
26067
  });
25389
26068
  }
25390
26069
 
25391
- // ../protocol/src/support/FeatureFlags.ts
26070
+ // ../../../Decionis/apps/protocol/src/support/FeatureFlags.ts
25392
26071
  var FeatureFlags = class {
25393
26072
  static parseFeatureFlagAllowlist(raw) {
25394
26073
  return new Set(
@@ -25415,7 +26094,7 @@ function resolveFeatureFlagState(flag) {
25415
26094
  return FeatureFlags.resolveFeatureFlagState(flag);
25416
26095
  }
25417
26096
 
25418
- // ../protocol/src/evaluate-decision/EvaluateDecisionGovernance.ts
26097
+ // ../../../Decionis/apps/protocol/src/evaluate-decision/EvaluateDecisionGovernance.ts
25419
26098
  var DOCKER_DESKTOP_GOVERNED_LIMIT = 25;
25420
26099
  var EvaluateDecisionGovernance = class _EvaluateDecisionGovernance {
25421
26100
  /**
@@ -25533,7 +26212,7 @@ function resolveEvaluateRolloutPolicy(store, input) {
25533
26212
  return EvaluateDecisionGovernance.resolveEvaluateRolloutPolicy(store, input);
25534
26213
  }
25535
26214
 
25536
- // ../protocol/src/evaluate-decision/EvaluateDecisionResolution.ts
26215
+ // ../../../Decionis/apps/protocol/src/evaluate-decision/EvaluateDecisionResolution.ts
25537
26216
  import { createHash as createHash13, randomUUID as randomUUID8 } from "crypto";
25538
26217
  var POLICY_BUNDLE_UNRESOLVED_SENTINEL_ID = "00000000-0000-0000-0000-000000000000";
25539
26218
  var EvaluateDecisionResolution = class {
@@ -25733,7 +26412,7 @@ function appendEvaluateDecisionLedgerEvent(store, input) {
25733
26412
  return EvaluateDecisionResolution.appendEvaluateDecisionLedgerEvent(store, input);
25734
26413
  }
25735
26414
 
25736
- // ../protocol/src/authority/AuthorityRequirementIssuer.ts
26415
+ // ../../../Decionis/apps/protocol/src/authority/AuthorityRequirementIssuer.ts
25737
26416
  import { randomBytes, randomUUID as randomUUID9 } from "crypto";
25738
26417
  var AuthorityRequirementIssuer = class _AuthorityRequirementIssuer {
25739
26418
  static MANAGED_CEREMONY_LIFETIME_MS = 5 * 6e4;
@@ -25946,7 +26625,7 @@ var AuthorityRequirementIssuer = class _AuthorityRequirementIssuer {
25946
26625
  }
25947
26626
  };
25948
26627
 
25949
- // ../protocol/src/execution-binding/ExecutionBindingBuilder.ts
26628
+ // ../../../Decionis/apps/protocol/src/execution-binding/ExecutionBindingBuilder.ts
25950
26629
  import { randomBytes as randomBytes2 } from "crypto";
25951
26630
  var ExecutionBindingBuilder = class _ExecutionBindingBuilder {
25952
26631
  static build(input) {
@@ -26174,7 +26853,7 @@ function normalizeDigest(value) {
26174
26853
  return /^sha256:[0-9a-f]{64}$/.test(normalized) ? normalized : null;
26175
26854
  }
26176
26855
 
26177
- // ../protocol/src/decision-chains/SequenceContextProvider.ts
26856
+ // ../../../Decionis/apps/protocol/src/decision-chains/SequenceContextProvider.ts
26178
26857
  var SEQUENCE_CONTEXT_SCHEMA_VERSION = "1.0";
26179
26858
  var SEQUENCE_CONTEXT_KEY = "sequence";
26180
26859
  function actionFromLink(link) {
@@ -26263,7 +26942,7 @@ function withSequenceContext(context, sequence) {
26263
26942
  };
26264
26943
  }
26265
26944
 
26266
- // ../protocol/src/evaluate-decision/EvaluateDecisionRoutes.ts
26945
+ // ../../../Decionis/apps/protocol/src/evaluate-decision/EvaluateDecisionRoutes.ts
26267
26946
  function registerEvaluateDecisionRoutes(app, deps) {
26268
26947
  const { store } = deps;
26269
26948
  const authorityRequirementIssuer = new AuthorityRequirementIssuer();
@@ -26734,6 +27413,12 @@ function registerEvaluateDecisionRoutes(app, deps) {
26734
27413
  }
26735
27414
  }
26736
27415
  app.log.error({ err }, "Evaluate-decision execution failed");
27416
+ if (err instanceof ProtocolStoreValidationError && err.code === AUDIT_LEDGER_NOT_APPENDABLE) {
27417
+ return reply.code(500).send({
27418
+ error: AUDIT_LEDGER_NOT_APPENDABLE,
27419
+ message: "Failed to evaluate decision: the organisation's audit ledger has no unique head and refuses appends until it is repaired"
27420
+ });
27421
+ }
26737
27422
  return reply.code(500).send({
26738
27423
  error: "EVALUATION_FAILED",
26739
27424
  message: "Failed to evaluate decision"
@@ -26770,7 +27455,7 @@ function registerEvaluateDecisionRoutes(app, deps) {
26770
27455
  app.post("/v1/protocol/decision-dossiers/reproduce", reproduceDecisionHandler);
26771
27456
  }
26772
27457
 
26773
- // ../protocol/src/webex/WebexRoutes.ts
27458
+ // ../../../Decionis/apps/protocol/src/webex/WebexRoutes.ts
26774
27459
  function registerWebexRoutes(app, deps) {
26775
27460
  const { store } = deps;
26776
27461
  const evaluateWebexAgentIntentHandler = async (req, reply) => {
@@ -26940,13 +27625,13 @@ function registerWebexRoutes(app, deps) {
26940
27625
  app.post("/v1/protocol/webex/agent-intents/evaluate", evaluateWebexAgentIntentHandler);
26941
27626
  }
26942
27627
 
26943
- // ../protocol/src/surface-verify/SapVerifyRoutes.ts
27628
+ // ../../../Decionis/apps/protocol/src/surface-verify/SapVerifyRoutes.ts
26944
27629
  import { randomUUID as randomUUID11 } from "crypto";
26945
27630
 
26946
- // ../protocol/src/verticals/sap/SapSurface.ts
27631
+ // ../../../Decionis/apps/protocol/src/verticals/sap/SapSurface.ts
26947
27632
  import { createHash as createHash15 } from "crypto";
26948
27633
 
26949
- // ../protocol/src/verticals/shared/DuplicateDetection.ts
27634
+ // ../../../Decionis/apps/protocol/src/verticals/shared/DuplicateDetection.ts
26950
27635
  var DuplicateDetection = class _DuplicateDetection {
26951
27636
  /**
26952
27637
  * Vendor + invoice/amount fingerprint for duplicate-payment detection, or null.
@@ -27000,7 +27685,7 @@ async function deriveDuplicateFacts(input) {
27000
27685
  return DuplicateDetection.deriveFacts(input);
27001
27686
  }
27002
27687
 
27003
- // ../protocol/src/verticals/sap/SapSurface.ts
27688
+ // ../../../Decionis/apps/protocol/src/verticals/sap/SapSurface.ts
27004
27689
  var REQUIRED_STATE_FIELDS = ["amount", "currency", "vendor_id", "cost_center"];
27005
27690
  var AUTHORIZED_ROLES = /* @__PURE__ */ new Set(["ProcurementManager", "TreasuryHead", "Controller", "CFO"]);
27006
27691
  var PO_TREASURY_THRESHOLD = 5e4;
@@ -27329,7 +28014,7 @@ async function deriveSapDuplicateFacts(input) {
27329
28014
  return SapSurface.deriveDuplicateFacts(input);
27330
28015
  }
27331
28016
 
27332
- // ../protocol/src/surface-verify/SurfaceVerifyShared.ts
28017
+ // ../../../Decionis/apps/protocol/src/surface-verify/SurfaceVerifyShared.ts
27333
28018
  var SAP_DEFAULT_ORG_ID = "5ab00000-0000-4000-8000-000000000001";
27334
28019
  var SAP_VERIFY_BASE_URL = "https://verify.decionis.com";
27335
28020
  var OPS_DEFAULT_ORG_ID = "09500000-0000-4000-8000-000000000001";
@@ -27337,7 +28022,7 @@ var WORKDAY_DEFAULT_ORG_ID = "d0d00000-0000-4000-8000-000000000001";
27337
28022
  var WORKDAY_FIN_DEFAULT_ORG_ID = "d0f00000-0000-4000-8000-000000000001";
27338
28023
  var DUPLICATE_LOOKBACK_DAYS = 90;
27339
28024
 
27340
- // ../protocol/src/surface-verify/SapVerifyRoutes.ts
28025
+ // ../../../Decionis/apps/protocol/src/surface-verify/SapVerifyRoutes.ts
27341
28026
  function registerSapVerifyRoutes(app, deps) {
27342
28027
  const { store } = deps;
27343
28028
  const protocolAuthLookup = deps.authLookup ?? null;
@@ -27441,10 +28126,10 @@ function registerSapVerifyRoutes(app, deps) {
27441
28126
  );
27442
28127
  }
27443
28128
 
27444
- // ../protocol/src/surface-verify/SalesforceVerifyRoutes.ts
28129
+ // ../../../Decionis/apps/protocol/src/surface-verify/SalesforceVerifyRoutes.ts
27445
28130
  import { randomUUID as randomUUID12 } from "crypto";
27446
28131
 
27447
- // ../protocol/src/verticals/salesforce/SalesforceSurface.ts
28132
+ // ../../../Decionis/apps/protocol/src/verticals/salesforce/SalesforceSurface.ts
27448
28133
  import { createHash as createHash16 } from "crypto";
27449
28134
  var MATNR_MAX_LENGTH = 18;
27450
28135
  var MANUAL_DISCOUNT_THRESHOLD_PCT = 15;
@@ -27756,7 +28441,7 @@ function resolveSalesforceMode(payload) {
27756
28441
  return SalesforceSurface.resolveMode(payload);
27757
28442
  }
27758
28443
 
27759
- // ../protocol/src/surface-verify/SalesforceVerifyRoutes.ts
28444
+ // ../../../Decionis/apps/protocol/src/surface-verify/SalesforceVerifyRoutes.ts
27760
28445
  function registerSalesforceVerifyRoutes(app, deps) {
27761
28446
  const { store } = deps;
27762
28447
  const protocolAuthLookup = deps.authLookup ?? null;
@@ -27873,10 +28558,10 @@ function registerSalesforceVerifyRoutes(app, deps) {
27873
28558
  );
27874
28559
  }
27875
28560
 
27876
- // ../protocol/src/surface-verify/OpsVerifyRoutes.ts
28561
+ // ../../../Decionis/apps/protocol/src/surface-verify/OpsVerifyRoutes.ts
27877
28562
  import { randomUUID as randomUUID13 } from "crypto";
27878
28563
 
27879
- // ../protocol/src/verticals/ops/OpsSurface.ts
28564
+ // ../../../Decionis/apps/protocol/src/verticals/ops/OpsSurface.ts
27880
28565
  import { createHash as createHash17 } from "crypto";
27881
28566
  var OpsSurface = class _OpsSurface {
27882
28567
  /**
@@ -27954,7 +28639,7 @@ async function deriveOpsDuplicateFacts(input) {
27954
28639
  return OpsSurface.deriveDuplicateFacts(input);
27955
28640
  }
27956
28641
 
27957
- // ../protocol/src/surface-verify/OpsVerifyRoutes.ts
28642
+ // ../../../Decionis/apps/protocol/src/surface-verify/OpsVerifyRoutes.ts
27958
28643
  function registerOpsVerifyRoutes(app, deps) {
27959
28644
  const { store } = deps;
27960
28645
  const protocolAuthLookup = deps.authLookup ?? null;
@@ -28058,10 +28743,10 @@ function registerOpsVerifyRoutes(app, deps) {
28058
28743
  );
28059
28744
  }
28060
28745
 
28061
- // ../protocol/src/surface-verify/WorkdayVerifyRoutes.ts
28746
+ // ../../../Decionis/apps/protocol/src/surface-verify/WorkdayVerifyRoutes.ts
28062
28747
  import { randomUUID as randomUUID14 } from "crypto";
28063
28748
 
28064
- // ../protocol/src/verticals/workday/WorkdaySurface.ts
28749
+ // ../../../Decionis/apps/protocol/src/verticals/workday/WorkdaySurface.ts
28065
28750
  import { createHash as createHash18 } from "crypto";
28066
28751
  var AUTHORIZED_HR_ROLES = /* @__PURE__ */ new Set([
28067
28752
  "HRBusinessPartner",
@@ -28414,7 +29099,7 @@ async function deriveWorkdayDuplicateFacts(input) {
28414
29099
  return WorkdaySurface.deriveDuplicateFacts(input);
28415
29100
  }
28416
29101
 
28417
- // ../protocol/src/surface-verify/WorkdayVerifyRoutes.ts
29102
+ // ../../../Decionis/apps/protocol/src/surface-verify/WorkdayVerifyRoutes.ts
28418
29103
  function registerWorkdayVerifyRoutes(app, deps) {
28419
29104
  const { store } = deps;
28420
29105
  const protocolAuthLookup = deps.authLookup ?? null;
@@ -28520,10 +29205,10 @@ function registerWorkdayVerifyRoutes(app, deps) {
28520
29205
  );
28521
29206
  }
28522
29207
 
28523
- // ../protocol/src/surface-verify/WorkdayFinancialsVerifyRoutes.ts
29208
+ // ../../../Decionis/apps/protocol/src/surface-verify/WorkdayFinancialsVerifyRoutes.ts
28524
29209
  import { randomUUID as randomUUID15 } from "crypto";
28525
29210
 
28526
- // ../protocol/src/verticals/workday-financials/WorkdayFinancialsSurface.ts
29211
+ // ../../../Decionis/apps/protocol/src/verticals/workday-financials/WorkdayFinancialsSurface.ts
28527
29212
  import { createHash as createHash19 } from "crypto";
28528
29213
  var AUTHORIZED_FINANCE_ROLES = /* @__PURE__ */ new Set([
28529
29214
  "PayrollAdministrator",
@@ -28875,7 +29560,7 @@ async function deriveWorkdayFinancialsDuplicateFacts(input) {
28875
29560
  return WorkdayFinancialsSurface.deriveDuplicateFacts(input);
28876
29561
  }
28877
29562
 
28878
- // ../protocol/src/surface-verify/WorkdayFinancialsVerifyRoutes.ts
29563
+ // ../../../Decionis/apps/protocol/src/surface-verify/WorkdayFinancialsVerifyRoutes.ts
28879
29564
  function registerWorkdayFinancialsVerifyRoutes(app, deps) {
28880
29565
  const { store } = deps;
28881
29566
  const protocolAuthLookup = deps.authLookup ?? null;
@@ -28983,7 +29668,7 @@ function registerWorkdayFinancialsVerifyRoutes(app, deps) {
28983
29668
  );
28984
29669
  }
28985
29670
 
28986
- // ../protocol/src/surface-verify/SurfaceDecisionRoutes.ts
29671
+ // ../../../Decionis/apps/protocol/src/surface-verify/SurfaceDecisionRoutes.ts
28987
29672
  import { randomUUID as randomUUID16 } from "crypto";
28988
29673
  function registerSurfaceDecisionRoutes(app, deps) {
28989
29674
  const { store } = deps;
@@ -29094,7 +29779,7 @@ function registerSurfaceDecisionRoutes(app, deps) {
29094
29779
  app.post("/v1/protocol/surfaces/decisions", handleSurfaceDecision);
29095
29780
  }
29096
29781
 
29097
- // ../protocol/src/enforcement/EnforcementRolloutRoutes.ts
29782
+ // ../../../Decionis/apps/protocol/src/enforcement/EnforcementRolloutRoutes.ts
29098
29783
  var EnforcementRolloutParsing = class {
29099
29784
  static parseEnforcementRolloutMutation(input) {
29100
29785
  const record = asRecord3(input);
@@ -29195,7 +29880,7 @@ function registerEnforcementRolloutRoutes(app, deps) {
29195
29880
  });
29196
29881
  }
29197
29882
 
29198
- // ../protocol/src/integrity/ProofPacket.ts
29883
+ // ../../../Decionis/apps/protocol/src/integrity/ProofPacket.ts
29199
29884
  var VERIFY_STEPS = [
29200
29885
  "Canonicalize each proof-bundle artifact's source document with that artifact's declared canonicalization_profile (RFC8785/JCS or DECIONIS_SORTED_JSON_V1); historical artifacts without a profile use DECIONIS_SORTED_JSON_V1.",
29201
29886
  "Recompute SHA-256 over the canonical bytes and confirm it matches canonical_document_sha256.",
@@ -29373,7 +30058,7 @@ function buildDecisionChainProofPacket(input) {
29373
30058
  return ProofPacket.buildDecisionChainProofPacket(input);
29374
30059
  }
29375
30060
 
29376
- // ../protocol/src/dossiers/ProofPacketAuth.ts
30061
+ // ../../../Decionis/apps/protocol/src/dossiers/ProofPacketAuth.ts
29377
30062
  var ProofPacketAuth = class {
29378
30063
  static async authorizeProofPacketRead(req, orgId, authLookup) {
29379
30064
  if (hasValidInternalCredential(req, resolveInternalSecrets())) return null;
@@ -29421,7 +30106,7 @@ async function authorizeProofPacketWrite(req, orgId, authLookup) {
29421
30106
  return null;
29422
30107
  }
29423
30108
 
29424
- // ../protocol/src/interop/scitt/aac-v04/AgentActionCapsuleV04.ts
30109
+ // ../../../Decionis/apps/protocol/src/interop/scitt/aac-v04/AgentActionCapsuleV04.ts
29425
30110
  import { createHash as createHash20 } from "crypto";
29426
30111
  var AAC_V04_SPEC_VERSION = "draft-mih-scitt-agent-action-capsule-04";
29427
30112
  var AAC_V04_FORMAT_VERSION = "4";
@@ -29996,10 +30681,10 @@ function verifyAgentActionCapsuleV04Class1(value, options) {
29996
30681
  }
29997
30682
  }
29998
30683
 
29999
- // ../protocol/src/interop/scitt/cose/ProducerEnvelope.ts
30684
+ // ../../../Decionis/apps/protocol/src/interop/scitt/cose/ProducerEnvelope.ts
30000
30685
  import { createPublicKey as createPublicKey2, verify as verifySignature } from "crypto";
30001
30686
 
30002
- // ../protocol/src/interop/scitt/cose/Cbor.ts
30687
+ // ../../../Decionis/apps/protocol/src/interop/scitt/cose/Cbor.ts
30003
30688
  function concat(parts) {
30004
30689
  const length = parts.reduce((total, part) => total + part.length, 0);
30005
30690
  const output = new Uint8Array(length);
@@ -30146,7 +30831,7 @@ function decodeCbor(bytes2) {
30146
30831
  return decoded;
30147
30832
  }
30148
30833
 
30149
- // ../protocol/src/interop/scitt/cose/ProducerEnvelope.ts
30834
+ // ../../../Decionis/apps/protocol/src/interop/scitt/cose/ProducerEnvelope.ts
30150
30835
  var AAC_PRODUCER_ENVELOPE_CONTENT_TYPE = "application/agent-action-capsule-id";
30151
30836
  var AAC_PRODUCER_ENVELOPE_MEDIA_TYPE = "application/cose";
30152
30837
  function rawCapsuleId(capsuleId) {
@@ -30282,7 +30967,7 @@ function verifyAgentActionCapsuleProducerEnvelope(envelope, capsuleId) {
30282
30967
  };
30283
30968
  }
30284
30969
 
30285
- // ../protocol/src/interop/scitt/aac-v04/DossierMapper.ts
30970
+ // ../../../Decionis/apps/protocol/src/interop/scitt/aac-v04/DossierMapper.ts
30286
30971
  import { createHash as createHash21 } from "crypto";
30287
30972
  function digest(value) {
30288
30973
  return createHash21("sha256").update(jcsCanonicalize(value), "utf8").digest("hex");
@@ -30512,7 +31197,7 @@ function decisionDossierReference(dossier) {
30512
31197
  };
30513
31198
  }
30514
31199
 
30515
- // ../protocol/src/integrity/DossierLedgerAnchor.ts
31200
+ // ../../../Decionis/apps/protocol/src/integrity/DossierLedgerAnchor.ts
30516
31201
  function normalizedSha256(value) {
30517
31202
  if (typeof value !== "string") return null;
30518
31203
  const candidate = value.trim().toLowerCase();
@@ -30533,7 +31218,9 @@ async function verifyDossierLedgerAnchor(input) {
30533
31218
  reason: "LEDGER_CONTINUITY_UNVERIFIED",
30534
31219
  ledger_entry_id: ledgerEntryId,
30535
31220
  declared_entry_hash: declaredHash,
30536
- stored_entry_hash: null
31221
+ stored_entry_hash: null,
31222
+ ledger_membership: null,
31223
+ orphan_resolution_entry_id: null
30537
31224
  };
30538
31225
  }
30539
31226
  if (!ledgerEntryId || !isLikelyUuid(ledgerEntryId) || !declaredHash) {
@@ -30547,7 +31234,9 @@ async function verifyDossierLedgerAnchor(input) {
30547
31234
  reason: "ANCHOR_MISSING_OR_MALFORMED",
30548
31235
  ledger_entry_id: ledgerEntryId,
30549
31236
  declared_entry_hash: declaredHash,
30550
- stored_entry_hash: null
31237
+ stored_entry_hash: null,
31238
+ ledger_membership: null,
31239
+ orphan_resolution_entry_id: null
30551
31240
  };
30552
31241
  }
30553
31242
  const row = await input.store.getAuditLedgerEntry({
@@ -30565,7 +31254,9 @@ async function verifyDossierLedgerAnchor(input) {
30565
31254
  reason: "ANCHOR_NOT_FOUND",
30566
31255
  ledger_entry_id: ledgerEntryId,
30567
31256
  declared_entry_hash: declaredHash,
30568
- stored_entry_hash: null
31257
+ stored_entry_hash: null,
31258
+ ledger_membership: null,
31259
+ orphan_resolution_entry_id: null
30569
31260
  };
30570
31261
  }
30571
31262
  const storedHash = normalizedSha256(row.entry_hash);
@@ -30592,11 +31283,13 @@ async function verifyDossierLedgerAnchor(input) {
30592
31283
  reason,
30593
31284
  ledger_entry_id: ledgerEntryId,
30594
31285
  declared_entry_hash: declaredHash,
30595
- stored_entry_hash: storedHash
31286
+ stored_entry_hash: storedHash,
31287
+ ledger_membership: row.ledger_membership ?? "canonical",
31288
+ orphan_resolution_entry_id: row.ledger_membership === "orphaned" ? row.orphan_resolution_entry_id ?? null : null
30596
31289
  };
30597
31290
  }
30598
31291
 
30599
- // ../protocol/src/decision-chains/DecisionChainRoutes.ts
31292
+ // ../../../Decionis/apps/protocol/src/decision-chains/DecisionChainRoutes.ts
30600
31293
  var DEFAULT_DECISION_CHAIN_LEDGER_VERIFICATION_LIMIT = 5e3;
30601
31294
  var MAX_DECISION_CHAIN_LEDGER_VERIFICATION_LIMIT = 5e4;
30602
31295
  function resolveDecisionChainLedgerVerificationLimit(env = process.env) {
@@ -30704,7 +31397,8 @@ function registerDecisionChainRoutes(app, deps) {
30704
31397
  valid: ledger.valid,
30705
31398
  complete: ledger.complete,
30706
31399
  checked: ledger.checked,
30707
- maxEntries: ledgerVerificationLimit
31400
+ maxEntries: ledgerVerificationLimit,
31401
+ ...ledger.orphaned ? { orphaned: ledger.orphaned } : {}
30708
31402
  },
30709
31403
  proofVerifications: new Map(
30710
31404
  [...proofByDossierId].map(([dossierId, result]) => [
@@ -30766,7 +31460,8 @@ function registerDecisionChainRoutes(app, deps) {
30766
31460
  valid: ledger.valid,
30767
31461
  complete: ledger.complete,
30768
31462
  checked: ledger.checked,
30769
- maxEntries: ledgerVerificationLimit
31463
+ maxEntries: ledgerVerificationLimit,
31464
+ ...ledger.orphaned ? { orphaned: ledger.orphaned } : {}
30770
31465
  }
30771
31466
  })
30772
31467
  );
@@ -30819,14 +31514,15 @@ function registerDecisionChainRoutes(app, deps) {
30819
31514
  valid: ledger.valid,
30820
31515
  complete: ledger.complete,
30821
31516
  checked: ledger.checked,
30822
- maxEntries: ledgerVerificationLimit
31517
+ maxEntries: ledgerVerificationLimit,
31518
+ ...ledger.orphaned ? { orphaned: ledger.orphaned } : {}
30823
31519
  }
30824
31520
  })
30825
31521
  );
30826
31522
  });
30827
31523
  }
30828
31524
 
30829
- // ../protocol/src/dossiers/DossierCapsuleExport.ts
31525
+ // ../../../Decionis/apps/protocol/src/dossiers/DossierCapsuleExport.ts
30830
31526
  function parentDossierIds(payload) {
30831
31527
  const direct = asRecord3(payload.decision_chain);
30832
31528
  const nested = asRecord3(asRecord3(payload.routing_decision).decision_chain);
@@ -30875,7 +31571,7 @@ async function buildDossierAgentActionCapsuleV04Export(input) {
30875
31571
  return { dossier, capsule, parent_capsule: parentCapsule, class_1: class1 };
30876
31572
  }
30877
31573
 
30878
- // ../protocol/src/dossiers/DossierRoutes.ts
31574
+ // ../../../Decionis/apps/protocol/src/dossiers/DossierRoutes.ts
30879
31575
  function registerDossierRoutes(app, deps) {
30880
31576
  const { store } = deps;
30881
31577
  const protocolAuthLookup = deps.authLookup ?? null;
@@ -31118,7 +31814,7 @@ function registerDossierRoutes(app, deps) {
31118
31814
  );
31119
31815
  }
31120
31816
 
31121
- // ../protocol/src/policy-graph/PolicyDecisionRegister.ts
31817
+ // ../../../Decionis/apps/protocol/src/policy-graph/PolicyDecisionRegister.ts
31122
31818
  function asRecord7(value) {
31123
31819
  return value && typeof value === "object" && !Array.isArray(value) ? value : {};
31124
31820
  }
@@ -31304,7 +32000,7 @@ async function loadPolicyDecisionRegister(input) {
31304
32000
  });
31305
32001
  }
31306
32002
 
31307
- // ../protocol/src/policy-graph/PolicyDecisionRegisterRoutes.ts
32003
+ // ../../../Decionis/apps/protocol/src/policy-graph/PolicyDecisionRegisterRoutes.ts
31308
32004
  var MAX_BUNDLE_LOOKBACK = 500;
31309
32005
  var DEFAULT_BUNDLE_LOOKBACK = 100;
31310
32006
  function registerPolicyDecisionRegisterRoutes(app, deps) {
@@ -31336,7 +32032,7 @@ function registerPolicyDecisionRegisterRoutes(app, deps) {
31336
32032
  });
31337
32033
  }
31338
32034
 
31339
- // ../protocol/src/artifacts/ArtifactIngestion.ts
32035
+ // ../../../Decionis/apps/protocol/src/artifacts/ArtifactIngestion.ts
31340
32036
  import { createHash as createHash22, randomUUID as randomUUID17 } from "crypto";
31341
32037
  var ArtifactIngestion = class {
31342
32038
  static createArtifactPayloads(request, shadow, resolvedVerticalPack, previousLedgerHash) {
@@ -31565,6 +32261,19 @@ var ArtifactIngestion = class {
31565
32261
  issues: validation.issues
31566
32262
  });
31567
32263
  }
32264
+ if (kind === "audit_ledger_entry" && validation.value.event_type === LEDGER_FORK_RESOLVED_EVENT_TYPE) {
32265
+ return reply.code(400).send({
32266
+ error: "VALIDATION_ERROR",
32267
+ message: `${LEDGER_FORK_RESOLVED_EVENT_TYPE} is reserved for the ledger fork repair command`,
32268
+ issues: [
32269
+ {
32270
+ path: "/event_type",
32271
+ keyword: "reserved",
32272
+ message: "written only by the operator fork-resolution command"
32273
+ }
32274
+ ]
32275
+ });
32276
+ }
31568
32277
  if (kind === "signal_envelope") {
31569
32278
  const semantic = asRecord3(validation.value.semantic);
31570
32279
  if (Object.keys(semantic).length > 0) {
@@ -31636,7 +32345,7 @@ function ingestArtifact(app, reply, store, kind, payload) {
31636
32345
  return ArtifactIngestion.ingestArtifact(app, reply, store, kind, payload);
31637
32346
  }
31638
32347
 
31639
- // ../protocol/src/artifacts/ArtifactRoutes.ts
32348
+ // ../../../Decionis/apps/protocol/src/artifacts/ArtifactRoutes.ts
31640
32349
  function registerArtifactRoutes(app, deps) {
31641
32350
  const { store } = deps;
31642
32351
  app.post(
@@ -31728,7 +32437,7 @@ function registerArtifactRoutes(app, deps) {
31728
32437
  });
31729
32438
  }
31730
32439
 
31731
- // ../protocol/src/marketplaces/MarketplaceProfiles.ts
32440
+ // ../../../Decionis/apps/protocol/src/marketplaces/MarketplaceProfiles.ts
31732
32441
  var commonContracts = [
31733
32442
  "signal_envelope",
31734
32443
  "context_snapshot",
@@ -32159,10 +32868,11 @@ var readiness = {
32159
32868
  // core COGS, HPOS order CRUD, and the signed dossier were verified end
32160
32869
  // to end on a staging store — including an admin-enabled ENFORCEMENT
32161
32870
  // block — before the listing went live (shared readiness provenance).
32162
- // The previous PLANNED states predated the public listing.
32871
+ // The previous PLANNED states predated the public listing. In production
32872
+ // since 2026-09-26 (Festus); each store still starts in Shadow Mode.
32163
32873
  adapter_state: "LIVE",
32164
32874
  docs_state: "LIVE",
32165
- launch_state: "BUILDING",
32875
+ launch_state: "LIVE",
32166
32876
  next_milestone: "WordPress.org listing is live and self-serve; grow installs and collect the first live-store enforcement evidence for the listing's proof section"
32167
32877
  },
32168
32878
  jumia: {
@@ -32201,7 +32911,7 @@ function getMarketplaceReadiness(target) {
32201
32911
  return MarketplaceProfiles.getReadiness(target);
32202
32912
  }
32203
32913
 
32204
- // ../protocol/src/marketplaces/MarketplaceContracts.ts
32914
+ // ../../../Decionis/apps/protocol/src/marketplaces/MarketplaceContracts.ts
32205
32915
  var PROTOCOL_MARKETPLACE_TARGETS = [
32206
32916
  "atlassian",
32207
32917
  "microsoft",
@@ -32223,7 +32933,7 @@ var PROTOCOL_MARKETPLACE_TARGETS = [
32223
32933
  "jumia"
32224
32934
  ];
32225
32935
 
32226
- // ../protocol/src/marketplaces/MarketplaceRoutes.ts
32936
+ // ../../../Decionis/apps/protocol/src/marketplaces/MarketplaceRoutes.ts
32227
32937
  var MarketplaceRouteParsing = class {
32228
32938
  static parseMarketplaceTarget(input) {
32229
32939
  const value = asString2(input)?.toLowerCase();
@@ -32300,7 +33010,7 @@ function registerMarketplaceRoutes(app) {
32300
33010
  });
32301
33011
  }
32302
33012
 
32303
- // ../protocol/src/verticals/VerticalRoutes.ts
33013
+ // ../../../Decionis/apps/protocol/src/verticals/VerticalRoutes.ts
32304
33014
  import { randomUUID as randomUUID18 } from "crypto";
32305
33015
  var VerticalRouteParsing = class {
32306
33016
  static parseVerticalPackMutation(input) {
@@ -32457,10 +33167,10 @@ function registerVerticalRoutes(app, deps) {
32457
33167
  });
32458
33168
  }
32459
33169
 
32460
- // ../protocol/src/shadow/ShadowRoutes.ts
33170
+ // ../../../Decionis/apps/protocol/src/shadow/ShadowRoutes.ts
32461
33171
  import { createHash as createHash23 } from "crypto";
32462
33172
 
32463
- // ../protocol/src/shadow/ShadowDecisioning.ts
33173
+ // ../../../Decionis/apps/protocol/src/shadow/ShadowDecisioning.ts
32464
33174
  var ShadowDecisioning = class {
32465
33175
  static parseShadowRequest(input) {
32466
33176
  const record = asRecord3(input);
@@ -32595,7 +33305,7 @@ function buildShadowDecision(request, resolvedVerticalPack) {
32595
33305
  return ShadowDecisioning.buildShadowDecision(request, resolvedVerticalPack);
32596
33306
  }
32597
33307
 
32598
- // ../protocol/src/shadow/ShadowReports.ts
33308
+ // ../../../Decionis/apps/protocol/src/shadow/ShadowReports.ts
32599
33309
  var ShadowReports = class {
32600
33310
  static shadowExecutionActionFromOutcome(outcome) {
32601
33311
  if (outcome === "APPROVE") return "CONTINUE";
@@ -32747,7 +33457,7 @@ function parseShadowEvaluateDecisionReportsQuery(input) {
32747
33457
  return ShadowReports.parseShadowEvaluateDecisionReportsQuery(input);
32748
33458
  }
32749
33459
 
32750
- // ../protocol/src/shadow/ShadowRoutes.ts
33460
+ // ../../../Decionis/apps/protocol/src/shadow/ShadowRoutes.ts
32751
33461
  function registerShadowRoutes(app, deps) {
32752
33462
  const { store } = deps;
32753
33463
  app.get("/v1/protocol/shadow/evaluate-decision/reports", async (req, reply) => {
@@ -32880,7 +33590,7 @@ function registerShadowRoutes(app, deps) {
32880
33590
  });
32881
33591
  }
32882
33592
 
32883
- // ../protocol/src/execution-binding/ExecutionRevalidationState.ts
33593
+ // ../../../Decionis/apps/protocol/src/execution-binding/ExecutionRevalidationState.ts
32884
33594
  import { createHash as createHash24 } from "crypto";
32885
33595
  var ExecutionRevalidationState = class _ExecutionRevalidationState {
32886
33596
  static async resolve(input) {
@@ -33093,7 +33803,7 @@ function normalizeDigest2(value) {
33093
33803
  return /^sha256:[0-9a-f]{64}$/.test(normalized) ? normalized : null;
33094
33804
  }
33095
33805
 
33096
- // ../protocol/src/execution-binding/ExecutionRevalidationRoutes.ts
33806
+ // ../../../Decionis/apps/protocol/src/execution-binding/ExecutionRevalidationRoutes.ts
33097
33807
  function registerExecutionRevalidationRoutes(app, deps) {
33098
33808
  const internalSecrets = deps.internalSecret === void 0 && deps.internalSecretPrevious === void 0 ? resolveInternalSecrets() : {
33099
33809
  current: deps.internalSecret ?? null,
@@ -33187,7 +33897,7 @@ function registerExecutionRevalidationRoutes(app, deps) {
33187
33897
  });
33188
33898
  }
33189
33899
 
33190
- // ../protocol/src/interop/scitt/registration/ScittSignedStatement.ts
33900
+ // ../../../Decionis/apps/protocol/src/interop/scitt/registration/ScittSignedStatement.ts
33191
33901
  import { createPublicKey as createPublicKey3, verify as verifySignature2 } from "crypto";
33192
33902
  var SCITT_SIGNED_STATEMENT_MEDIA_TYPE = "application/scitt-statement+cose";
33193
33903
  var SCITT_RECEIPT_MEDIA_TYPE = "application/scitt-receipt+cose";
@@ -33306,7 +34016,7 @@ function verifyScittCapsuleIdSignedStatement(statement, capsuleId) {
33306
34016
  };
33307
34017
  }
33308
34018
 
33309
- // ../protocol/src/interop/scitt/registration/ScittRegistrationService.ts
34019
+ // ../../../Decionis/apps/protocol/src/interop/scitt/registration/ScittRegistrationService.ts
33310
34020
  function origin(value) {
33311
34021
  try {
33312
34022
  const url = new URL(value);
@@ -33499,7 +34209,7 @@ var ScittRegistrationService = class {
33499
34209
  }
33500
34210
  };
33501
34211
 
33502
- // ../protocol/src/app.ts
34212
+ // ../../../Decionis/apps/protocol/src/app.ts
33503
34213
  function buildProtocolApp(options) {
33504
34214
  const app = Fastify({
33505
34215
  logger: options?.logger ?? true
@@ -34063,4 +34773,4 @@ toad-cache/dist/toad-cache.cjs:
34063
34773
  * @version 3.7.0
34064
34774
  *)
34065
34775
  */
34066
- //# sourceMappingURL=chunk-LIVLO4MV.js.map
34776
+ //# sourceMappingURL=chunk-5Q6BCK32.js.map