@twin.org/rights-management-plugins 0.0.3-next.30 → 0.0.3-next.32
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.
|
@@ -926,14 +926,14 @@ export class DefaultPolicyArbiter {
|
|
|
926
926
|
if (this.isTwinJsonPathTarget(first)) {
|
|
927
927
|
const t = first;
|
|
928
928
|
const expression = t[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION];
|
|
929
|
-
if (Is.stringValue(expression)) {
|
|
930
|
-
|
|
931
|
-
const sourceKey = Is.stringValue(dataSource)
|
|
932
|
-
? dataSource
|
|
933
|
-
: DefaultPolicyArbiter._DATA_SOURCE_KEY;
|
|
934
|
-
return `${sourceKey}:${expression}`;
|
|
929
|
+
if (!Is.stringValue(expression)) {
|
|
930
|
+
return undefined;
|
|
935
931
|
}
|
|
936
|
-
|
|
932
|
+
const dataSource = t[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE];
|
|
933
|
+
const sourceKey = Is.stringValue(dataSource)
|
|
934
|
+
? dataSource
|
|
935
|
+
: DefaultPolicyArbiter._DATA_SOURCE_KEY;
|
|
936
|
+
return `${sourceKey}:${expression}`;
|
|
937
937
|
}
|
|
938
938
|
return OdrlPolicyHelper.getUid(first);
|
|
939
939
|
}
|
|
@@ -951,8 +951,16 @@ export class DefaultPolicyArbiter {
|
|
|
951
951
|
const firstTarget = arr[0];
|
|
952
952
|
if (Is.object(firstTarget) &&
|
|
953
953
|
OdrlPolicyHelper.getType(firstTarget) === OdrlTypes.AssetCollection &&
|
|
954
|
-
|
|
955
|
-
|
|
954
|
+
firstTarget.source === DefaultPolicyArbiter._TWIN_JSONPATH) {
|
|
955
|
+
const ctx = firstTarget;
|
|
956
|
+
const expression = ctx[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION];
|
|
957
|
+
if (Is.stringValue(expression)) {
|
|
958
|
+
const dataSource = ctx[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE];
|
|
959
|
+
const sourceKey = Is.stringValue(dataSource)
|
|
960
|
+
? dataSource
|
|
961
|
+
: DefaultPolicyArbiter._DATA_SOURCE_KEY;
|
|
962
|
+
return `${DefaultPolicyArbiter._TWIN_JSONPATH}:${sourceKey}:${expression}`;
|
|
963
|
+
}
|
|
956
964
|
}
|
|
957
965
|
}
|
|
958
966
|
return this.getTargetId(target);
|
|
@@ -1016,19 +1024,23 @@ export class DefaultPolicyArbiter {
|
|
|
1016
1024
|
}
|
|
1017
1025
|
if (Is.object(firstTarget) &&
|
|
1018
1026
|
OdrlPolicyHelper.getType(firstTarget) === OdrlTypes.AssetCollection) {
|
|
1019
|
-
if (
|
|
1020
|
-
!firstTarget.source.startsWith(`${DefaultPolicyArbiter._TWIN_JSONPATH}:`)) {
|
|
1027
|
+
if (firstTarget.source !== DefaultPolicyArbiter._TWIN_JSONPATH) {
|
|
1021
1028
|
throw new GeneralError(DefaultPolicyArbiter.CLASS_NAME, "assetCollectionSourceNotSupported", {
|
|
1022
1029
|
source: firstTarget.source ?? ""
|
|
1023
1030
|
});
|
|
1024
1031
|
}
|
|
1032
|
+
const ctx = firstTarget;
|
|
1033
|
+
const dataSource = ctx[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE];
|
|
1034
|
+
const sourceKey = Is.stringValue(dataSource)
|
|
1035
|
+
? dataSource
|
|
1036
|
+
: DefaultPolicyArbiter._DATA_SOURCE_KEY;
|
|
1025
1037
|
let sourceLookup;
|
|
1026
1038
|
try {
|
|
1027
|
-
sourceLookup = this.
|
|
1039
|
+
sourceLookup = this.resolveDataSourceByKey(sourceKey, ctx[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION], dataSources);
|
|
1028
1040
|
}
|
|
1029
1041
|
catch {
|
|
1030
1042
|
throw new GeneralError(DefaultPolicyArbiter.CLASS_NAME, "assetCollectionSourceNotSupported", {
|
|
1031
|
-
source:
|
|
1043
|
+
source: ctx[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION] ?? ""
|
|
1032
1044
|
});
|
|
1033
1045
|
}
|
|
1034
1046
|
return {
|
|
@@ -1146,6 +1158,18 @@ export class DefaultPolicyArbiter {
|
|
|
1146
1158
|
}
|
|
1147
1159
|
return typedOperand;
|
|
1148
1160
|
}
|
|
1161
|
+
// Legacy string form: "twin:information:$.foo". Extract the prefix, rewrite the
|
|
1162
|
+
// JSONPath expression to scope to the per-item target, then re-assemble. Without
|
|
1163
|
+
// this, the leftOperand stays at the wildcard
|
|
1164
|
+
// `$.itemList.itemListElement[*].unloadingLocation.id` for every item, returning
|
|
1165
|
+
// the full array of all ids per check — so all items pass the equality test.
|
|
1166
|
+
if (Is.stringValue(operand) &&
|
|
1167
|
+
operand.startsWith(`twin:${DefaultPolicyArbiter._INFORMATION_SOURCE_KEY}:`)) {
|
|
1168
|
+
const prefix = `twin:${DefaultPolicyArbiter._INFORMATION_SOURCE_KEY}:`;
|
|
1169
|
+
const expression = operand.slice(prefix.length);
|
|
1170
|
+
const rewritten = this.rewriteWildcardPath(expression, sourceTarget, itemTarget);
|
|
1171
|
+
return `${prefix}${rewritten}`;
|
|
1172
|
+
}
|
|
1149
1173
|
return operand;
|
|
1150
1174
|
}
|
|
1151
1175
|
/**
|
|
@@ -1336,11 +1360,23 @@ export class DefaultPolicyArbiter {
|
|
|
1336
1360
|
* @internal
|
|
1337
1361
|
*/
|
|
1338
1362
|
tryResolveOperandLookup(operandTypeOrValue, operandValue, dataSources) {
|
|
1339
|
-
|
|
1340
|
-
|
|
1363
|
+
let sourceKey = this.normalizeTwinJsonPathOperandAlias(operandTypeOrValue);
|
|
1364
|
+
let value = operandValue;
|
|
1365
|
+
// Combined form: operandTypeOrValue is a full "<prefix>:<expression>" string
|
|
1366
|
+
// like "twin:jsonPath:$.foo" rather than the canonical separation of @type +
|
|
1367
|
+
// @value/expression. Detect by walking the registered datasource keys for a prefix
|
|
1368
|
+
// match; on hit, split into key + expression so resolveDataSourceByKey can evaluate.
|
|
1369
|
+
if (!dataSources[sourceKey]) {
|
|
1370
|
+
const matchingKey = Object.keys(dataSources).find(k => sourceKey.startsWith(`${k}:`));
|
|
1371
|
+
if (matchingKey) {
|
|
1372
|
+
value = sourceKey.slice(matchingKey.length + 1);
|
|
1373
|
+
sourceKey = matchingKey;
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
if (!dataSources[sourceKey] || !Is.stringValue(value)) {
|
|
1341
1377
|
return undefined;
|
|
1342
1378
|
}
|
|
1343
|
-
const resolved = this.resolveDataSourceByKey(sourceKey,
|
|
1379
|
+
const resolved = this.resolveDataSourceByKey(sourceKey, value, dataSources);
|
|
1344
1380
|
return { source: resolved.source, jsonPath: resolved.target };
|
|
1345
1381
|
}
|
|
1346
1382
|
/**
|
|
@@ -1351,8 +1387,6 @@ export class DefaultPolicyArbiter {
|
|
|
1351
1387
|
* @internal
|
|
1352
1388
|
*/
|
|
1353
1389
|
calculateOperandValue(operand, dataSources, constraint) {
|
|
1354
|
-
// Treat prefixed operands as selectors against a namespaced source dictionary.
|
|
1355
|
-
// Examples: twin:jsonpath:$.field, twin:information:$.credentials.level
|
|
1356
1390
|
let jsonPath;
|
|
1357
1391
|
let operandRoot;
|
|
1358
1392
|
if (Is.stringValue(operand)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultPolicyArbiter.js","sourceRoot":"","sources":["../../../src/policyArbiters/defaultPolicyArbiter.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,WAAW,EACX,MAAM,EACN,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,EAAE,EACF,YAAY,EACZ,YAAY,EACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,+BAA+B,EAK/B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAEN,w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C/B,CAAC;QACD,OAAO,SAAS,CAAC;IAClB,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tArrayHelper,\n\tCoerce,\n\tComponentFactory,\n\tGeneralError,\n\tGuards,\n\tIs,\n\tObjectHelper,\n\tStringHelper\n} from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport { JsonPathHelper } from \"@twin.org/data-json-path\";\nimport type { ILoggingComponent } from \"@twin.org/logging-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tOdrlPolicyHelper,\n\tOdrlProfiles,\n\tPolicyDecision,\n\tPolicyObligationEnforcerFactory,\n\ttype IPolicyAdministrationPointComponent,\n\ttype IPolicyArbiter,\n\ttype IPolicyDecision,\n\ttype IRightsManagementPolicy\n} from \"@twin.org/rights-management-models\";\nimport type { IDataspaceProtocolAgreement } from \"@twin.org/standards-dataspace-protocol\";\nimport {\n\ttype IOdrlAssetCollection,\n\tOdrlConflictStrategyType,\n\tOdrlLogicalConstraintType,\n\tOdrlOperatorType,\n\tOdrlTypes,\n\ttype IOdrlAction,\n\ttype IOdrlAsset,\n\ttype IOdrlConstraint,\n\ttype IOdrlDuty,\n\ttype IOdrlLogicalConstraint,\n\ttype IOdrlLogicalConstraintOperand,\n\ttype IOdrlParty,\n\ttype IOdrlPartyCollection,\n\ttype IOdrlPermission,\n\ttype IOdrlProhibition,\n\ttype IOdrlRule,\n\ttype OdrlActionType\n} from \"@twin.org/standards-w3c-odrl\";\nimport type { IDefaultPolicyArbiterConstructorOptions } from \"../models/IDefaultPolicyArbiterConstructorOptions.js\";\n\n/**\n * Default Policy Arbiter.\n */\nexport class DefaultPolicyArbiter implements IPolicyArbiter {\n\t/**\n\t * The class name of the Default Policy Arbiter.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<DefaultPolicyArbiter>();\n\n\t/**\n\t * ODRL profiles whose custom vocabulary this arbiter understands and supports.\n\t * Any policy declaring a profile not in this set will be rejected.\n\t * Add a new entry here when support for an additional profile is implemented.\n\t */\n\tpublic static readonly SUPPORTED_PROFILES: ReadonlySet<string> = new Set([OdrlProfiles.Twin]);\n\n\t/**\n\t * Default maximum inheritance depth.\n\t * @internal\n\t */\n\tprivate static readonly _DEFAULT_MAX_INHERITANCE_DEPTH = 10;\n\n\t/**\n\t * Datasource key for the primary JSON path data source.\n\t * @internal\n\t */\n\tprivate static readonly _DATA_SOURCE_KEY = \"data\";\n\n\t/**\n\t * Datasource key for the information source used in JSON path expressions.\n\t * @internal\n\t */\n\tprivate static readonly _INFORMATION_SOURCE_KEY = \"information\";\n\n\t/**\n\t * TWIN prefix JSONPath canonical alias.\n\t * @internal\n\t */\n\tprivate static readonly _TWIN_JSONPATH = \"twin:jsonPath\";\n\n\t/**\n\t * Canonical jsonPath expression property.\n\t * @internal\n\t */\n\tprivate static readonly _TWIN_JSONPATH_EXPRESSION = \"twin:jsonPathExpression\";\n\n\t/**\n\t * Optional data source key property for canonical twin:jsonPath targets.\n\t * When absent, defaults to the primary data source.\n\t * @internal\n\t */\n\tprivate static readonly _TWIN_JSONPATH_DATA_SOURCE = \"twin:jsonPathDataSource\";\n\n\t/**\n\t * The logging component.\n\t * @internal\n\t */\n\tprivate readonly _logging: ILoggingComponent;\n\n\t/**\n\t * The policy administration point component.\n\t * @internal\n\t */\n\tprivate readonly _policyAdministrationPoint: IPolicyAdministrationPointComponent;\n\n\t/**\n\t * The maximum depth to traverse when resolving inherited policies.\n\t * @internal\n\t */\n\tprivate readonly _maxInheritanceDepth: number;\n\n\t/**\n\t * Create a new instance of DefaultPolicyArbiter.\n\t * @param options The options for the default policy arbiter.\n\t */\n\tconstructor(options?: IDefaultPolicyArbiterConstructorOptions) {\n\t\tthis._logging = ComponentFactory.get<ILoggingComponent>(\n\t\t\toptions?.loggingComponentType ?? \"logging\"\n\t\t);\n\n\t\tthis._policyAdministrationPoint = ComponentFactory.get<IPolicyAdministrationPointComponent>(\n\t\t\toptions?.policyAdministrationPointComponentType ?? \"policy-administration-point\"\n\t\t);\n\n\t\tthis._maxInheritanceDepth =\n\t\t\tCoerce.integer(options?.config?.maxInheritanceDepth) ??\n\t\t\tDefaultPolicyArbiter._DEFAULT_MAX_INHERITANCE_DEPTH;\n\t}\n\n\t/**\n\t * Normalises a profile IRI for comparison against the supported-profiles allowlist.\n\t * Per RFC 3986: scheme and host are case-insensitive (the URL constructor folds them to\n\t * lowercase automatically); a trailing slash on the terminal path segment is treated as\n\t * equivalent to its absence; repeated slashes in the path are collapsed to a single slash.\n\t * Non-URL strings are returned unchanged.\n\t * @param iri The IRI to normalise.\n\t * @returns The normalised IRI.\n\t * @internal\n\t */\n\tprivate static normalizeProfileIri(iri: string): string {\n\t\ttry {\n\t\t\tconst url = new URL(iri);\n\t\t\tconst pathname = url.pathname.replace(/\\/+/g, \"/\");\n\t\t\treturn `${url.protocol}//${url.host}${StringHelper.trimTrailingSlashes(pathname)}`;\n\t\t} catch {\n\t\t\treturn iri;\n\t\t}\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn DefaultPolicyArbiter.CLASS_NAME;\n\t}\n\n\t/**\n\t * Makes decisions regarding policy access to data.\n\t * @param agreement The agreement to evaluate.\n\t * @param information Information provided by the requester to determine if a policy can be created.\n\t * @param data The data to make a decision on.\n\t * @param action Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.\n\t * @returns The decisions about access to the data.\n\t */\n\tpublic async decide<D = unknown>(\n\t\tagreement: IDataspaceProtocolAgreement,\n\t\tinformation?: { [id: string]: IJsonLdNodeObject },\n\t\tdata?: D,\n\t\taction?: OdrlActionType | string\n\t): Promise<IPolicyDecision[]> {\n\t\tGuards.object<IDataspaceProtocolAgreement>(\n\t\t\tDefaultPolicyArbiter.CLASS_NAME,\n\t\t\tnameof(agreement),\n\t\t\tagreement\n\t\t);\n\n\t\t// ODRL policy profiles extend the vocabulary with additional semantics (e.g. custom\n\t\t// operators, left operands). Without profile-aware evaluation logic the arbiter\n\t\t// cannot guarantee correctness, so any policy that declares an unknown profile is\n\t\t// rejected. The TWIN platform profile is explicitly supported.\n\t\t//\n\t\t// Empty-string profile values (e.g. from over-eager schema defaults or serialization\n\t\t// round-trips) are treated as \"no profile declared\" and filtered out before comparison.\n\t\t//\n\t\t// Profile IRIs are normalized before lookup: scheme and host are case-folded to\n\t\t// lowercase and a trailing slash on the last path segment is stripped. This accepts\n\t\t// common IRI variants (HTTPS://, uppercase host, trailing slash) instead of silently\n\t\t// rejecting valid policies authored by IRI-aware tooling.\n\t\t//\n\t\t// `every` (conjunction) is intentional: a policy declaring [\"TWIN\", \"unknown\"] is\n\t\t// rejected — the arbiter refuses to evaluate rules from a profile whose semantics it\n\t\t// does not understand, even if other declared profiles are known.\n\t\tconst declaredProfiles = ArrayHelper.fromObjectOrArray<string>(agreement.profile ?? [])\n\t\t\t.filter(p => Is.stringValue(p))\n\t\t\t.map(p => DefaultPolicyArbiter.normalizeProfileIri(p));\n\t\tif (\n\t\t\tIs.arrayValue(declaredProfiles) &&\n\t\t\t!declaredProfiles.every(p => DefaultPolicyArbiter.SUPPORTED_PROFILES.has(p))\n\t\t) {\n\t\t\tconst unsupportedProfile = declaredProfiles.find(\n\t\t\t\tp => !DefaultPolicyArbiter.SUPPORTED_PROFILES.has(p)\n\t\t\t);\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"policyProfileNotSupported\", {\n\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(agreement) ?? \"\",\n\t\t\t\tunsupportedProfile\n\t\t\t});\n\t\t}\n\n\t\tawait this._logging.log({\n\t\t\tlevel: \"info\",\n\t\t\tsource: DefaultPolicyArbiter.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"decidingPolicy\",\n\t\t\tdata: {\n\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(agreement) ?? \"\"\n\t\t\t}\n\t\t});\n\n\t\t// Resolve and merge inherited policies.\n\t\tconst mergedPolicy = await this.mergeInheritedPolicies(agreement);\n\t\tconst expandedPolicy = this.expandCompactPolicyRules(mergedPolicy);\n\t\tconst dataSources = {\n\t\t\t[DefaultPolicyArbiter._DATA_SOURCE_KEY]: data,\n\t\t\t[DefaultPolicyArbiter._INFORMATION_SOURCE_KEY]: information\n\t\t};\n\n\t\t// Extract agreement parties once for use in rule evaluation\n\t\tconst agreementAssigner = OdrlPolicyHelper.getPartyIds(agreement.assigner);\n\t\tconst agreementAssignee = OdrlPolicyHelper.getPartyIds(agreement.assignee);\n\t\tconst obligationsFulfilled = await this.evaluatePolicyObligations(\n\t\t\tagreementAssigner,\n\t\t\tagreementAssignee,\n\t\t\texpandedPolicy,\n\t\t\tdataSources\n\t\t);\n\n\t\t// ODRL-style rule evaluation grouped by decision target:\n\t\t// - Permission rules authorize if ANY applicable permission on the same target matches.\n\t\t// - Default to denied when no permission applies on a target (closed-world for access control).\n\t\t// - Conflict strategy controls how applicable permissions/prohibitions are resolved per target.\n\t\tconst targetStates: {\n\t\t\t[target: string]: {\n\t\t\t\tpermissionApplies: boolean;\n\t\t\t\tprohibitionApplies: boolean;\n\t\t\t};\n\t\t} = Object.create(null) as {\n\t\t\t[target: string]: {\n\t\t\t\tpermissionApplies: boolean;\n\t\t\t\tprohibitionApplies: boolean;\n\t\t\t};\n\t\t};\n\n\t\tconst permissions = ArrayHelper.fromObjectOrArray(expandedPolicy.permission ?? []);\n\t\tfor (const permission of permissions) {\n\t\t\tconst decisionTargets = this.resolveRuleDecisionTargets(permission, dataSources);\n\t\t\tfor (const decisionTarget of decisionTargets) {\n\t\t\t\tconst state = this.getOrCreateTargetState(targetStates, decisionTarget.target);\n\t\t\t\tif (\n\t\t\t\t\tawait this.evaluatePermission(\n\t\t\t\t\t\tagreementAssigner,\n\t\t\t\t\t\tagreementAssignee,\n\t\t\t\t\t\texpandedPolicy,\n\t\t\t\t\t\tpermission,\n\t\t\t\t\t\tdecisionTarget.refinements,\n\t\t\t\t\t\tdataSources,\n\t\t\t\t\t\taction,\n\t\t\t\t\t\tdecisionTarget.target\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tstate.permissionApplies = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst prohibitions = ArrayHelper.fromObjectOrArray<IOdrlProhibition>(\n\t\t\texpandedPolicy.prohibition ?? []\n\t\t);\n\t\tfor (const prohibition of prohibitions) {\n\t\t\tconst decisionTargets = this.resolveRuleDecisionTargets(prohibition, dataSources);\n\t\t\tfor (const decisionTarget of decisionTargets) {\n\t\t\t\tif (\n\t\t\t\t\tawait this.evaluateProhibition(\n\t\t\t\t\t\texpandedPolicy,\n\t\t\t\t\t\tagreementAssigner,\n\t\t\t\t\t\tagreementAssignee,\n\t\t\t\t\t\tprohibition,\n\t\t\t\t\t\tdecisionTarget.refinements,\n\t\t\t\t\t\tdataSources,\n\t\t\t\t\t\taction,\n\t\t\t\t\t\tdecisionTarget.target\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tconst state = this.getOrCreateTargetState(targetStates, decisionTarget.target);\n\t\t\t\t\tstate.prohibitionApplies = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst conflictStrategy = expandedPolicy.conflict ?? OdrlConflictStrategyType.Invalid;\n\t\tif (Object.keys(targetStates).length === 0) {\n\t\t\t// Closed-world fallback when the policy has no rules at all.\n\t\t\treturn [{ decision: PolicyDecision.Denied, target: \"$\" }];\n\t\t}\n\n\t\tconst decisions: IPolicyDecision[] = [];\n\t\tfor (const [target, state] of Object.entries(targetStates)) {\n\t\t\tlet decision: PolicyDecision;\n\t\t\tif (state.permissionApplies && state.prohibitionApplies) {\n\t\t\t\tswitch (conflictStrategy) {\n\t\t\t\t\tcase OdrlConflictStrategyType.Perm:\n\t\t\t\t\t\tdecision = PolicyDecision.Granted;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase OdrlConflictStrategyType.Prohibit:\n\t\t\t\t\tcase OdrlConflictStrategyType.Invalid:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tdecision = PolicyDecision.Denied;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdecision = state.permissionApplies ? PolicyDecision.Granted : PolicyDecision.Denied;\n\t\t\t}\n\n\t\t\tif (!obligationsFulfilled) {\n\t\t\t\tdecision = PolicyDecision.Denied;\n\t\t\t}\n\n\t\t\tdecisions.push({\n\t\t\t\tdecision,\n\t\t\t\ttarget\n\t\t\t});\n\t\t}\n\n\t\treturn decisions;\n\t}\n\n\t/**\n\t * Expand compact/compound policy rule forms into atomic rules.\n\t * ODRL 2.7 allows compact forms where rule properties can be arrays.\n\t * Evaluation in this arbiter is performed on expanded atomic rules.\n\t * @param policy The policy to expand.\n\t * @returns A policy with expanded rule arrays.\n\t * @internal\n\t */\n\tprivate expandCompactPolicyRules(policy: IRightsManagementPolicy): IRightsManagementPolicy {\n\t\tconst expandedPermissions = this.expandRules(\n\t\t\tArrayHelper.fromObjectOrArray<IOdrlPermission>(policy.permission ?? [])\n\t\t);\n\t\tconst expandedProhibitions = this.expandRules(\n\t\t\tArrayHelper.fromObjectOrArray<IOdrlProhibition>(policy.prohibition ?? [])\n\t\t);\n\t\tconst expandedObligations = this.expandRules(\n\t\t\tArrayHelper.fromObjectOrArray<IOdrlDuty>(policy.obligation ?? [])\n\t\t);\n\n\t\treturn {\n\t\t\t...policy,\n\t\t\tpermission: expandedPermissions.length > 0 ? expandedPermissions : undefined,\n\t\t\tprohibition: expandedProhibitions.length > 0 ? expandedProhibitions : undefined,\n\t\t\tobligation: expandedObligations.length > 0 ? expandedObligations : undefined\n\t\t};\n\t}\n\n\t/**\n\t * Expand a rule list into atomic rules.\n\t * @param rules The rules to expand.\n\t * @returns Expanded atomic rules.\n\t * @internal\n\t */\n\tprivate expandRules<T extends IOdrlRule>(rules: T[]): T[] {\n\t\tconst expanded: T[] = [];\n\t\tfor (const rule of rules) {\n\t\t\texpanded.push(...this.expandRule(rule));\n\t\t}\n\n\t\treturn expanded;\n\t}\n\n\t/**\n\t * Expand a single compact/compound rule into atomic rules.\n\t * @param rule The rule to expand.\n\t * @returns Expanded atomic rules.\n\t * @internal\n\t */\n\tprivate expandRule<T extends IOdrlRule>(rule: T): T[] {\n\t\tconst targets = this.normalizeRuleField<NonNullable<IOdrlRule[\"target\"]>>(rule.target);\n\t\tconst actions = this.normalizeRuleField<NonNullable<IOdrlRule[\"action\"]>>(rule.action);\n\t\tconst assigners = this.normalizeRuleField<NonNullable<IOdrlRule[\"assigner\"]>>(rule.assigner);\n\t\tconst assignees = this.normalizeRuleField<NonNullable<IOdrlRule[\"assignee\"]>>(rule.assignee);\n\n\t\tconst expanded: T[] = [];\n\t\tfor (const target of targets) {\n\t\t\tfor (const action of actions) {\n\t\t\t\tfor (const assigner of assigners) {\n\t\t\t\t\tfor (const assignee of assignees) {\n\t\t\t\t\t\tconst atomicRule = { ...rule };\n\t\t\t\t\t\tatomicRule.target = target;\n\t\t\t\t\t\tatomicRule.action = action;\n\t\t\t\t\t\tatomicRule.assigner = assigner;\n\t\t\t\t\t\tatomicRule.assignee = assignee;\n\t\t\t\t\t\texpanded.push(atomicRule);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn expanded;\n\t}\n\n\t/**\n\t * Normalize a potentially compact rule field into an array for expansion.\n\t * @param value The field value.\n\t * @returns Normalized values (or a single undefined when not provided).\n\t * @internal\n\t */\n\tprivate normalizeRuleField<T>(value: T | undefined): (T | undefined)[] {\n\t\tif (Is.undefined(value)) {\n\t\t\treturn [undefined];\n\t\t}\n\n\t\tconst values = ArrayHelper.fromObjectOrArray(value);\n\t\treturn values.length > 0 ? values : [undefined];\n\t}\n\n\t/**\n\t * Get an existing target state or create an initial state if it doesn't exist.\n\t * @param targetStates The dictionary of target states.\n\t * @param target The target key.\n\t * @returns The target state.\n\t * @internal\n\t */\n\tprivate getOrCreateTargetState(\n\t\ttargetStates: {\n\t\t\t[target: string]: {\n\t\t\t\tpermissionApplies: boolean;\n\t\t\t\tprohibitionApplies: boolean;\n\t\t\t};\n\t\t},\n\t\ttarget: string\n\t): {\n\t\tpermissionApplies: boolean;\n\t\tprohibitionApplies: boolean;\n\t} {\n\t\tlet state = targetStates[target];\n\t\tif (Is.undefined(state)) {\n\t\t\tstate = {\n\t\t\t\tpermissionApplies: false,\n\t\t\t\tprohibitionApplies: false\n\t\t\t};\n\t\t\ttargetStates[target] = state;\n\t\t}\n\n\t\treturn state;\n\t}\n\n\t/**\n\t * Evaluate whether a prohibition applies.\n\t * @param policy The policy containing the prohibition.\n\t * @param agreementAssigner The assigner ID from the agreement.\n\t * @param agreementAssignee The assignee ID from the agreement.\n\t * @param prohibition The prohibition to evaluate.\n\t * @param targetRefinements Additional constraints from target refinement.\n\t * @param dataSources The operand lookup sources.\n\t * @param action Optional action to check against the prohibition's applicable actions.\n\t * @returns True if the prohibition applies.\n\t * @internal\n\t */\n\tprivate async evaluateProhibition(\n\t\tpolicy: IRightsManagementPolicy,\n\t\tagreementAssigner: string[] | undefined,\n\t\tagreementAssignee: string[] | undefined,\n\t\tprohibition: IOdrlProhibition,\n\t\ttargetRefinements: (IOdrlConstraint | IOdrlLogicalConstraint)[],\n\t\tdataSources: { [source: string]: unknown },\n\t\taction?: OdrlActionType | string,\n\t\tdecisionTarget?: string\n\t): Promise<boolean> {\n\t\tif (\n\t\t\t!this.isRuleApplicableToParties(\n\t\t\t\tprohibition,\n\t\t\t\tagreementAssigner,\n\t\t\t\tagreementAssignee,\n\t\t\t\tdataSources\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if the prohibition's action(s) match the requested action\n\t\tif (!this.isActionApplicable(prohibition.action, action, dataSources)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// ODRL semantics: a rule without constraints is unconditional.\n\t\tconst constraints = [\n\t\t\t...ArrayHelper.fromObjectOrArray(prohibition.constraint ?? []),\n\t\t\t...targetRefinements\n\t\t];\n\t\tif (\n\t\t\tconstraints.length > 0 &&\n\t\t\t!constraints.every(c => this.evaluateConstraint(c, dataSources))\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst prohibitionTargetLookup = this.tryResolveTargetDataSource(\n\t\t\tthis.buildRuleDataContextTargetId(\n\t\t\t\tthis.getRuleDataContextTargetId(prohibition.target),\n\t\t\t\tdecisionTarget\n\t\t\t),\n\t\t\tdataSources,\n\t\t\ttrue\n\t\t);\n\t\tconst ruleDataContext = prohibitionTargetLookup.value;\n\n\t\tconst remedies = ArrayHelper.fromObjectOrArray<IOdrlDuty>(prohibition.remedy ?? []);\n\t\tif (remedies.length === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (const remedy of remedies) {\n\t\t\tif (!(await this.enforceDuty(policy, remedy, dataSources, ruleDataContext))) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// Remedies satisfied: prohibition is treated as no longer infringed.\n\t\treturn false;\n\t}\n\n\t/**\n\t * Evaluate all policy-level obligations.\n\t * @param agreementAssigner The assigner ID from the agreement.\n\t * @param agreementAssignee The assignee ID from the agreement.\n\t * @param policy The policy containing obligations.\n\t * @param dataSources The operand lookup sources.\n\t * @returns True if all applicable obligations are fulfilled.\n\t * @internal\n\t */\n\tprivate async evaluatePolicyObligations(\n\t\tagreementAssigner: string[] | undefined,\n\t\tagreementAssignee: string[] | undefined,\n\t\tpolicy: IRightsManagementPolicy,\n\t\tdataSources: { [source: string]: unknown }\n\t): Promise<boolean> {\n\t\tconst obligations = ArrayHelper.fromObjectOrArray<IOdrlDuty>(policy.obligation ?? []);\n\t\tfor (const obligation of obligations) {\n\t\t\tif (\n\t\t\t\t!(await this.evaluateObligation(\n\t\t\t\t\tagreementAssigner,\n\t\t\t\t\tagreementAssignee,\n\t\t\t\t\tpolicy,\n\t\t\t\t\tobligation,\n\t\t\t\t\tdataSources\n\t\t\t\t))\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Evaluate whether a policy-level obligation is fulfilled.\n\t * @param agreementAssigner The assigner ID from the agreement.\n\t * @param agreementAssignee The assignee ID from the agreement.\n\t * @param policy The policy containing the obligation.\n\t * @param obligation The obligation to evaluate.\n\t * @param dataSources The operand lookup sources.\n\t * @returns True if the obligation is not applicable or is fulfilled.\n\t * @internal\n\t */\n\tprivate async evaluateObligation(\n\t\tagreementAssigner: string[] | undefined,\n\t\tagreementAssignee: string[] | undefined,\n\t\tpolicy: IRightsManagementPolicy,\n\t\tobligation: IOdrlDuty,\n\t\tdataSources: { [source: string]: unknown }\n\t): Promise<boolean> {\n\t\tif (\n\t\t\t!this.isRuleApplicableToParties(obligation, agreementAssigner, agreementAssignee, dataSources)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst { refinements } = this.resolveRuleTarget(obligation, dataSources);\n\t\tconst obligationTargetLookup = this.tryResolveTargetDataSource(\n\t\t\tthis.getTargetId(obligation.target),\n\t\t\tdataSources,\n\t\t\ttrue\n\t\t);\n\t\tconst ruleDataContext = obligationTargetLookup.value;\n\t\tconst constraints = [\n\t\t\t...ArrayHelper.fromObjectOrArray(obligation.constraint ?? []),\n\t\t\t...refinements\n\t\t];\n\n\t\tif (\n\t\t\tconstraints.length > 0 &&\n\t\t\t!constraints.every(c => this.evaluateConstraint(c, dataSources))\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn this.enforceDuty(policy, obligation, dataSources, ruleDataContext);\n\t}\n\n\t/**\n\t * Merge inherited policies into the current policy.\n\t * Inherited policies' permissions, prohibitions, and obligations are combined with the current policy's rules.\n\t * @param policy The policy to evaluate.\n\t * @returns A new policy with merged rules from all ancestors.\n\t * @internal\n\t */\n\tprivate async mergeInheritedPolicies(\n\t\tpolicy: IRightsManagementPolicy\n\t): Promise<IRightsManagementPolicy> {\n\t\tconst visitedPolicyIds: string[] = [];\n\t\tvisitedPolicyIds.push(OdrlPolicyHelper.getUid(policy) ?? \"\");\n\t\tconst inheritedPolicies = await this.resolveInheritedPolicies(policy, visitedPolicyIds, 0);\n\t\tconst conflictStrategies = new Set<OdrlConflictStrategyType>();\n\t\tif (Is.stringValue(policy.conflict)) {\n\t\t\tconflictStrategies.add(policy.conflict);\n\t\t}\n\n\t\t// Start with copies of the current policy's rules\n\t\tconst mergedPermissions: IOdrlPermission[] = ArrayHelper.fromObjectOrArray(\n\t\t\tpolicy.permission ?? []\n\t\t).map(permission => this.applyPolicyDefaultsToRule(policy, permission));\n\n\t\tconst mergedProhibitions: IOdrlProhibition[] = ArrayHelper.fromObjectOrArray(\n\t\t\tpolicy.prohibition ?? []\n\t\t).map(prohibition => this.applyPolicyDefaultsToRule(policy, prohibition));\n\n\t\tconst mergedObligations: IOdrlDuty[] = ArrayHelper.fromObjectOrArray(\n\t\t\tpolicy.obligation ?? []\n\t\t).map(obligation => this.applyPolicyDefaultsToRule(policy, obligation));\n\n\t\t// Merge rules from each inherited policy, applying the same profile guard as the\n\t\t// top-level policy. A parent that declares an unsupported profile may carry rules\n\t\t// whose semantics the arbiter cannot guarantee, so it is rejected.\n\t\tfor (const inheritedPolicy of inheritedPolicies) {\n\t\t\tconst inheritedProfiles = ArrayHelper.fromObjectOrArray<string>(inheritedPolicy.profile ?? [])\n\t\t\t\t.filter(p => Is.stringValue(p))\n\t\t\t\t.map(p => DefaultPolicyArbiter.normalizeProfileIri(p));\n\t\t\tif (\n\t\t\t\tIs.arrayValue(inheritedProfiles) &&\n\t\t\t\t!inheritedProfiles.every(p => DefaultPolicyArbiter.SUPPORTED_PROFILES.has(p))\n\t\t\t) {\n\t\t\t\tthrow new GeneralError(\n\t\t\t\t\tDefaultPolicyArbiter.CLASS_NAME,\n\t\t\t\t\t\"inheritedPolicyProfileNotSupported\",\n\t\t\t\t\t{ policyId: OdrlPolicyHelper.getUid(inheritedPolicy) ?? \"\" }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (Is.stringValue(inheritedPolicy.conflict)) {\n\t\t\t\tconflictStrategies.add(inheritedPolicy.conflict);\n\t\t\t}\n\t\t\tconst inheritedPermissions = ArrayHelper.fromObjectOrArray(inheritedPolicy.permission ?? []);\n\t\t\tif (inheritedPermissions.length > 0) {\n\t\t\t\tmergedPermissions.push(\n\t\t\t\t\t...inheritedPermissions.map(permission =>\n\t\t\t\t\t\tthis.applyPolicyDefaultsToRule(inheritedPolicy, permission)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst inheritedProhibitions = ArrayHelper.fromObjectOrArray(\n\t\t\t\tinheritedPolicy.prohibition ?? []\n\t\t\t);\n\t\t\tif (inheritedProhibitions.length > 0) {\n\t\t\t\tmergedProhibitions.push(\n\t\t\t\t\t...inheritedProhibitions.map(prohibition =>\n\t\t\t\t\t\tthis.applyPolicyDefaultsToRule(inheritedPolicy, prohibition)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst inheritedObligations = ArrayHelper.fromObjectOrArray(inheritedPolicy.obligation ?? []);\n\t\t\tif (inheritedObligations.length > 0) {\n\t\t\t\tmergedObligations.push(\n\t\t\t\t\t...inheritedObligations.map(obligation =>\n\t\t\t\t\t\tthis.applyPolicyDefaultsToRule(inheritedPolicy, obligation)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tlet mergedConflict: OdrlConflictStrategyType | undefined;\n\t\tif (conflictStrategies.size === 1) {\n\t\t\tmergedConflict = Array.from(conflictStrategies)[0];\n\t\t} else if (conflictStrategies.size > 1) {\n\t\t\tmergedConflict = OdrlConflictStrategyType.Invalid;\n\t\t}\n\n\t\t// Return a new policy with merged rules\n\t\treturn {\n\t\t\t...policy,\n\t\t\tconflict: mergedConflict,\n\t\t\tpermission: mergedPermissions.length > 0 ? mergedPermissions : undefined,\n\t\t\tprohibition: mergedProhibitions.length > 0 ? mergedProhibitions : undefined,\n\t\t\tobligation: mergedObligations.length > 0 ? mergedObligations : undefined\n\t\t};\n\t}\n\n\t/**\n\t * Resolve inherited policies by their UIDs from the Policy Administration Point.\n\t * Policies can inherit from other policies via the inheritFrom property.\n\t * @param policy The policy that may have inheritFrom references.\n\t * @param visitedPolicyIds Array of policy UIDs already visited in this inheritance chain.\n\t * @returns Array of inherited policies fetched from the PAP.\n\t * @internal\n\t */\n\tprivate async resolveInheritedPolicies(\n\t\tpolicy: IRightsManagementPolicy,\n\t\tvisitedPolicyIds: string[],\n\t\tcurrentDepth: number\n\t): Promise<IRightsManagementPolicy[]> {\n\t\tconst inheritedPolicies: IRightsManagementPolicy[] = [];\n\n\t\t// If policy has no inheritFrom, return empty array\n\t\tif (Is.empty(policy.inheritFrom)) {\n\t\t\treturn inheritedPolicies;\n\t\t}\n\n\t\tconst inheritFromIds = ArrayHelper.fromObjectOrArray<string>(policy.inheritFrom) ?? [];\n\n\t\tfor (const inheritFromId of inheritFromIds) {\n\t\t\tconst nextDepth = currentDepth + 1;\n\t\t\tif (nextDepth > this._maxInheritanceDepth) {\n\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"maxInheritanceDepthExceeded\", {\n\t\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(policy) ?? \"\",\n\t\t\t\t\tinheritFromId,\n\t\t\t\t\tmaxInheritanceDepth: this._maxInheritanceDepth\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Check for circular inheritance\n\t\t\tif (visitedPolicyIds.includes(inheritFromId)) {\n\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"circularInheritanceDetected\", {\n\t\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(policy) ?? \"\",\n\t\t\t\t\tinheritFromId\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Fetch the inherited policy from the PAP\n\t\t\tconst inheritedPolicy = await this._policyAdministrationPoint.get(inheritFromId);\n\t\t\tif (Is.empty(inheritedPolicy)) {\n\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"inheritedPolicyNotFound\", {\n\t\t\t\t\tinheritFromId\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Mark this policy as visited\n\t\t\tvisitedPolicyIds.push(inheritFromId);\n\n\t\t\tinheritedPolicies.push(inheritedPolicy);\n\n\t\t\t// Recursively resolve inherited policies of the parent\n\t\t\tconst grandparentPolicies = await this.resolveInheritedPolicies(\n\t\t\t\tinheritedPolicy,\n\t\t\t\tvisitedPolicyIds,\n\t\t\t\tnextDepth\n\t\t\t);\n\t\t\tinheritedPolicies.push(...grandparentPolicies);\n\t\t}\n\n\t\treturn inheritedPolicies;\n\t}\n\n\t/**\n\t * Apply policy-level default values (assigner, assignee, target, action) to rules that don't override them.\n\t * @param policy The policy providing defaults.\n\t * @param rule The rule to apply defaults to.\n\t * @returns The rule with policy-level defaults applied.\n\t * @internal\n\t */\n\tprivate applyPolicyDefaultsToRule<T extends IOdrlRule>(\n\t\tpolicy: IRightsManagementPolicy,\n\t\trule: T\n\t): T {\n\t\tconst assigner = Is.empty(rule.assigner) ? policy.assigner : rule.assigner;\n\t\tconst assignee = Is.empty(rule.assignee) ? policy.assignee : rule.assignee;\n\t\tconst target = Is.empty(rule.target) ? policy.target : rule.target;\n\t\tconst action = Is.empty(rule.action) ? policy.action : rule.action;\n\n\t\tconst assignerIds = OdrlPolicyHelper.getPartyIds(assigner);\n\t\tconst ruleAssignerIds = OdrlPolicyHelper.getPartyIds(rule.assigner);\n\t\tconst assigneeIds = OdrlPolicyHelper.getPartyIds(assignee);\n\t\tconst ruleAssigneeIds = OdrlPolicyHelper.getPartyIds(rule.assignee);\n\n\t\tlet assignerEqual = false;\n\t\tif (Is.empty(assignerIds) && Is.empty(ruleAssignerIds)) {\n\t\t\tassignerEqual = true;\n\t\t} else if (!Is.empty(assignerIds) && !Is.empty(ruleAssignerIds)) {\n\t\t\tassignerEqual =\n\t\t\t\tassignerIds.length === ruleAssignerIds.length &&\n\t\t\t\tassignerIds.every(id => ruleAssignerIds.includes(id));\n\t\t}\n\n\t\tlet assigneeEqual = false;\n\t\tif (Is.empty(assigneeIds) && Is.empty(ruleAssigneeIds)) {\n\t\t\tassigneeEqual = true;\n\t\t} else if (!Is.empty(assigneeIds) && !Is.empty(ruleAssigneeIds)) {\n\t\t\tassigneeEqual =\n\t\t\t\tassigneeIds.length === ruleAssigneeIds.length &&\n\t\t\t\tassigneeIds.every(id => ruleAssigneeIds.includes(id));\n\t\t}\n\n\t\tconst targetEqual = target === rule.target;\n\t\tconst actionEqual = action === rule.action;\n\n\t\tif (assignerEqual && assigneeEqual && targetEqual && actionEqual) {\n\t\t\treturn rule;\n\t\t}\n\n\t\treturn {\n\t\t\t...rule,\n\t\t\tassigner,\n\t\t\tassignee,\n\t\t\ttarget,\n\t\t\taction\n\t\t};\n\t}\n\n\t/**\n\t * Determine whether a rule applies to the agreement parties based on assigner/assignee.\n\t * @param rule The rule to evaluate.\n\t * @param agreementAssigner The assigner ID from the agreement.\n\t * @param agreementAssignee The assignee ID from the agreement.\n\t * @returns True if the rule is applicable to the agreement parties.\n\t * @internal\n\t */\n\tprivate isRuleApplicableToParties(\n\t\trule: IOdrlRule,\n\t\tagreementAssigner: string[] | undefined,\n\t\tagreementAssignee: string[] | undefined,\n\t\tdataSources: { [source: string]: unknown }\n\t): boolean {\n\t\tconst assignerContext = this.resolveRulePartyContext(rule.assigner);\n\t\tconst assigneeContext = this.resolveRulePartyContext(rule.assignee);\n\n\t\tif (!this.isPartyApplicable(assignerContext.partyIds, agreementAssigner)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (\n\t\t\tassignerContext.refinements.length > 0 &&\n\t\t\t!assignerContext.refinements.every(c => this.evaluateConstraint(c, dataSources))\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!this.isPartyApplicable(assigneeContext.partyIds, agreementAssignee)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (\n\t\t\tassigneeContext.refinements.length > 0 &&\n\t\t\t!assigneeContext.refinements.every(c => this.evaluateConstraint(c, dataSources))\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Resolve rule party identifiers and refinements.\n\t * PartyCollection source values are currently not supported for party matching.\n\t * @param party The rule party value.\n\t * @returns Resolved party identifiers and refinement constraints.\n\t * @throws GeneralError if PartyCollection source has a value.\n\t * @internal\n\t */\n\tprivate resolveRulePartyContext(party: IOdrlRule[\"assigner\"] | IOdrlRule[\"assignee\"]): {\n\t\tpartyIds: string[];\n\t\trefinements: (IOdrlConstraint | IOdrlLogicalConstraint)[];\n\t} {\n\t\tconst partyIds: string[] = [];\n\t\tconst refinements: (IOdrlConstraint | IOdrlLogicalConstraint)[] = [];\n\n\t\tconst parties = ArrayHelper.fromObjectOrArray(party ?? []);\n\t\tfor (const partyEntry of parties) {\n\t\t\tif (Is.stringValue(partyEntry)) {\n\t\t\t\tpartyIds.push(partyEntry);\n\t\t\t} else if (Is.object<IOdrlParty>(partyEntry)) {\n\t\t\t\t// Guard against unsupported ODRL party properties\n\t\t\t\tif (Is.notEmpty(partyEntry.assignerOf)) {\n\t\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"partyAssignerOfNotSupported\");\n\t\t\t\t}\n\t\t\t\tif (Is.notEmpty(partyEntry.assigneeOf)) {\n\t\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"partyAssigneeOfNotSupported\");\n\t\t\t\t}\n\t\t\t\tif (Is.notEmpty(partyEntry.partOf)) {\n\t\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"partyPartOfNotSupported\");\n\t\t\t\t}\n\n\t\t\t\tif (OdrlPolicyHelper.getType(partyEntry) === OdrlTypes.PartyCollection) {\n\t\t\t\t\tconst partyCollectionEntry = partyEntry as IOdrlPartyCollection;\n\t\t\t\t\tif (Is.stringValue(partyCollectionEntry.source)) {\n\t\t\t\t\t\tthrow new GeneralError(\n\t\t\t\t\t\t\tDefaultPolicyArbiter.CLASS_NAME,\n\t\t\t\t\t\t\t\"partyCollectionSourceNotSupported\",\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsource: partyCollectionEntry.source ?? \"\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\trefinements.push(...ArrayHelper.fromObjectOrArray(partyCollectionEntry.refinement ?? []));\n\t\t\t\t} else {\n\t\t\t\t\tconst partyId = OdrlPolicyHelper.getUid(partyEntry);\n\t\t\t\t\tif (Is.stringValue(partyId)) {\n\t\t\t\t\t\tpartyIds.push(partyId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tpartyIds,\n\t\t\trefinements\n\t\t};\n\t}\n\n\t/**\n\t * Determine whether a rule party constraint applies to the agreement parties.\n\t * Rule party is treated as a constraint: if specified, it must match at least one agreement party.\n\t * @param rulePartyIds The party ids specified on the rule (if any).\n\t * @param agreementPartyIds The party ids extracted from the agreement.\n\t * @returns True if the rule party constraint is satisfied.\n\t * @internal\n\t */\n\tprivate isPartyApplicable(\n\t\trulePartyIds: string[] | undefined,\n\t\tagreementPartyIds: string[] | undefined\n\t): boolean {\n\t\t// No party specified on rule means it applies to any agreement party.\n\t\tif (Is.empty(rulePartyIds)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Rule specifies party/parties, but agreement doesn't provide any.\n\t\tif (Is.empty(agreementPartyIds)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (const rulePartyId of rulePartyIds) {\n\t\t\tif (agreementPartyIds.includes(rulePartyId)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determine whether a rule's action(s) match the requested action.\n\t * Supports exact match, includedIn hierarchy, and implies relationships.\n\t * If no action is specified in the rule, it applies to all actions (action-agnostic).\n\t * If an action is specified in the rule and a specific action is requested, they must match.\n\t * If an action is specified in the rule but no specific action is requested, the rule applies (general evaluation).\n\t * @param ruleActions The actions defined in the rule (can be string, object, or array).\n\t * @param requestedAction The action being requested (optional).\n\t * @returns True if the rule's action(s) apply.\n\t * @internal\n\t */\n\tprivate isActionApplicable(\n\t\truleActions: IOdrlRule[\"action\"],\n\t\trequestedAction: OdrlActionType | string | undefined,\n\t\tdataSources: { [source: string]: unknown }\n\t): boolean {\n\t\t// If the rule has no action specified, it applies to all actions\n\t\tif (Is.empty(ruleActions)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// If the rule has actions but no specific action is requested,\n\t\t// the rule applies (we're evaluating permissions in general)\n\t\tif (Is.empty(requestedAction)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst requestedActionId = Is.string(requestedAction)\n\t\t\t? requestedAction\n\t\t\t: OdrlPolicyHelper.getUid(requestedAction);\n\n\t\tif (!Is.stringValue(requestedActionId)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst ruleActionArray = ArrayHelper.fromObjectOrArray(ruleActions) ?? [];\n\n\t\tfor (const ruleAction of ruleActionArray) {\n\t\t\tif (this.ruleActionCoversRequested(ruleAction, requestedActionId, dataSources)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determine whether a single rule action covers a requested action.\n\t * Covers exact match plus ODRL action hierarchy semantics.\n\t * - includedIn: the rule action is a sub-action of a broader parent.\n\t * A rule naming the narrower action also covers requests for the parent.\n\t * E.g. rule action \"print\" with includedIn \"reproduce\" covers a request for \"reproduce\".\n\t * - implies: the rule action entails another action.\n\t * A rule granting action X also covers action Y when X implies Y.\n\t * E.g. rule action \"distribute\" implying \"reproduce\" covers a request for \"reproduce\".\n\t * @param ruleAction The action specified in the rule.\n\t * @param requestedActionId The requested action identifier.\n\t * @returns True if the rule action covers the requested action.\n\t * @internal\n\t */\n\tprivate ruleActionCoversRequested(\n\t\truleAction: OdrlActionType | string | IOdrlAction,\n\t\trequestedActionId: string,\n\t\tdataSources: { [source: string]: unknown }\n\t): boolean {\n\t\t// Extract the rule action ID — support both @id and rdf:value forms\n\t\tlet ruleActionId: string | undefined;\n\t\tif (Is.string(ruleAction)) {\n\t\t\truleActionId = ruleAction;\n\t\t} else if (Is.object<IOdrlAction>(ruleAction)) {\n\t\t\truleActionId = ruleAction[\"rdf:value\"]?.[\"@id\"] ?? OdrlPolicyHelper.getUid(ruleAction);\n\t\t}\n\n\t\t// Determine whether this rule action covers the requested action via any semantic path.\n\t\tlet covers = false;\n\n\t\tif (Is.stringValue(ruleActionId) && ruleActionId === requestedActionId) {\n\t\t\t// Exact match\n\t\t\tcovers = true;\n\t\t} else if (Is.object<IOdrlAction>(ruleAction)) {\n\t\t\t// includedIn: rule action A includedIn B means A is a sub-type of B.\n\t\t\t// A rule that names the narrower action A with includedIn B also covers requests for B.\n\t\t\tif (Is.stringValue(ruleAction.includedIn) && ruleAction.includedIn === requestedActionId) {\n\t\t\t\tcovers = true;\n\t\t\t}\n\n\t\t\t// implies: rule action A implies B means exercising A also entails B.\n\t\t\t// A rule granting A therefore also grants each implied action.\n\t\t\tif (!covers && (ruleAction.implies ?? []).includes(requestedActionId as OdrlActionType)) {\n\t\t\t\tcovers = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!covers) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the action specifies refinements, all must be satisfied for the action to apply.\n\t\t// Refinements constrain the manner in which the action is exercised (e.g. print count <= 5).\n\t\tif (Is.object<IOdrlAction>(ruleAction) && Is.notEmpty(ruleAction.refinement)) {\n\t\t\tconst refinements = ArrayHelper.fromObjectOrArray<IOdrlConstraint | IOdrlLogicalConstraint>(\n\t\t\t\truleAction.refinement ?? []\n\t\t\t);\n\t\t\treturn refinements.every((refinement: IOdrlConstraint | IOdrlLogicalConstraint) =>\n\t\t\t\tthis.evaluateConstraint(refinement, dataSources)\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Apply a permission and create decisions based on that information.\n\t * @param agreementAssigner The assigner ID from the agreement.\n\t * @param agreementAssignee The assignee ID from the agreement.\n\t * @param policy The policy containing the permission.\n\t * @param permission The permission to apply.\n\t * @param targetRefinements Additional constraints from target refinement.\n\t * @param dataSources The operand lookup sources.\n\t * @returns True if the permission applies.\n\t * @internal\n\t */\n\tprivate async evaluatePermission(\n\t\tagreementAssigner: string[] | undefined,\n\t\tagreementAssignee: string[] | undefined,\n\t\tpolicy: IRightsManagementPolicy,\n\t\tpermission: IOdrlPermission,\n\t\ttargetRefinements: (IOdrlConstraint | IOdrlLogicalConstraint)[],\n\t\tdataSources: { [source: string]: unknown },\n\t\taction?: OdrlActionType | string,\n\t\tdecisionTarget?: string\n\t): Promise<boolean> {\n\t\tif (\n\t\t\t!this.isRuleApplicableToParties(permission, agreementAssigner, agreementAssignee, dataSources)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if the permission's action(s) match the requested action\n\t\tif (!this.isActionApplicable(permission.action, action, dataSources)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// ODRL semantics: a Permission without constraints is unconditional.\n\t\tconst constraints = [\n\t\t\t...ArrayHelper.fromObjectOrArray(permission.constraint ?? []),\n\t\t\t...targetRefinements\n\t\t];\n\t\tconst permissionTargetLookup = this.tryResolveTargetDataSource(\n\t\t\tthis.buildRuleDataContextTargetId(\n\t\t\t\tthis.getRuleDataContextTargetId(permission.target),\n\t\t\t\tdecisionTarget\n\t\t\t),\n\t\t\tdataSources,\n\t\t\ttrue\n\t\t);\n\t\tconst ruleDataContext = permissionTargetLookup.value;\n\t\tif (constraints.length === 0) {\n\t\t\treturn this.enforcePermissionDuties(policy, permission, dataSources, ruleDataContext);\n\t\t}\n\n\t\t// All constraints must be satisfied for the permission to apply.\n\t\tconst constraintsSatisfied = constraints.every(c => this.evaluateConstraint(c, dataSources));\n\n\t\tif (!constraintsSatisfied) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this.enforcePermissionDuties(policy, permission, dataSources, ruleDataContext);\n\t}\n\n\t/**\n\t * Enforce duties attached to a permission.\n\t * @param policy The policy being evaluated.\n\t * @param permission The permission being evaluated.\n\t * @param dataSources The operand lookup sources.\n\t * @param ruleDataContext The target-scoped data context passed to enforcers.\n\t * @returns True if all duties are enforced or none are present.\n\t * @internal\n\t */\n\tprivate async enforcePermissionDuties(\n\t\tpolicy: IRightsManagementPolicy,\n\t\tpermission: IOdrlPermission,\n\t\tdataSources: { [source: string]: unknown },\n\t\truleDataContext?: unknown\n\t): Promise<boolean> {\n\t\tconst duties = ArrayHelper.fromObjectOrArray(permission.duty ?? []);\n\t\tif (duties.length === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (const duty of duties) {\n\t\t\tconst enforced = await this.enforceDuty(policy, duty, dataSources, ruleDataContext);\n\t\t\tif (!enforced) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Enforce a single duty using registered obligation enforcers.\n\t * @param policy The policy being evaluated.\n\t * @param duty The duty to enforce.\n\t * @param dataSources The operand lookup sources.\n\t * @param ruleDataContext The target-scoped data context passed to enforcers.\n\t * @returns True if any enforcer succeeds.\n\t * @internal\n\t */\n\tprivate async enforceDuty(\n\t\tpolicy: IRightsManagementPolicy,\n\t\tduty: IOdrlDuty,\n\t\tdataSources: { [source: string]: unknown },\n\t\truleDataContext?: unknown\n\t): Promise<boolean> {\n\t\tconst enforcerNames = PolicyObligationEnforcerFactory.names();\n\t\tconst information = dataSources[DefaultPolicyArbiter._INFORMATION_SOURCE_KEY] as\n\t\t\t| { [id: string]: IJsonLdNodeObject }\n\t\t\t| undefined;\n\n\t\tif (enforcerNames.length === 0) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"noObligationEnforcersRegistered\");\n\t\t}\n\n\t\tfor (const enforcerName of enforcerNames) {\n\t\t\tconst enforcer = PolicyObligationEnforcerFactory.get(enforcerName);\n\t\t\tif (await enforcer.enforce(policy, duty, information, ruleDataContext)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tconst consequences = ArrayHelper.fromObjectOrArray<IOdrlDuty>(duty.consequence ?? []);\n\t\tif (consequences.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (const consequence of consequences) {\n\t\t\tif (!(await this.enforceDuty(policy, consequence, dataSources, ruleDataContext))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Resolve a target string to a matching datasource prefix and remaining target value.\n\t * @param targetId The target identifier to resolve.\n\t * @param dataSources The available lookup sources.\n\t * @param resolveValue True to resolve an item from the target path/key.\n\t * @returns The matching prefix, source, remaining target and optional resolved value.\n\t * @internal\n\t */\n\tprivate tryResolveTargetDataSource(\n\t\ttargetId: string | undefined,\n\t\tdataSources: { [source: string]: unknown },\n\t\tresolveValue: boolean = false\n\t): { source: unknown; target: string; value?: unknown } {\n\t\t// If there is no target id, default to the data datasource\n\t\tif (Is.empty(targetId)) {\n\t\t\treturn {\n\t\t\t\tsource: dataSources[DefaultPolicyArbiter._DATA_SOURCE_KEY],\n\t\t\t\ttarget: \"$\",\n\t\t\t\tvalue: dataSources[DefaultPolicyArbiter._DATA_SOURCE_KEY]\n\t\t\t};\n\t\t}\n\n\t\t// Handle twin:jsonPath:<datasource>:<expression> format.\n\t\t// The datasource segment is optional; when absent the expression starts with \"$\"\n\t\t// and falls back to the primary data source.\n\t\tif (targetId.startsWith(`${DefaultPolicyArbiter._TWIN_JSONPATH}:`)) {\n\t\t\tconst rest = targetId.slice(DefaultPolicyArbiter._TWIN_JSONPATH.length + 1);\n\t\t\tconst matchingKey = Object.keys(dataSources).find(k => rest.startsWith(`${k}:`));\n\t\t\tconst sourceKey = matchingKey ?? DefaultPolicyArbiter._DATA_SOURCE_KEY;\n\t\t\tconst expression = matchingKey ? rest.slice(matchingKey.length + 1) : rest;\n\t\t\treturn this.resolveDataSourceByKey(sourceKey, expression, dataSources, resolveValue);\n\t\t}\n\n\t\t// Handle <datasource>:<expression> format\n\t\tconst matchingKey = Object.keys(dataSources).find(k => targetId.startsWith(`${k}:`));\n\t\tif (matchingKey) {\n\t\t\tconst expression = targetId.slice(matchingKey.length + 1);\n\t\t\treturn this.resolveDataSourceByKey(matchingKey, expression, dataSources, resolveValue);\n\t\t}\n\n\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"ruleTargetNotSupported\", {\n\t\t\ttarget: targetId\n\t\t});\n\t}\n\n\t/**\n\t * Resolve a datasource by key and evaluate a JSONPath expression against it.\n\t * @param sourceKey The datasource key.\n\t * @param expression The JSONPath expression.\n\t * @param dataSources The available datasources.\n\t * @param resolveValue Whether to evaluate the expression and return the matched value.\n\t * @returns The resolved source, target expression, and optionally the matched value.\n\t * @internal\n\t */\n\tprivate resolveDataSourceByKey(\n\t\tsourceKey: string,\n\t\texpression: string | undefined,\n\t\tdataSources: { [source: string]: unknown },\n\t\tresolveValue: boolean = false\n\t): { source: unknown; target: string; value?: unknown } {\n\t\tif (!Is.stringValue(expression)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"jsonPathExpressionMissing\", {\n\t\t\t\toperand: \"target\"\n\t\t\t});\n\t\t}\n\n\t\tif (!expression.startsWith(\"$\")) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"ruleTargetNotSupported\", {\n\t\t\t\ttarget: `${sourceKey}:${expression}`\n\t\t\t});\n\t\t}\n\t\tconst source = dataSources[sourceKey];\n\t\tif (!resolveValue) {\n\t\t\treturn { source, target: expression };\n\t\t}\n\t\tconst matches = JsonPathHelper.query(expression, source);\n\t\tif (matches.length === 0) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"ruleTargetNotSupported\", {\n\t\t\t\ttarget: `${sourceKey}:${expression}`\n\t\t\t});\n\t\t}\n\t\treturn {\n\t\t\tsource,\n\t\t\ttarget: expression,\n\t\t\tvalue: matches.length === 1 ? matches[0].value : matches.map(m => m.value)\n\t\t};\n\t}\n\n\t/**\n\t * Extract the target id from the permission.\n\t * @param target The permission target.\n\t * @returns The information key, or undefined when the target is not an information reference.\n\t * @internal\n\t */\n\tprivate getTargetId(target: IOdrlRule[\"target\"]): string | undefined {\n\t\tif (Is.undefined(target)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (Is.array(target) && target.length > 1) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"multipleTargetsNotSupported\");\n\t\t}\n\n\t\tconst arr = ArrayHelper.fromObjectOrArray(target ?? []);\n\t\tif (arr.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst first = arr[0];\n\t\tif (Is.string(first)) {\n\t\t\treturn first;\n\t\t}\n\t\tif (this.isTwinJsonPathTarget(first)) {\n\t\t\tconst t = first as {\n\t\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE]?: string;\n\t\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION]?: string;\n\t\t\t};\n\t\t\tconst expression = t[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION];\n\t\t\tif (Is.stringValue(expression)) {\n\t\t\t\tconst dataSource = t[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE];\n\t\t\t\tconst sourceKey = Is.stringValue(dataSource)\n\t\t\t\t\t? dataSource\n\t\t\t\t\t: DefaultPolicyArbiter._DATA_SOURCE_KEY;\n\t\t\t\treturn `${sourceKey}:${expression}`;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\t\treturn OdrlPolicyHelper.getUid(first);\n\t}\n\n\t/**\n\t * Resolve the target identifier used for rule data context lookup.\n\t * For AssetCollection targets the `source` property is used because the collection has no `uid`.\n\t * Falls back to `getTargetId` for all other target forms.\n\t * @param target The rule target field value.\n\t * @returns The prefixed target string for data context resolution.\n\t * @internal\n\t */\n\tprivate getRuleDataContextTargetId(target: IOdrlRule[\"target\"]): string | undefined {\n\t\tconst arr = ArrayHelper.fromObjectOrArray(target ?? []);\n\t\tif (arr.length === 1) {\n\t\t\tconst firstTarget = arr[0];\n\t\t\tif (\n\t\t\t\tIs.object<IOdrlAssetCollection>(firstTarget) &&\n\t\t\t\tOdrlPolicyHelper.getType(firstTarget) === OdrlTypes.AssetCollection &&\n\t\t\t\tIs.stringValue(firstTarget.source)\n\t\t\t) {\n\t\t\t\treturn firstTarget.source;\n\t\t\t}\n\t\t}\n\t\treturn this.getTargetId(target);\n\t}\n\n\t/**\n\t * Build a concrete prefixed target id for rule data-context lookup.\n\t * @param baseTargetId The original prefixed target id from the rule.\n\t * @param decisionTarget The concrete decision JSONPath target.\n\t * @returns The concrete prefixed target id.\n\t * @internal\n\t */\n\tprivate buildRuleDataContextTargetId(\n\t\tbaseTargetId: string | undefined,\n\t\tdecisionTarget: string | undefined\n\t): string | undefined {\n\t\tif (!Is.stringValue(decisionTarget) || decisionTarget === \"$\") {\n\t\t\treturn baseTargetId;\n\t\t}\n\n\t\tif (!Is.stringValue(baseTargetId)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst pathStartIndex = baseTargetId.indexOf(\":$\");\n\t\tif (pathStartIndex < 0) {\n\t\t\treturn baseTargetId;\n\t\t}\n\n\t\treturn `${baseTargetId.slice(0, pathStartIndex)}:${decisionTarget}`;\n\t}\n\n\t/**\n\t * Resolve a rule target into a policy-decision JSONPath target and extracted refinements.\n\t * For AssetCollection targets, `source` is treated as the decision target and `refinement`\n\t * constraints are applied as additional rule constraints.\n\t * @param rule The rule to resolve the target for.\n\t * @returns The decision target and target refinements.\n\t * @throws GeneralError if target is invalid or unsupported.\n\t * @internal\n\t */\n\tprivate resolveRuleTarget(\n\t\trule: IOdrlRule,\n\t\tdataSources: { [source: string]: unknown }\n\t): {\n\t\ttarget: string;\n\t\trefinements: (IOdrlConstraint | IOdrlLogicalConstraint)[];\n\t} {\n\t\tconst arr = ArrayHelper.fromObjectOrArray(rule.target ?? []);\n\t\tif (arr.length === 0) {\n\t\t\treturn {\n\t\t\t\ttarget: \"$\",\n\t\t\t\trefinements: []\n\t\t\t};\n\t\t}\n\n\t\tif (arr.length > 1) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"multipleTargetsNotSupported\");\n\t\t}\n\n\t\tconst firstTarget = arr[0];\n\n\t\tif (this.isTwinJsonPathTarget(firstTarget)) {\n\t\t\tconst t = firstTarget as {\n\t\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE]?: string;\n\t\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION]?: string;\n\t\t\t};\n\t\t\tconst resolved = this.resolveDataSourceByKey(\n\t\t\t\tt[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE] ?? DefaultPolicyArbiter._DATA_SOURCE_KEY,\n\t\t\t\tt[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION],\n\t\t\t\tdataSources\n\t\t\t);\n\t\t\treturn {\n\t\t\t\ttarget: resolved.target,\n\t\t\t\trefinements: []\n\t\t\t};\n\t\t}\n\n\t\tif (Is.object<IOdrlAsset>(firstTarget)) {\n\t\t\t// Guard against unsupported ODRL asset properties\n\t\t\tif (Is.notEmpty(firstTarget.hasPolicy)) {\n\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"assetHasPolicyNotSupported\");\n\t\t\t}\n\t\t\tif (Is.notEmpty(firstTarget.partOf)) {\n\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"assetPartOfNotSupported\");\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tIs.object<IOdrlAssetCollection>(firstTarget) &&\n\t\t\t\tOdrlPolicyHelper.getType(firstTarget) === OdrlTypes.AssetCollection\n\t\t\t) {\n\t\t\t\tif (\n\t\t\t\t\t!Is.stringValue(firstTarget.source) ||\n\t\t\t\t\t!firstTarget.source.startsWith(`${DefaultPolicyArbiter._TWIN_JSONPATH}:`)\n\t\t\t\t) {\n\t\t\t\t\tthrow new GeneralError(\n\t\t\t\t\t\tDefaultPolicyArbiter.CLASS_NAME,\n\t\t\t\t\t\t\"assetCollectionSourceNotSupported\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsource: firstTarget.source ?? \"\"\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tlet sourceLookup: { source: unknown; target: string; value?: unknown };\n\t\t\t\ttry {\n\t\t\t\t\tsourceLookup = this.tryResolveTargetDataSource(firstTarget.source, dataSources);\n\t\t\t\t} catch {\n\t\t\t\t\tthrow new GeneralError(\n\t\t\t\t\t\tDefaultPolicyArbiter.CLASS_NAME,\n\t\t\t\t\t\t\"assetCollectionSourceNotSupported\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsource: firstTarget.source\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\ttarget: sourceLookup.target,\n\t\t\t\t\trefinements: ArrayHelper.fromObjectOrArray(firstTarget.refinement ?? [])\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tconst targetId = Is.string(firstTarget) ? firstTarget : OdrlPolicyHelper.getUid(firstTarget);\n\t\tif (!Is.stringValue(targetId)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"ruleTargetNotSupported\", {\n\t\t\t\ttarget: \"\"\n\t\t\t});\n\t\t}\n\n\t\tconst targetLookup = this.tryResolveTargetDataSource(targetId, dataSources);\n\n\t\treturn {\n\t\t\ttarget: targetLookup.target,\n\t\t\trefinements: []\n\t\t};\n\t}\n\n\t/**\n\t * Resolve decision targets for a rule.\n\t * AssetCollection wildcard targets with refinements are expanded to per-item targets.\n\t * @param rule The rule being evaluated.\n\t * @param dataSources The operand lookup sources.\n\t * @returns The decision targets and scoped refinements.\n\t * @internal\n\t */\n\tprivate resolveRuleDecisionTargets(\n\t\trule: IOdrlRule,\n\t\tdataSources: { [source: string]: unknown }\n\t): {\n\t\ttarget: string;\n\t\trefinements: (IOdrlConstraint | IOdrlLogicalConstraint)[];\n\t}[] {\n\t\tconst resolvedTarget = this.resolveRuleTarget(rule, dataSources);\n\n\t\tif (!this.shouldExpandToPerItemTargets(rule, resolvedTarget)) {\n\t\t\treturn [resolvedTarget];\n\t\t}\n\n\t\tconst sourceLookup = this.tryResolveTargetDataSource(\n\t\t\tthis.getRuleDataContextTargetId(rule.target),\n\t\t\tdataSources\n\t\t);\n\t\tconst matches = JsonPathHelper.query(sourceLookup.target, sourceLookup.source);\n\t\tif (matches.length === 0) {\n\t\t\treturn [resolvedTarget];\n\t\t}\n\n\t\treturn matches.map(match => {\n\t\t\tconst itemTarget = this.normalizeDecisionTargetPath(match.path ?? resolvedTarget.target);\n\t\t\treturn {\n\t\t\t\ttarget: itemTarget,\n\t\t\t\trefinements: resolvedTarget.refinements.map(refinement =>\n\t\t\t\t\tthis.rewriteRefinementForDecisionTarget(refinement, resolvedTarget.target, itemTarget)\n\t\t\t\t)\n\t\t\t};\n\t\t});\n\t}\n\n\t/**\n\t * Determine if a rule should be expanded to per-item targets.\n\t * @param rule The rule.\n\t * @param resolvedTarget The resolved target details.\n\t * @returns True if the rule should emit per-item decisions.\n\t * @internal\n\t */\n\tprivate shouldExpandToPerItemTargets(\n\t\trule: IOdrlRule,\n\t\tresolvedTarget: {\n\t\t\ttarget: string;\n\t\t\trefinements: (IOdrlConstraint | IOdrlLogicalConstraint)[];\n\t\t}\n\t): boolean {\n\t\tif (resolvedTarget.refinements.length === 0 || !resolvedTarget.target.includes(\"[*]\")) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst targets = ArrayHelper.fromObjectOrArray(rule.target ?? []);\n\t\tif (targets.length !== 1 || !Is.object<IOdrlAssetCollection>(targets[0])) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn OdrlPolicyHelper.getType(targets[0]) === OdrlTypes.AssetCollection;\n\t}\n\n\t/**\n\t * Rewrite a refinement so wildcard paths are scoped to a concrete item target.\n\t * @param refinement The refinement to rewrite.\n\t * @param sourceTarget The wildcard source target.\n\t * @param itemTarget The concrete item target.\n\t * @returns The rewritten refinement.\n\t * @internal\n\t */\n\tprivate rewriteRefinementForDecisionTarget(\n\t\trefinement: IOdrlConstraint | IOdrlLogicalConstraint,\n\t\tsourceTarget: string,\n\t\titemTarget: string\n\t): IOdrlConstraint | IOdrlLogicalConstraint {\n\t\tconst logicalConstraint = this.getLogicalConstraintOperands(refinement);\n\t\tif (logicalConstraint) {\n\t\t\treturn {\n\t\t\t\t...refinement,\n\t\t\t\t[logicalConstraint.operator]: logicalConstraint.constraints.map(item =>\n\t\t\t\t\tthis.rewriteRefinementForDecisionTarget(item, sourceTarget, itemTarget)\n\t\t\t\t)\n\t\t\t} as IOdrlLogicalConstraint;\n\t\t}\n\n\t\tconst regularConstraint = refinement as IOdrlConstraint;\n\t\tconst constraintWithExtensions = regularConstraint as IOdrlConstraint & {\n\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION]?: string;\n\t\t};\n\t\tconst canonicalExpression =\n\t\t\tconstraintWithExtensions[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION];\n\t\tconst rewrittenConstraint: IOdrlConstraint & {\n\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION]?: string;\n\t\t} = {\n\t\t\t...regularConstraint,\n\t\t\tleftOperand: this.rewriteOperandForDecisionTarget(\n\t\t\t\tregularConstraint.leftOperand,\n\t\t\t\tsourceTarget,\n\t\t\t\titemTarget\n\t\t\t) as IOdrlConstraint[\"leftOperand\"],\n\t\t\trightOperand: this.rewriteOperandForDecisionTarget(\n\t\t\t\tregularConstraint.rightOperand,\n\t\t\t\tsourceTarget,\n\t\t\t\titemTarget\n\t\t\t)\n\t\t};\n\t\tif (Is.stringValue(canonicalExpression)) {\n\t\t\trewrittenConstraint[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION] =\n\t\t\t\tthis.rewriteWildcardPath(canonicalExpression, sourceTarget, itemTarget);\n\t\t}\n\n\t\treturn rewrittenConstraint;\n\t}\n\n\t/**\n\t * Rewrite JSONPath-based operands from wildcard source to concrete item target.\n\t * @param operand The operand to rewrite.\n\t * @param sourceTarget The wildcard source target.\n\t * @param itemTarget The concrete item target.\n\t * @returns The rewritten operand.\n\t * @internal\n\t */\n\tprivate rewriteOperandForDecisionTarget(\n\t\toperand: IOdrlConstraint[\"leftOperand\"] | IOdrlConstraint[\"rightOperand\"] | string,\n\t\tsourceTarget: string,\n\t\titemTarget: string\n\t): IOdrlConstraint[\"leftOperand\"] | IOdrlConstraint[\"rightOperand\"] | string {\n\t\tif (Is.object<{ \"@type\": unknown; \"@value\": unknown }>(operand)) {\n\t\t\tconst typedOperand = {\n\t\t\t\t...(operand as { [key: string]: unknown; \"@type\": unknown; \"@value\"?: unknown })\n\t\t\t};\n\t\t\tif (this.isTwinJsonPathOperandType(typedOperand[\"@type\"])) {\n\t\t\t\tif (Is.stringValue(typedOperand[\"@value\"])) {\n\t\t\t\t\ttypedOperand[\"@value\"] = this.rewriteWildcardPath(\n\t\t\t\t\t\ttypedOperand[\"@value\"],\n\t\t\t\t\t\tsourceTarget,\n\t\t\t\t\t\titemTarget\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst canonicalExpression = typedOperand[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION];\n\t\t\t\tif (Is.stringValue(canonicalExpression)) {\n\t\t\t\t\ttypedOperand[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION] = this.rewriteWildcardPath(\n\t\t\t\t\t\tcanonicalExpression,\n\t\t\t\t\t\tsourceTarget,\n\t\t\t\t\t\titemTarget\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn typedOperand as\n\t\t\t\t| IOdrlConstraint[\"leftOperand\"]\n\t\t\t\t| IOdrlConstraint[\"rightOperand\"]\n\t\t\t\t| string;\n\t\t}\n\n\t\treturn operand;\n\t}\n\n\t/**\n\t * Rewrite wildcard source JSONPath segments to a concrete item JSONPath.\n\t * @param valuePath The operand path.\n\t * @param sourceTarget The wildcard source path.\n\t * @param itemTarget The concrete item path.\n\t * @returns The rewritten path.\n\t * @internal\n\t */\n\tprivate rewriteWildcardPath(valuePath: string, sourceTarget: string, itemTarget: string): string {\n\t\tif (!sourceTarget.includes(\"[*]\") || !valuePath.includes(\"[*]\")) {\n\t\t\treturn valuePath;\n\t\t}\n\n\t\tif (valuePath.startsWith(sourceTarget)) {\n\t\t\treturn `${itemTarget}${valuePath.slice(sourceTarget.length)}`;\n\t\t}\n\n\t\treturn valuePath;\n\t}\n\n\t/**\n\t * Normalize JSONPath strings to dot notation for stable decision targets.\n\t * @param path The JSONPath to normalize.\n\t * @returns The normalized path.\n\t * @internal\n\t */\n\tprivate normalizeDecisionTargetPath(path: string): string {\n\t\treturn path.replace(/\\['([^']+)']/g, \".$1\");\n\t}\n\n\t/**\n\t * Evaluate a single ODRL constraint against the available context.\n\t * Supports logical constraint composition through nested refinements.\n\t * @param constraint The constraint to evaluate.\n\t * @param dataSources The operand lookup sources.\n\t * @returns True if the constraint is satisfied.\n\t * @internal\n\t */\n\tprivate evaluateConstraint(\n\t\tconstraint: IOdrlConstraint | IOdrlLogicalConstraint,\n\t\tdataSources: { [source: string]: unknown }\n\t): boolean {\n\t\tconst logicalConstraint = this.getLogicalConstraintOperands(constraint);\n\t\tif (logicalConstraint) {\n\t\t\treturn this.evaluateLogicalConstraint(logicalConstraint, dataSources);\n\t\t}\n\n\t\t// Must be a regular constraint beyond this point\n\t\tconst regularConstraint = constraint as IOdrlConstraint;\n\n\t\t// rightOperandReference is not supported — it requires an external IRI lookup that\n\t\t// is outside the scope of the local evaluation engine.\n\t\tif (Is.notEmpty(regularConstraint.rightOperandReference)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"rightOperandReferenceNotSupported\");\n\t\t}\n\n\t\t// dataType specifies how the rightOperand value should be coerced before comparison.\n\t\t// Without dataType-aware coercion logic the comparison may produce incorrect results.\n\t\tif (Is.notEmpty(regularConstraint.dataType)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"constraintDataTypeNotSupported\");\n\t\t}\n\n\t\t// unit specifies the measurement unit for the right operand (e.g. currency, length).\n\t\t// Unit-aware comparison is not implemented.\n\t\tif (Is.notEmpty(regularConstraint.unit)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"constraintUnitNotSupported\");\n\t\t}\n\n\t\t// status represents a state-based evaluation operand (e.g. odrl:policyUsage).\n\t\t// State-based evaluation is not implemented.\n\t\tif (Is.notEmpty(regularConstraint.status)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"constraintStatusNotSupported\");\n\t\t}\n\n\t\t// Evaluate the main constraint condition\n\t\tconst leftValue = this.calculateOperandValue(\n\t\t\tregularConstraint.leftOperand,\n\t\t\tdataSources,\n\t\t\tregularConstraint\n\t\t);\n\t\tconst rightValue = this.calculateOperandValue(\n\t\t\tregularConstraint.rightOperand,\n\t\t\tdataSources,\n\t\t\tregularConstraint\n\t\t);\n\t\tconst mainSatisfied = this.evaluateOperator(regularConstraint.operator, leftValue, rightValue);\n\n\t\t// If main constraint is not satisfied, the overall constraint fails\n\t\treturn mainSatisfied;\n\t}\n\n\t/**\n\t * Extract logical constraint operands when present.\n\t * @param constraint The constraint to inspect.\n\t * @returns The logical operator and its operands, or undefined when not logical.\n\t * @throws GeneralError if logical constraint operands are not unique.\n\t * @internal\n\t */\n\tprivate getLogicalConstraintOperands(constraint: IOdrlConstraint | IOdrlLogicalConstraint):\n\t\t| {\n\t\t\t\toperator: OdrlLogicalConstraintType;\n\t\t\t\tconstraints: (IOdrlConstraint | IOdrlLogicalConstraint)[];\n\t\t }\n\t\t| undefined {\n\t\tconst logicalConstraint = constraint as IOdrlLogicalConstraint;\n\t\tconst operators: OdrlLogicalConstraintType[] = Object.values(OdrlLogicalConstraintType);\n\t\tfor (const operator of operators) {\n\t\t\tconst value = logicalConstraint[operator];\n\t\t\tif (!Is.undefined(value)) {\n\t\t\t\tconst constraints = this.normalizeLogicalConstraintOperands(value);\n\t\t\t\tthis.validateLogicalConstraintOperandUniqueness(constraints, operator);\n\t\t\t\treturn {\n\t\t\t\t\toperator,\n\t\t\t\t\tconstraints\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Normalize logical constraint operands into a constraint array.\n\t * Handles both IOdrlConstraint and IOdrlLogicalConstraint types.\n\t * @param raw The raw operand value.\n\t * @returns The constraint array.\n\t * @internal\n\t */\n\tprivate normalizeLogicalConstraintOperands(\n\t\traw: unknown\n\t): (IOdrlConstraint | IOdrlLogicalConstraint)[] {\n\t\tlet normalized = raw;\n\t\tif (\n\t\t\tIs.object<IOdrlLogicalConstraintOperand>(normalized) &&\n\t\t\t!Is.undefined(normalized[\"@list\"])\n\t\t) {\n\t\t\tnormalized = normalized[\"@list\"];\n\t\t}\n\n\t\treturn (ArrayHelper.fromObjectOrArray(normalized) ?? [])\n\t\t\t.filter(item => Is.object(item))\n\t\t\t.map(item => item as IOdrlConstraint | IOdrlLogicalConstraint);\n\t}\n\n\t/**\n\t * Validate that all operands in a logical constraint are unique.\n\t * ODRL spec 2.5.2 requires that all operand values MUST be unique Constraint instances.\n\t * Uniqueness is checked by uid property and id property.\n\t * @param constraints The constraint operands to validate.\n\t * @param operator The logical operator type (for error messaging).\n\t * @throws GeneralError if duplicate constraints are found.\n\t * @internal\n\t */\n\tprivate validateLogicalConstraintOperandUniqueness(\n\t\tconstraints: (IOdrlConstraint | IOdrlLogicalConstraint)[],\n\t\toperator: OdrlLogicalConstraintType\n\t): void {\n\t\tconst seenIdentifiers = new Set<string>();\n\n\t\tfor (let i = 0; i < constraints.length; i++) {\n\t\t\tconst constraint = constraints[i];\n\t\t\tconst identifier = OdrlPolicyHelper.getUid(constraint);\n\n\t\t\t// If we have an identifier, check for duplicates\n\t\t\tif (Is.stringValue(identifier)) {\n\t\t\t\tif (seenIdentifiers.has(identifier)) {\n\t\t\t\t\tthrow new GeneralError(\n\t\t\t\t\t\tDefaultPolicyArbiter.CLASS_NAME,\n\t\t\t\t\t\t\"logicalConstraintOperandNotUnique\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toperator,\n\t\t\t\t\t\t\tidentifier,\n\t\t\t\t\t\t\tindex: i\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tseenIdentifiers.add(identifier);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Evaluate a logical constraint operator against its operands.\n\t * @param logicalConstraint The operator and operand list.\n\t * @param dataSources The operand lookup sources.\n\t * @returns True if the logical constraint is satisfied.\n\t * @internal\n\t */\n\tprivate evaluateLogicalConstraint(\n\t\tlogicalConstraint: {\n\t\t\toperator: OdrlLogicalConstraintType;\n\t\t\tconstraints: (IOdrlConstraint | IOdrlLogicalConstraint)[];\n\t\t},\n\t\tdataSources: { [source: string]: unknown }\n\t): boolean {\n\t\tconst { operator, constraints } = logicalConstraint;\n\t\tif (constraints.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch (operator) {\n\t\t\tcase OdrlLogicalConstraintType.And:\n\t\t\t\treturn constraints.every(item => this.evaluateConstraint(item, dataSources));\n\t\t\tcase OdrlLogicalConstraintType.AndSequence: {\n\t\t\t\tfor (const item of constraints) {\n\t\t\t\t\tif (!this.evaluateConstraint(item, dataSources)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcase OdrlLogicalConstraintType.Or:\n\t\t\t\treturn constraints.some(item => this.evaluateConstraint(item, dataSources));\n\t\t\tcase OdrlLogicalConstraintType.Xone: {\n\t\t\t\tlet satisfied = 0;\n\t\t\t\tfor (const item of constraints) {\n\t\t\t\t\tif (this.evaluateConstraint(item, dataSources)) {\n\t\t\t\t\t\tsatisfied += 1;\n\t\t\t\t\t\tif (satisfied > 1) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn satisfied === 1;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Resolve a prefixed operand to its source object and JSONPath expression.\n\t * Prefix matching is dictionary-driven so additional operand namespaces can be\n\t * added in one place by extending the lookup sources map.\n\t * @param operandTypeOrValue The string operand value or typed operand namespace.\n\t * @param operandValue The JSONPath expression.\n\t * @param dataSources The available lookup sources.\n\t * @returns The resolved source and JSONPath, or undefined when not namespaced.\n\t * @throws GeneralError if a twin: prefixed operand doesn't resolve to any available datasource key.\n\t * @internal\n\t */\n\tprivate tryResolveOperandLookup(\n\t\toperandTypeOrValue: string,\n\t\toperandValue: unknown,\n\t\tdataSources: { [source: string]: unknown }\n\t): { source: unknown; jsonPath: string } | undefined {\n\t\tconst sourceKey = this.normalizeTwinJsonPathOperandAlias(operandTypeOrValue);\n\t\tif (!dataSources[sourceKey] || !Is.stringValue(operandValue)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst resolved = this.resolveDataSourceByKey(sourceKey, operandValue, dataSources);\n\t\treturn { source: resolved.source, jsonPath: resolved.target };\n\t}\n\n\t/**\n\t * Calculate an operand value.\n\t * @param operand The operand.\n\t * @param dataSources The available prefixed operand sources.\n\t * @returns The resolved operand value.\n\t * @internal\n\t */\n\tprivate calculateOperandValue(\n\t\toperand: IOdrlConstraint[\"leftOperand\"] | IOdrlConstraint[\"rightOperand\"] | string,\n\t\tdataSources: { [source: string]: unknown },\n\t\tconstraint?: IOdrlConstraint\n\t): unknown {\n\t\t// Treat prefixed operands as selectors against a namespaced source dictionary.\n\t\t// Examples: twin:jsonpath:$.field, twin:information:$.credentials.level\n\t\tlet jsonPath: string | undefined;\n\t\tlet operandRoot: unknown;\n\t\tif (Is.stringValue(operand)) {\n\t\t\tconst expression = this.extractJsonPathExpressionFromConstraint(constraint, operand);\n\t\t\tlet resolvedOperand = operand;\n\t\t\tif (\n\t\t\t\toperand === DefaultPolicyArbiter._TWIN_JSONPATH &&\n\t\t\t\tIs.object<{ [key: string]: unknown }>(constraint)\n\t\t\t) {\n\t\t\t\tconst dataSourceOverride = constraint[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE];\n\t\t\t\tif (Is.stringValue(dataSourceOverride)) {\n\t\t\t\t\tresolvedOperand = dataSourceOverride;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst lookup = this.tryResolveOperandLookup(\n\t\t\t\tresolvedOperand,\n\t\t\t\texpression ?? operand,\n\t\t\t\tdataSources\n\t\t\t);\n\t\t\tif (lookup) {\n\t\t\t\tjsonPath = lookup.jsonPath;\n\t\t\t\toperandRoot = lookup.source;\n\t\t\t}\n\t\t} else if (Is.object<{ \"@type\": unknown; \"@value\": unknown }>(operand)) {\n\t\t\tconst typedOperand = operand as {\n\t\t\t\t[key: string]: unknown;\n\t\t\t\t\"@type\": unknown;\n\t\t\t\t\"@value\"?: unknown;\n\t\t\t};\n\t\t\t// Is this an object { \"@value\": \"18\", \"@type\": \"xsd:integer\" } ?\n\t\t\tconst value =\n\t\t\t\t(this.extractJsonPathExpressionFromTypedOperand(typedOperand) as unknown) ??\n\t\t\t\ttypedOperand[\"@value\"];\n\t\t\tconst type = typedOperand[\"@type\"];\n\t\t\tif (Is.stringValue(type)) {\n\t\t\t\tlet resolvedType = type;\n\t\t\t\tif (this.isTwinJsonPathOperandType(type)) {\n\t\t\t\t\tconst dataSourceOverride = typedOperand[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE];\n\t\t\t\t\tif (Is.stringValue(dataSourceOverride)) {\n\t\t\t\t\t\tresolvedType = dataSourceOverride;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst lookup = this.tryResolveOperandLookup(resolvedType, value, dataSources);\n\t\t\t\tif (lookup) {\n\t\t\t\t\tjsonPath = lookup.jsonPath;\n\t\t\t\t\toperandRoot = lookup.source;\n\t\t\t\t} else {\n\t\t\t\t\tconst xsdValue = this.coerceXsdType(value, type);\n\t\t\t\t\tif (!Is.undefined(xsdValue)) {\n\t\t\t\t\t\treturn xsdValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// We have a JSON Path to resolve\n\t\tif (Is.stringValue(jsonPath)) {\n\t\t\tconst jsonPaths = JsonPathHelper.query(jsonPath, operandRoot);\n\t\t\tif (jsonPaths.length === 0) {\n\t\t\t\t// No matches\n\t\t\t\treturn undefined;\n\t\t\t} else if (jsonPaths.length === 1) {\n\t\t\t\t// Single match - return the value directly\n\t\t\t\treturn jsonPaths[0].value;\n\t\t\t}\n\n\t\t\t// Multiple matches - return array of values\n\t\t\treturn jsonPaths.map(p => p.value);\n\t\t}\n\n\t\t// Not JSON Path or object value so return as is\n\t\treturn operand;\n\t}\n\n\t/**\n\t * Determine if a target object uses the canonical twin:jsonPath object format.\n\t * @param target The target value.\n\t * @returns True if the target is a canonical twin:jsonPath object.\n\t * @internal\n\t */\n\tprivate isTwinJsonPathTarget(target: unknown): boolean {\n\t\treturn Is.object(target) && this.isTwinJsonPathOperandType(OdrlPolicyHelper.getType(target));\n\t}\n\n\t/**\n\t * Determine if the operand type is a jsonPath namespace.\n\t * @param type The operand type.\n\t * @returns True if the type is twin:jsonPath.\n\t * @internal\n\t */\n\tprivate isTwinJsonPathOperandType(type: unknown): boolean {\n\t\treturn type === DefaultPolicyArbiter._TWIN_JSONPATH;\n\t}\n\n\t/**\n\t * Normalize canonical jsonPath alias to the legacy jsonpath namespace key.\n\t * @param operandTypeOrValue The raw operand type or value.\n\t * @returns The normalized operand type/value.\n\t * @internal\n\t */\n\tprivate normalizeTwinJsonPathOperandAlias(operandTypeOrValue: string): string {\n\t\tif (\n\t\t\toperandTypeOrValue === DefaultPolicyArbiter._TWIN_JSONPATH ||\n\t\t\toperandTypeOrValue.startsWith(`${DefaultPolicyArbiter._TWIN_JSONPATH}:`)\n\t\t) {\n\t\t\tconst suffix = operandTypeOrValue.slice(DefaultPolicyArbiter._TWIN_JSONPATH.length);\n\t\t\treturn `${DefaultPolicyArbiter._DATA_SOURCE_KEY}${suffix}`;\n\t\t}\n\n\t\treturn operandTypeOrValue;\n\t}\n\n\t/**\n\t * Extract canonical jsonPath expression from typed operand object.\n\t * @param operand The typed operand.\n\t * @returns The jsonPath expression if present.\n\t * @internal\n\t */\n\tprivate extractJsonPathExpressionFromTypedOperand(operand: {\n\t\t[key: string]: unknown;\n\t\t\"@type\": unknown;\n\t\t\"@value\"?: unknown;\n\t}): string | undefined {\n\t\tif (!this.isTwinJsonPathOperandType(operand[\"@type\"])) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst expression = operand[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION];\n\t\tif (Is.stringValue(expression)) {\n\t\t\treturn expression;\n\t\t}\n\n\t\tconst type = operand[\"@type\"];\n\t\tif (type === DefaultPolicyArbiter._TWIN_JSONPATH) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"jsonPathExpressionMissing\", {\n\t\t\t\toperand: \"rightOperand\"\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Extract canonical jsonPath expression from constraint for leftOperand aliases.\n\t * @param constraint The constraint containing the left operand.\n\t * @param leftOperand The left operand.\n\t * @returns The expression if canonical form is used.\n\t * @internal\n\t */\n\tprivate extractJsonPathExpressionFromConstraint(\n\t\tconstraint: IOdrlConstraint | undefined,\n\t\tleftOperand: string\n\t): string | undefined {\n\t\tif (!Is.object<{ [key: string]: unknown }>(constraint)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (constraint.leftOperand !== leftOperand) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (leftOperand.startsWith(`${DefaultPolicyArbiter._TWIN_JSONPATH}:`)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"jsonPathExpressionMissing\", {\n\t\t\t\toperand: \"leftOperand\"\n\t\t\t});\n\t\t}\n\n\t\tif (leftOperand !== DefaultPolicyArbiter._TWIN_JSONPATH) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst expression = constraint[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION];\n\t\tif (Is.stringValue(expression)) {\n\t\t\treturn expression;\n\t\t}\n\n\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"jsonPathExpressionMissing\", {\n\t\t\toperand: \"leftOperand\"\n\t\t});\n\t}\n\n\t/**\n\t * Evaluate an ODRL operator against resolved operands.\n\t * @param operator The operator.\n\t * @param left The resolved left operand.\n\t * @param right The resolved right operand.\n\t * @returns True if the comparison is satisfied.\n\t * @internal\n\t */\n\tprivate evaluateOperator(operator: OdrlOperatorType, left: unknown, right: unknown): boolean {\n\t\t// Handle array/collection left values (e.g. JSONPath returning multiple matches).\n\t\tconst leftValues = ArrayHelper.fromObjectOrArray(left ?? []);\n\n\t\tswitch (operator) {\n\t\t\tcase OdrlOperatorType.Eq:\n\t\t\t\treturn leftValues.some(v => ObjectHelper.equal(v, right, false));\n\t\t\tcase OdrlOperatorType.Neq:\n\t\t\t\treturn leftValues.every(v => !ObjectHelper.equal(v, right, false));\n\t\t\tcase OdrlOperatorType.Gt:\n\t\t\t\treturn leftValues.some(v => this.compareOrdered(v, right, (a, b) => a > b));\n\t\t\tcase OdrlOperatorType.Gteq:\n\t\t\t\treturn leftValues.some(v => this.compareOrdered(v, right, (a, b) => a >= b));\n\t\t\tcase OdrlOperatorType.Lt:\n\t\t\t\treturn leftValues.some(v => this.compareOrdered(v, right, (a, b) => a < b));\n\t\t\tcase OdrlOperatorType.Lteq:\n\t\t\t\treturn leftValues.some(v => this.compareOrdered(v, right, (a, b) => a <= b));\n\t\t\tcase OdrlOperatorType.IsAnyOf: {\n\t\t\t\treturn leftValues.some(v => {\n\t\t\t\t\tconst stringValue =\n\t\t\t\t\t\ttypeof v === \"string\" || typeof v === \"number\" || typeof v === \"boolean\"\n\t\t\t\t\t\t\t? String(v)\n\t\t\t\t\t\t\t: JSON.stringify(v);\n\t\t\t\t\treturn (ArrayHelper.fromObjectOrArray(right) ?? []).includes(stringValue);\n\t\t\t\t});\n\t\t\t}\n\t\t\tcase OdrlOperatorType.IsAllOf: {\n\t\t\t\treturn ObjectHelper.equal(leftValues, ArrayHelper.fromObjectOrArray(right) ?? [], false);\n\t\t\t}\n\t\t\tcase OdrlOperatorType.IsNoneOf: {\n\t\t\t\treturn leftValues.every(v => !(ArrayHelper.fromObjectOrArray(right) ?? []).includes(v));\n\t\t\t}\n\t\t\tcase OdrlOperatorType.LocTimeEq:\n\t\t\t\treturn leftValues.some(v => ObjectHelper.equal(v, right, false));\n\t\t\tcase OdrlOperatorType.LocTimeGteq:\n\t\t\t\treturn leftValues.some(v => this.compareOrdered(v, right, (a, b) => a >= b));\n\t\t\tcase OdrlOperatorType.IsA:\n\t\t\tcase OdrlOperatorType.HasPart:\n\t\t\tcase OdrlOperatorType.IsPartOf:\n\t\t\t\t// For now, treat these as simple equality/ordering semantics where meaningful.\n\t\t\t\t// Profiles can introduce richer semantics via additional arbiters.\n\t\t\t\treturn leftValues.some(v => ObjectHelper.equal(v, right, false));\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Compare values with numeric/date/string coercion.\n\t * @param left The left value.\n\t * @param right The right value.\n\t * @param compare Comparison operator.\n\t * @returns True if ordered comparison passes.\n\t * @internal\n\t */\n\tprivate compareOrdered(\n\t\tleft: unknown,\n\t\tright: unknown,\n\t\tcompare: (a: number, b: number) => boolean\n\t): boolean {\n\t\tconst leftNum = Coerce.number(left);\n\t\tconst rightNum = Coerce.number(right);\n\t\tif (!Is.undefined(leftNum) && !Is.undefined(rightNum)) {\n\t\t\treturn compare(leftNum, rightNum);\n\t\t}\n\t\tconst leftDate = Coerce.dateTime(left);\n\t\tconst rightDate = Coerce.dateTime(right);\n\t\tif (!Is.undefined(leftDate) && !Is.undefined(rightDate)) {\n\t\t\treturn compare(leftDate.getTime(), rightDate.getTime());\n\t\t}\n\n\t\t// Only use string ordering when both operands are actual strings.\n\t\t// Avoid coercing other types into strings, as that can cause\n\t\t// unintended comparisons like 18 >= \"$.minAge\" evaluating to true.\n\t\tif (Is.string(left) && Is.string(right)) {\n\t\t\treturn compare(left.localeCompare(right), 0);\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Coerce a value to a specific XSD type.\n\t * @param value The value to coerce.\n\t * @param type The XSD type.\n\t * @returns The coerced value, or undefined when coercion is not possible.\n\t * @internal\n\t */\n\tprivate coerceXsdType(value: unknown, type: string): unknown {\n\t\tif (\n\t\t\t[\n\t\t\t\t\"xsd:string\",\n\t\t\t\t\"xsd:normalizedString\",\n\t\t\t\t\"xsd:token\",\n\t\t\t\t\"xsd:anyURI\",\n\t\t\t\t\"xsd:QName\",\n\t\t\t\t\"xsd:NOTATION\"\n\t\t\t].includes(type)\n\t\t) {\n\t\t\t// Handle standard xsd types\n\t\t\treturn Coerce.string(value);\n\t\t} else if (\n\t\t\t[\n\t\t\t\t\"xsd:integer\",\n\t\t\t\t\"xsd:decimal\",\n\t\t\t\t\"xsd:float\",\n\t\t\t\t\"xsd:double\",\n\t\t\t\t\"xsd:long\",\n\t\t\t\t\"xsd:int\",\n\t\t\t\t\"xsd:short\",\n\t\t\t\t\"xsd:byte\"\n\t\t\t].includes(type)\n\t\t) {\n\t\t\t// Handle standard xsd types\n\t\t\treturn Coerce.number(value);\n\t\t} else if (type === \"xsd:boolean\") {\n\t\t\t// Handle standard xsd types\n\t\t\treturn Coerce.boolean(value);\n\t\t} else if ([\"xsd:date\", \"xsd:dateTime\", \"xsd:time\"].includes(type)) {\n\t\t\t// Handle standard xsd types\n\t\t\treturn Coerce.dateTime(value);\n\t\t}\n\t\treturn undefined;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"defaultPolicyArbiter.js","sourceRoot":"","sources":["../../../src/policyArbiters/defaultPolicyArbiter.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,WAAW,EACX,MAAM,EACN,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,EAAE,EACF,YAAY,EACZ,YAAY,EACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,+BAA+B,EAK/B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAEN,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,SAAS,EAaT,MAAM,8BAA8B,CAAC;AAGtC;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAChC;;OAEG;IACI,MAAM,CAAU,UAAU,0BAA0C;IAE3E;;;;OAIG;IACI,MAAM,CAAU,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IAE9F;;;OAGG;IACK,MAAM,CAAU,8BAA8B,GAAG,EAAE,CAAC;IAE5D;;;OAGG;IACK,MAAM,CAAU,gBAAgB,GAAG,MAAM,CAAC;IAElD;;;OAGG;IACK,MAAM,CAAU,uBAAuB,GAAG,aAAa,CAAC;IAEhE;;;OAGG;IACK,MAAM,CAAU,cAAc,GAAG,eAAe,CAAC;IAEzD;;;OAGG;IACK,MAAM,CAAU,yBAAyB,GAAG,yBAAyB,CAAC;IAE9E;;;;OAIG;IACK,MAAM,CAAU,0BAA0B,GAAG,yBAAyB,CAAC;IAE/E;;;OAGG;IACc,QAAQ,CAAoB;IAE7C;;;OAGG;IACc,0BAA0B,CAAsC;IAEjF;;;OAGG;IACc,oBAAoB,CAAS;IAE9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AAC,EAAE,CAAC,CAAC,CAAC;QAC9C,CAAC;QAED,OAAO,KAAK,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACK,aAAa,CAAC,KAAc,EAAE,IAAY;QACjD,IACC;YACC,YAAY;YACZ,sBAAsB;YACtB,WAAW;YACX,YAAY;YACZ,WAAW;YACX,cAAc;SACd,CAAC,QAAQ,CAAC,IAAI,CAAC,EACf,CAAC;YACF,4BAA4B;YAC5B,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC;aAAM,IACN;YACC,aAAa;YACb,aAAa;YACb,WAAW;YACX,YAAY;YACZ,UAAU;YACV,SAAS;YACT,WAAW;YACX,UAAU;SACV,CAAC,QAAQ,CAAC,IAAI,CAAC,EACf,CAAC;YACF,4BAA4B;YAC5B,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC;aAAM,IAAI,IAAI,KAAK,aAAa,EAAE,CAAC;YACnC,4BAA4B;YAC5B,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;aAAM,IAAI,CAAC,UAAU,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACpE,4BAA4B;YAC5B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,SAAS,CAAC;IAClB,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tArrayHelper,\n\tCoerce,\n\tComponentFactory,\n\tGeneralError,\n\tGuards,\n\tIs,\n\tObjectHelper,\n\tStringHelper\n} from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport { JsonPathHelper } from \"@twin.org/data-json-path\";\nimport type { ILoggingComponent } from \"@twin.org/logging-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tOdrlPolicyHelper,\n\tOdrlProfiles,\n\tPolicyDecision,\n\tPolicyObligationEnforcerFactory,\n\ttype IPolicyAdministrationPointComponent,\n\ttype IPolicyArbiter,\n\ttype IPolicyDecision,\n\ttype IRightsManagementPolicy\n} from \"@twin.org/rights-management-models\";\nimport type { IDataspaceProtocolAgreement } from \"@twin.org/standards-dataspace-protocol\";\nimport {\n\ttype IOdrlAssetCollection,\n\tOdrlConflictStrategyType,\n\tOdrlLogicalConstraintType,\n\tOdrlOperatorType,\n\tOdrlTypes,\n\ttype IOdrlAction,\n\ttype IOdrlAsset,\n\ttype IOdrlConstraint,\n\ttype IOdrlDuty,\n\ttype IOdrlLogicalConstraint,\n\ttype IOdrlLogicalConstraintOperand,\n\ttype IOdrlParty,\n\ttype IOdrlPartyCollection,\n\ttype IOdrlPermission,\n\ttype IOdrlProhibition,\n\ttype IOdrlRule,\n\ttype OdrlActionType\n} from \"@twin.org/standards-w3c-odrl\";\nimport type { IDefaultPolicyArbiterConstructorOptions } from \"../models/IDefaultPolicyArbiterConstructorOptions.js\";\n\n/**\n * Default Policy Arbiter.\n */\nexport class DefaultPolicyArbiter implements IPolicyArbiter {\n\t/**\n\t * The class name of the Default Policy Arbiter.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<DefaultPolicyArbiter>();\n\n\t/**\n\t * ODRL profiles whose custom vocabulary this arbiter understands and supports.\n\t * Any policy declaring a profile not in this set will be rejected.\n\t * Add a new entry here when support for an additional profile is implemented.\n\t */\n\tpublic static readonly SUPPORTED_PROFILES: ReadonlySet<string> = new Set([OdrlProfiles.Twin]);\n\n\t/**\n\t * Default maximum inheritance depth.\n\t * @internal\n\t */\n\tprivate static readonly _DEFAULT_MAX_INHERITANCE_DEPTH = 10;\n\n\t/**\n\t * Datasource key for the primary JSON path data source.\n\t * @internal\n\t */\n\tprivate static readonly _DATA_SOURCE_KEY = \"data\";\n\n\t/**\n\t * Datasource key for the information source used in JSON path expressions.\n\t * @internal\n\t */\n\tprivate static readonly _INFORMATION_SOURCE_KEY = \"information\";\n\n\t/**\n\t * TWIN prefix JSONPath canonical alias.\n\t * @internal\n\t */\n\tprivate static readonly _TWIN_JSONPATH = \"twin:jsonPath\";\n\n\t/**\n\t * Canonical jsonPath expression property.\n\t * @internal\n\t */\n\tprivate static readonly _TWIN_JSONPATH_EXPRESSION = \"twin:jsonPathExpression\";\n\n\t/**\n\t * Optional data source key property for canonical twin:jsonPath targets.\n\t * When absent, defaults to the primary data source.\n\t * @internal\n\t */\n\tprivate static readonly _TWIN_JSONPATH_DATA_SOURCE = \"twin:jsonPathDataSource\";\n\n\t/**\n\t * The logging component.\n\t * @internal\n\t */\n\tprivate readonly _logging: ILoggingComponent;\n\n\t/**\n\t * The policy administration point component.\n\t * @internal\n\t */\n\tprivate readonly _policyAdministrationPoint: IPolicyAdministrationPointComponent;\n\n\t/**\n\t * The maximum depth to traverse when resolving inherited policies.\n\t * @internal\n\t */\n\tprivate readonly _maxInheritanceDepth: number;\n\n\t/**\n\t * Create a new instance of DefaultPolicyArbiter.\n\t * @param options The options for the default policy arbiter.\n\t */\n\tconstructor(options?: IDefaultPolicyArbiterConstructorOptions) {\n\t\tthis._logging = ComponentFactory.get<ILoggingComponent>(\n\t\t\toptions?.loggingComponentType ?? \"logging\"\n\t\t);\n\n\t\tthis._policyAdministrationPoint = ComponentFactory.get<IPolicyAdministrationPointComponent>(\n\t\t\toptions?.policyAdministrationPointComponentType ?? \"policy-administration-point\"\n\t\t);\n\n\t\tthis._maxInheritanceDepth =\n\t\t\tCoerce.integer(options?.config?.maxInheritanceDepth) ??\n\t\t\tDefaultPolicyArbiter._DEFAULT_MAX_INHERITANCE_DEPTH;\n\t}\n\n\t/**\n\t * Normalises a profile IRI for comparison against the supported-profiles allowlist.\n\t * Per RFC 3986: scheme and host are case-insensitive (the URL constructor folds them to\n\t * lowercase automatically); a trailing slash on the terminal path segment is treated as\n\t * equivalent to its absence; repeated slashes in the path are collapsed to a single slash.\n\t * Non-URL strings are returned unchanged.\n\t * @param iri The IRI to normalise.\n\t * @returns The normalised IRI.\n\t * @internal\n\t */\n\tprivate static normalizeProfileIri(iri: string): string {\n\t\ttry {\n\t\t\tconst url = new URL(iri);\n\t\t\tconst pathname = url.pathname.replace(/\\/+/g, \"/\");\n\t\t\treturn `${url.protocol}//${url.host}${StringHelper.trimTrailingSlashes(pathname)}`;\n\t\t} catch {\n\t\t\treturn iri;\n\t\t}\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn DefaultPolicyArbiter.CLASS_NAME;\n\t}\n\n\t/**\n\t * Makes decisions regarding policy access to data.\n\t * @param agreement The agreement to evaluate.\n\t * @param information Information provided by the requester to determine if a policy can be created.\n\t * @param data The data to make a decision on.\n\t * @param action Optional action to make a decision on, if not provided, the arbiter will evaluate all actions in the agreement.\n\t * @returns The decisions about access to the data.\n\t */\n\tpublic async decide<D = unknown>(\n\t\tagreement: IDataspaceProtocolAgreement,\n\t\tinformation?: { [id: string]: IJsonLdNodeObject },\n\t\tdata?: D,\n\t\taction?: OdrlActionType | string\n\t): Promise<IPolicyDecision[]> {\n\t\tGuards.object<IDataspaceProtocolAgreement>(\n\t\t\tDefaultPolicyArbiter.CLASS_NAME,\n\t\t\tnameof(agreement),\n\t\t\tagreement\n\t\t);\n\n\t\t// ODRL policy profiles extend the vocabulary with additional semantics (e.g. custom\n\t\t// operators, left operands). Without profile-aware evaluation logic the arbiter\n\t\t// cannot guarantee correctness, so any policy that declares an unknown profile is\n\t\t// rejected. The TWIN platform profile is explicitly supported.\n\t\t//\n\t\t// Empty-string profile values (e.g. from over-eager schema defaults or serialization\n\t\t// round-trips) are treated as \"no profile declared\" and filtered out before comparison.\n\t\t//\n\t\t// Profile IRIs are normalized before lookup: scheme and host are case-folded to\n\t\t// lowercase and a trailing slash on the last path segment is stripped. This accepts\n\t\t// common IRI variants (HTTPS://, uppercase host, trailing slash) instead of silently\n\t\t// rejecting valid policies authored by IRI-aware tooling.\n\t\t//\n\t\t// `every` (conjunction) is intentional: a policy declaring [\"TWIN\", \"unknown\"] is\n\t\t// rejected — the arbiter refuses to evaluate rules from a profile whose semantics it\n\t\t// does not understand, even if other declared profiles are known.\n\t\tconst declaredProfiles = ArrayHelper.fromObjectOrArray<string>(agreement.profile ?? [])\n\t\t\t.filter(p => Is.stringValue(p))\n\t\t\t.map(p => DefaultPolicyArbiter.normalizeProfileIri(p));\n\t\tif (\n\t\t\tIs.arrayValue(declaredProfiles) &&\n\t\t\t!declaredProfiles.every(p => DefaultPolicyArbiter.SUPPORTED_PROFILES.has(p))\n\t\t) {\n\t\t\tconst unsupportedProfile = declaredProfiles.find(\n\t\t\t\tp => !DefaultPolicyArbiter.SUPPORTED_PROFILES.has(p)\n\t\t\t);\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"policyProfileNotSupported\", {\n\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(agreement) ?? \"\",\n\t\t\t\tunsupportedProfile\n\t\t\t});\n\t\t}\n\n\t\tawait this._logging.log({\n\t\t\tlevel: \"info\",\n\t\t\tsource: DefaultPolicyArbiter.CLASS_NAME,\n\t\t\tts: Date.now(),\n\t\t\tmessage: \"decidingPolicy\",\n\t\t\tdata: {\n\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(agreement) ?? \"\"\n\t\t\t}\n\t\t});\n\n\t\t// Resolve and merge inherited policies.\n\t\tconst mergedPolicy = await this.mergeInheritedPolicies(agreement);\n\t\tconst expandedPolicy = this.expandCompactPolicyRules(mergedPolicy);\n\t\tconst dataSources = {\n\t\t\t[DefaultPolicyArbiter._DATA_SOURCE_KEY]: data,\n\t\t\t[DefaultPolicyArbiter._INFORMATION_SOURCE_KEY]: information\n\t\t};\n\n\t\t// Extract agreement parties once for use in rule evaluation\n\t\tconst agreementAssigner = OdrlPolicyHelper.getPartyIds(agreement.assigner);\n\t\tconst agreementAssignee = OdrlPolicyHelper.getPartyIds(agreement.assignee);\n\t\tconst obligationsFulfilled = await this.evaluatePolicyObligations(\n\t\t\tagreementAssigner,\n\t\t\tagreementAssignee,\n\t\t\texpandedPolicy,\n\t\t\tdataSources\n\t\t);\n\n\t\t// ODRL-style rule evaluation grouped by decision target:\n\t\t// - Permission rules authorize if ANY applicable permission on the same target matches.\n\t\t// - Default to denied when no permission applies on a target (closed-world for access control).\n\t\t// - Conflict strategy controls how applicable permissions/prohibitions are resolved per target.\n\t\tconst targetStates: {\n\t\t\t[target: string]: {\n\t\t\t\tpermissionApplies: boolean;\n\t\t\t\tprohibitionApplies: boolean;\n\t\t\t};\n\t\t} = Object.create(null) as {\n\t\t\t[target: string]: {\n\t\t\t\tpermissionApplies: boolean;\n\t\t\t\tprohibitionApplies: boolean;\n\t\t\t};\n\t\t};\n\n\t\tconst permissions = ArrayHelper.fromObjectOrArray(expandedPolicy.permission ?? []);\n\t\tfor (const permission of permissions) {\n\t\t\tconst decisionTargets = this.resolveRuleDecisionTargets(permission, dataSources);\n\t\t\tfor (const decisionTarget of decisionTargets) {\n\t\t\t\tconst state = this.getOrCreateTargetState(targetStates, decisionTarget.target);\n\t\t\t\tif (\n\t\t\t\t\tawait this.evaluatePermission(\n\t\t\t\t\t\tagreementAssigner,\n\t\t\t\t\t\tagreementAssignee,\n\t\t\t\t\t\texpandedPolicy,\n\t\t\t\t\t\tpermission,\n\t\t\t\t\t\tdecisionTarget.refinements,\n\t\t\t\t\t\tdataSources,\n\t\t\t\t\t\taction,\n\t\t\t\t\t\tdecisionTarget.target\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tstate.permissionApplies = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst prohibitions = ArrayHelper.fromObjectOrArray<IOdrlProhibition>(\n\t\t\texpandedPolicy.prohibition ?? []\n\t\t);\n\t\tfor (const prohibition of prohibitions) {\n\t\t\tconst decisionTargets = this.resolveRuleDecisionTargets(prohibition, dataSources);\n\t\t\tfor (const decisionTarget of decisionTargets) {\n\t\t\t\tif (\n\t\t\t\t\tawait this.evaluateProhibition(\n\t\t\t\t\t\texpandedPolicy,\n\t\t\t\t\t\tagreementAssigner,\n\t\t\t\t\t\tagreementAssignee,\n\t\t\t\t\t\tprohibition,\n\t\t\t\t\t\tdecisionTarget.refinements,\n\t\t\t\t\t\tdataSources,\n\t\t\t\t\t\taction,\n\t\t\t\t\t\tdecisionTarget.target\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tconst state = this.getOrCreateTargetState(targetStates, decisionTarget.target);\n\t\t\t\t\tstate.prohibitionApplies = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst conflictStrategy = expandedPolicy.conflict ?? OdrlConflictStrategyType.Invalid;\n\t\tif (Object.keys(targetStates).length === 0) {\n\t\t\t// Closed-world fallback when the policy has no rules at all.\n\t\t\treturn [{ decision: PolicyDecision.Denied, target: \"$\" }];\n\t\t}\n\n\t\tconst decisions: IPolicyDecision[] = [];\n\t\tfor (const [target, state] of Object.entries(targetStates)) {\n\t\t\tlet decision: PolicyDecision;\n\t\t\tif (state.permissionApplies && state.prohibitionApplies) {\n\t\t\t\tswitch (conflictStrategy) {\n\t\t\t\t\tcase OdrlConflictStrategyType.Perm:\n\t\t\t\t\t\tdecision = PolicyDecision.Granted;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase OdrlConflictStrategyType.Prohibit:\n\t\t\t\t\tcase OdrlConflictStrategyType.Invalid:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tdecision = PolicyDecision.Denied;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdecision = state.permissionApplies ? PolicyDecision.Granted : PolicyDecision.Denied;\n\t\t\t}\n\n\t\t\tif (!obligationsFulfilled) {\n\t\t\t\tdecision = PolicyDecision.Denied;\n\t\t\t}\n\n\t\t\tdecisions.push({\n\t\t\t\tdecision,\n\t\t\t\ttarget\n\t\t\t});\n\t\t}\n\n\t\treturn decisions;\n\t}\n\n\t/**\n\t * Expand compact/compound policy rule forms into atomic rules.\n\t * ODRL 2.7 allows compact forms where rule properties can be arrays.\n\t * Evaluation in this arbiter is performed on expanded atomic rules.\n\t * @param policy The policy to expand.\n\t * @returns A policy with expanded rule arrays.\n\t * @internal\n\t */\n\tprivate expandCompactPolicyRules(policy: IRightsManagementPolicy): IRightsManagementPolicy {\n\t\tconst expandedPermissions = this.expandRules(\n\t\t\tArrayHelper.fromObjectOrArray<IOdrlPermission>(policy.permission ?? [])\n\t\t);\n\t\tconst expandedProhibitions = this.expandRules(\n\t\t\tArrayHelper.fromObjectOrArray<IOdrlProhibition>(policy.prohibition ?? [])\n\t\t);\n\t\tconst expandedObligations = this.expandRules(\n\t\t\tArrayHelper.fromObjectOrArray<IOdrlDuty>(policy.obligation ?? [])\n\t\t);\n\n\t\treturn {\n\t\t\t...policy,\n\t\t\tpermission: expandedPermissions.length > 0 ? expandedPermissions : undefined,\n\t\t\tprohibition: expandedProhibitions.length > 0 ? expandedProhibitions : undefined,\n\t\t\tobligation: expandedObligations.length > 0 ? expandedObligations : undefined\n\t\t};\n\t}\n\n\t/**\n\t * Expand a rule list into atomic rules.\n\t * @param rules The rules to expand.\n\t * @returns Expanded atomic rules.\n\t * @internal\n\t */\n\tprivate expandRules<T extends IOdrlRule>(rules: T[]): T[] {\n\t\tconst expanded: T[] = [];\n\t\tfor (const rule of rules) {\n\t\t\texpanded.push(...this.expandRule(rule));\n\t\t}\n\n\t\treturn expanded;\n\t}\n\n\t/**\n\t * Expand a single compact/compound rule into atomic rules.\n\t * @param rule The rule to expand.\n\t * @returns Expanded atomic rules.\n\t * @internal\n\t */\n\tprivate expandRule<T extends IOdrlRule>(rule: T): T[] {\n\t\tconst targets = this.normalizeRuleField<NonNullable<IOdrlRule[\"target\"]>>(rule.target);\n\t\tconst actions = this.normalizeRuleField<NonNullable<IOdrlRule[\"action\"]>>(rule.action);\n\t\tconst assigners = this.normalizeRuleField<NonNullable<IOdrlRule[\"assigner\"]>>(rule.assigner);\n\t\tconst assignees = this.normalizeRuleField<NonNullable<IOdrlRule[\"assignee\"]>>(rule.assignee);\n\n\t\tconst expanded: T[] = [];\n\t\tfor (const target of targets) {\n\t\t\tfor (const action of actions) {\n\t\t\t\tfor (const assigner of assigners) {\n\t\t\t\t\tfor (const assignee of assignees) {\n\t\t\t\t\t\tconst atomicRule = { ...rule };\n\t\t\t\t\t\tatomicRule.target = target;\n\t\t\t\t\t\tatomicRule.action = action;\n\t\t\t\t\t\tatomicRule.assigner = assigner;\n\t\t\t\t\t\tatomicRule.assignee = assignee;\n\t\t\t\t\t\texpanded.push(atomicRule);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn expanded;\n\t}\n\n\t/**\n\t * Normalize a potentially compact rule field into an array for expansion.\n\t * @param value The field value.\n\t * @returns Normalized values (or a single undefined when not provided).\n\t * @internal\n\t */\n\tprivate normalizeRuleField<T>(value: T | undefined): (T | undefined)[] {\n\t\tif (Is.undefined(value)) {\n\t\t\treturn [undefined];\n\t\t}\n\n\t\tconst values = ArrayHelper.fromObjectOrArray(value);\n\t\treturn values.length > 0 ? values : [undefined];\n\t}\n\n\t/**\n\t * Get an existing target state or create an initial state if it doesn't exist.\n\t * @param targetStates The dictionary of target states.\n\t * @param target The target key.\n\t * @returns The target state.\n\t * @internal\n\t */\n\tprivate getOrCreateTargetState(\n\t\ttargetStates: {\n\t\t\t[target: string]: {\n\t\t\t\tpermissionApplies: boolean;\n\t\t\t\tprohibitionApplies: boolean;\n\t\t\t};\n\t\t},\n\t\ttarget: string\n\t): {\n\t\tpermissionApplies: boolean;\n\t\tprohibitionApplies: boolean;\n\t} {\n\t\tlet state = targetStates[target];\n\t\tif (Is.undefined(state)) {\n\t\t\tstate = {\n\t\t\t\tpermissionApplies: false,\n\t\t\t\tprohibitionApplies: false\n\t\t\t};\n\t\t\ttargetStates[target] = state;\n\t\t}\n\n\t\treturn state;\n\t}\n\n\t/**\n\t * Evaluate whether a prohibition applies.\n\t * @param policy The policy containing the prohibition.\n\t * @param agreementAssigner The assigner ID from the agreement.\n\t * @param agreementAssignee The assignee ID from the agreement.\n\t * @param prohibition The prohibition to evaluate.\n\t * @param targetRefinements Additional constraints from target refinement.\n\t * @param dataSources The operand lookup sources.\n\t * @param action Optional action to check against the prohibition's applicable actions.\n\t * @returns True if the prohibition applies.\n\t * @internal\n\t */\n\tprivate async evaluateProhibition(\n\t\tpolicy: IRightsManagementPolicy,\n\t\tagreementAssigner: string[] | undefined,\n\t\tagreementAssignee: string[] | undefined,\n\t\tprohibition: IOdrlProhibition,\n\t\ttargetRefinements: (IOdrlConstraint | IOdrlLogicalConstraint)[],\n\t\tdataSources: { [source: string]: unknown },\n\t\taction?: OdrlActionType | string,\n\t\tdecisionTarget?: string\n\t): Promise<boolean> {\n\t\tif (\n\t\t\t!this.isRuleApplicableToParties(\n\t\t\t\tprohibition,\n\t\t\t\tagreementAssigner,\n\t\t\t\tagreementAssignee,\n\t\t\t\tdataSources\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if the prohibition's action(s) match the requested action\n\t\tif (!this.isActionApplicable(prohibition.action, action, dataSources)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// ODRL semantics: a rule without constraints is unconditional.\n\t\tconst constraints = [\n\t\t\t...ArrayHelper.fromObjectOrArray(prohibition.constraint ?? []),\n\t\t\t...targetRefinements\n\t\t];\n\t\tif (\n\t\t\tconstraints.length > 0 &&\n\t\t\t!constraints.every(c => this.evaluateConstraint(c, dataSources))\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst prohibitionTargetLookup = this.tryResolveTargetDataSource(\n\t\t\tthis.buildRuleDataContextTargetId(\n\t\t\t\tthis.getRuleDataContextTargetId(prohibition.target),\n\t\t\t\tdecisionTarget\n\t\t\t),\n\t\t\tdataSources,\n\t\t\ttrue\n\t\t);\n\t\tconst ruleDataContext = prohibitionTargetLookup.value;\n\n\t\tconst remedies = ArrayHelper.fromObjectOrArray<IOdrlDuty>(prohibition.remedy ?? []);\n\t\tif (remedies.length === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (const remedy of remedies) {\n\t\t\tif (!(await this.enforceDuty(policy, remedy, dataSources, ruleDataContext))) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// Remedies satisfied: prohibition is treated as no longer infringed.\n\t\treturn false;\n\t}\n\n\t/**\n\t * Evaluate all policy-level obligations.\n\t * @param agreementAssigner The assigner ID from the agreement.\n\t * @param agreementAssignee The assignee ID from the agreement.\n\t * @param policy The policy containing obligations.\n\t * @param dataSources The operand lookup sources.\n\t * @returns True if all applicable obligations are fulfilled.\n\t * @internal\n\t */\n\tprivate async evaluatePolicyObligations(\n\t\tagreementAssigner: string[] | undefined,\n\t\tagreementAssignee: string[] | undefined,\n\t\tpolicy: IRightsManagementPolicy,\n\t\tdataSources: { [source: string]: unknown }\n\t): Promise<boolean> {\n\t\tconst obligations = ArrayHelper.fromObjectOrArray<IOdrlDuty>(policy.obligation ?? []);\n\t\tfor (const obligation of obligations) {\n\t\t\tif (\n\t\t\t\t!(await this.evaluateObligation(\n\t\t\t\t\tagreementAssigner,\n\t\t\t\t\tagreementAssignee,\n\t\t\t\t\tpolicy,\n\t\t\t\t\tobligation,\n\t\t\t\t\tdataSources\n\t\t\t\t))\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Evaluate whether a policy-level obligation is fulfilled.\n\t * @param agreementAssigner The assigner ID from the agreement.\n\t * @param agreementAssignee The assignee ID from the agreement.\n\t * @param policy The policy containing the obligation.\n\t * @param obligation The obligation to evaluate.\n\t * @param dataSources The operand lookup sources.\n\t * @returns True if the obligation is not applicable or is fulfilled.\n\t * @internal\n\t */\n\tprivate async evaluateObligation(\n\t\tagreementAssigner: string[] | undefined,\n\t\tagreementAssignee: string[] | undefined,\n\t\tpolicy: IRightsManagementPolicy,\n\t\tobligation: IOdrlDuty,\n\t\tdataSources: { [source: string]: unknown }\n\t): Promise<boolean> {\n\t\tif (\n\t\t\t!this.isRuleApplicableToParties(obligation, agreementAssigner, agreementAssignee, dataSources)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst { refinements } = this.resolveRuleTarget(obligation, dataSources);\n\t\tconst obligationTargetLookup = this.tryResolveTargetDataSource(\n\t\t\tthis.getTargetId(obligation.target),\n\t\t\tdataSources,\n\t\t\ttrue\n\t\t);\n\t\tconst ruleDataContext = obligationTargetLookup.value;\n\t\tconst constraints = [\n\t\t\t...ArrayHelper.fromObjectOrArray(obligation.constraint ?? []),\n\t\t\t...refinements\n\t\t];\n\n\t\tif (\n\t\t\tconstraints.length > 0 &&\n\t\t\t!constraints.every(c => this.evaluateConstraint(c, dataSources))\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn this.enforceDuty(policy, obligation, dataSources, ruleDataContext);\n\t}\n\n\t/**\n\t * Merge inherited policies into the current policy.\n\t * Inherited policies' permissions, prohibitions, and obligations are combined with the current policy's rules.\n\t * @param policy The policy to evaluate.\n\t * @returns A new policy with merged rules from all ancestors.\n\t * @internal\n\t */\n\tprivate async mergeInheritedPolicies(\n\t\tpolicy: IRightsManagementPolicy\n\t): Promise<IRightsManagementPolicy> {\n\t\tconst visitedPolicyIds: string[] = [];\n\t\tvisitedPolicyIds.push(OdrlPolicyHelper.getUid(policy) ?? \"\");\n\t\tconst inheritedPolicies = await this.resolveInheritedPolicies(policy, visitedPolicyIds, 0);\n\t\tconst conflictStrategies = new Set<OdrlConflictStrategyType>();\n\t\tif (Is.stringValue(policy.conflict)) {\n\t\t\tconflictStrategies.add(policy.conflict);\n\t\t}\n\n\t\t// Start with copies of the current policy's rules\n\t\tconst mergedPermissions: IOdrlPermission[] = ArrayHelper.fromObjectOrArray(\n\t\t\tpolicy.permission ?? []\n\t\t).map(permission => this.applyPolicyDefaultsToRule(policy, permission));\n\n\t\tconst mergedProhibitions: IOdrlProhibition[] = ArrayHelper.fromObjectOrArray(\n\t\t\tpolicy.prohibition ?? []\n\t\t).map(prohibition => this.applyPolicyDefaultsToRule(policy, prohibition));\n\n\t\tconst mergedObligations: IOdrlDuty[] = ArrayHelper.fromObjectOrArray(\n\t\t\tpolicy.obligation ?? []\n\t\t).map(obligation => this.applyPolicyDefaultsToRule(policy, obligation));\n\n\t\t// Merge rules from each inherited policy, applying the same profile guard as the\n\t\t// top-level policy. A parent that declares an unsupported profile may carry rules\n\t\t// whose semantics the arbiter cannot guarantee, so it is rejected.\n\t\tfor (const inheritedPolicy of inheritedPolicies) {\n\t\t\tconst inheritedProfiles = ArrayHelper.fromObjectOrArray<string>(inheritedPolicy.profile ?? [])\n\t\t\t\t.filter(p => Is.stringValue(p))\n\t\t\t\t.map(p => DefaultPolicyArbiter.normalizeProfileIri(p));\n\t\t\tif (\n\t\t\t\tIs.arrayValue(inheritedProfiles) &&\n\t\t\t\t!inheritedProfiles.every(p => DefaultPolicyArbiter.SUPPORTED_PROFILES.has(p))\n\t\t\t) {\n\t\t\t\tthrow new GeneralError(\n\t\t\t\t\tDefaultPolicyArbiter.CLASS_NAME,\n\t\t\t\t\t\"inheritedPolicyProfileNotSupported\",\n\t\t\t\t\t{ policyId: OdrlPolicyHelper.getUid(inheritedPolicy) ?? \"\" }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (Is.stringValue(inheritedPolicy.conflict)) {\n\t\t\t\tconflictStrategies.add(inheritedPolicy.conflict);\n\t\t\t}\n\t\t\tconst inheritedPermissions = ArrayHelper.fromObjectOrArray(inheritedPolicy.permission ?? []);\n\t\t\tif (inheritedPermissions.length > 0) {\n\t\t\t\tmergedPermissions.push(\n\t\t\t\t\t...inheritedPermissions.map(permission =>\n\t\t\t\t\t\tthis.applyPolicyDefaultsToRule(inheritedPolicy, permission)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst inheritedProhibitions = ArrayHelper.fromObjectOrArray(\n\t\t\t\tinheritedPolicy.prohibition ?? []\n\t\t\t);\n\t\t\tif (inheritedProhibitions.length > 0) {\n\t\t\t\tmergedProhibitions.push(\n\t\t\t\t\t...inheritedProhibitions.map(prohibition =>\n\t\t\t\t\t\tthis.applyPolicyDefaultsToRule(inheritedPolicy, prohibition)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst inheritedObligations = ArrayHelper.fromObjectOrArray(inheritedPolicy.obligation ?? []);\n\t\t\tif (inheritedObligations.length > 0) {\n\t\t\t\tmergedObligations.push(\n\t\t\t\t\t...inheritedObligations.map(obligation =>\n\t\t\t\t\t\tthis.applyPolicyDefaultsToRule(inheritedPolicy, obligation)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tlet mergedConflict: OdrlConflictStrategyType | undefined;\n\t\tif (conflictStrategies.size === 1) {\n\t\t\tmergedConflict = Array.from(conflictStrategies)[0];\n\t\t} else if (conflictStrategies.size > 1) {\n\t\t\tmergedConflict = OdrlConflictStrategyType.Invalid;\n\t\t}\n\n\t\t// Return a new policy with merged rules\n\t\treturn {\n\t\t\t...policy,\n\t\t\tconflict: mergedConflict,\n\t\t\tpermission: mergedPermissions.length > 0 ? mergedPermissions : undefined,\n\t\t\tprohibition: mergedProhibitions.length > 0 ? mergedProhibitions : undefined,\n\t\t\tobligation: mergedObligations.length > 0 ? mergedObligations : undefined\n\t\t};\n\t}\n\n\t/**\n\t * Resolve inherited policies by their UIDs from the Policy Administration Point.\n\t * Policies can inherit from other policies via the inheritFrom property.\n\t * @param policy The policy that may have inheritFrom references.\n\t * @param visitedPolicyIds Array of policy UIDs already visited in this inheritance chain.\n\t * @returns Array of inherited policies fetched from the PAP.\n\t * @internal\n\t */\n\tprivate async resolveInheritedPolicies(\n\t\tpolicy: IRightsManagementPolicy,\n\t\tvisitedPolicyIds: string[],\n\t\tcurrentDepth: number\n\t): Promise<IRightsManagementPolicy[]> {\n\t\tconst inheritedPolicies: IRightsManagementPolicy[] = [];\n\n\t\t// If policy has no inheritFrom, return empty array\n\t\tif (Is.empty(policy.inheritFrom)) {\n\t\t\treturn inheritedPolicies;\n\t\t}\n\n\t\tconst inheritFromIds = ArrayHelper.fromObjectOrArray<string>(policy.inheritFrom) ?? [];\n\n\t\tfor (const inheritFromId of inheritFromIds) {\n\t\t\tconst nextDepth = currentDepth + 1;\n\t\t\tif (nextDepth > this._maxInheritanceDepth) {\n\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"maxInheritanceDepthExceeded\", {\n\t\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(policy) ?? \"\",\n\t\t\t\t\tinheritFromId,\n\t\t\t\t\tmaxInheritanceDepth: this._maxInheritanceDepth\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Check for circular inheritance\n\t\t\tif (visitedPolicyIds.includes(inheritFromId)) {\n\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"circularInheritanceDetected\", {\n\t\t\t\t\tpolicyId: OdrlPolicyHelper.getUid(policy) ?? \"\",\n\t\t\t\t\tinheritFromId\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Fetch the inherited policy from the PAP\n\t\t\tconst inheritedPolicy = await this._policyAdministrationPoint.get(inheritFromId);\n\t\t\tif (Is.empty(inheritedPolicy)) {\n\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"inheritedPolicyNotFound\", {\n\t\t\t\t\tinheritFromId\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Mark this policy as visited\n\t\t\tvisitedPolicyIds.push(inheritFromId);\n\n\t\t\tinheritedPolicies.push(inheritedPolicy);\n\n\t\t\t// Recursively resolve inherited policies of the parent\n\t\t\tconst grandparentPolicies = await this.resolveInheritedPolicies(\n\t\t\t\tinheritedPolicy,\n\t\t\t\tvisitedPolicyIds,\n\t\t\t\tnextDepth\n\t\t\t);\n\t\t\tinheritedPolicies.push(...grandparentPolicies);\n\t\t}\n\n\t\treturn inheritedPolicies;\n\t}\n\n\t/**\n\t * Apply policy-level default values (assigner, assignee, target, action) to rules that don't override them.\n\t * @param policy The policy providing defaults.\n\t * @param rule The rule to apply defaults to.\n\t * @returns The rule with policy-level defaults applied.\n\t * @internal\n\t */\n\tprivate applyPolicyDefaultsToRule<T extends IOdrlRule>(\n\t\tpolicy: IRightsManagementPolicy,\n\t\trule: T\n\t): T {\n\t\tconst assigner = Is.empty(rule.assigner) ? policy.assigner : rule.assigner;\n\t\tconst assignee = Is.empty(rule.assignee) ? policy.assignee : rule.assignee;\n\t\tconst target = Is.empty(rule.target) ? policy.target : rule.target;\n\t\tconst action = Is.empty(rule.action) ? policy.action : rule.action;\n\n\t\tconst assignerIds = OdrlPolicyHelper.getPartyIds(assigner);\n\t\tconst ruleAssignerIds = OdrlPolicyHelper.getPartyIds(rule.assigner);\n\t\tconst assigneeIds = OdrlPolicyHelper.getPartyIds(assignee);\n\t\tconst ruleAssigneeIds = OdrlPolicyHelper.getPartyIds(rule.assignee);\n\n\t\tlet assignerEqual = false;\n\t\tif (Is.empty(assignerIds) && Is.empty(ruleAssignerIds)) {\n\t\t\tassignerEqual = true;\n\t\t} else if (!Is.empty(assignerIds) && !Is.empty(ruleAssignerIds)) {\n\t\t\tassignerEqual =\n\t\t\t\tassignerIds.length === ruleAssignerIds.length &&\n\t\t\t\tassignerIds.every(id => ruleAssignerIds.includes(id));\n\t\t}\n\n\t\tlet assigneeEqual = false;\n\t\tif (Is.empty(assigneeIds) && Is.empty(ruleAssigneeIds)) {\n\t\t\tassigneeEqual = true;\n\t\t} else if (!Is.empty(assigneeIds) && !Is.empty(ruleAssigneeIds)) {\n\t\t\tassigneeEqual =\n\t\t\t\tassigneeIds.length === ruleAssigneeIds.length &&\n\t\t\t\tassigneeIds.every(id => ruleAssigneeIds.includes(id));\n\t\t}\n\n\t\tconst targetEqual = target === rule.target;\n\t\tconst actionEqual = action === rule.action;\n\n\t\tif (assignerEqual && assigneeEqual && targetEqual && actionEqual) {\n\t\t\treturn rule;\n\t\t}\n\n\t\treturn {\n\t\t\t...rule,\n\t\t\tassigner,\n\t\t\tassignee,\n\t\t\ttarget,\n\t\t\taction\n\t\t};\n\t}\n\n\t/**\n\t * Determine whether a rule applies to the agreement parties based on assigner/assignee.\n\t * @param rule The rule to evaluate.\n\t * @param agreementAssigner The assigner ID from the agreement.\n\t * @param agreementAssignee The assignee ID from the agreement.\n\t * @returns True if the rule is applicable to the agreement parties.\n\t * @internal\n\t */\n\tprivate isRuleApplicableToParties(\n\t\trule: IOdrlRule,\n\t\tagreementAssigner: string[] | undefined,\n\t\tagreementAssignee: string[] | undefined,\n\t\tdataSources: { [source: string]: unknown }\n\t): boolean {\n\t\tconst assignerContext = this.resolveRulePartyContext(rule.assigner);\n\t\tconst assigneeContext = this.resolveRulePartyContext(rule.assignee);\n\n\t\tif (!this.isPartyApplicable(assignerContext.partyIds, agreementAssigner)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (\n\t\t\tassignerContext.refinements.length > 0 &&\n\t\t\t!assignerContext.refinements.every(c => this.evaluateConstraint(c, dataSources))\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!this.isPartyApplicable(assigneeContext.partyIds, agreementAssignee)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (\n\t\t\tassigneeContext.refinements.length > 0 &&\n\t\t\t!assigneeContext.refinements.every(c => this.evaluateConstraint(c, dataSources))\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Resolve rule party identifiers and refinements.\n\t * PartyCollection source values are currently not supported for party matching.\n\t * @param party The rule party value.\n\t * @returns Resolved party identifiers and refinement constraints.\n\t * @throws GeneralError if PartyCollection source has a value.\n\t * @internal\n\t */\n\tprivate resolveRulePartyContext(party: IOdrlRule[\"assigner\"] | IOdrlRule[\"assignee\"]): {\n\t\tpartyIds: string[];\n\t\trefinements: (IOdrlConstraint | IOdrlLogicalConstraint)[];\n\t} {\n\t\tconst partyIds: string[] = [];\n\t\tconst refinements: (IOdrlConstraint | IOdrlLogicalConstraint)[] = [];\n\n\t\tconst parties = ArrayHelper.fromObjectOrArray(party ?? []);\n\t\tfor (const partyEntry of parties) {\n\t\t\tif (Is.stringValue(partyEntry)) {\n\t\t\t\tpartyIds.push(partyEntry);\n\t\t\t} else if (Is.object<IOdrlParty>(partyEntry)) {\n\t\t\t\t// Guard against unsupported ODRL party properties\n\t\t\t\tif (Is.notEmpty(partyEntry.assignerOf)) {\n\t\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"partyAssignerOfNotSupported\");\n\t\t\t\t}\n\t\t\t\tif (Is.notEmpty(partyEntry.assigneeOf)) {\n\t\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"partyAssigneeOfNotSupported\");\n\t\t\t\t}\n\t\t\t\tif (Is.notEmpty(partyEntry.partOf)) {\n\t\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"partyPartOfNotSupported\");\n\t\t\t\t}\n\n\t\t\t\tif (OdrlPolicyHelper.getType(partyEntry) === OdrlTypes.PartyCollection) {\n\t\t\t\t\tconst partyCollectionEntry = partyEntry as IOdrlPartyCollection;\n\t\t\t\t\tif (Is.stringValue(partyCollectionEntry.source)) {\n\t\t\t\t\t\tthrow new GeneralError(\n\t\t\t\t\t\t\tDefaultPolicyArbiter.CLASS_NAME,\n\t\t\t\t\t\t\t\"partyCollectionSourceNotSupported\",\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsource: partyCollectionEntry.source ?? \"\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\trefinements.push(...ArrayHelper.fromObjectOrArray(partyCollectionEntry.refinement ?? []));\n\t\t\t\t} else {\n\t\t\t\t\tconst partyId = OdrlPolicyHelper.getUid(partyEntry);\n\t\t\t\t\tif (Is.stringValue(partyId)) {\n\t\t\t\t\t\tpartyIds.push(partyId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tpartyIds,\n\t\t\trefinements\n\t\t};\n\t}\n\n\t/**\n\t * Determine whether a rule party constraint applies to the agreement parties.\n\t * Rule party is treated as a constraint: if specified, it must match at least one agreement party.\n\t * @param rulePartyIds The party ids specified on the rule (if any).\n\t * @param agreementPartyIds The party ids extracted from the agreement.\n\t * @returns True if the rule party constraint is satisfied.\n\t * @internal\n\t */\n\tprivate isPartyApplicable(\n\t\trulePartyIds: string[] | undefined,\n\t\tagreementPartyIds: string[] | undefined\n\t): boolean {\n\t\t// No party specified on rule means it applies to any agreement party.\n\t\tif (Is.empty(rulePartyIds)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Rule specifies party/parties, but agreement doesn't provide any.\n\t\tif (Is.empty(agreementPartyIds)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (const rulePartyId of rulePartyIds) {\n\t\t\tif (agreementPartyIds.includes(rulePartyId)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determine whether a rule's action(s) match the requested action.\n\t * Supports exact match, includedIn hierarchy, and implies relationships.\n\t * If no action is specified in the rule, it applies to all actions (action-agnostic).\n\t * If an action is specified in the rule and a specific action is requested, they must match.\n\t * If an action is specified in the rule but no specific action is requested, the rule applies (general evaluation).\n\t * @param ruleActions The actions defined in the rule (can be string, object, or array).\n\t * @param requestedAction The action being requested (optional).\n\t * @returns True if the rule's action(s) apply.\n\t * @internal\n\t */\n\tprivate isActionApplicable(\n\t\truleActions: IOdrlRule[\"action\"],\n\t\trequestedAction: OdrlActionType | string | undefined,\n\t\tdataSources: { [source: string]: unknown }\n\t): boolean {\n\t\t// If the rule has no action specified, it applies to all actions\n\t\tif (Is.empty(ruleActions)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// If the rule has actions but no specific action is requested,\n\t\t// the rule applies (we're evaluating permissions in general)\n\t\tif (Is.empty(requestedAction)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst requestedActionId = Is.string(requestedAction)\n\t\t\t? requestedAction\n\t\t\t: OdrlPolicyHelper.getUid(requestedAction);\n\n\t\tif (!Is.stringValue(requestedActionId)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst ruleActionArray = ArrayHelper.fromObjectOrArray(ruleActions) ?? [];\n\n\t\tfor (const ruleAction of ruleActionArray) {\n\t\t\tif (this.ruleActionCoversRequested(ruleAction, requestedActionId, dataSources)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determine whether a single rule action covers a requested action.\n\t * Covers exact match plus ODRL action hierarchy semantics.\n\t * - includedIn: the rule action is a sub-action of a broader parent.\n\t * A rule naming the narrower action also covers requests for the parent.\n\t * E.g. rule action \"print\" with includedIn \"reproduce\" covers a request for \"reproduce\".\n\t * - implies: the rule action entails another action.\n\t * A rule granting action X also covers action Y when X implies Y.\n\t * E.g. rule action \"distribute\" implying \"reproduce\" covers a request for \"reproduce\".\n\t * @param ruleAction The action specified in the rule.\n\t * @param requestedActionId The requested action identifier.\n\t * @returns True if the rule action covers the requested action.\n\t * @internal\n\t */\n\tprivate ruleActionCoversRequested(\n\t\truleAction: OdrlActionType | string | IOdrlAction,\n\t\trequestedActionId: string,\n\t\tdataSources: { [source: string]: unknown }\n\t): boolean {\n\t\t// Extract the rule action ID — support both @id and rdf:value forms\n\t\tlet ruleActionId: string | undefined;\n\t\tif (Is.string(ruleAction)) {\n\t\t\truleActionId = ruleAction;\n\t\t} else if (Is.object<IOdrlAction>(ruleAction)) {\n\t\t\truleActionId = ruleAction[\"rdf:value\"]?.[\"@id\"] ?? OdrlPolicyHelper.getUid(ruleAction);\n\t\t}\n\n\t\t// Determine whether this rule action covers the requested action via any semantic path.\n\t\tlet covers = false;\n\n\t\tif (Is.stringValue(ruleActionId) && ruleActionId === requestedActionId) {\n\t\t\t// Exact match\n\t\t\tcovers = true;\n\t\t} else if (Is.object<IOdrlAction>(ruleAction)) {\n\t\t\t// includedIn: rule action A includedIn B means A is a sub-type of B.\n\t\t\t// A rule that names the narrower action A with includedIn B also covers requests for B.\n\t\t\tif (Is.stringValue(ruleAction.includedIn) && ruleAction.includedIn === requestedActionId) {\n\t\t\t\tcovers = true;\n\t\t\t}\n\n\t\t\t// implies: rule action A implies B means exercising A also entails B.\n\t\t\t// A rule granting A therefore also grants each implied action.\n\t\t\tif (!covers && (ruleAction.implies ?? []).includes(requestedActionId as OdrlActionType)) {\n\t\t\t\tcovers = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!covers) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the action specifies refinements, all must be satisfied for the action to apply.\n\t\t// Refinements constrain the manner in which the action is exercised (e.g. print count <= 5).\n\t\tif (Is.object<IOdrlAction>(ruleAction) && Is.notEmpty(ruleAction.refinement)) {\n\t\t\tconst refinements = ArrayHelper.fromObjectOrArray<IOdrlConstraint | IOdrlLogicalConstraint>(\n\t\t\t\truleAction.refinement ?? []\n\t\t\t);\n\t\t\treturn refinements.every((refinement: IOdrlConstraint | IOdrlLogicalConstraint) =>\n\t\t\t\tthis.evaluateConstraint(refinement, dataSources)\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Apply a permission and create decisions based on that information.\n\t * @param agreementAssigner The assigner ID from the agreement.\n\t * @param agreementAssignee The assignee ID from the agreement.\n\t * @param policy The policy containing the permission.\n\t * @param permission The permission to apply.\n\t * @param targetRefinements Additional constraints from target refinement.\n\t * @param dataSources The operand lookup sources.\n\t * @returns True if the permission applies.\n\t * @internal\n\t */\n\tprivate async evaluatePermission(\n\t\tagreementAssigner: string[] | undefined,\n\t\tagreementAssignee: string[] | undefined,\n\t\tpolicy: IRightsManagementPolicy,\n\t\tpermission: IOdrlPermission,\n\t\ttargetRefinements: (IOdrlConstraint | IOdrlLogicalConstraint)[],\n\t\tdataSources: { [source: string]: unknown },\n\t\taction?: OdrlActionType | string,\n\t\tdecisionTarget?: string\n\t): Promise<boolean> {\n\t\tif (\n\t\t\t!this.isRuleApplicableToParties(permission, agreementAssigner, agreementAssignee, dataSources)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if the permission's action(s) match the requested action\n\t\tif (!this.isActionApplicable(permission.action, action, dataSources)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// ODRL semantics: a Permission without constraints is unconditional.\n\t\tconst constraints = [\n\t\t\t...ArrayHelper.fromObjectOrArray(permission.constraint ?? []),\n\t\t\t...targetRefinements\n\t\t];\n\t\tconst permissionTargetLookup = this.tryResolveTargetDataSource(\n\t\t\tthis.buildRuleDataContextTargetId(\n\t\t\t\tthis.getRuleDataContextTargetId(permission.target),\n\t\t\t\tdecisionTarget\n\t\t\t),\n\t\t\tdataSources,\n\t\t\ttrue\n\t\t);\n\t\tconst ruleDataContext = permissionTargetLookup.value;\n\t\tif (constraints.length === 0) {\n\t\t\treturn this.enforcePermissionDuties(policy, permission, dataSources, ruleDataContext);\n\t\t}\n\n\t\t// All constraints must be satisfied for the permission to apply.\n\t\tconst constraintsSatisfied = constraints.every(c => this.evaluateConstraint(c, dataSources));\n\n\t\tif (!constraintsSatisfied) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this.enforcePermissionDuties(policy, permission, dataSources, ruleDataContext);\n\t}\n\n\t/**\n\t * Enforce duties attached to a permission.\n\t * @param policy The policy being evaluated.\n\t * @param permission The permission being evaluated.\n\t * @param dataSources The operand lookup sources.\n\t * @param ruleDataContext The target-scoped data context passed to enforcers.\n\t * @returns True if all duties are enforced or none are present.\n\t * @internal\n\t */\n\tprivate async enforcePermissionDuties(\n\t\tpolicy: IRightsManagementPolicy,\n\t\tpermission: IOdrlPermission,\n\t\tdataSources: { [source: string]: unknown },\n\t\truleDataContext?: unknown\n\t): Promise<boolean> {\n\t\tconst duties = ArrayHelper.fromObjectOrArray(permission.duty ?? []);\n\t\tif (duties.length === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (const duty of duties) {\n\t\t\tconst enforced = await this.enforceDuty(policy, duty, dataSources, ruleDataContext);\n\t\t\tif (!enforced) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Enforce a single duty using registered obligation enforcers.\n\t * @param policy The policy being evaluated.\n\t * @param duty The duty to enforce.\n\t * @param dataSources The operand lookup sources.\n\t * @param ruleDataContext The target-scoped data context passed to enforcers.\n\t * @returns True if any enforcer succeeds.\n\t * @internal\n\t */\n\tprivate async enforceDuty(\n\t\tpolicy: IRightsManagementPolicy,\n\t\tduty: IOdrlDuty,\n\t\tdataSources: { [source: string]: unknown },\n\t\truleDataContext?: unknown\n\t): Promise<boolean> {\n\t\tconst enforcerNames = PolicyObligationEnforcerFactory.names();\n\t\tconst information = dataSources[DefaultPolicyArbiter._INFORMATION_SOURCE_KEY] as\n\t\t\t| { [id: string]: IJsonLdNodeObject }\n\t\t\t| undefined;\n\n\t\tif (enforcerNames.length === 0) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"noObligationEnforcersRegistered\");\n\t\t}\n\n\t\tfor (const enforcerName of enforcerNames) {\n\t\t\tconst enforcer = PolicyObligationEnforcerFactory.get(enforcerName);\n\t\t\tif (await enforcer.enforce(policy, duty, information, ruleDataContext)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tconst consequences = ArrayHelper.fromObjectOrArray<IOdrlDuty>(duty.consequence ?? []);\n\t\tif (consequences.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (const consequence of consequences) {\n\t\t\tif (!(await this.enforceDuty(policy, consequence, dataSources, ruleDataContext))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Resolve a target string to a matching datasource prefix and remaining target value.\n\t * @param targetId The target identifier to resolve.\n\t * @param dataSources The available lookup sources.\n\t * @param resolveValue True to resolve an item from the target path/key.\n\t * @returns The matching prefix, source, remaining target and optional resolved value.\n\t * @internal\n\t */\n\tprivate tryResolveTargetDataSource(\n\t\ttargetId: string | undefined,\n\t\tdataSources: { [source: string]: unknown },\n\t\tresolveValue: boolean = false\n\t): { source: unknown; target: string; value?: unknown } {\n\t\t// If there is no target id, default to the data datasource\n\t\tif (Is.empty(targetId)) {\n\t\t\treturn {\n\t\t\t\tsource: dataSources[DefaultPolicyArbiter._DATA_SOURCE_KEY],\n\t\t\t\ttarget: \"$\",\n\t\t\t\tvalue: dataSources[DefaultPolicyArbiter._DATA_SOURCE_KEY]\n\t\t\t};\n\t\t}\n\n\t\t// Handle twin:jsonPath:<datasource>:<expression> format.\n\t\t// The datasource segment is optional; when absent the expression starts with \"$\"\n\t\t// and falls back to the primary data source.\n\t\tif (targetId.startsWith(`${DefaultPolicyArbiter._TWIN_JSONPATH}:`)) {\n\t\t\tconst rest = targetId.slice(DefaultPolicyArbiter._TWIN_JSONPATH.length + 1);\n\t\t\tconst matchingKey = Object.keys(dataSources).find(k => rest.startsWith(`${k}:`));\n\t\t\tconst sourceKey = matchingKey ?? DefaultPolicyArbiter._DATA_SOURCE_KEY;\n\t\t\tconst expression = matchingKey ? rest.slice(matchingKey.length + 1) : rest;\n\t\t\treturn this.resolveDataSourceByKey(sourceKey, expression, dataSources, resolveValue);\n\t\t}\n\n\t\t// Handle <datasource>:<expression> format\n\t\tconst matchingKey = Object.keys(dataSources).find(k => targetId.startsWith(`${k}:`));\n\t\tif (matchingKey) {\n\t\t\tconst expression = targetId.slice(matchingKey.length + 1);\n\t\t\treturn this.resolveDataSourceByKey(matchingKey, expression, dataSources, resolveValue);\n\t\t}\n\n\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"ruleTargetNotSupported\", {\n\t\t\ttarget: targetId\n\t\t});\n\t}\n\n\t/**\n\t * Resolve a datasource by key and evaluate a JSONPath expression against it.\n\t * @param sourceKey The datasource key.\n\t * @param expression The JSONPath expression.\n\t * @param dataSources The available datasources.\n\t * @param resolveValue Whether to evaluate the expression and return the matched value.\n\t * @returns The resolved source, target expression, and optionally the matched value.\n\t * @internal\n\t */\n\tprivate resolveDataSourceByKey(\n\t\tsourceKey: string,\n\t\texpression: string | undefined,\n\t\tdataSources: { [source: string]: unknown },\n\t\tresolveValue: boolean = false\n\t): { source: unknown; target: string; value?: unknown } {\n\t\tif (!Is.stringValue(expression)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"jsonPathExpressionMissing\", {\n\t\t\t\toperand: \"target\"\n\t\t\t});\n\t\t}\n\n\t\tif (!expression.startsWith(\"$\")) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"ruleTargetNotSupported\", {\n\t\t\t\ttarget: `${sourceKey}:${expression}`\n\t\t\t});\n\t\t}\n\t\tconst source = dataSources[sourceKey];\n\t\tif (!resolveValue) {\n\t\t\treturn { source, target: expression };\n\t\t}\n\t\tconst matches = JsonPathHelper.query(expression, source);\n\t\tif (matches.length === 0) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"ruleTargetNotSupported\", {\n\t\t\t\ttarget: `${sourceKey}:${expression}`\n\t\t\t});\n\t\t}\n\t\treturn {\n\t\t\tsource,\n\t\t\ttarget: expression,\n\t\t\tvalue: matches.length === 1 ? matches[0].value : matches.map(m => m.value)\n\t\t};\n\t}\n\n\t/**\n\t * Extract the target id from the permission.\n\t * @param target The permission target.\n\t * @returns The information key, or undefined when the target is not an information reference.\n\t * @internal\n\t */\n\tprivate getTargetId(target: IOdrlRule[\"target\"]): string | undefined {\n\t\tif (Is.undefined(target)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (Is.array(target) && target.length > 1) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"multipleTargetsNotSupported\");\n\t\t}\n\n\t\tconst arr = ArrayHelper.fromObjectOrArray(target ?? []);\n\t\tif (arr.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst first = arr[0];\n\t\tif (Is.string(first)) {\n\t\t\treturn first;\n\t\t}\n\t\tif (this.isTwinJsonPathTarget(first)) {\n\t\t\tconst t = first as {\n\t\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE]?: string;\n\t\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION]?: string;\n\t\t\t};\n\t\t\tconst expression = t[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION];\n\t\t\tif (!Is.stringValue(expression)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst dataSource = t[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE];\n\t\t\tconst sourceKey = Is.stringValue(dataSource)\n\t\t\t\t? dataSource\n\t\t\t\t: DefaultPolicyArbiter._DATA_SOURCE_KEY;\n\t\t\treturn `${sourceKey}:${expression}`;\n\t\t}\n\t\treturn OdrlPolicyHelper.getUid(first);\n\t}\n\n\t/**\n\t * Resolve the target identifier used for rule data context lookup.\n\t * For AssetCollection targets the `source` property is used because the collection has no `uid`.\n\t * Falls back to `getTargetId` for all other target forms.\n\t * @param target The rule target field value.\n\t * @returns The prefixed target string for data context resolution.\n\t * @internal\n\t */\n\tprivate getRuleDataContextTargetId(target: IOdrlRule[\"target\"]): string | undefined {\n\t\tconst arr = ArrayHelper.fromObjectOrArray(target ?? []);\n\t\tif (arr.length === 1) {\n\t\t\tconst firstTarget = arr[0];\n\t\t\tif (\n\t\t\t\tIs.object<IOdrlAssetCollection>(firstTarget) &&\n\t\t\t\tOdrlPolicyHelper.getType(firstTarget) === OdrlTypes.AssetCollection &&\n\t\t\t\tfirstTarget.source === DefaultPolicyArbiter._TWIN_JSONPATH\n\t\t\t) {\n\t\t\t\tconst ctx = firstTarget as unknown as {\n\t\t\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION]?: string;\n\t\t\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE]?: string;\n\t\t\t\t};\n\t\t\t\tconst expression = ctx[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION];\n\t\t\t\tif (Is.stringValue(expression)) {\n\t\t\t\t\tconst dataSource = ctx[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE];\n\t\t\t\t\tconst sourceKey = Is.stringValue(dataSource)\n\t\t\t\t\t\t? dataSource\n\t\t\t\t\t\t: DefaultPolicyArbiter._DATA_SOURCE_KEY;\n\t\t\t\t\treturn `${DefaultPolicyArbiter._TWIN_JSONPATH}:${sourceKey}:${expression}`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.getTargetId(target);\n\t}\n\n\t/**\n\t * Build a concrete prefixed target id for rule data-context lookup.\n\t * @param baseTargetId The original prefixed target id from the rule.\n\t * @param decisionTarget The concrete decision JSONPath target.\n\t * @returns The concrete prefixed target id.\n\t * @internal\n\t */\n\tprivate buildRuleDataContextTargetId(\n\t\tbaseTargetId: string | undefined,\n\t\tdecisionTarget: string | undefined\n\t): string | undefined {\n\t\tif (!Is.stringValue(decisionTarget) || decisionTarget === \"$\") {\n\t\t\treturn baseTargetId;\n\t\t}\n\n\t\tif (!Is.stringValue(baseTargetId)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst pathStartIndex = baseTargetId.indexOf(\":$\");\n\t\tif (pathStartIndex < 0) {\n\t\t\treturn baseTargetId;\n\t\t}\n\n\t\treturn `${baseTargetId.slice(0, pathStartIndex)}:${decisionTarget}`;\n\t}\n\n\t/**\n\t * Resolve a rule target into a policy-decision JSONPath target and extracted refinements.\n\t * For AssetCollection targets, `source` is treated as the decision target and `refinement`\n\t * constraints are applied as additional rule constraints.\n\t * @param rule The rule to resolve the target for.\n\t * @returns The decision target and target refinements.\n\t * @throws GeneralError if target is invalid or unsupported.\n\t * @internal\n\t */\n\tprivate resolveRuleTarget(\n\t\trule: IOdrlRule,\n\t\tdataSources: { [source: string]: unknown }\n\t): {\n\t\ttarget: string;\n\t\trefinements: (IOdrlConstraint | IOdrlLogicalConstraint)[];\n\t} {\n\t\tconst arr = ArrayHelper.fromObjectOrArray(rule.target ?? []);\n\t\tif (arr.length === 0) {\n\t\t\treturn {\n\t\t\t\ttarget: \"$\",\n\t\t\t\trefinements: []\n\t\t\t};\n\t\t}\n\n\t\tif (arr.length > 1) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"multipleTargetsNotSupported\");\n\t\t}\n\n\t\tconst firstTarget = arr[0];\n\n\t\tif (this.isTwinJsonPathTarget(firstTarget)) {\n\t\t\tconst t = firstTarget as {\n\t\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE]?: string;\n\t\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION]?: string;\n\t\t\t};\n\t\t\tconst resolved = this.resolveDataSourceByKey(\n\t\t\t\tt[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE] ?? DefaultPolicyArbiter._DATA_SOURCE_KEY,\n\t\t\t\tt[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION],\n\t\t\t\tdataSources\n\t\t\t);\n\t\t\treturn {\n\t\t\t\ttarget: resolved.target,\n\t\t\t\trefinements: []\n\t\t\t};\n\t\t}\n\n\t\tif (Is.object<IOdrlAsset>(firstTarget)) {\n\t\t\t// Guard against unsupported ODRL asset properties\n\t\t\tif (Is.notEmpty(firstTarget.hasPolicy)) {\n\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"assetHasPolicyNotSupported\");\n\t\t\t}\n\t\t\tif (Is.notEmpty(firstTarget.partOf)) {\n\t\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"assetPartOfNotSupported\");\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tIs.object<IOdrlAssetCollection>(firstTarget) &&\n\t\t\t\tOdrlPolicyHelper.getType(firstTarget) === OdrlTypes.AssetCollection\n\t\t\t) {\n\t\t\t\tif (firstTarget.source !== DefaultPolicyArbiter._TWIN_JSONPATH) {\n\t\t\t\t\tthrow new GeneralError(\n\t\t\t\t\t\tDefaultPolicyArbiter.CLASS_NAME,\n\t\t\t\t\t\t\"assetCollectionSourceNotSupported\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsource: firstTarget.source ?? \"\"\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst ctx = firstTarget as unknown as {\n\t\t\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION]?: string;\n\t\t\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE]?: string;\n\t\t\t\t};\n\t\t\t\tconst dataSource = ctx[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE];\n\t\t\t\tconst sourceKey = Is.stringValue(dataSource)\n\t\t\t\t\t? dataSource\n\t\t\t\t\t: DefaultPolicyArbiter._DATA_SOURCE_KEY;\n\t\t\t\tlet sourceLookup: { source: unknown; target: string; value?: unknown };\n\t\t\t\ttry {\n\t\t\t\t\tsourceLookup = this.resolveDataSourceByKey(\n\t\t\t\t\t\tsourceKey,\n\t\t\t\t\t\tctx[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION],\n\t\t\t\t\t\tdataSources\n\t\t\t\t\t);\n\t\t\t\t} catch {\n\t\t\t\t\tthrow new GeneralError(\n\t\t\t\t\t\tDefaultPolicyArbiter.CLASS_NAME,\n\t\t\t\t\t\t\"assetCollectionSourceNotSupported\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsource: ctx[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION] ?? \"\"\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\ttarget: sourceLookup.target,\n\t\t\t\t\trefinements: ArrayHelper.fromObjectOrArray(firstTarget.refinement ?? [])\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tconst targetId = Is.string(firstTarget) ? firstTarget : OdrlPolicyHelper.getUid(firstTarget);\n\t\tif (!Is.stringValue(targetId)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"ruleTargetNotSupported\", {\n\t\t\t\ttarget: \"\"\n\t\t\t});\n\t\t}\n\n\t\tconst targetLookup = this.tryResolveTargetDataSource(targetId, dataSources);\n\n\t\treturn {\n\t\t\ttarget: targetLookup.target,\n\t\t\trefinements: []\n\t\t};\n\t}\n\n\t/**\n\t * Resolve decision targets for a rule.\n\t * AssetCollection wildcard targets with refinements are expanded to per-item targets.\n\t * @param rule The rule being evaluated.\n\t * @param dataSources The operand lookup sources.\n\t * @returns The decision targets and scoped refinements.\n\t * @internal\n\t */\n\tprivate resolveRuleDecisionTargets(\n\t\trule: IOdrlRule,\n\t\tdataSources: { [source: string]: unknown }\n\t): {\n\t\ttarget: string;\n\t\trefinements: (IOdrlConstraint | IOdrlLogicalConstraint)[];\n\t}[] {\n\t\tconst resolvedTarget = this.resolveRuleTarget(rule, dataSources);\n\n\t\tif (!this.shouldExpandToPerItemTargets(rule, resolvedTarget)) {\n\t\t\treturn [resolvedTarget];\n\t\t}\n\n\t\tconst sourceLookup = this.tryResolveTargetDataSource(\n\t\t\tthis.getRuleDataContextTargetId(rule.target),\n\t\t\tdataSources\n\t\t);\n\t\tconst matches = JsonPathHelper.query(sourceLookup.target, sourceLookup.source);\n\t\tif (matches.length === 0) {\n\t\t\treturn [resolvedTarget];\n\t\t}\n\n\t\treturn matches.map(match => {\n\t\t\tconst itemTarget = this.normalizeDecisionTargetPath(match.path ?? resolvedTarget.target);\n\t\t\treturn {\n\t\t\t\ttarget: itemTarget,\n\t\t\t\trefinements: resolvedTarget.refinements.map(refinement =>\n\t\t\t\t\tthis.rewriteRefinementForDecisionTarget(refinement, resolvedTarget.target, itemTarget)\n\t\t\t\t)\n\t\t\t};\n\t\t});\n\t}\n\n\t/**\n\t * Determine if a rule should be expanded to per-item targets.\n\t * @param rule The rule.\n\t * @param resolvedTarget The resolved target details.\n\t * @returns True if the rule should emit per-item decisions.\n\t * @internal\n\t */\n\tprivate shouldExpandToPerItemTargets(\n\t\trule: IOdrlRule,\n\t\tresolvedTarget: {\n\t\t\ttarget: string;\n\t\t\trefinements: (IOdrlConstraint | IOdrlLogicalConstraint)[];\n\t\t}\n\t): boolean {\n\t\tif (resolvedTarget.refinements.length === 0 || !resolvedTarget.target.includes(\"[*]\")) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst targets = ArrayHelper.fromObjectOrArray(rule.target ?? []);\n\t\tif (targets.length !== 1 || !Is.object<IOdrlAssetCollection>(targets[0])) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn OdrlPolicyHelper.getType(targets[0]) === OdrlTypes.AssetCollection;\n\t}\n\n\t/**\n\t * Rewrite a refinement so wildcard paths are scoped to a concrete item target.\n\t * @param refinement The refinement to rewrite.\n\t * @param sourceTarget The wildcard source target.\n\t * @param itemTarget The concrete item target.\n\t * @returns The rewritten refinement.\n\t * @internal\n\t */\n\tprivate rewriteRefinementForDecisionTarget(\n\t\trefinement: IOdrlConstraint | IOdrlLogicalConstraint,\n\t\tsourceTarget: string,\n\t\titemTarget: string\n\t): IOdrlConstraint | IOdrlLogicalConstraint {\n\t\tconst logicalConstraint = this.getLogicalConstraintOperands(refinement);\n\t\tif (logicalConstraint) {\n\t\t\treturn {\n\t\t\t\t...refinement,\n\t\t\t\t[logicalConstraint.operator]: logicalConstraint.constraints.map(item =>\n\t\t\t\t\tthis.rewriteRefinementForDecisionTarget(item, sourceTarget, itemTarget)\n\t\t\t\t)\n\t\t\t} as IOdrlLogicalConstraint;\n\t\t}\n\n\t\tconst regularConstraint = refinement as IOdrlConstraint;\n\t\tconst constraintWithExtensions = regularConstraint as IOdrlConstraint & {\n\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION]?: string;\n\t\t};\n\t\tconst canonicalExpression =\n\t\t\tconstraintWithExtensions[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION];\n\t\tconst rewrittenConstraint: IOdrlConstraint & {\n\t\t\t[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION]?: string;\n\t\t} = {\n\t\t\t...regularConstraint,\n\t\t\tleftOperand: this.rewriteOperandForDecisionTarget(\n\t\t\t\tregularConstraint.leftOperand,\n\t\t\t\tsourceTarget,\n\t\t\t\titemTarget\n\t\t\t) as IOdrlConstraint[\"leftOperand\"],\n\t\t\trightOperand: this.rewriteOperandForDecisionTarget(\n\t\t\t\tregularConstraint.rightOperand,\n\t\t\t\tsourceTarget,\n\t\t\t\titemTarget\n\t\t\t)\n\t\t};\n\t\tif (Is.stringValue(canonicalExpression)) {\n\t\t\trewrittenConstraint[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION] =\n\t\t\t\tthis.rewriteWildcardPath(canonicalExpression, sourceTarget, itemTarget);\n\t\t}\n\n\t\treturn rewrittenConstraint;\n\t}\n\n\t/**\n\t * Rewrite JSONPath-based operands from wildcard source to concrete item target.\n\t * @param operand The operand to rewrite.\n\t * @param sourceTarget The wildcard source target.\n\t * @param itemTarget The concrete item target.\n\t * @returns The rewritten operand.\n\t * @internal\n\t */\n\tprivate rewriteOperandForDecisionTarget(\n\t\toperand: IOdrlConstraint[\"leftOperand\"] | IOdrlConstraint[\"rightOperand\"] | string,\n\t\tsourceTarget: string,\n\t\titemTarget: string\n\t): IOdrlConstraint[\"leftOperand\"] | IOdrlConstraint[\"rightOperand\"] | string {\n\t\tif (Is.object<{ \"@type\": unknown; \"@value\": unknown }>(operand)) {\n\t\t\tconst typedOperand = {\n\t\t\t\t...(operand as { [key: string]: unknown; \"@type\": unknown; \"@value\"?: unknown })\n\t\t\t};\n\t\t\tif (this.isTwinJsonPathOperandType(typedOperand[\"@type\"])) {\n\t\t\t\tif (Is.stringValue(typedOperand[\"@value\"])) {\n\t\t\t\t\ttypedOperand[\"@value\"] = this.rewriteWildcardPath(\n\t\t\t\t\t\ttypedOperand[\"@value\"],\n\t\t\t\t\t\tsourceTarget,\n\t\t\t\t\t\titemTarget\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst canonicalExpression = typedOperand[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION];\n\t\t\t\tif (Is.stringValue(canonicalExpression)) {\n\t\t\t\t\ttypedOperand[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION] = this.rewriteWildcardPath(\n\t\t\t\t\t\tcanonicalExpression,\n\t\t\t\t\t\tsourceTarget,\n\t\t\t\t\t\titemTarget\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn typedOperand as\n\t\t\t\t| IOdrlConstraint[\"leftOperand\"]\n\t\t\t\t| IOdrlConstraint[\"rightOperand\"]\n\t\t\t\t| string;\n\t\t}\n\n\t\t// Legacy string form: \"twin:information:$.foo\". Extract the prefix, rewrite the\n\t\t// JSONPath expression to scope to the per-item target, then re-assemble. Without\n\t\t// this, the leftOperand stays at the wildcard\n\t\t// `$.itemList.itemListElement[*].unloadingLocation.id` for every item, returning\n\t\t// the full array of all ids per check — so all items pass the equality test.\n\t\tif (\n\t\t\tIs.stringValue(operand) &&\n\t\t\toperand.startsWith(`twin:${DefaultPolicyArbiter._INFORMATION_SOURCE_KEY}:`)\n\t\t) {\n\t\t\tconst prefix = `twin:${DefaultPolicyArbiter._INFORMATION_SOURCE_KEY}:`;\n\t\t\tconst expression = operand.slice(prefix.length);\n\t\t\tconst rewritten = this.rewriteWildcardPath(expression, sourceTarget, itemTarget);\n\t\t\treturn `${prefix}${rewritten}`;\n\t\t}\n\n\t\treturn operand;\n\t}\n\n\t/**\n\t * Rewrite wildcard source JSONPath segments to a concrete item JSONPath.\n\t * @param valuePath The operand path.\n\t * @param sourceTarget The wildcard source path.\n\t * @param itemTarget The concrete item path.\n\t * @returns The rewritten path.\n\t * @internal\n\t */\n\tprivate rewriteWildcardPath(valuePath: string, sourceTarget: string, itemTarget: string): string {\n\t\tif (!sourceTarget.includes(\"[*]\") || !valuePath.includes(\"[*]\")) {\n\t\t\treturn valuePath;\n\t\t}\n\n\t\tif (valuePath.startsWith(sourceTarget)) {\n\t\t\treturn `${itemTarget}${valuePath.slice(sourceTarget.length)}`;\n\t\t}\n\n\t\treturn valuePath;\n\t}\n\n\t/**\n\t * Normalize JSONPath strings to dot notation for stable decision targets.\n\t * @param path The JSONPath to normalize.\n\t * @returns The normalized path.\n\t * @internal\n\t */\n\tprivate normalizeDecisionTargetPath(path: string): string {\n\t\treturn path.replace(/\\['([^']+)']/g, \".$1\");\n\t}\n\n\t/**\n\t * Evaluate a single ODRL constraint against the available context.\n\t * Supports logical constraint composition through nested refinements.\n\t * @param constraint The constraint to evaluate.\n\t * @param dataSources The operand lookup sources.\n\t * @returns True if the constraint is satisfied.\n\t * @internal\n\t */\n\tprivate evaluateConstraint(\n\t\tconstraint: IOdrlConstraint | IOdrlLogicalConstraint,\n\t\tdataSources: { [source: string]: unknown }\n\t): boolean {\n\t\tconst logicalConstraint = this.getLogicalConstraintOperands(constraint);\n\t\tif (logicalConstraint) {\n\t\t\treturn this.evaluateLogicalConstraint(logicalConstraint, dataSources);\n\t\t}\n\n\t\t// Must be a regular constraint beyond this point\n\t\tconst regularConstraint = constraint as IOdrlConstraint;\n\n\t\t// rightOperandReference is not supported — it requires an external IRI lookup that\n\t\t// is outside the scope of the local evaluation engine.\n\t\tif (Is.notEmpty(regularConstraint.rightOperandReference)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"rightOperandReferenceNotSupported\");\n\t\t}\n\n\t\t// dataType specifies how the rightOperand value should be coerced before comparison.\n\t\t// Without dataType-aware coercion logic the comparison may produce incorrect results.\n\t\tif (Is.notEmpty(regularConstraint.dataType)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"constraintDataTypeNotSupported\");\n\t\t}\n\n\t\t// unit specifies the measurement unit for the right operand (e.g. currency, length).\n\t\t// Unit-aware comparison is not implemented.\n\t\tif (Is.notEmpty(regularConstraint.unit)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"constraintUnitNotSupported\");\n\t\t}\n\n\t\t// status represents a state-based evaluation operand (e.g. odrl:policyUsage).\n\t\t// State-based evaluation is not implemented.\n\t\tif (Is.notEmpty(regularConstraint.status)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"constraintStatusNotSupported\");\n\t\t}\n\n\t\t// Evaluate the main constraint condition\n\t\tconst leftValue = this.calculateOperandValue(\n\t\t\tregularConstraint.leftOperand,\n\t\t\tdataSources,\n\t\t\tregularConstraint\n\t\t);\n\t\tconst rightValue = this.calculateOperandValue(\n\t\t\tregularConstraint.rightOperand,\n\t\t\tdataSources,\n\t\t\tregularConstraint\n\t\t);\n\t\tconst mainSatisfied = this.evaluateOperator(regularConstraint.operator, leftValue, rightValue);\n\n\t\t// If main constraint is not satisfied, the overall constraint fails\n\t\treturn mainSatisfied;\n\t}\n\n\t/**\n\t * Extract logical constraint operands when present.\n\t * @param constraint The constraint to inspect.\n\t * @returns The logical operator and its operands, or undefined when not logical.\n\t * @throws GeneralError if logical constraint operands are not unique.\n\t * @internal\n\t */\n\tprivate getLogicalConstraintOperands(constraint: IOdrlConstraint | IOdrlLogicalConstraint):\n\t\t| {\n\t\t\t\toperator: OdrlLogicalConstraintType;\n\t\t\t\tconstraints: (IOdrlConstraint | IOdrlLogicalConstraint)[];\n\t\t }\n\t\t| undefined {\n\t\tconst logicalConstraint = constraint as IOdrlLogicalConstraint;\n\t\tconst operators: OdrlLogicalConstraintType[] = Object.values(OdrlLogicalConstraintType);\n\t\tfor (const operator of operators) {\n\t\t\tconst value = logicalConstraint[operator];\n\t\t\tif (!Is.undefined(value)) {\n\t\t\t\tconst constraints = this.normalizeLogicalConstraintOperands(value);\n\t\t\t\tthis.validateLogicalConstraintOperandUniqueness(constraints, operator);\n\t\t\t\treturn {\n\t\t\t\t\toperator,\n\t\t\t\t\tconstraints\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Normalize logical constraint operands into a constraint array.\n\t * Handles both IOdrlConstraint and IOdrlLogicalConstraint types.\n\t * @param raw The raw operand value.\n\t * @returns The constraint array.\n\t * @internal\n\t */\n\tprivate normalizeLogicalConstraintOperands(\n\t\traw: unknown\n\t): (IOdrlConstraint | IOdrlLogicalConstraint)[] {\n\t\tlet normalized = raw;\n\t\tif (\n\t\t\tIs.object<IOdrlLogicalConstraintOperand>(normalized) &&\n\t\t\t!Is.undefined(normalized[\"@list\"])\n\t\t) {\n\t\t\tnormalized = normalized[\"@list\"];\n\t\t}\n\n\t\treturn (ArrayHelper.fromObjectOrArray(normalized) ?? [])\n\t\t\t.filter(item => Is.object(item))\n\t\t\t.map(item => item as IOdrlConstraint | IOdrlLogicalConstraint);\n\t}\n\n\t/**\n\t * Validate that all operands in a logical constraint are unique.\n\t * ODRL spec 2.5.2 requires that all operand values MUST be unique Constraint instances.\n\t * Uniqueness is checked by uid property and id property.\n\t * @param constraints The constraint operands to validate.\n\t * @param operator The logical operator type (for error messaging).\n\t * @throws GeneralError if duplicate constraints are found.\n\t * @internal\n\t */\n\tprivate validateLogicalConstraintOperandUniqueness(\n\t\tconstraints: (IOdrlConstraint | IOdrlLogicalConstraint)[],\n\t\toperator: OdrlLogicalConstraintType\n\t): void {\n\t\tconst seenIdentifiers = new Set<string>();\n\n\t\tfor (let i = 0; i < constraints.length; i++) {\n\t\t\tconst constraint = constraints[i];\n\t\t\tconst identifier = OdrlPolicyHelper.getUid(constraint);\n\n\t\t\t// If we have an identifier, check for duplicates\n\t\t\tif (Is.stringValue(identifier)) {\n\t\t\t\tif (seenIdentifiers.has(identifier)) {\n\t\t\t\t\tthrow new GeneralError(\n\t\t\t\t\t\tDefaultPolicyArbiter.CLASS_NAME,\n\t\t\t\t\t\t\"logicalConstraintOperandNotUnique\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toperator,\n\t\t\t\t\t\t\tidentifier,\n\t\t\t\t\t\t\tindex: i\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tseenIdentifiers.add(identifier);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Evaluate a logical constraint operator against its operands.\n\t * @param logicalConstraint The operator and operand list.\n\t * @param dataSources The operand lookup sources.\n\t * @returns True if the logical constraint is satisfied.\n\t * @internal\n\t */\n\tprivate evaluateLogicalConstraint(\n\t\tlogicalConstraint: {\n\t\t\toperator: OdrlLogicalConstraintType;\n\t\t\tconstraints: (IOdrlConstraint | IOdrlLogicalConstraint)[];\n\t\t},\n\t\tdataSources: { [source: string]: unknown }\n\t): boolean {\n\t\tconst { operator, constraints } = logicalConstraint;\n\t\tif (constraints.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch (operator) {\n\t\t\tcase OdrlLogicalConstraintType.And:\n\t\t\t\treturn constraints.every(item => this.evaluateConstraint(item, dataSources));\n\t\t\tcase OdrlLogicalConstraintType.AndSequence: {\n\t\t\t\tfor (const item of constraints) {\n\t\t\t\t\tif (!this.evaluateConstraint(item, dataSources)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcase OdrlLogicalConstraintType.Or:\n\t\t\t\treturn constraints.some(item => this.evaluateConstraint(item, dataSources));\n\t\t\tcase OdrlLogicalConstraintType.Xone: {\n\t\t\t\tlet satisfied = 0;\n\t\t\t\tfor (const item of constraints) {\n\t\t\t\t\tif (this.evaluateConstraint(item, dataSources)) {\n\t\t\t\t\t\tsatisfied += 1;\n\t\t\t\t\t\tif (satisfied > 1) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn satisfied === 1;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Resolve a prefixed operand to its source object and JSONPath expression.\n\t * Prefix matching is dictionary-driven so additional operand namespaces can be\n\t * added in one place by extending the lookup sources map.\n\t * @param operandTypeOrValue The string operand value or typed operand namespace.\n\t * @param operandValue The JSONPath expression.\n\t * @param dataSources The available lookup sources.\n\t * @returns The resolved source and JSONPath, or undefined when not namespaced.\n\t * @throws GeneralError if a twin: prefixed operand doesn't resolve to any available datasource key.\n\t * @internal\n\t */\n\tprivate tryResolveOperandLookup(\n\t\toperandTypeOrValue: string,\n\t\toperandValue: unknown,\n\t\tdataSources: { [source: string]: unknown }\n\t): { source: unknown; jsonPath: string } | undefined {\n\t\tlet sourceKey = this.normalizeTwinJsonPathOperandAlias(operandTypeOrValue);\n\t\tlet value: unknown = operandValue;\n\n\t\t// Combined form: operandTypeOrValue is a full \"<prefix>:<expression>\" string\n\t\t// like \"twin:jsonPath:$.foo\" rather than the canonical separation of @type +\n\t\t// @value/expression. Detect by walking the registered datasource keys for a prefix\n\t\t// match; on hit, split into key + expression so resolveDataSourceByKey can evaluate.\n\t\tif (!dataSources[sourceKey]) {\n\t\t\tconst matchingKey = Object.keys(dataSources).find(k => sourceKey.startsWith(`${k}:`));\n\t\t\tif (matchingKey) {\n\t\t\t\tvalue = sourceKey.slice(matchingKey.length + 1);\n\t\t\t\tsourceKey = matchingKey;\n\t\t\t}\n\t\t}\n\n\t\tif (!dataSources[sourceKey] || !Is.stringValue(value)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst resolved = this.resolveDataSourceByKey(sourceKey, value, dataSources);\n\t\treturn { source: resolved.source, jsonPath: resolved.target };\n\t}\n\n\t/**\n\t * Calculate an operand value.\n\t * @param operand The operand.\n\t * @param dataSources The available prefixed operand sources.\n\t * @returns The resolved operand value.\n\t * @internal\n\t */\n\tprivate calculateOperandValue(\n\t\toperand: IOdrlConstraint[\"leftOperand\"] | IOdrlConstraint[\"rightOperand\"] | string,\n\t\tdataSources: { [source: string]: unknown },\n\t\tconstraint?: IOdrlConstraint\n\t): unknown {\n\t\tlet jsonPath: string | undefined;\n\t\tlet operandRoot: unknown;\n\t\tif (Is.stringValue(operand)) {\n\t\t\tconst expression = this.extractJsonPathExpressionFromConstraint(constraint, operand);\n\t\t\tlet resolvedOperand = operand;\n\t\t\tif (\n\t\t\t\toperand === DefaultPolicyArbiter._TWIN_JSONPATH &&\n\t\t\t\tIs.object<{ [key: string]: unknown }>(constraint)\n\t\t\t) {\n\t\t\t\tconst dataSourceOverride = constraint[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE];\n\t\t\t\tif (Is.stringValue(dataSourceOverride)) {\n\t\t\t\t\tresolvedOperand = dataSourceOverride;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst lookup = this.tryResolveOperandLookup(\n\t\t\t\tresolvedOperand,\n\t\t\t\texpression ?? operand,\n\t\t\t\tdataSources\n\t\t\t);\n\t\t\tif (lookup) {\n\t\t\t\tjsonPath = lookup.jsonPath;\n\t\t\t\toperandRoot = lookup.source;\n\t\t\t}\n\t\t} else if (Is.object<{ \"@type\": unknown; \"@value\": unknown }>(operand)) {\n\t\t\tconst typedOperand = operand as {\n\t\t\t\t[key: string]: unknown;\n\t\t\t\t\"@type\": unknown;\n\t\t\t\t\"@value\"?: unknown;\n\t\t\t};\n\t\t\t// Is this an object { \"@value\": \"18\", \"@type\": \"xsd:integer\" } ?\n\t\t\tconst value =\n\t\t\t\t(this.extractJsonPathExpressionFromTypedOperand(typedOperand) as unknown) ??\n\t\t\t\ttypedOperand[\"@value\"];\n\t\t\tconst type = typedOperand[\"@type\"];\n\t\t\tif (Is.stringValue(type)) {\n\t\t\t\tlet resolvedType = type;\n\t\t\t\tif (this.isTwinJsonPathOperandType(type)) {\n\t\t\t\t\tconst dataSourceOverride = typedOperand[DefaultPolicyArbiter._TWIN_JSONPATH_DATA_SOURCE];\n\t\t\t\t\tif (Is.stringValue(dataSourceOverride)) {\n\t\t\t\t\t\tresolvedType = dataSourceOverride;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst lookup = this.tryResolveOperandLookup(resolvedType, value, dataSources);\n\t\t\t\tif (lookup) {\n\t\t\t\t\tjsonPath = lookup.jsonPath;\n\t\t\t\t\toperandRoot = lookup.source;\n\t\t\t\t} else {\n\t\t\t\t\tconst xsdValue = this.coerceXsdType(value, type);\n\t\t\t\t\tif (!Is.undefined(xsdValue)) {\n\t\t\t\t\t\treturn xsdValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// We have a JSON Path to resolve\n\t\tif (Is.stringValue(jsonPath)) {\n\t\t\tconst jsonPaths = JsonPathHelper.query(jsonPath, operandRoot);\n\t\t\tif (jsonPaths.length === 0) {\n\t\t\t\t// No matches\n\t\t\t\treturn undefined;\n\t\t\t} else if (jsonPaths.length === 1) {\n\t\t\t\t// Single match - return the value directly\n\t\t\t\treturn jsonPaths[0].value;\n\t\t\t}\n\n\t\t\t// Multiple matches - return array of values\n\t\t\treturn jsonPaths.map(p => p.value);\n\t\t}\n\n\t\t// Not JSON Path or object value so return as is\n\t\treturn operand;\n\t}\n\n\t/**\n\t * Determine if a target object uses the canonical twin:jsonPath object format.\n\t * @param target The target value.\n\t * @returns True if the target is a canonical twin:jsonPath object.\n\t * @internal\n\t */\n\tprivate isTwinJsonPathTarget(target: unknown): boolean {\n\t\treturn Is.object(target) && this.isTwinJsonPathOperandType(OdrlPolicyHelper.getType(target));\n\t}\n\n\t/**\n\t * Determine if the operand type is a jsonPath namespace.\n\t * @param type The operand type.\n\t * @returns True if the type is twin:jsonPath.\n\t * @internal\n\t */\n\tprivate isTwinJsonPathOperandType(type: unknown): boolean {\n\t\treturn type === DefaultPolicyArbiter._TWIN_JSONPATH;\n\t}\n\n\t/**\n\t * Normalize canonical jsonPath alias to the legacy jsonpath namespace key.\n\t * @param operandTypeOrValue The raw operand type or value.\n\t * @returns The normalized operand type/value.\n\t * @internal\n\t */\n\tprivate normalizeTwinJsonPathOperandAlias(operandTypeOrValue: string): string {\n\t\tif (\n\t\t\toperandTypeOrValue === DefaultPolicyArbiter._TWIN_JSONPATH ||\n\t\t\toperandTypeOrValue.startsWith(`${DefaultPolicyArbiter._TWIN_JSONPATH}:`)\n\t\t) {\n\t\t\tconst suffix = operandTypeOrValue.slice(DefaultPolicyArbiter._TWIN_JSONPATH.length);\n\t\t\treturn `${DefaultPolicyArbiter._DATA_SOURCE_KEY}${suffix}`;\n\t\t}\n\n\t\treturn operandTypeOrValue;\n\t}\n\n\t/**\n\t * Extract canonical jsonPath expression from typed operand object.\n\t * @param operand The typed operand.\n\t * @returns The jsonPath expression if present.\n\t * @internal\n\t */\n\tprivate extractJsonPathExpressionFromTypedOperand(operand: {\n\t\t[key: string]: unknown;\n\t\t\"@type\": unknown;\n\t\t\"@value\"?: unknown;\n\t}): string | undefined {\n\t\tif (!this.isTwinJsonPathOperandType(operand[\"@type\"])) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst expression = operand[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION];\n\t\tif (Is.stringValue(expression)) {\n\t\t\treturn expression;\n\t\t}\n\n\t\tconst type = operand[\"@type\"];\n\t\tif (type === DefaultPolicyArbiter._TWIN_JSONPATH) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"jsonPathExpressionMissing\", {\n\t\t\t\toperand: \"rightOperand\"\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Extract canonical jsonPath expression from constraint for leftOperand aliases.\n\t * @param constraint The constraint containing the left operand.\n\t * @param leftOperand The left operand.\n\t * @returns The expression if canonical form is used.\n\t * @internal\n\t */\n\tprivate extractJsonPathExpressionFromConstraint(\n\t\tconstraint: IOdrlConstraint | undefined,\n\t\tleftOperand: string\n\t): string | undefined {\n\t\tif (!Is.object<{ [key: string]: unknown }>(constraint)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (constraint.leftOperand !== leftOperand) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (leftOperand.startsWith(`${DefaultPolicyArbiter._TWIN_JSONPATH}:`)) {\n\t\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"jsonPathExpressionMissing\", {\n\t\t\t\toperand: \"leftOperand\"\n\t\t\t});\n\t\t}\n\n\t\tif (leftOperand !== DefaultPolicyArbiter._TWIN_JSONPATH) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst expression = constraint[DefaultPolicyArbiter._TWIN_JSONPATH_EXPRESSION];\n\t\tif (Is.stringValue(expression)) {\n\t\t\treturn expression;\n\t\t}\n\n\t\tthrow new GeneralError(DefaultPolicyArbiter.CLASS_NAME, \"jsonPathExpressionMissing\", {\n\t\t\toperand: \"leftOperand\"\n\t\t});\n\t}\n\n\t/**\n\t * Evaluate an ODRL operator against resolved operands.\n\t * @param operator The operator.\n\t * @param left The resolved left operand.\n\t * @param right The resolved right operand.\n\t * @returns True if the comparison is satisfied.\n\t * @internal\n\t */\n\tprivate evaluateOperator(operator: OdrlOperatorType, left: unknown, right: unknown): boolean {\n\t\t// Handle array/collection left values (e.g. JSONPath returning multiple matches).\n\t\tconst leftValues = ArrayHelper.fromObjectOrArray(left ?? []);\n\n\t\tswitch (operator) {\n\t\t\tcase OdrlOperatorType.Eq:\n\t\t\t\treturn leftValues.some(v => ObjectHelper.equal(v, right, false));\n\t\t\tcase OdrlOperatorType.Neq:\n\t\t\t\treturn leftValues.every(v => !ObjectHelper.equal(v, right, false));\n\t\t\tcase OdrlOperatorType.Gt:\n\t\t\t\treturn leftValues.some(v => this.compareOrdered(v, right, (a, b) => a > b));\n\t\t\tcase OdrlOperatorType.Gteq:\n\t\t\t\treturn leftValues.some(v => this.compareOrdered(v, right, (a, b) => a >= b));\n\t\t\tcase OdrlOperatorType.Lt:\n\t\t\t\treturn leftValues.some(v => this.compareOrdered(v, right, (a, b) => a < b));\n\t\t\tcase OdrlOperatorType.Lteq:\n\t\t\t\treturn leftValues.some(v => this.compareOrdered(v, right, (a, b) => a <= b));\n\t\t\tcase OdrlOperatorType.IsAnyOf: {\n\t\t\t\treturn leftValues.some(v => {\n\t\t\t\t\tconst stringValue =\n\t\t\t\t\t\ttypeof v === \"string\" || typeof v === \"number\" || typeof v === \"boolean\"\n\t\t\t\t\t\t\t? String(v)\n\t\t\t\t\t\t\t: JSON.stringify(v);\n\t\t\t\t\treturn (ArrayHelper.fromObjectOrArray(right) ?? []).includes(stringValue);\n\t\t\t\t});\n\t\t\t}\n\t\t\tcase OdrlOperatorType.IsAllOf: {\n\t\t\t\treturn ObjectHelper.equal(leftValues, ArrayHelper.fromObjectOrArray(right) ?? [], false);\n\t\t\t}\n\t\t\tcase OdrlOperatorType.IsNoneOf: {\n\t\t\t\treturn leftValues.every(v => !(ArrayHelper.fromObjectOrArray(right) ?? []).includes(v));\n\t\t\t}\n\t\t\tcase OdrlOperatorType.LocTimeEq:\n\t\t\t\treturn leftValues.some(v => ObjectHelper.equal(v, right, false));\n\t\t\tcase OdrlOperatorType.LocTimeGteq:\n\t\t\t\treturn leftValues.some(v => this.compareOrdered(v, right, (a, b) => a >= b));\n\t\t\tcase OdrlOperatorType.IsA:\n\t\t\tcase OdrlOperatorType.HasPart:\n\t\t\tcase OdrlOperatorType.IsPartOf:\n\t\t\t\t// For now, treat these as simple equality/ordering semantics where meaningful.\n\t\t\t\t// Profiles can introduce richer semantics via additional arbiters.\n\t\t\t\treturn leftValues.some(v => ObjectHelper.equal(v, right, false));\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Compare values with numeric/date/string coercion.\n\t * @param left The left value.\n\t * @param right The right value.\n\t * @param compare Comparison operator.\n\t * @returns True if ordered comparison passes.\n\t * @internal\n\t */\n\tprivate compareOrdered(\n\t\tleft: unknown,\n\t\tright: unknown,\n\t\tcompare: (a: number, b: number) => boolean\n\t): boolean {\n\t\tconst leftNum = Coerce.number(left);\n\t\tconst rightNum = Coerce.number(right);\n\t\tif (!Is.undefined(leftNum) && !Is.undefined(rightNum)) {\n\t\t\treturn compare(leftNum, rightNum);\n\t\t}\n\t\tconst leftDate = Coerce.dateTime(left);\n\t\tconst rightDate = Coerce.dateTime(right);\n\t\tif (!Is.undefined(leftDate) && !Is.undefined(rightDate)) {\n\t\t\treturn compare(leftDate.getTime(), rightDate.getTime());\n\t\t}\n\n\t\t// Only use string ordering when both operands are actual strings.\n\t\t// Avoid coercing other types into strings, as that can cause\n\t\t// unintended comparisons like 18 >= \"$.minAge\" evaluating to true.\n\t\tif (Is.string(left) && Is.string(right)) {\n\t\t\treturn compare(left.localeCompare(right), 0);\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Coerce a value to a specific XSD type.\n\t * @param value The value to coerce.\n\t * @param type The XSD type.\n\t * @returns The coerced value, or undefined when coercion is not possible.\n\t * @internal\n\t */\n\tprivate coerceXsdType(value: unknown, type: string): unknown {\n\t\tif (\n\t\t\t[\n\t\t\t\t\"xsd:string\",\n\t\t\t\t\"xsd:normalizedString\",\n\t\t\t\t\"xsd:token\",\n\t\t\t\t\"xsd:anyURI\",\n\t\t\t\t\"xsd:QName\",\n\t\t\t\t\"xsd:NOTATION\"\n\t\t\t].includes(type)\n\t\t) {\n\t\t\t// Handle standard xsd types\n\t\t\treturn Coerce.string(value);\n\t\t} else if (\n\t\t\t[\n\t\t\t\t\"xsd:integer\",\n\t\t\t\t\"xsd:decimal\",\n\t\t\t\t\"xsd:float\",\n\t\t\t\t\"xsd:double\",\n\t\t\t\t\"xsd:long\",\n\t\t\t\t\"xsd:int\",\n\t\t\t\t\"xsd:short\",\n\t\t\t\t\"xsd:byte\"\n\t\t\t].includes(type)\n\t\t) {\n\t\t\t// Handle standard xsd types\n\t\t\treturn Coerce.number(value);\n\t\t} else if (type === \"xsd:boolean\") {\n\t\t\t// Handle standard xsd types\n\t\t\treturn Coerce.boolean(value);\n\t\t} else if ([\"xsd:date\", \"xsd:dateTime\", \"xsd:time\"].includes(type)) {\n\t\t\t// Handle standard xsd types\n\t\t\treturn Coerce.dateTime(value);\n\t\t}\n\t\treturn undefined;\n\t}\n}\n"]}
|
package/docs/changelog.md
CHANGED
|
@@ -6,6 +6,51 @@
|
|
|
6
6
|
|
|
7
7
|
* remove EcosystemPolicy-related examples/assumptions; plugins now target standard ODRL policy types for v2.
|
|
8
8
|
|
|
9
|
+
## [0.0.3-next.32](https://github.com/twinfoundation/twin-rights-management/compare/rights-management-plugins-v0.0.3-next.31...rights-management-plugins-v0.0.3-next.32) (2026-05-05)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Miscellaneous Chores
|
|
13
|
+
|
|
14
|
+
* **rights-management-plugins:** Synchronize repo versions
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Dependencies
|
|
18
|
+
|
|
19
|
+
* The following workspace dependencies were updated
|
|
20
|
+
* dependencies
|
|
21
|
+
* @twin.org/rights-management-models bumped from 0.0.3-next.31 to 0.0.3-next.32
|
|
22
|
+
* devDependencies
|
|
23
|
+
* @twin.org/rights-management-pap-service bumped from 0.0.3-next.31 to 0.0.3-next.32
|
|
24
|
+
* @twin.org/rights-management-pdp-service bumped from 0.0.3-next.31 to 0.0.3-next.32
|
|
25
|
+
* @twin.org/rights-management-pep-service bumped from 0.0.3-next.31 to 0.0.3-next.32
|
|
26
|
+
* @twin.org/rights-management-pip-service bumped from 0.0.3-next.31 to 0.0.3-next.32
|
|
27
|
+
* @twin.org/rights-management-pmp-service bumped from 0.0.3-next.31 to 0.0.3-next.32
|
|
28
|
+
* @twin.org/rights-management-pnp-service bumped from 0.0.3-next.31 to 0.0.3-next.32
|
|
29
|
+
* @twin.org/rights-management-pxp-service bumped from 0.0.3-next.31 to 0.0.3-next.32
|
|
30
|
+
|
|
31
|
+
## [0.0.3-next.31](https://github.com/twinfoundation/twin-rights-management/compare/rights-management-plugins-v0.0.3-next.30...rights-management-plugins-v0.0.3-next.31) (2026-05-01)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* improve json path handling ([#133](https://github.com/twinfoundation/twin-rights-management/issues/133)) ([0a3c0c4](https://github.com/twinfoundation/twin-rights-management/commit/0a3c0c41f15f74a6e2463ed9802c7b662d3e95f6))
|
|
37
|
+
* pnp callback encryption, getDatasetTargets helper, engine-driven callbackPath ([#132](https://github.com/twinfoundation/twin-rights-management/issues/132)) ([e642154](https://github.com/twinfoundation/twin-rights-management/commit/e6421546336bfa73a7c0a9fe102beeaa518249dd))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Dependencies
|
|
41
|
+
|
|
42
|
+
* The following workspace dependencies were updated
|
|
43
|
+
* dependencies
|
|
44
|
+
* @twin.org/rights-management-models bumped from 0.0.3-next.30 to 0.0.3-next.31
|
|
45
|
+
* devDependencies
|
|
46
|
+
* @twin.org/rights-management-pap-service bumped from 0.0.3-next.30 to 0.0.3-next.31
|
|
47
|
+
* @twin.org/rights-management-pdp-service bumped from 0.0.3-next.30 to 0.0.3-next.31
|
|
48
|
+
* @twin.org/rights-management-pep-service bumped from 0.0.3-next.30 to 0.0.3-next.31
|
|
49
|
+
* @twin.org/rights-management-pip-service bumped from 0.0.3-next.30 to 0.0.3-next.31
|
|
50
|
+
* @twin.org/rights-management-pmp-service bumped from 0.0.3-next.30 to 0.0.3-next.31
|
|
51
|
+
* @twin.org/rights-management-pnp-service bumped from 0.0.3-next.30 to 0.0.3-next.31
|
|
52
|
+
* @twin.org/rights-management-pxp-service bumped from 0.0.3-next.30 to 0.0.3-next.31
|
|
53
|
+
|
|
9
54
|
## [0.0.3-next.30](https://github.com/twinfoundation/twin-rights-management/compare/rights-management-plugins-v0.0.3-next.29...rights-management-plugins-v0.0.3-next.30) (2026-04-29)
|
|
10
55
|
|
|
11
56
|
|
package/locales/en.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"circularInheritanceDetected": "Circular inheritance detected: policy \"{policyId}\" inherits from \"{inheritFromId}\" which creates a cycle.",
|
|
10
10
|
"logicalConstraintOperandNotUnique": "Logical constraint operand is not unique within the policy, each operand must be unique.",
|
|
11
11
|
"inheritedPolicyNotFound": "The inherited policy with id \"{inheritFromId}\" could not be found in the Policy Administration Point.",
|
|
12
|
-
"assetCollectionSourceNotSupported": "AssetCollection source \"{source}\" is not supported. It must be a twin:
|
|
12
|
+
"assetCollectionSourceNotSupported": "AssetCollection source \"{source}\" is not supported. It must be a twin:jsonPath target.",
|
|
13
13
|
"partyCollectionSourceNotSupported": "PartyCollection source \"{source}\" is not supported.",
|
|
14
14
|
"assetHasPolicyNotSupported": "Asset hasPolicy is not supported. Policies must be referenced through the agreement directly.",
|
|
15
15
|
"assetPartOfNotSupported": "Asset partOf is not supported. AssetCollection membership is resolved through the agreement directly.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/rights-management-plugins",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.32",
|
|
4
4
|
"description": "Plugin implementations for extending rights management behaviour across components.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@twin.org/data-json-path": "next",
|
|
26
26
|
"@twin.org/logging-models": "next",
|
|
27
27
|
"@twin.org/nameof": "next",
|
|
28
|
-
"@twin.org/rights-management-models": "0.0.3-next.
|
|
28
|
+
"@twin.org/rights-management-models": "0.0.3-next.32",
|
|
29
29
|
"@twin.org/standards-w3c-odrl": "next"
|
|
30
30
|
},
|
|
31
31
|
"main": "./dist/es/index.js",
|