@pie-players/pie-assessment-toolkit 0.3.36 → 0.3.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -4
- package/dist/components/ItemToolBar.custom-element.js +6 -4
- package/dist/components/PieAssessmentToolkit.custom-element.js +34 -39
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/policy/core/PolicySource.d.ts +2 -2
- package/dist/policy/core/PolicySource.js +1 -1
- package/dist/policy/core/ToolPolicyEngine.d.ts +15 -17
- package/dist/policy/core/ToolPolicyEngine.d.ts.map +1 -1
- package/dist/policy/core/ToolPolicyEngine.js +21 -21
- package/dist/policy/core/ToolPolicyEngine.js.map +1 -1
- package/dist/policy/core/compose-decision.d.ts +5 -5
- package/dist/policy/core/compose-decision.d.ts.map +1 -1
- package/dist/policy/core/compose-decision.js +40 -38
- package/dist/policy/core/compose-decision.js.map +1 -1
- package/dist/policy/core/decision-types.d.ts +10 -10
- package/dist/policy/core/decision-types.d.ts.map +1 -1
- package/dist/policy/core/{qti-inputs.d.ts → pnp-policy-inputs.d.ts} +23 -23
- package/dist/policy/core/pnp-policy-inputs.d.ts.map +1 -0
- package/dist/policy/core/{qti-inputs.js → pnp-policy-inputs.js} +25 -25
- package/dist/policy/core/pnp-policy-inputs.js.map +1 -0
- package/dist/policy/core/policy-source-tag.d.ts +6 -6
- package/dist/policy/core/policy-source-tag.js +3 -3
- package/dist/policy/core/provenance.d.ts +11 -11
- package/dist/policy/core/provenance.d.ts.map +1 -1
- package/dist/policy/core/provenance.js +4 -4
- package/dist/policy/engine.d.ts +5 -5
- package/dist/policy/engine.d.ts.map +1 -1
- package/dist/policy/engine.js +2 -2
- package/dist/policy/internal.d.ts +4 -4
- package/dist/policy/internal.d.ts.map +1 -1
- package/dist/policy/internal.js +4 -4
- package/dist/policy/internal.js.map +1 -1
- package/dist/policy/sources/{QtiPolicySource.d.ts → PnpPolicySource.d.ts} +25 -25
- package/dist/policy/sources/PnpPolicySource.d.ts.map +1 -0
- package/dist/policy/sources/{QtiPolicySource.js → PnpPolicySource.js} +28 -27
- package/dist/policy/sources/PnpPolicySource.js.map +1 -0
- package/dist/services/I18nService.d.ts +0 -1
- package/dist/services/I18nService.d.ts.map +1 -1
- package/dist/services/I18nService.js +0 -1
- package/dist/services/I18nService.js.map +1 -1
- package/dist/services/PNPToolResolver.d.ts.map +1 -1
- package/dist/services/PNPToolResolver.js +14 -15
- package/dist/services/PNPToolResolver.js.map +1 -1
- package/dist/services/ToolkitCoordinator.d.ts +63 -50
- package/dist/services/ToolkitCoordinator.d.ts.map +1 -1
- package/dist/services/ToolkitCoordinator.js +118 -74
- package/dist/services/ToolkitCoordinator.js.map +1 -1
- package/dist/services/interfaces.d.ts +24 -16
- package/dist/services/interfaces.d.ts.map +1 -1
- package/dist/services/interfaces.js.map +1 -1
- package/dist/services/pnp-provenance.d.ts +1 -1
- package/dist/services/pnp-provenance.d.ts.map +1 -1
- package/dist/services/pnp-provenance.js +1 -0
- package/dist/services/pnp-provenance.js.map +1 -1
- package/dist/services/section-controller-types.d.ts +125 -0
- package/dist/services/section-controller-types.d.ts.map +1 -1
- package/dist/services/tools-config-normalizer.d.ts +14 -15
- package/dist/services/tools-config-normalizer.d.ts.map +1 -1
- package/dist/services/tools-config-normalizer.js +5 -5
- package/dist/services/tools-config-normalizer.js.map +1 -1
- package/package.json +7 -7
- package/dist/core/TypedEventBus.d.ts +0 -48
- package/dist/core/TypedEventBus.d.ts.map +0 -1
- package/dist/core/TypedEventBus.js +0 -63
- package/dist/core/TypedEventBus.js.map +0 -1
- package/dist/policy/core/qti-inputs.d.ts.map +0 -1
- package/dist/policy/core/qti-inputs.js.map +0 -1
- package/dist/policy/sources/QtiPolicySource.d.ts.map +0 -1
- package/dist/policy/sources/QtiPolicySource.js.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Compose-decision pipeline (M8 — see `.cursor/plans/m8-design.md` § 3).
|
|
3
3
|
*
|
|
4
4
|
* Pure function: given a decision request, the host's tools config,
|
|
5
|
-
* an optional
|
|
5
|
+
* an optional PNP policy source, and the registered custom sources, returns
|
|
6
6
|
* a `ToolPolicyDecision`. The function performs no I/O, holds no
|
|
7
7
|
* mutable state, and never reaches into Svelte / DOM — that is the
|
|
8
8
|
* `ToolPolicyEngine` class's job.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { normalizeToolList, } from "../../services/tools-config-normalizer.js";
|
|
14
14
|
import { ToolPolicyProvenanceBuilder } from "./provenance.js";
|
|
15
15
|
export function composeDecision(inputs) {
|
|
16
|
-
const { request, tools,
|
|
16
|
+
const { request, tools, pnpPolicy, customSources, contextId } = inputs;
|
|
17
17
|
const builder = new ToolPolicyProvenanceBuilder(contextId);
|
|
18
18
|
builder.addSource("host", {
|
|
19
19
|
id: request.scope.scopeId,
|
|
@@ -100,34 +100,36 @@ export function composeDecision(inputs) {
|
|
|
100
100
|
}
|
|
101
101
|
return true;
|
|
102
102
|
});
|
|
103
|
-
// Step 5 —
|
|
103
|
+
// Step 5 — PNP/profile policy gates.
|
|
104
104
|
const diagnostics = [];
|
|
105
105
|
const sourcesByTool = new Map();
|
|
106
106
|
for (const toolId of candidates) {
|
|
107
107
|
sourcesByTool.set(toolId, ["placement"]);
|
|
108
108
|
}
|
|
109
109
|
// Snapshot the post-host candidate set so step 5b can distinguish
|
|
110
|
-
// "host removed a
|
|
111
|
-
// from "
|
|
110
|
+
// "host removed a required tool" (requiredToolBlocked fires)
|
|
111
|
+
// from "profile policy's own precedence removed a required tool" (fix
|
|
112
112
|
// per M8 PR 1 R1 S1 — multi-rule conflict on the same tool must
|
|
113
113
|
// not blame the host).
|
|
114
114
|
const postHostCandidates = new Set(candidates);
|
|
115
|
-
let
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
let pnpPolicyResult = null;
|
|
116
|
+
if (pnpPolicy.enforcement === "on" &&
|
|
117
|
+
pnpPolicy.source &&
|
|
118
|
+
(pnpPolicy.assessment || pnpPolicy.currentItemRef)) {
|
|
119
|
+
pnpPolicyResult = pnpPolicy.source.apply({
|
|
120
|
+
assessment: pnpPolicy.assessment,
|
|
121
|
+
currentItemRef: pnpPolicy.currentItemRef,
|
|
120
122
|
});
|
|
121
|
-
if (
|
|
122
|
-
builder.addSource("assessment",
|
|
123
|
+
if (pnpPolicyResult.sources.assessment) {
|
|
124
|
+
builder.addSource("assessment", pnpPolicyResult.sources.assessment);
|
|
123
125
|
}
|
|
124
|
-
if (
|
|
125
|
-
builder.addSource("student",
|
|
126
|
+
if (pnpPolicyResult.sources.student) {
|
|
127
|
+
builder.addSource("student", pnpPolicyResult.sources.student);
|
|
126
128
|
}
|
|
127
|
-
if (
|
|
128
|
-
builder.addSource("item",
|
|
129
|
+
if (pnpPolicyResult.sources.item) {
|
|
130
|
+
builder.addSource("item", pnpPolicyResult.sources.item);
|
|
129
131
|
}
|
|
130
|
-
for (const decision of
|
|
132
|
+
for (const decision of pnpPolicyResult.decisions) {
|
|
131
133
|
builder.addDecision({
|
|
132
134
|
precedence: decision.precedence,
|
|
133
135
|
rule: decision.rule,
|
|
@@ -138,34 +140,34 @@ export function composeDecision(inputs) {
|
|
|
138
140
|
value: decision.value,
|
|
139
141
|
});
|
|
140
142
|
}
|
|
141
|
-
// 5a — remove
|
|
143
|
+
// 5a — remove PNP/profile-blocked tools from the candidate set.
|
|
142
144
|
candidates = candidates.filter((toolId) => {
|
|
143
|
-
return !
|
|
145
|
+
return !pnpPolicyResult.blockedToolIds.has(toolId);
|
|
144
146
|
});
|
|
145
147
|
for (const toolId of Array.from(sourcesByTool.keys())) {
|
|
146
|
-
if (
|
|
148
|
+
if (pnpPolicyResult.blockedToolIds.has(toolId)) {
|
|
147
149
|
sourcesByTool.delete(toolId);
|
|
148
150
|
}
|
|
149
151
|
}
|
|
150
|
-
// 5b — surface
|
|
151
|
-
//
|
|
152
|
+
// 5b — surface requiredToolBlocked diagnostics ONLY for
|
|
153
|
+
// PNP/profile-mandated tools that the host removed (i.e., the tool was
|
|
152
154
|
// NOT in `postHostCandidates`). Mandated tools removed by
|
|
153
|
-
//
|
|
154
|
-
// blocking a `requiredTools` mandate) are an internal
|
|
155
|
+
// profile policy's own higher-precedence rule (e.g. `restrictedTools`
|
|
156
|
+
// blocking a `requiredTools` mandate) are an internal policy
|
|
155
157
|
// resolution and must not be reported as a host conflict — the
|
|
156
158
|
// loser's `block` decision is already in the trail with full
|
|
157
|
-
//
|
|
159
|
+
// provenance.
|
|
158
160
|
//
|
|
159
161
|
// `details` carries `{ rule, hostRule, hostValue }` so consumers
|
|
160
162
|
// can render the conflict as a single sentence without
|
|
161
163
|
// re-deriving the host gate from `provenance.features`. See
|
|
162
|
-
// `
|
|
163
|
-
for (const mandatedToolId of
|
|
164
|
+
// `RequiredToolBlockedDetails` for the typed shape.
|
|
165
|
+
for (const mandatedToolId of pnpPolicyResult.mandatedToolIds) {
|
|
164
166
|
const removedByHost = !postHostCandidates.has(mandatedToolId);
|
|
165
167
|
if (!removedByHost)
|
|
166
168
|
continue;
|
|
167
|
-
const flag =
|
|
168
|
-
const ruleName = flag?.rule ?? "
|
|
169
|
+
const flag = pnpPolicyResult.perToolFlags.get(mandatedToolId);
|
|
170
|
+
const ruleName = flag?.rule ?? "required-tool";
|
|
169
171
|
const hostGate = detectHostRemovalGate(mandatedToolId, {
|
|
170
172
|
placement,
|
|
171
173
|
allowed,
|
|
@@ -178,28 +180,28 @@ export function composeDecision(inputs) {
|
|
|
178
180
|
hostValue: hostGate.hostValue,
|
|
179
181
|
};
|
|
180
182
|
diagnostics.push({
|
|
181
|
-
code: "tool-policy.
|
|
183
|
+
code: "tool-policy.requiredToolBlocked",
|
|
182
184
|
level: request.level,
|
|
183
185
|
toolId: mandatedToolId,
|
|
184
|
-
message: `
|
|
186
|
+
message: `Profile policy mandates "${mandatedToolId}" (${ruleName}) but host policy removed it from level "${request.level}" via ${hostGate.hostRule}.`,
|
|
185
187
|
details,
|
|
186
188
|
});
|
|
187
189
|
builder.addDecision({
|
|
188
190
|
precedence: 0,
|
|
189
|
-
rule: "
|
|
191
|
+
rule: "required-tool-blocked",
|
|
190
192
|
featureId: mandatedToolId,
|
|
191
193
|
action: "advisory",
|
|
192
194
|
sourceType: "host",
|
|
193
|
-
reason: `Host removed
|
|
195
|
+
reason: `Host removed required tool "${mandatedToolId}" via ${hostGate.hostRule}`,
|
|
194
196
|
value: details,
|
|
195
197
|
});
|
|
196
198
|
}
|
|
197
|
-
// 5c — attach
|
|
199
|
+
// 5c — attach PNP policy source tags to surviving entries.
|
|
198
200
|
for (const toolId of candidates) {
|
|
199
|
-
const flag =
|
|
201
|
+
const flag = pnpPolicyResult.perToolFlags.get(toolId);
|
|
200
202
|
if (flag) {
|
|
201
203
|
const tags = sourcesByTool.get(toolId) ?? [];
|
|
202
|
-
tags.push(`
|
|
204
|
+
tags.push(`pnp.${flag.rule}`);
|
|
203
205
|
sourcesByTool.set(toolId, tags);
|
|
204
206
|
}
|
|
205
207
|
}
|
|
@@ -283,7 +285,7 @@ export function composeDecision(inputs) {
|
|
|
283
285
|
}
|
|
284
286
|
const survivingIds = new Set(candidates);
|
|
285
287
|
const visibleTools = candidates.map((toolId) => {
|
|
286
|
-
const flag =
|
|
288
|
+
const flag = pnpPolicyResult?.perToolFlags.get(toolId);
|
|
287
289
|
return {
|
|
288
290
|
toolId,
|
|
289
291
|
required: flag?.required ?? false,
|
|
@@ -301,7 +303,7 @@ export function composeDecision(inputs) {
|
|
|
301
303
|
}
|
|
302
304
|
/**
|
|
303
305
|
* Identify which step-1-through-4 host gate removed a tool. Used by
|
|
304
|
-
* step 5b to enrich `tool-policy.
|
|
306
|
+
* step 5b to enrich `tool-policy.requiredToolBlocked` diagnostics. The
|
|
305
307
|
* checks mirror the pipeline order — step 1 (placement) first, step 4
|
|
306
308
|
* (blocklist) last — so the FIRST gate that would have matched wins,
|
|
307
309
|
* which is the gate the pipeline actually invoked. Subsequent gates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-decision.js","sourceRoot":"","sources":["../../../src/policy/core/compose-decision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,EAEN,iBAAiB,GACjB,MAAM,2CAA2C,CAAC;AAWnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAsB9D,MAAM,UAAU,eAAe,CAC9B,MAA6B;IAE7B,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"compose-decision.js","sourceRoot":"","sources":["../../../src/policy/core/compose-decision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,EAEN,iBAAiB,GACjB,MAAM,2CAA2C,CAAC;AAWnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAsB9D,MAAM,UAAU,eAAe,CAC9B,MAA6B;IAE7B,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IACvE,MAAM,OAAO,GAAG,IAAI,2BAA2B,CAAC,SAAS,CAAC,CAAC;IAE3D,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE;QACzB,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,OAAO;QACzB,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE;QACjD,MAAM,EAAE;YACP,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,MAAM,EAAE,KAAK,CAAC,MAAM;SACpB;KACD,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACpE,MAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,CAAC,MAAM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AAM,CAAC,EAAE,CAAC;QAC/D,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IAChE,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,OAAO;YACN,QAAQ,EAAE,cAAc;YACxB,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;SACnC,CAAC;IACH,CAAC;IACD,mEAAmE;IACnE,mEAAmE;IACnE,8DAA8D;IAC9D,kEAAkE;IAClE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;AACrE,CAAC"}
|
|
@@ -52,9 +52,9 @@ export interface ToolPolicyDecisionRequest {
|
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Diagnostic codes the engine may emit alongside a decision. The
|
|
55
|
-
* canonical case in M8 is `tool-policy.
|
|
55
|
+
* canonical case in M8 is `tool-policy.requiredToolBlocked` — fired
|
|
56
56
|
* when a host policy gate (`policy.blocked`, missing-from-`placement`,
|
|
57
|
-
* provider veto) removed a tool that
|
|
57
|
+
* provider veto) removed a tool that profile policy `requiredTools` /
|
|
58
58
|
* `district.requiredTools` mandates.
|
|
59
59
|
*
|
|
60
60
|
* `tool-policy.placementMissing` fires when a custom `PolicySource`
|
|
@@ -63,10 +63,10 @@ export interface ToolPolicyDecisionRequest {
|
|
|
63
63
|
* (already used by `tool-config-validation.ts`) covers config-time
|
|
64
64
|
* misconfiguration; this channel covers per-decision conflicts.
|
|
65
65
|
*/
|
|
66
|
-
export type ToolPolicyDiagnosticCode = "tool-policy.
|
|
66
|
+
export type ToolPolicyDiagnosticCode = "tool-policy.requiredToolBlocked" | "tool-policy.placementMissing";
|
|
67
67
|
/**
|
|
68
|
-
* Which host gate removed a
|
|
69
|
-
* `ToolPolicyDiagnostic.details` for `tool-policy.
|
|
68
|
+
* Which host gate removed a profile-mandated tool. Surfaced inside
|
|
69
|
+
* `ToolPolicyDiagnostic.details` for `tool-policy.requiredToolBlocked`
|
|
70
70
|
* so consumers can render a single human-readable explanation
|
|
71
71
|
* ("the proctor blocked the calculator that this student's IEP
|
|
72
72
|
* requires") without re-deriving the host gate from
|
|
@@ -80,14 +80,14 @@ export type ToolPolicyDiagnosticCode = "tool-policy.qtiRequiredBlocked" | "tool-
|
|
|
80
80
|
*/
|
|
81
81
|
export type ToolPolicyHostGate = "placement-missing" | "provider-disabled" | "host-allowlist" | "host-blocked";
|
|
82
82
|
/**
|
|
83
|
-
* Strongly-typed payload for `tool-policy.
|
|
83
|
+
* Strongly-typed payload for `tool-policy.requiredToolBlocked`
|
|
84
84
|
* diagnostics. The diagnostic's `details` field still types as
|
|
85
85
|
* `Record<string, unknown>` for forward compatibility, but engines
|
|
86
86
|
* always populate this exact shape today and consumers can safely
|
|
87
87
|
* cast.
|
|
88
88
|
*/
|
|
89
|
-
export interface
|
|
90
|
-
/** The
|
|
89
|
+
export interface RequiredToolBlockedDetails extends Record<string, unknown> {
|
|
90
|
+
/** The profile policy rule that mandated the tool (e.g. `district-requirement`). */
|
|
91
91
|
rule: string;
|
|
92
92
|
/** Which host gate removed the tool. */
|
|
93
93
|
hostRule: ToolPolicyHostGate;
|
|
@@ -105,7 +105,7 @@ export interface ToolPolicyDiagnostic {
|
|
|
105
105
|
export interface ToolPolicyEntry {
|
|
106
106
|
toolId: string;
|
|
107
107
|
/**
|
|
108
|
-
* `true` when
|
|
108
|
+
* `true` when PNP/profile policy mandates this tool (item or district
|
|
109
109
|
* `requiredTools`, or PNP support without prohibition). Advisory
|
|
110
110
|
* mandates that the host blocked do *not* surface here — they
|
|
111
111
|
* appear in `diagnostics` instead. Hosts that need to know about
|
|
@@ -121,7 +121,7 @@ export interface ToolPolicyEntry {
|
|
|
121
121
|
alwaysAvailable: boolean;
|
|
122
122
|
/**
|
|
123
123
|
* Tool-specific settings resolved from the assessment / item
|
|
124
|
-
* settings via the
|
|
124
|
+
* settings via the PNP policy source. Hosts that want to read these
|
|
125
125
|
* directly should use `entry.settings` rather than peeking into
|
|
126
126
|
* the assessment entity from above the engine.
|
|
127
127
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decision-types.d.ts","sourceRoot":"","sources":["../../../src/policy/core/decision-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,yBAAyB;IACzC;;;;;OAKG;IACH,KAAK,EAAE,kBAAkB,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,wBAAwB,GACjC,
|
|
1
|
+
{"version":3,"file":"decision-types.d.ts","sourceRoot":"","sources":["../../../src/policy/core/decision-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,E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AE,eAAe,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,OAAO,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IAClC,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,UAAU,EAAE,oBAAoB,CAAC;CACjC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* PNP/profile policy input detection (M8 PR 4 — see `.cursor/plans/m8-design.md` F2 and
|
|
3
3
|
* `.cursor/plans/m8-implementation-plan.md` § PR 4).
|
|
4
4
|
*
|
|
5
5
|
* Pure helpers that decide whether the inputs the engine has been given
|
|
6
|
-
* actually carry
|
|
6
|
+
* actually carry PNP/profile policy material. Used by:
|
|
7
7
|
*
|
|
8
8
|
* - {@link ToolPolicyEngine}'s constructor as the auto-default for
|
|
9
|
-
* `
|
|
9
|
+
* `pnpEnforcement` when the host did not pass an explicit `"on"` /
|
|
10
10
|
* `"off"`.
|
|
11
|
-
* - {@link ToolkitCoordinator.
|
|
11
|
+
* - {@link ToolkitCoordinator.resolveEffectivePnpEnforcement} as the
|
|
12
12
|
* auto-mode rule. PR 2 used a coarse "any non-null assessment → on"
|
|
13
13
|
* placeholder; PR 4 narrows it to "assessment OR currentItemRef
|
|
14
|
-
* carries
|
|
14
|
+
* carries profile policy material."
|
|
15
15
|
*
|
|
16
16
|
* The rule is intentionally narrow. Hosts that bind a bare assessment
|
|
17
17
|
* record (only `id` / `name`, no PNP and no settings) get the legacy
|
|
18
|
-
* floating-tools behavior —
|
|
18
|
+
* floating-tools behavior — PNP/profile gates do not engage. The flip happens
|
|
19
19
|
* the moment the assessment carries any of:
|
|
20
20
|
*
|
|
21
21
|
* - `personalNeedsProfile` (any `supports`, `prohibitedSupports`, or
|
|
@@ -28,40 +28,40 @@
|
|
|
28
28
|
* `requiredTools` / `restrictedTools` / `toolParameters`.
|
|
29
29
|
*
|
|
30
30
|
* Hosts opt out of the auto-on behavior by passing
|
|
31
|
-
* `
|
|
32
|
-
* `ToolkitCoordinator.
|
|
31
|
+
* `pnpEnforcement: "off"` explicitly (engine input or
|
|
32
|
+
* `ToolkitCoordinator.setPnpEnforcement("off")`).
|
|
33
33
|
*/
|
|
34
34
|
import type { AssessmentEntity, AssessmentItemRef } from "@pie-players/pie-players-shared/types";
|
|
35
35
|
/**
|
|
36
|
-
* Return `true` when the assessment carries any
|
|
37
|
-
* material that the engine's `
|
|
36
|
+
* Return `true` when the assessment carries any PNP/profile policy
|
|
37
|
+
* material that the engine's `PnpPolicySource` would consume.
|
|
38
38
|
*
|
|
39
39
|
* The check is structural — the presence of a non-empty PNP, district
|
|
40
40
|
* policy, or test administration block is enough; the content does not
|
|
41
41
|
* have to validate against any specific rule.
|
|
42
42
|
*/
|
|
43
|
-
export declare function
|
|
43
|
+
export declare function assessmentHasPnpPolicyInputs(assessment: AssessmentEntity | null | undefined): boolean;
|
|
44
44
|
/**
|
|
45
|
-
* Return `true` when the bound item reference carries item-level
|
|
45
|
+
* Return `true` when the bound item reference carries item-level profile policy
|
|
46
46
|
* material (`requiredTools`, `restrictedTools`, or `toolParameters`).
|
|
47
47
|
*
|
|
48
|
-
* Used in addition to {@link
|
|
49
|
-
* navigates to an item with
|
|
48
|
+
* Used in addition to {@link assessmentHasPnpPolicyInputs} so a host that
|
|
49
|
+
* navigates to an item with profile-relevant settings — without a parent
|
|
50
50
|
* assessment carrying its own PNP/district/test-admin block — still
|
|
51
|
-
* gets
|
|
51
|
+
* gets PNP/profile gates engaged for that item.
|
|
52
52
|
*/
|
|
53
|
-
export declare function
|
|
53
|
+
export declare function itemRefHasPnpPolicyInputs(itemRef: AssessmentItemRef | null | undefined): boolean;
|
|
54
54
|
/**
|
|
55
|
-
* Resolve the default `
|
|
55
|
+
* Resolve the default `pnpEnforcement` mode given the bound inputs.
|
|
56
56
|
*
|
|
57
|
-
* Returns `"on"` when {@link
|
|
58
|
-
* {@link
|
|
57
|
+
* Returns `"on"` when {@link assessmentHasPnpPolicyInputs} or
|
|
58
|
+
* {@link itemRefHasPnpPolicyInputs} reports any profile policy material; otherwise
|
|
59
59
|
* `"off"`. Hosts override the default by passing an explicit
|
|
60
|
-
* `
|
|
61
|
-
* `ToolkitCoordinator.
|
|
60
|
+
* `pnpEnforcement` value (engine input) or by calling
|
|
61
|
+
* `ToolkitCoordinator.setPnpEnforcement("on" | "off")`.
|
|
62
62
|
*/
|
|
63
|
-
export declare function
|
|
63
|
+
export declare function resolveDefaultPnpEnforcement(args: {
|
|
64
64
|
assessment?: AssessmentEntity | null;
|
|
65
65
|
currentItemRef?: AssessmentItemRef | null;
|
|
66
66
|
}): "on" | "off";
|
|
67
|
-
//# sourceMappingURL=
|
|
67
|
+
//# sourceMappingURL=pnp-policy-inputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pnp-policy-inputs.d.ts","sourceRoot":"","sources":["../../../src/policy/core/pnp-policy-inputs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EACX,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,uCAAuC,CAAC;AAE/C;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC3C,UAAU,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GAC7C,OAAO,CA4DT;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACxC,OAAO,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,GAC3C,OAAO,CAuBT;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IAClD,UAAU,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACrC,cAAc,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC1C,GAAG,IAAI,GAAG,KAAK,CAIf"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* PNP/profile policy input detection (M8 PR 4 — see `.cursor/plans/m8-design.md` F2 and
|
|
3
3
|
* `.cursor/plans/m8-implementation-plan.md` § PR 4).
|
|
4
4
|
*
|
|
5
5
|
* Pure helpers that decide whether the inputs the engine has been given
|
|
6
|
-
* actually carry
|
|
6
|
+
* actually carry PNP/profile policy material. Used by:
|
|
7
7
|
*
|
|
8
8
|
* - {@link ToolPolicyEngine}'s constructor as the auto-default for
|
|
9
|
-
* `
|
|
9
|
+
* `pnpEnforcement` when the host did not pass an explicit `"on"` /
|
|
10
10
|
* `"off"`.
|
|
11
|
-
* - {@link ToolkitCoordinator.
|
|
11
|
+
* - {@link ToolkitCoordinator.resolveEffectivePnpEnforcement} as the
|
|
12
12
|
* auto-mode rule. PR 2 used a coarse "any non-null assessment → on"
|
|
13
13
|
* placeholder; PR 4 narrows it to "assessment OR currentItemRef
|
|
14
|
-
* carries
|
|
14
|
+
* carries profile policy material."
|
|
15
15
|
*
|
|
16
16
|
* The rule is intentionally narrow. Hosts that bind a bare assessment
|
|
17
17
|
* record (only `id` / `name`, no PNP and no settings) get the legacy
|
|
18
|
-
* floating-tools behavior —
|
|
18
|
+
* floating-tools behavior — PNP/profile gates do not engage. The flip happens
|
|
19
19
|
* the moment the assessment carries any of:
|
|
20
20
|
*
|
|
21
21
|
* - `personalNeedsProfile` (any `supports`, `prohibitedSupports`, or
|
|
@@ -28,18 +28,18 @@
|
|
|
28
28
|
* `requiredTools` / `restrictedTools` / `toolParameters`.
|
|
29
29
|
*
|
|
30
30
|
* Hosts opt out of the auto-on behavior by passing
|
|
31
|
-
* `
|
|
32
|
-
* `ToolkitCoordinator.
|
|
31
|
+
* `pnpEnforcement: "off"` explicitly (engine input or
|
|
32
|
+
* `ToolkitCoordinator.setPnpEnforcement("off")`).
|
|
33
33
|
*/
|
|
34
34
|
/**
|
|
35
|
-
* Return `true` when the assessment carries any
|
|
36
|
-
* material that the engine's `
|
|
35
|
+
* Return `true` when the assessment carries any PNP/profile policy
|
|
36
|
+
* material that the engine's `PnpPolicySource` would consume.
|
|
37
37
|
*
|
|
38
38
|
* The check is structural — the presence of a non-empty PNP, district
|
|
39
39
|
* policy, or test administration block is enough; the content does not
|
|
40
40
|
* have to validate against any specific rule.
|
|
41
41
|
*/
|
|
42
|
-
export function
|
|
42
|
+
export function assessmentHasPnpPolicyInputs(assessment) {
|
|
43
43
|
if (!assessment)
|
|
44
44
|
return false;
|
|
45
45
|
const pnp = assessment.personalNeedsProfile;
|
|
@@ -93,15 +93,15 @@ export function assessmentHasQtiInputs(assessment) {
|
|
|
93
93
|
return false;
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
|
-
* Return `true` when the bound item reference carries item-level
|
|
96
|
+
* Return `true` when the bound item reference carries item-level profile policy
|
|
97
97
|
* material (`requiredTools`, `restrictedTools`, or `toolParameters`).
|
|
98
98
|
*
|
|
99
|
-
* Used in addition to {@link
|
|
100
|
-
* navigates to an item with
|
|
99
|
+
* Used in addition to {@link assessmentHasPnpPolicyInputs} so a host that
|
|
100
|
+
* navigates to an item with profile-relevant settings — without a parent
|
|
101
101
|
* assessment carrying its own PNP/district/test-admin block — still
|
|
102
|
-
* gets
|
|
102
|
+
* gets PNP/profile gates engaged for that item.
|
|
103
103
|
*/
|
|
104
|
-
export function
|
|
104
|
+
export function itemRefHasPnpPolicyInputs(itemRef) {
|
|
105
105
|
const settings = itemRef?.settings;
|
|
106
106
|
if (!settings)
|
|
107
107
|
return false;
|
|
@@ -121,19 +121,19 @@ export function itemRefHasQtiInputs(itemRef) {
|
|
|
121
121
|
return false;
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
|
-
* Resolve the default `
|
|
124
|
+
* Resolve the default `pnpEnforcement` mode given the bound inputs.
|
|
125
125
|
*
|
|
126
|
-
* Returns `"on"` when {@link
|
|
127
|
-
* {@link
|
|
126
|
+
* Returns `"on"` when {@link assessmentHasPnpPolicyInputs} or
|
|
127
|
+
* {@link itemRefHasPnpPolicyInputs} reports any profile policy material; otherwise
|
|
128
128
|
* `"off"`. Hosts override the default by passing an explicit
|
|
129
|
-
* `
|
|
130
|
-
* `ToolkitCoordinator.
|
|
129
|
+
* `pnpEnforcement` value (engine input) or by calling
|
|
130
|
+
* `ToolkitCoordinator.setPnpEnforcement("on" | "off")`.
|
|
131
131
|
*/
|
|
132
|
-
export function
|
|
133
|
-
if (
|
|
132
|
+
export function resolveDefaultPnpEnforcement(args) {
|
|
133
|
+
if (assessmentHasPnpPolicyInputs(args.assessment))
|
|
134
134
|
return "on";
|
|
135
|
-
if (
|
|
135
|
+
if (itemRefHasPnpPolicyInputs(args.currentItemRef))
|
|
136
136
|
return "on";
|
|
137
137
|
return "off";
|
|
138
138
|
}
|
|
139
|
-
//# sourceMappingURL=
|
|
139
|
+
//# sourceMappingURL=pnp-policy-inputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pnp-policy-inputs.js","sourceRoot":"","sources":["../../../src/policy/core/pnp-policy-inputs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAOH;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAC3C,UAA+C;IAE/C,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAC9B,MAAM,GAAG,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAC5C,IAAI,GAAG,EAAE,CAAC;QACT,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,G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AAC;AACd,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,4BAA4B,CAAC,IAG5C;IACA,IAAI,4BAA4B,CAAC,IAAI,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/D,IAAI,yBAAyB,CAAC,IAAI,CAAC,cAAc,CAAC;QAAE,OAAO,IAAI,CAAC;IAChE,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The engine attaches a `PolicySourceTag` to every `ToolPolicyEntry` it
|
|
5
5
|
* emits, capturing every step from `compose-decision.ts` that contributed
|
|
6
|
-
* to the entry being kept (or, in the case of `
|
|
6
|
+
* to the entry being kept (or, in the case of `required-tool-blocked`,
|
|
7
7
|
* the step that surfaced the conflict).
|
|
8
8
|
*
|
|
9
9
|
* Tag vocabulary maps onto the six composition steps in
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* non-`enabled: false` check)
|
|
16
16
|
* 3. Host whitelist → `"policy"`
|
|
17
17
|
* 4. Host blocklist → `"policy"` (negative)
|
|
18
|
-
* 5.
|
|
19
|
-
* `"
|
|
18
|
+
* 5. PNP/profile gates → `"pnp.${rule}"` (e.g. `"pnp.pnp-support"`,
|
|
19
|
+
* `"pnp.item-requirement"`)
|
|
20
20
|
* 6. Custom PolicySources → `"custom.${source.id}"`
|
|
21
21
|
*
|
|
22
22
|
* Negative tags do not appear on surviving entries — they are reflected
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
* *removed* one. Diagnostic surfacing of removals is the
|
|
26
26
|
* provenance/diagnostic channel's job.
|
|
27
27
|
*/
|
|
28
|
-
export type
|
|
29
|
-
export type
|
|
28
|
+
export type PnpPolicySourceRule = "district-block" | "test-admin-override" | "item-restriction" | "item-requirement" | "district-requirement" | "pnp-support" | "pnp-prohibited";
|
|
29
|
+
export type PnpPolicySourceTag = `pnp.${PnpPolicySourceRule}`;
|
|
30
30
|
export type CustomPolicySourceTag = `custom.${string}`;
|
|
31
|
-
export type PolicySourceTag = "placement" | "policy" | "provider" |
|
|
31
|
+
export type PolicySourceTag = "placement" | "policy" | "provider" | PnpPolicySourceTag | CustomPolicySourceTag;
|
|
32
32
|
//# sourceMappingURL=policy-source-tag.d.ts.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The engine attaches a `PolicySourceTag` to every `ToolPolicyEntry` it
|
|
5
5
|
* emits, capturing every step from `compose-decision.ts` that contributed
|
|
6
|
-
* to the entry being kept (or, in the case of `
|
|
6
|
+
* to the entry being kept (or, in the case of `required-tool-blocked`,
|
|
7
7
|
* the step that surfaced the conflict).
|
|
8
8
|
*
|
|
9
9
|
* Tag vocabulary maps onto the six composition steps in
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* non-`enabled: false` check)
|
|
16
16
|
* 3. Host whitelist → `"policy"`
|
|
17
17
|
* 4. Host blocklist → `"policy"` (negative)
|
|
18
|
-
* 5.
|
|
19
|
-
* `"
|
|
18
|
+
* 5. PNP/profile gates → `"pnp.${rule}"` (e.g. `"pnp.pnp-support"`,
|
|
19
|
+
* `"pnp.item-requirement"`)
|
|
20
20
|
* 6. Custom PolicySources → `"custom.${source.id}"`
|
|
21
21
|
*
|
|
22
22
|
* Negative tags do not appear on surviving entries — they are reflected
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Today's `PnpResolutionProvenance` (in `services/pnp-provenance.ts`)
|
|
6
6
|
* tracks decisions made by `PnpToolResolver` only. M8 generalizes the
|
|
7
7
|
* shape to track decisions from every Pass-1 contributor — host
|
|
8
|
-
* placement, host policy, provider veto,
|
|
8
|
+
* placement, host policy, provider veto, PNP/profile gates, and custom policy
|
|
9
9
|
* sources — without losing PNP debugger compatibility.
|
|
10
10
|
*
|
|
11
11
|
* **Compatibility posture.** This module is the new home of the shape;
|
|
@@ -15,30 +15,30 @@
|
|
|
15
15
|
* fields (`contextId`, `resolvedAt`, `sources`, `features`,
|
|
16
16
|
* `decisionLog`, `summary`) are preserved verbatim. The rule
|
|
17
17
|
* vocabulary expands, and `ResolutionDecision.precedence` widens from
|
|
18
|
-
* `1 | 2 | 3 | 4 | 5 | 6` to a `number` so non-
|
|
19
|
-
* (the
|
|
18
|
+
* `1 | 2 | 3 | 4 | 5 | 6` to a `number` so non-profile rules can fit
|
|
19
|
+
* (the PNP/profile rules continue to use `1`–`6` exactly as before).
|
|
20
20
|
*/
|
|
21
21
|
/**
|
|
22
22
|
* Expanded rule vocabulary for `ResolutionDecision.rule` in M8.
|
|
23
23
|
*
|
|
24
24
|
* The first six values map 1:1 onto `PnpResolutionProvenance`'s
|
|
25
|
-
* existing rule names (the
|
|
25
|
+
* existing rule names (the PNP/profile precedence ladder). The remaining
|
|
26
26
|
* values capture the new contributors the M8 engine surfaces:
|
|
27
27
|
* placement membership (step 1), provider veto (step 2), host policy
|
|
28
|
-
* (steps 3 / 4), the
|
|
28
|
+
* (steps 3 / 4), the required-tool conflict diagnostic (`required-tool-blocked`),
|
|
29
29
|
* custom sources (step 6), and the catch-all `system-default` for the
|
|
30
30
|
* "not configured at any level" fallback.
|
|
31
31
|
*/
|
|
32
|
-
export type ToolPolicyDecisionRule = "district-block" | "test-admin-override" | "item-restriction" | "item-requirement" | "district-requirement" | "pnp-support" | "pnp-prohibited" | "placement-membership" | "provider-disabled" | "host-allowlist" | "host-blocked" | "
|
|
32
|
+
export type ToolPolicyDecisionRule = "district-block" | "test-admin-override" | "item-restriction" | "item-requirement" | "district-requirement" | "pnp-support" | "pnp-prohibited" | "placement-membership" | "provider-disabled" | "host-allowlist" | "host-blocked" | "required-tool-blocked" | "custom-source" | "system-default";
|
|
33
33
|
export type ToolPolicySourceType = "organization" | "assessment" | "section" | "item" | "student" | "system" | "host" | "custom";
|
|
34
34
|
export interface ToolPolicyResolutionDecision {
|
|
35
35
|
/** Monotonic step index across the entire decision log. */
|
|
36
36
|
step: number;
|
|
37
37
|
/**
|
|
38
|
-
* Precedence level.
|
|
39
|
-
* `PnpResolutionProvenance`. Non-
|
|
40
|
-
* gates that always fire before
|
|
41
|
-
* fire after
|
|
38
|
+
* Precedence level. PNP/profile rules use `1`–`6` exactly as in today's
|
|
39
|
+
* `PnpResolutionProvenance`. Non-profile rules use `0` (host-side
|
|
40
|
+
* gates that always fire before PNP/profile policy) or `7+` (custom sources that
|
|
41
|
+
* fire after PNP/profile policy).
|
|
42
42
|
*/
|
|
43
43
|
precedence: number;
|
|
44
44
|
rule: ToolPolicyDecisionRule;
|
|
@@ -140,7 +140,7 @@ export declare class ToolPolicyProvenanceBuilder {
|
|
|
140
140
|
* highest-precedence non-skip decision per feature, but a tool's
|
|
141
141
|
* *actual* visibility is only known after step 6 of the
|
|
142
142
|
* composition pipeline — earlier decisions can be reversed by
|
|
143
|
-
* later host gates,
|
|
143
|
+
* later host gates, PNP/profile gates, or custom sources. This method
|
|
144
144
|
* walks every feature trail and rewrites `finalState` from the
|
|
145
145
|
* final candidate set so callers can rely on
|
|
146
146
|
* `provenance.features.get(toolId)?.finalState` as the canonical
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../../../src/policy/core/provenance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,sBAAsB,GAC/B,gBAAgB,GAChB,qBAAqB,GACrB,kBAAkB,GAClB,kBAAkB,GAClB,sBAAsB,GACtB,aAAa,GACb,gBAAgB,GAChB,sBAAsB,GACtB,mBAAmB,GACnB,gBAAgB,GAChB,cAAc,GACd,
|
|
1
|
+
{"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../../../src/policy/core/provenance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,sBAAsB,GAC/B,gBAAgB,GAChB,qBAAqB,GACrB,kBAAkB,GAClB,kBAAkB,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