@lssm/example.policy-safe-knowledge-assistant 0.0.0-canary-20251220002821 → 0.0.0-canary-20251220015515

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.
@@ -6,7 +6,7 @@ $ tsdown
6
6
  ℹ tsconfig: tsconfig.json
7
7
  ℹ Build start
8
8
  ℹ Cleaning 97 files
9
- ℹ dist/orchestrator/buildAnswer.js  2.44 kB │ gzip: 0.93 kB
9
+ ℹ dist/orchestrator/buildAnswer.js  2.46 kB │ gzip: 0.93 kB
10
10
  ℹ dist/feature.js  2.23 kB │ gzip: 0.67 kB
11
11
  ℹ dist/docs/policy-safe-knowledge-assistant.docblock.js  1.94 kB │ gzip: 0.92 kB
12
12
  ℹ dist/example.js  1.01 kB │ gzip: 0.51 kB
@@ -27,7 +27,7 @@ $ tsdown
27
27
  ℹ dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js  5.90 kB │ gzip: 2.68 kB
28
28
  ℹ dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js  5.71 kB │ gzip: 2.36 kB
29
29
  ℹ dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map  5.10 kB │ gzip: 1.98 kB
30
- ℹ dist/orchestrator/buildAnswer.js.map  5.03 kB │ gzip: 1.68 kB
30
+ ℹ dist/orchestrator/buildAnswer.js.map  5.07 kB │ gzip: 1.67 kB
31
31
  ℹ dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js.map  4.64 kB │ gzip: 1.68 kB
32
32
  ℹ dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map  4.24 kB │ gzip: 1.72 kB
33
33
  ℹ dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js  4.21 kB │ gzip: 1.80 kB
@@ -84,5 +84,5 @@ $ tsdown
84
84
  ℹ dist/seed/index.d.ts  0.07 kB │ gzip: 0.07 kB
85
85
  ℹ dist/docs/index.d.ts  0.01 kB │ gzip: 0.03 kB
86
86
  ℹ dist/docs/policy-safe-knowledge-assistant.docblock.d.ts  0.01 kB │ gzip: 0.03 kB
87
- ℹ 78 files, total: 265.24 kB
88
- ✔ Build complete in 34152ms
87
+ ℹ 78 files, total: 265.30 kB
88
+ ✔ Build complete in 38422ms
@@ -6,7 +6,7 @@ $ tsdown
6
6
  ℹ target: esnext
7
7
  ℹ tsconfig: tsconfig.json
8
8
  ℹ Build start
9
- ℹ dist/orchestrator/buildAnswer.js  2.44 kB │ gzip: 0.93 kB
9
+ ℹ dist/orchestrator/buildAnswer.js  2.46 kB │ gzip: 0.93 kB
10
10
  ℹ dist/feature.js  2.23 kB │ gzip: 0.67 kB
11
11
  ℹ dist/docs/policy-safe-knowledge-assistant.docblock.js  1.94 kB │ gzip: 0.92 kB
12
12
  ℹ dist/example.js  1.01 kB │ gzip: 0.51 kB
@@ -27,7 +27,7 @@ $ tsdown
27
27
  ℹ dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js  5.90 kB │ gzip: 2.68 kB
28
28
  ℹ dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js  5.71 kB │ gzip: 2.36 kB
29
29
  ℹ dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map  5.10 kB │ gzip: 1.98 kB
30
- ℹ dist/orchestrator/buildAnswer.js.map  5.03 kB │ gzip: 1.68 kB
30
+ ℹ dist/orchestrator/buildAnswer.js.map  5.07 kB │ gzip: 1.67 kB
31
31
  ℹ dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js.map  4.64 kB │ gzip: 1.68 kB
32
32
  ℹ dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map  4.24 kB │ gzip: 1.72 kB
33
33
  ℹ dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js  4.21 kB │ gzip: 1.80 kB
@@ -84,6 +84,6 @@ $ tsdown
84
84
  ℹ dist/seed/index.d.ts  0.07 kB │ gzip: 0.07 kB
85
85
  ℹ dist/docs/index.d.ts  0.01 kB │ gzip: 0.03 kB
86
86
  ℹ dist/docs/policy-safe-knowledge-assistant.docblock.d.ts  0.01 kB │ gzip: 0.03 kB
87
- ℹ 78 files, total: 265.24 kB
88
- ✔ Build complete in 41784ms
87
+ ℹ 78 files, total: 265.30 kB
88
+ ✔ Build complete in 42323ms
89
89
  $ tsc --noEmit
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @lssm/example.policy-safe-knowledge-assistant
2
2
 
3
- ## 0.0.0-canary-20251220002821
3
+ ## 0.0.0-canary-20251220015515
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -9,17 +9,17 @@
9
9
  ### Patch Changes
10
10
 
11
11
  - Updated dependencies [66a5dfd]
12
- - @lssm/example.kb-update-pipeline@0.0.0-canary-20251220002821
13
- - @lssm/example.learning-patterns@0.0.0-canary-20251220002821
14
- - @lssm/example.locale-jurisdiction-gate@0.0.0-canary-20251220002821
15
- - @lssm/example.versioned-knowledge-base@0.0.0-canary-20251220002821
16
- - @lssm/lib.contracts@0.0.0-canary-20251220002821
17
- - @lssm/lib.feature-flags@0.0.0-canary-20251220002821
18
- - @lssm/lib.files@0.0.0-canary-20251220002821
19
- - @lssm/lib.identity-rbac@0.0.0-canary-20251220002821
20
- - @lssm/lib.jobs@0.0.0-canary-20251220002821
21
- - @lssm/lib.metering@0.0.0-canary-20251220002821
22
- - @lssm/lib.schema@0.0.0-canary-20251220002821
23
- - @lssm/module.audit-trail@0.0.0-canary-20251220002821
24
- - @lssm/module.learning-journey@0.0.0-canary-20251220002821
25
- - @lssm/module.notifications@0.0.0-canary-20251220002821
12
+ - @lssm/example.kb-update-pipeline@0.0.0-canary-20251220015515
13
+ - @lssm/example.learning-patterns@0.0.0-canary-20251220015515
14
+ - @lssm/example.locale-jurisdiction-gate@0.0.0-canary-20251220015515
15
+ - @lssm/example.versioned-knowledge-base@0.0.0-canary-20251220015515
16
+ - @lssm/lib.contracts@0.0.0-canary-20251220015515
17
+ - @lssm/lib.feature-flags@0.0.0-canary-20251220015515
18
+ - @lssm/lib.files@0.0.0-canary-20251220015515
19
+ - @lssm/lib.identity-rbac@0.0.0-canary-20251220015515
20
+ - @lssm/lib.jobs@0.0.0-canary-20251220015515
21
+ - @lssm/lib.metering@0.0.0-canary-20251220015515
22
+ - @lssm/lib.schema@0.0.0-canary-20251220015515
23
+ - @lssm/module.audit-trail@0.0.0-canary-20251220015515
24
+ - @lssm/module.learning-journey@0.0.0-canary-20251220015515
25
+ - @lssm/module.notifications@0.0.0-canary-20251220015515
@@ -24,7 +24,7 @@ async function buildPolicySafeAnswer(input) {
24
24
  };
25
25
  const results = await input.kbSearch({
26
26
  snapshotId: env.value.kbSnapshotId,
27
- jurisdiction: env.value.regulatoryContext.jurisdiction,
27
+ jurisdiction: env.value.regulatoryContext?.jurisdiction ?? "UNKNOWN",
28
28
  query: input.question
29
29
  });
30
30
  const citations = results.items.map((item) => ({
@@ -36,7 +36,7 @@ async function buildPolicySafeAnswer(input) {
36
36
  }));
37
37
  const draft = {
38
38
  locale: env.value.locale,
39
- jurisdiction: env.value.regulatoryContext.jurisdiction,
39
+ jurisdiction: env.value.regulatoryContext?.jurisdiction ?? "UNKNOWN",
40
40
  allowedScope: env.value.allowedScope,
41
41
  sections: [{
42
42
  heading: "Answer (KB-derived)",
@@ -1 +1 @@
1
- {"version":3,"file":"buildAnswer.js","names":["draft: AssistantAnswerIR"],"sources":["../../src/orchestrator/buildAnswer.ts"],"sourcesContent":["import {\n enforceAllowedScope,\n enforceCitations,\n validateEnvelope,\n} from '@lssm/example.locale-jurisdiction-gate/policy/guard';\n\ntype AllowedScope = 'education_only' | 'generic_info' | 'escalation_required';\n\nexport interface AssistantAnswerIR {\n locale: string;\n jurisdiction: string;\n allowedScope: AllowedScope;\n sections: { heading: string; body: string }[];\n citations: {\n kbSnapshotId: string;\n sourceType: string;\n sourceId: string;\n title?: string;\n excerpt?: string;\n }[];\n disclaimers?: string[];\n riskFlags?: string[];\n refused?: boolean;\n refusalReason?: string;\n}\n\nexport interface BuildAnswerInput {\n envelope: {\n traceId: string;\n locale: string;\n kbSnapshotId: string;\n allowedScope: AllowedScope;\n regulatoryContext: { jurisdiction: string };\n };\n question: string;\n kbSearch: (input: {\n snapshotId: string;\n jurisdiction: string;\n query: string;\n }) => Promise<{ items: { ruleVersionId: string; excerpt?: string }[] }>;\n}\n\n/**\n * Build a policy-safe assistant answer derived from KB search results.\n *\n * Deterministic: no LLM calls; if search yields no results, it refuses.\n */\nexport async function buildPolicySafeAnswer(\n input: BuildAnswerInput\n): Promise<AssistantAnswerIR> {\n const env = validateEnvelope(input.envelope);\n if (!env.ok) {\n return {\n locale: input.envelope.locale ?? 'en-GB',\n jurisdiction: input.envelope.regulatoryContext?.jurisdiction ?? 'UNKNOWN',\n allowedScope: input.envelope.allowedScope ?? 'education_only',\n sections: [{ heading: 'Request blocked', body: env.error.message }],\n citations: [],\n disclaimers: ['This system refuses to answer without a valid envelope.'],\n riskFlags: [env.error.code],\n refused: true,\n refusalReason: env.error.code,\n };\n }\n\n const results = await input.kbSearch({\n snapshotId: env.value.kbSnapshotId,\n jurisdiction: env.value.regulatoryContext!.jurisdiction!,\n query: input.question,\n });\n\n const citations = results.items.map((item) => ({\n kbSnapshotId: env.value.kbSnapshotId,\n sourceType: 'ruleVersion',\n sourceId: item.ruleVersionId,\n title: 'Curated rule version',\n excerpt: item.excerpt,\n }));\n\n const draft: AssistantAnswerIR = {\n locale: env.value.locale,\n jurisdiction: env.value.regulatoryContext!.jurisdiction!,\n allowedScope: env.value.allowedScope,\n sections: [\n {\n heading: 'Answer (KB-derived)',\n body:\n results.items.length > 0\n ? `This answer is derived from ${results.items.length} curated rule version(s) in the referenced snapshot.`\n : 'No curated knowledge found in the referenced snapshot.',\n },\n ],\n citations,\n disclaimers: ['Educational demo only.'],\n riskFlags: [],\n };\n\n const scope = enforceAllowedScope(env.value.allowedScope, draft);\n if (!scope.ok) {\n return {\n ...draft,\n sections: [{ heading: 'Escalation required', body: scope.error.message }],\n refused: true,\n refusalReason: scope.error.code,\n riskFlags: [...(draft.riskFlags ?? []), scope.error.code],\n };\n }\n\n const cited = enforceCitations(draft);\n if (!cited.ok) {\n return {\n ...draft,\n sections: [{ heading: 'Request blocked', body: cited.error.message }],\n citations: [],\n refused: true,\n refusalReason: cited.error.code,\n riskFlags: [...(draft.riskFlags ?? []), cited.error.code],\n };\n }\n\n return draft;\n}\n"],"mappings":";;;;;;;;AA+CA,eAAsB,sBACpB,OAC4B;CAC5B,MAAM,MAAM,iBAAiB,MAAM,SAAS;AAC5C,KAAI,CAAC,IAAI,GACP,QAAO;EACL,QAAQ,MAAM,SAAS,UAAU;EACjC,cAAc,MAAM,SAAS,mBAAmB,gBAAgB;EAChE,cAAc,MAAM,SAAS,gBAAgB;EAC7C,UAAU,CAAC;GAAE,SAAS;GAAmB,MAAM,IAAI,MAAM;GAAS,CAAC;EACnE,WAAW,EAAE;EACb,aAAa,CAAC,0DAA0D;EACxE,WAAW,CAAC,IAAI,MAAM,KAAK;EAC3B,SAAS;EACT,eAAe,IAAI,MAAM;EAC1B;CAGH,MAAM,UAAU,MAAM,MAAM,SAAS;EACnC,YAAY,IAAI,MAAM;EACtB,cAAc,IAAI,MAAM,kBAAmB;EAC3C,OAAO,MAAM;EACd,CAAC;CAEF,MAAM,YAAY,QAAQ,MAAM,KAAK,UAAU;EAC7C,cAAc,IAAI,MAAM;EACxB,YAAY;EACZ,UAAU,KAAK;EACf,OAAO;EACP,SAAS,KAAK;EACf,EAAE;CAEH,MAAMA,QAA2B;EAC/B,QAAQ,IAAI,MAAM;EAClB,cAAc,IAAI,MAAM,kBAAmB;EAC3C,cAAc,IAAI,MAAM;EACxB,UAAU,CACR;GACE,SAAS;GACT,MACE,QAAQ,MAAM,SAAS,IACnB,+BAA+B,QAAQ,MAAM,OAAO,wDACpD;GACP,CACF;EACD;EACA,aAAa,CAAC,yBAAyB;EACvC,WAAW,EAAE;EACd;CAED,MAAM,QAAQ,oBAAoB,IAAI,MAAM,cAAc,MAAM;AAChE,KAAI,CAAC,MAAM,GACT,QAAO;EACL,GAAG;EACH,UAAU,CAAC;GAAE,SAAS;GAAuB,MAAM,MAAM,MAAM;GAAS,CAAC;EACzE,SAAS;EACT,eAAe,MAAM,MAAM;EAC3B,WAAW,CAAC,GAAI,MAAM,aAAa,EAAE,EAAG,MAAM,MAAM,KAAK;EAC1D;CAGH,MAAM,QAAQ,iBAAiB,MAAM;AACrC,KAAI,CAAC,MAAM,GACT,QAAO;EACL,GAAG;EACH,UAAU,CAAC;GAAE,SAAS;GAAmB,MAAM,MAAM,MAAM;GAAS,CAAC;EACrE,WAAW,EAAE;EACb,SAAS;EACT,eAAe,MAAM,MAAM;EAC3B,WAAW,CAAC,GAAI,MAAM,aAAa,EAAE,EAAG,MAAM,MAAM,KAAK;EAC1D;AAGH,QAAO"}
1
+ {"version":3,"file":"buildAnswer.js","names":["draft: AssistantAnswerIR"],"sources":["../../src/orchestrator/buildAnswer.ts"],"sourcesContent":["import {\n enforceAllowedScope,\n enforceCitations,\n validateEnvelope,\n} from '@lssm/example.locale-jurisdiction-gate/policy/guard';\n\ntype AllowedScope = 'education_only' | 'generic_info' | 'escalation_required';\n\nexport interface AssistantAnswerIR {\n locale: string;\n jurisdiction: string;\n allowedScope: AllowedScope;\n sections: { heading: string; body: string }[];\n citations: {\n kbSnapshotId: string;\n sourceType: string;\n sourceId: string;\n title?: string;\n excerpt?: string;\n }[];\n disclaimers?: string[];\n riskFlags?: string[];\n refused?: boolean;\n refusalReason?: string;\n}\n\nexport interface BuildAnswerInput {\n envelope: {\n traceId: string;\n locale: string;\n kbSnapshotId: string;\n allowedScope: AllowedScope;\n regulatoryContext: { jurisdiction: string };\n };\n question: string;\n kbSearch: (input: {\n snapshotId: string;\n jurisdiction: string;\n query: string;\n }) => Promise<{ items: { ruleVersionId: string; excerpt?: string }[] }>;\n}\n\n/**\n * Build a policy-safe assistant answer derived from KB search results.\n *\n * Deterministic: no LLM calls; if search yields no results, it refuses.\n */\nexport async function buildPolicySafeAnswer(\n input: BuildAnswerInput\n): Promise<AssistantAnswerIR> {\n const env = validateEnvelope(input.envelope);\n if (!env.ok) {\n return {\n locale: input.envelope.locale ?? 'en-GB',\n jurisdiction: input.envelope.regulatoryContext?.jurisdiction ?? 'UNKNOWN',\n allowedScope: input.envelope.allowedScope ?? 'education_only',\n sections: [{ heading: 'Request blocked', body: env.error.message }],\n citations: [],\n disclaimers: ['This system refuses to answer without a valid envelope.'],\n riskFlags: [env.error.code],\n refused: true,\n refusalReason: env.error.code,\n };\n }\n\n const results = await input.kbSearch({\n snapshotId: env.value.kbSnapshotId,\n jurisdiction: env.value.regulatoryContext?.jurisdiction ?? 'UNKNOWN',\n query: input.question,\n });\n\n const citations = results.items.map((item) => ({\n kbSnapshotId: env.value.kbSnapshotId,\n sourceType: 'ruleVersion',\n sourceId: item.ruleVersionId,\n title: 'Curated rule version',\n excerpt: item.excerpt,\n }));\n\n const draft: AssistantAnswerIR = {\n locale: env.value.locale,\n jurisdiction: env.value.regulatoryContext?.jurisdiction ?? 'UNKNOWN',\n allowedScope: env.value.allowedScope,\n sections: [\n {\n heading: 'Answer (KB-derived)',\n body:\n results.items.length > 0\n ? `This answer is derived from ${results.items.length} curated rule version(s) in the referenced snapshot.`\n : 'No curated knowledge found in the referenced snapshot.',\n },\n ],\n citations,\n disclaimers: ['Educational demo only.'],\n riskFlags: [],\n };\n\n const scope = enforceAllowedScope(env.value.allowedScope, draft);\n if (!scope.ok) {\n return {\n ...draft,\n sections: [{ heading: 'Escalation required', body: scope.error.message }],\n refused: true,\n refusalReason: scope.error.code,\n riskFlags: [...(draft.riskFlags ?? []), scope.error.code],\n };\n }\n\n const cited = enforceCitations(draft);\n if (!cited.ok) {\n return {\n ...draft,\n sections: [{ heading: 'Request blocked', body: cited.error.message }],\n citations: [],\n refused: true,\n refusalReason: cited.error.code,\n riskFlags: [...(draft.riskFlags ?? []), cited.error.code],\n };\n }\n\n return draft;\n}\n"],"mappings":";;;;;;;;AA+CA,eAAsB,sBACpB,OAC4B;CAC5B,MAAM,MAAM,iBAAiB,MAAM,SAAS;AAC5C,KAAI,CAAC,IAAI,GACP,QAAO;EACL,QAAQ,MAAM,SAAS,UAAU;EACjC,cAAc,MAAM,SAAS,mBAAmB,gBAAgB;EAChE,cAAc,MAAM,SAAS,gBAAgB;EAC7C,UAAU,CAAC;GAAE,SAAS;GAAmB,MAAM,IAAI,MAAM;GAAS,CAAC;EACnE,WAAW,EAAE;EACb,aAAa,CAAC,0DAA0D;EACxE,WAAW,CAAC,IAAI,MAAM,KAAK;EAC3B,SAAS;EACT,eAAe,IAAI,MAAM;EAC1B;CAGH,MAAM,UAAU,MAAM,MAAM,SAAS;EACnC,YAAY,IAAI,MAAM;EACtB,cAAc,IAAI,MAAM,mBAAmB,gBAAgB;EAC3D,OAAO,MAAM;EACd,CAAC;CAEF,MAAM,YAAY,QAAQ,MAAM,KAAK,UAAU;EAC7C,cAAc,IAAI,MAAM;EACxB,YAAY;EACZ,UAAU,KAAK;EACf,OAAO;EACP,SAAS,KAAK;EACf,EAAE;CAEH,MAAMA,QAA2B;EAC/B,QAAQ,IAAI,MAAM;EAClB,cAAc,IAAI,MAAM,mBAAmB,gBAAgB;EAC3D,cAAc,IAAI,MAAM;EACxB,UAAU,CACR;GACE,SAAS;GACT,MACE,QAAQ,MAAM,SAAS,IACnB,+BAA+B,QAAQ,MAAM,OAAO,wDACpD;GACP,CACF;EACD;EACA,aAAa,CAAC,yBAAyB;EACvC,WAAW,EAAE;EACd;CAED,MAAM,QAAQ,oBAAoB,IAAI,MAAM,cAAc,MAAM;AAChE,KAAI,CAAC,MAAM,GACT,QAAO;EACL,GAAG;EACH,UAAU,CAAC;GAAE,SAAS;GAAuB,MAAM,MAAM,MAAM;GAAS,CAAC;EACzE,SAAS;EACT,eAAe,MAAM,MAAM;EAC3B,WAAW,CAAC,GAAI,MAAM,aAAa,EAAE,EAAG,MAAM,MAAM,KAAK;EAC1D;CAGH,MAAM,QAAQ,iBAAiB,MAAM;AACrC,KAAI,CAAC,MAAM,GACT,QAAO;EACL,GAAG;EACH,UAAU,CAAC;GAAE,SAAS;GAAmB,MAAM,MAAM,MAAM;GAAS,CAAC;EACrE,WAAW,EAAE;EACb,SAAS;EACT,eAAe,MAAM,MAAM;EAC3B,WAAW,CAAC,GAAI,MAAM,aAAa,EAAE,EAAG,MAAM,MAAM,KAAK;EAC1D;AAGH,QAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lssm/example.policy-safe-knowledge-assistant",
3
- "version": "0.0.0-canary-20251220002821",
3
+ "version": "0.0.0-canary-20251220015515",
4
4
  "description": "All-in-one template example: policy-safe knowledge assistant with locale/jurisdiction gating, versioned KB snapshots, HITL update pipeline, and learning hub.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -31,24 +31,24 @@
31
31
  "test": "bun test"
32
32
  },
33
33
  "dependencies": {
34
- "@lssm/example.locale-jurisdiction-gate": "0.0.0-canary-20251220002821",
35
- "@lssm/example.versioned-knowledge-base": "0.0.0-canary-20251220002821",
36
- "@lssm/example.kb-update-pipeline": "0.0.0-canary-20251220002821",
37
- "@lssm/example.learning-patterns": "0.0.0-canary-20251220002821",
38
- "@lssm/lib.schema": "0.0.0-canary-20251220002821",
39
- "@lssm/lib.contracts": "0.0.0-canary-20251220002821",
40
- "@lssm/lib.identity-rbac": "0.0.0-canary-20251220002821",
41
- "@lssm/lib.jobs": "0.0.0-canary-20251220002821",
42
- "@lssm/lib.feature-flags": "0.0.0-canary-20251220002821",
43
- "@lssm/lib.files": "0.0.0-canary-20251220002821",
44
- "@lssm/lib.metering": "0.0.0-canary-20251220002821",
45
- "@lssm/module.audit-trail": "0.0.0-canary-20251220002821",
46
- "@lssm/module.notifications": "0.0.0-canary-20251220002821",
47
- "@lssm/module.learning-journey": "0.0.0-canary-20251220002821"
34
+ "@lssm/example.locale-jurisdiction-gate": "0.0.0-canary-20251220015515",
35
+ "@lssm/example.versioned-knowledge-base": "0.0.0-canary-20251220015515",
36
+ "@lssm/example.kb-update-pipeline": "0.0.0-canary-20251220015515",
37
+ "@lssm/example.learning-patterns": "0.0.0-canary-20251220015515",
38
+ "@lssm/lib.schema": "0.0.0-canary-20251220015515",
39
+ "@lssm/lib.contracts": "0.0.0-canary-20251220015515",
40
+ "@lssm/lib.identity-rbac": "0.0.0-canary-20251220015515",
41
+ "@lssm/lib.jobs": "0.0.0-canary-20251220015515",
42
+ "@lssm/lib.feature-flags": "0.0.0-canary-20251220015515",
43
+ "@lssm/lib.files": "0.0.0-canary-20251220015515",
44
+ "@lssm/lib.metering": "0.0.0-canary-20251220015515",
45
+ "@lssm/module.audit-trail": "0.0.0-canary-20251220015515",
46
+ "@lssm/module.notifications": "0.0.0-canary-20251220015515",
47
+ "@lssm/module.learning-journey": "0.0.0-canary-20251220015515"
48
48
  },
49
49
  "devDependencies": {
50
- "@lssm/tool.tsdown": "0.0.0-canary-20251220002821",
51
- "@lssm/tool.typescript": "0.0.0-canary-20251220002821",
50
+ "@lssm/tool.tsdown": "0.0.0-canary-20251220015515",
51
+ "@lssm/tool.typescript": "0.0.0-canary-20251220015515",
52
52
  "tsdown": "^0.18.1",
53
53
  "typescript": "^5.9.3"
54
54
  },
@@ -65,7 +65,7 @@ export async function buildPolicySafeAnswer(
65
65
 
66
66
  const results = await input.kbSearch({
67
67
  snapshotId: env.value.kbSnapshotId,
68
- jurisdiction: env.value.regulatoryContext!.jurisdiction!,
68
+ jurisdiction: env.value.regulatoryContext?.jurisdiction ?? 'UNKNOWN',
69
69
  query: input.question,
70
70
  });
71
71
 
@@ -79,7 +79,7 @@ export async function buildPolicySafeAnswer(
79
79
 
80
80
  const draft: AssistantAnswerIR = {
81
81
  locale: env.value.locale,
82
- jurisdiction: env.value.regulatoryContext!.jurisdiction!,
82
+ jurisdiction: env.value.regulatoryContext?.jurisdiction ?? 'UNKNOWN',
83
83
  allowedScope: env.value.allowedScope,
84
84
  sections: [
85
85
  {