@lssm/example.policy-safe-knowledge-assistant 0.0.0-canary-20251213172311 → 0.0.0-canary-20251215220103

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.
@@ -1,6 +1,6 @@
1
1
  $ bun build:bundle && bun build:types
2
2
  $ tsdown
3
- ℹ tsdown v0.17.0 powered by rolldown v1.0.0-beta.53
3
+ ℹ tsdown v0.17.4 powered by rolldown v1.0.0-beta.53
4
4
  ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/policy-safe-knowledge-assistant/tsdown.config.js
5
5
  ℹ entry: src/example.ts, src/feature.ts, src/index.ts, src/docs/index.ts, src/docs/policy-safe-knowledge-assistant.docblock.ts, src/orchestrator/buildAnswer.ts, src/seed/fixtures.ts, src/seed/index.ts
6
6
  ℹ target: esnext
@@ -15,5 +15,5 @@ $ tsdown
15
15
  ℹ dist/seed/index.js 0.07 kB │ gzip: 0.08 kB
16
16
  ℹ dist/docs/index.js 0.05 kB │ gzip: 0.07 kB
17
17
  ℹ 8 files, total: 6.60 kB
18
- ✔ Build complete in 57ms
18
+ ✔ Build complete in 65ms
19
19
  $ tsc --noEmit
package/CHANGELOG.md CHANGED
@@ -1,20 +1,20 @@
1
1
  # @lssm/example.policy-safe-knowledge-assistant
2
2
 
3
- ## 0.0.0-canary-20251213172311
3
+ ## 0.0.0-canary-20251215220103
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Updated dependencies [3086383]
8
- - @lssm/lib.contracts@0.0.0-canary-20251213172311
9
- - @lssm/lib.jobs@0.0.0-canary-20251213172311
10
- - @lssm/example.kb-update-pipeline@0.0.0-canary-20251213172311
11
- - @lssm/example.locale-jurisdiction-gate@0.0.0-canary-20251213172311
12
- - @lssm/example.versioned-knowledge-base@0.0.0-canary-20251213172311
13
- - @lssm/lib.feature-flags@0.0.0-canary-20251213172311
14
- - @lssm/lib.files@0.0.0-canary-20251213172311
15
- - @lssm/lib.identity-rbac@0.0.0-canary-20251213172311
16
- - @lssm/lib.metering@0.0.0-canary-20251213172311
17
- - @lssm/module.audit-trail@0.0.0-canary-20251213172311
18
- - @lssm/module.learning-journey@0.0.0-canary-20251213172311
19
- - @lssm/module.notifications@0.0.0-canary-20251213172311
20
- - @lssm/example.learning-patterns@0.0.0-canary-20251213172311
8
+ - @lssm/lib.contracts@0.0.0-canary-20251215220103
9
+ - @lssm/lib.jobs@0.0.0-canary-20251215220103
10
+ - @lssm/example.kb-update-pipeline@0.0.0-canary-20251215220103
11
+ - @lssm/example.locale-jurisdiction-gate@0.0.0-canary-20251215220103
12
+ - @lssm/example.versioned-knowledge-base@0.0.0-canary-20251215220103
13
+ - @lssm/lib.feature-flags@0.0.0-canary-20251215220103
14
+ - @lssm/lib.files@0.0.0-canary-20251215220103
15
+ - @lssm/lib.identity-rbac@0.0.0-canary-20251215220103
16
+ - @lssm/lib.metering@0.0.0-canary-20251215220103
17
+ - @lssm/module.audit-trail@0.0.0-canary-20251215220103
18
+ - @lssm/module.learning-journey@0.0.0-canary-20251215220103
19
+ - @lssm/module.notifications@0.0.0-canary-20251215220103
20
+ - @lssm/example.learning-patterns@0.0.0-canary-20251215220103
@@ -30,3 +30,4 @@ The runnable **sandbox UI/runtime** lives in `@lssm/bundle.contractspec-studio`
30
30
  - **Storage**: in tests, in-memory stores; in sandbox, browser SQLite + IndexedDB.
31
31
 
32
32
 
33
+
package/README.md CHANGED
@@ -10,3 +10,4 @@ All-in-one template example demonstrating a **policy-safe knowledge assistant**
10
10
 
11
11
  This package is the **spec-first** source of truth. The sandbox UI/runtime integration lives in `@lssm/bundle.contractspec-studio`.\n+\n+## Seed scenario\n+\n+See `src/seed/fixtures.ts` for deterministic offline fixtures (no web dependencies).\n+\n+## Running tests\n+\n+```bash\n+bun test\n+```\n+
12
12
 
13
+
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-20251213172311",
3
+ "version": "0.0.0-canary-20251215220103",
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",
@@ -46,7 +46,7 @@
46
46
  "devDependencies": {
47
47
  "@lssm/tool.tsdown": "workspace:*",
48
48
  "@lssm/tool.typescript": "workspace:*",
49
- "tsdown": "^0.17.0",
49
+ "tsdown": "^0.17.4",
50
50
  "typescript": "^5.9.3"
51
51
  },
52
52
  "publishConfig": {
package/src/docs/index.ts CHANGED
@@ -1,3 +1 @@
1
1
  import './policy-safe-knowledge-assistant.docblock';
2
-
3
-
@@ -26,5 +26,3 @@ const docBlocks: DocBlock[] = [
26
26
  ];
27
27
 
28
28
  registerDocBlocks(docBlocks);
29
-
30
-
package/src/example.ts CHANGED
@@ -17,12 +17,13 @@ const example = {
17
17
  },
18
18
  surfaces: {
19
19
  templates: true,
20
- sandbox: { enabled: true, modes: ['playground', 'specs', 'builder', 'markdown', 'evolution'] },
20
+ sandbox: {
21
+ enabled: true,
22
+ modes: ['playground', 'specs', 'builder', 'markdown', 'evolution'],
23
+ },
21
24
  studio: { enabled: true, installable: true },
22
25
  mcp: { enabled: true },
23
26
  },
24
27
  } as const;
25
28
 
26
29
  export default example;
27
-
28
-
package/src/index.ts CHANGED
@@ -7,5 +7,3 @@ export * from './orchestrator/buildAnswer';
7
7
  export { default as example } from './example';
8
8
 
9
9
  import './docs';
10
-
11
-
@@ -1,7 +1,13 @@
1
1
  import { describe, expect, it } from 'bun:test';
2
2
 
3
- import { createMemoryKbHandlers, createMemoryKbStore } from '@lssm/example.versioned-knowledge-base/handlers/memory.handlers';
4
- import { createPipelineMemoryHandlers, createPipelineMemoryStore } from '@lssm/example.kb-update-pipeline/handlers/memory.handlers';
3
+ import {
4
+ createMemoryKbHandlers,
5
+ createMemoryKbStore,
6
+ } from '@lssm/example.versioned-knowledge-base/handlers/memory.handlers';
7
+ import {
8
+ createPipelineMemoryHandlers,
9
+ createPipelineMemoryStore,
10
+ } from '@lssm/example.kb-update-pipeline/handlers/memory.handlers';
5
11
 
6
12
  import { buildPolicySafeAnswer } from './orchestrator/buildAnswer';
7
13
  import { DEMO_FIXTURES } from './seed/fixtures';
@@ -23,7 +29,10 @@ describe('@lssm/example.policy-safe-knowledge-assistant integration', () => {
23
29
  content: 'EU: Reporting obligations v1',
24
30
  sourceRefs: [{ sourceDocumentId: 'src_eu_v1', excerpt: 'v1 excerpt' }],
25
31
  });
26
- await kb.approveRuleVersion({ ruleVersionId: rv1.id, approver: 'expert_1' });
32
+ await kb.approveRuleVersion({
33
+ ruleVersionId: rv1.id,
34
+ approver: 'expert_1',
35
+ });
27
36
  const snap1 = await kb.publishSnapshot({
28
37
  jurisdiction: 'EU',
29
38
  asOfDate: new Date('2026-01-01T00:00:00.000Z'),
@@ -54,7 +63,9 @@ describe('@lssm/example.policy-safe-knowledge-assistant integration', () => {
54
63
  diffSummary: 'Updated obligations',
55
64
  riskLevel: 'high',
56
65
  });
57
- const review = await pipeline.createReviewTask({ changeCandidateId: 'cand_1' });
66
+ const review = await pipeline.createReviewTask({
67
+ changeCandidateId: 'cand_1',
68
+ });
58
69
  await pipeline.submitDecision({
59
70
  reviewTaskId: review.id,
60
71
  decision: 'approve',
@@ -68,7 +79,10 @@ describe('@lssm/example.policy-safe-knowledge-assistant integration', () => {
68
79
  content: 'EU: Reporting obligations v2 (updated)',
69
80
  sourceRefs: [{ sourceDocumentId: 'src_eu_v2', excerpt: 'v2 excerpt' }],
70
81
  });
71
- await kb.approveRuleVersion({ ruleVersionId: rv2.id, approver: 'expert_2' });
82
+ await kb.approveRuleVersion({
83
+ ruleVersionId: rv2.id,
84
+ approver: 'expert_2',
85
+ });
72
86
 
73
87
  // Link pipeline proposal to the actual KB rule version id, then mark it approved
74
88
  await pipeline.proposeRulePatch({
@@ -92,5 +106,3 @@ describe('@lssm/example.policy-safe-knowledge-assistant integration', () => {
92
106
  expect(a2.citations[0]?.kbSnapshotId).toBe(snap2.id);
93
107
  });
94
108
  });
95
-
96
-
@@ -6,23 +6,23 @@ import {
6
6
 
7
7
  type AllowedScope = 'education_only' | 'generic_info' | 'escalation_required';
8
8
 
9
- export type AssistantAnswerIR = {
9
+ export interface AssistantAnswerIR {
10
10
  locale: string;
11
11
  jurisdiction: string;
12
12
  allowedScope: AllowedScope;
13
- sections: Array<{ heading: string; body: string }>;
14
- citations: Array<{
13
+ sections: { heading: string; body: string }[];
14
+ citations: {
15
15
  kbSnapshotId: string;
16
16
  sourceType: string;
17
17
  sourceId: string;
18
18
  title?: string;
19
19
  excerpt?: string;
20
- }>;
20
+ }[];
21
21
  disclaimers?: string[];
22
22
  riskFlags?: string[];
23
23
  refused?: boolean;
24
24
  refusalReason?: string;
25
- };
25
+ }
26
26
 
27
27
  export interface BuildAnswerInput {
28
28
  envelope: {
@@ -37,7 +37,7 @@ export interface BuildAnswerInput {
37
37
  snapshotId: string;
38
38
  jurisdiction: string;
39
39
  query: string;
40
- }) => Promise<{ items: Array<{ ruleVersionId: string; excerpt?: string }> }>;
40
+ }) => Promise<{ items: { ruleVersionId: string; excerpt?: string }[] }>;
41
41
  }
42
42
 
43
43
  /**
@@ -120,5 +120,3 @@ export async function buildPolicySafeAnswer(
120
120
 
121
121
  return draft;
122
122
  }
123
-
124
-
@@ -29,5 +29,3 @@ export const DEMO_FIXTURES = {
29
29
  },
30
30
  },
31
31
  } as const;
32
-
33
-
package/src/seed/index.ts CHANGED
@@ -1,3 +1 @@
1
1
  export * from './fixtures';
2
-
3
-
package/tsconfig.json CHANGED
@@ -9,3 +9,4 @@
9
9
  }
10
10
 
11
11
 
12
+