@contractspec/example.policy-safe-knowledge-assistant 3.7.6 → 3.7.7
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/.turbo/turbo-build.log +3 -3
- package/AGENTS.md +50 -26
- package/README.md +68 -15
- package/dist/browser/index.js +15 -15
- package/dist/browser/ui/PolicySafeKnowledgeAssistantDashboard.js +15 -15
- package/dist/browser/ui/hooks/usePolicySafeKnowledgeAssistant.js +1 -1
- package/dist/browser/ui/index.js +15 -15
- package/dist/index.d.ts +3 -3
- package/dist/index.js +15 -15
- package/dist/node/index.js +15 -15
- package/dist/node/ui/PolicySafeKnowledgeAssistantDashboard.js +15 -15
- package/dist/node/ui/hooks/usePolicySafeKnowledgeAssistant.js +1 -1
- package/dist/node/ui/index.js +15 -15
- package/dist/ui/PolicySafeKnowledgeAssistantDashboard.js +15 -15
- package/dist/ui/hooks/usePolicySafeKnowledgeAssistant.js +1 -1
- package/dist/ui/index.js +15 -15
- package/package.json +12 -12
- package/src/docs/policy-safe-knowledge-assistant.docblock.ts +21 -21
- package/src/example.ts +30 -30
- package/src/handlers/policy-safe-knowledge-assistant.handlers.ts +426 -425
- package/src/index.ts +4 -3
- package/src/integration.test.ts +87 -88
- package/src/orchestrator/buildAnswer.ts +97 -97
- package/src/policy-safe-knowledge-assistant.feature.ts +61 -61
- package/src/seed/fixtures.ts +29 -29
- package/src/seeders/index.ts +12 -12
- package/src/ui/PolicySafeKnowledgeAssistantDashboard.tsx +191 -191
- package/src/ui/hooks/usePolicySafeKnowledgeAssistant.ts +204 -204
- package/tsconfig.json +7 -17
- package/tsdown.config.js +7 -13
package/src/index.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Policy-safe Knowledge Assistant (all-in-one template) — spec-first exports.
|
|
3
3
|
*/
|
|
4
|
+
|
|
5
|
+
export { default as example } from './example';
|
|
6
|
+
export * from './handlers/policy-safe-knowledge-assistant.handlers';
|
|
7
|
+
export * from './orchestrator/buildAnswer';
|
|
4
8
|
export * from './policy-safe-knowledge-assistant.feature';
|
|
5
9
|
export * from './seed';
|
|
6
|
-
export * from './orchestrator/buildAnswer';
|
|
7
|
-
export * from './handlers/policy-safe-knowledge-assistant.handlers';
|
|
8
10
|
export * from './ui';
|
|
9
|
-
export { default as example } from './example';
|
|
10
11
|
|
|
11
12
|
import './docs';
|
package/src/integration.test.ts
CHANGED
|
@@ -1,108 +1,107 @@
|
|
|
1
1
|
import { describe, expect, it } from 'bun:test';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
createMemoryKbHandlers,
|
|
5
|
-
createMemoryKbStore,
|
|
6
|
-
} from '@contractspec/example.versioned-knowledge-base/handlers/memory.handlers';
|
|
7
2
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
createPipelineMemoryHandlers,
|
|
4
|
+
createPipelineMemoryStore,
|
|
10
5
|
} from '@contractspec/example.kb-update-pipeline/handlers/memory.handlers';
|
|
6
|
+
import {
|
|
7
|
+
createMemoryKbHandlers,
|
|
8
|
+
createMemoryKbStore,
|
|
9
|
+
} from '@contractspec/example.versioned-knowledge-base/handlers/memory.handlers';
|
|
11
10
|
|
|
12
11
|
import { buildPolicySafeAnswer } from './orchestrator/buildAnswer';
|
|
13
12
|
import { DEMO_FIXTURES } from './seed/fixtures';
|
|
14
13
|
|
|
15
14
|
describe('@contractspec/example.policy-safe-knowledge-assistant integration', () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
it('answers cite latest snapshot; after pipeline change + publish, answers cite new snapshot', async () => {
|
|
16
|
+
const kbStore = createMemoryKbStore();
|
|
17
|
+
const kb = createMemoryKbHandlers(kbStore);
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const pipelineStore = createPipelineMemoryStore();
|
|
20
|
+
const pipeline = createPipelineMemoryHandlers(pipelineStore);
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
// Seed rules
|
|
23
|
+
await kb.createRule(DEMO_FIXTURES.rules.EU_RULE_TAX);
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
// Publish initial snapshot (EU v1)
|
|
26
|
+
const rv1 = await kb.upsertRuleVersion({
|
|
27
|
+
ruleId: DEMO_FIXTURES.rules.EU_RULE_TAX.id,
|
|
28
|
+
content: 'EU: Reporting obligations v1',
|
|
29
|
+
sourceRefs: [{ sourceDocumentId: 'src_eu_v1', excerpt: 'v1 excerpt' }],
|
|
30
|
+
});
|
|
31
|
+
await kb.approveRuleVersion({
|
|
32
|
+
ruleVersionId: rv1.id,
|
|
33
|
+
approver: 'expert_1',
|
|
34
|
+
});
|
|
35
|
+
const snap1 = await kb.publishSnapshot({
|
|
36
|
+
jurisdiction: 'EU',
|
|
37
|
+
asOfDate: new Date('2026-01-01T00:00:00.000Z'),
|
|
38
|
+
});
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
const envelopeBase = {
|
|
41
|
+
traceId: 'trace_1',
|
|
42
|
+
locale: 'en-GB',
|
|
43
|
+
regulatoryContext: { jurisdiction: 'EU' },
|
|
44
|
+
allowedScope: 'education_only' as const,
|
|
45
|
+
};
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
const a1 = await buildPolicySafeAnswer({
|
|
48
|
+
envelope: { ...envelopeBase, kbSnapshotId: snap1.id },
|
|
49
|
+
question: 'reporting obligations',
|
|
50
|
+
kbSearch: kb.search,
|
|
51
|
+
});
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
expect(a1.refused).not.toBeTrue();
|
|
54
|
+
expect(a1.citations.length).toBeGreaterThan(0);
|
|
55
|
+
expect(a1.citations[0]?.kbSnapshotId).toBe(snap1.id);
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
57
|
+
// Simulate regulatory change via pipeline: create candidate, review, propose patch
|
|
58
|
+
pipelineStore.candidates.set('cand_1', {
|
|
59
|
+
id: 'cand_1',
|
|
60
|
+
sourceDocumentId: 'EU_src_change',
|
|
61
|
+
detectedAt: new Date('2026-02-01T00:00:00.000Z'),
|
|
62
|
+
diffSummary: 'Updated obligations',
|
|
63
|
+
riskLevel: 'high',
|
|
64
|
+
});
|
|
65
|
+
const review = await pipeline.createReviewTask({
|
|
66
|
+
changeCandidateId: 'cand_1',
|
|
67
|
+
});
|
|
68
|
+
await pipeline.submitDecision({
|
|
69
|
+
reviewTaskId: review.id,
|
|
70
|
+
decision: 'approve',
|
|
71
|
+
decidedBy: 'expert_2',
|
|
72
|
+
decidedByRole: 'expert',
|
|
73
|
+
});
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
// Create + approve new KB rule version
|
|
76
|
+
const rv2 = await kb.upsertRuleVersion({
|
|
77
|
+
ruleId: DEMO_FIXTURES.rules.EU_RULE_TAX.id,
|
|
78
|
+
content: 'EU: Reporting obligations v2 (updated)',
|
|
79
|
+
sourceRefs: [{ sourceDocumentId: 'src_eu_v2', excerpt: 'v2 excerpt' }],
|
|
80
|
+
});
|
|
81
|
+
await kb.approveRuleVersion({
|
|
82
|
+
ruleVersionId: rv2.id,
|
|
83
|
+
approver: 'expert_2',
|
|
84
|
+
});
|
|
86
85
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
// Link pipeline proposal to the actual KB rule version id, then mark it approved
|
|
87
|
+
await pipeline.proposeRulePatch({
|
|
88
|
+
changeCandidateId: 'cand_1',
|
|
89
|
+
proposedRuleVersionIds: [rv2.id],
|
|
90
|
+
});
|
|
91
|
+
await pipeline.markRuleVersionApproved({ ruleVersionId: rv2.id });
|
|
92
|
+
await pipeline.publishIfReady({ jurisdiction: 'EU' });
|
|
94
93
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
const snap2 = await kb.publishSnapshot({
|
|
95
|
+
jurisdiction: 'EU',
|
|
96
|
+
asOfDate: new Date('2026-02-01T00:00:00.000Z'),
|
|
97
|
+
});
|
|
99
98
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
99
|
+
const a2 = await buildPolicySafeAnswer({
|
|
100
|
+
envelope: { ...envelopeBase, kbSnapshotId: snap2.id },
|
|
101
|
+
question: 'updated obligations',
|
|
102
|
+
kbSearch: kb.search,
|
|
103
|
+
});
|
|
104
|
+
expect(a2.refused).not.toBeTrue();
|
|
105
|
+
expect(a2.citations[0]?.kbSnapshotId).toBe(snap2.id);
|
|
106
|
+
});
|
|
108
107
|
});
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
enforceAllowedScope,
|
|
3
|
+
enforceCitations,
|
|
4
|
+
validateEnvelope,
|
|
5
5
|
} from '@contractspec/example.locale-jurisdiction-gate/policy/guard';
|
|
6
6
|
|
|
7
7
|
type AllowedScope = 'education_only' | 'generic_info' | 'escalation_required';
|
|
8
8
|
|
|
9
9
|
export interface AssistantAnswerIR {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
locale: string;
|
|
11
|
+
jurisdiction: string;
|
|
12
|
+
allowedScope: AllowedScope;
|
|
13
|
+
sections: { heading: string; body: string }[];
|
|
14
|
+
citations: {
|
|
15
|
+
kbSnapshotId: string;
|
|
16
|
+
sourceType: string;
|
|
17
|
+
sourceId: string;
|
|
18
|
+
title?: string;
|
|
19
|
+
excerpt?: string;
|
|
20
|
+
}[];
|
|
21
|
+
disclaimers?: string[];
|
|
22
|
+
riskFlags?: string[];
|
|
23
|
+
refused?: boolean;
|
|
24
|
+
refusalReason?: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export interface BuildAnswerInput {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
envelope: {
|
|
29
|
+
traceId: string;
|
|
30
|
+
locale: string;
|
|
31
|
+
kbSnapshotId: string;
|
|
32
|
+
allowedScope: AllowedScope;
|
|
33
|
+
regulatoryContext: { jurisdiction: string };
|
|
34
|
+
};
|
|
35
|
+
question: string;
|
|
36
|
+
kbSearch: (input: {
|
|
37
|
+
snapshotId: string;
|
|
38
|
+
jurisdiction: string;
|
|
39
|
+
query: string;
|
|
40
|
+
}) => Promise<{ items: { ruleVersionId: string; excerpt?: string }[] }>;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/**
|
|
@@ -46,77 +46,77 @@ export interface BuildAnswerInput {
|
|
|
46
46
|
* Deterministic: no LLM calls; if search yields no results, it refuses.
|
|
47
47
|
*/
|
|
48
48
|
export async function buildPolicySafeAnswer(
|
|
49
|
-
|
|
49
|
+
input: BuildAnswerInput
|
|
50
50
|
): Promise<AssistantAnswerIR> {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
51
|
+
const env = validateEnvelope(input.envelope);
|
|
52
|
+
if (!env.ok) {
|
|
53
|
+
return {
|
|
54
|
+
locale: input.envelope.locale ?? 'en-GB',
|
|
55
|
+
jurisdiction: input.envelope.regulatoryContext?.jurisdiction ?? 'UNKNOWN',
|
|
56
|
+
allowedScope: input.envelope.allowedScope ?? 'education_only',
|
|
57
|
+
sections: [{ heading: 'Request blocked', body: env.error.message }],
|
|
58
|
+
citations: [],
|
|
59
|
+
disclaimers: ['This system refuses to answer without a valid envelope.'],
|
|
60
|
+
riskFlags: [env.error.code],
|
|
61
|
+
refused: true,
|
|
62
|
+
refusalReason: env.error.code,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
const results = await input.kbSearch({
|
|
67
|
+
snapshotId: env.value.kbSnapshotId,
|
|
68
|
+
jurisdiction: env.value.regulatoryContext?.jurisdiction ?? 'UNKNOWN',
|
|
69
|
+
query: input.question,
|
|
70
|
+
});
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
const citations = results.items.map((item) => ({
|
|
73
|
+
kbSnapshotId: env.value.kbSnapshotId,
|
|
74
|
+
sourceType: 'ruleVersion',
|
|
75
|
+
sourceId: item.ruleVersionId,
|
|
76
|
+
title: 'Curated rule version',
|
|
77
|
+
excerpt: item.excerpt,
|
|
78
|
+
}));
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
80
|
+
const draft: AssistantAnswerIR = {
|
|
81
|
+
locale: env.value.locale,
|
|
82
|
+
jurisdiction: env.value.regulatoryContext?.jurisdiction ?? 'UNKNOWN',
|
|
83
|
+
allowedScope: env.value.allowedScope,
|
|
84
|
+
sections: [
|
|
85
|
+
{
|
|
86
|
+
heading: 'Answer (KB-derived)',
|
|
87
|
+
body:
|
|
88
|
+
results.items.length > 0
|
|
89
|
+
? `This answer is derived from ${results.items.length} curated rule version(s) in the referenced snapshot.`
|
|
90
|
+
: 'No curated knowledge found in the referenced snapshot.',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
citations,
|
|
94
|
+
disclaimers: ['Educational demo only.'],
|
|
95
|
+
riskFlags: [],
|
|
96
|
+
};
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
98
|
+
const scope = enforceAllowedScope(env.value.allowedScope, draft);
|
|
99
|
+
if (!scope.ok) {
|
|
100
|
+
return {
|
|
101
|
+
...draft,
|
|
102
|
+
sections: [{ heading: 'Escalation required', body: scope.error.message }],
|
|
103
|
+
refused: true,
|
|
104
|
+
refusalReason: scope.error.code,
|
|
105
|
+
riskFlags: [...(draft.riskFlags ?? []), scope.error.code],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
109
|
+
const cited = enforceCitations(draft);
|
|
110
|
+
if (!cited.ok) {
|
|
111
|
+
return {
|
|
112
|
+
...draft,
|
|
113
|
+
sections: [{ heading: 'Request blocked', body: cited.error.message }],
|
|
114
|
+
citations: [],
|
|
115
|
+
refused: true,
|
|
116
|
+
refusalReason: cited.error.code,
|
|
117
|
+
riskFlags: [...(draft.riskFlags ?? []), cited.error.code],
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
return draft;
|
|
122
122
|
}
|
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
import { defineFeature } from '@contractspec/lib.contracts-spec';
|
|
2
2
|
|
|
3
3
|
export const PolicySafeKnowledgeAssistantFeature = defineFeature({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
4
|
+
meta: {
|
|
5
|
+
key: 'policy-safe-knowledge-assistant',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
title: 'Policy-safe Knowledge Assistant',
|
|
8
|
+
description:
|
|
9
|
+
'All-in-one example composing locale/jurisdiction gate + versioned KB + HITL pipeline + learning hub.',
|
|
10
|
+
domain: 'knowledge',
|
|
11
|
+
owners: ['@examples'],
|
|
12
|
+
tags: ['assistant', 'knowledge', 'policy', 'hitl', 'learning'],
|
|
13
|
+
stability: 'experimental',
|
|
14
|
+
},
|
|
15
|
+
operations: [
|
|
16
|
+
// Gate
|
|
17
|
+
{ key: 'assistant.answer', version: '1.0.0' },
|
|
18
|
+
{ key: 'assistant.explainConcept', version: '1.0.0' },
|
|
19
|
+
// KB
|
|
20
|
+
{ key: 'kb.ingestSource', version: '1.0.0' },
|
|
21
|
+
{ key: 'kb.upsertRuleVersion', version: '1.0.0' },
|
|
22
|
+
{ key: 'kb.approveRuleVersion', version: '1.0.0' },
|
|
23
|
+
{ key: 'kb.publishSnapshot', version: '1.0.0' },
|
|
24
|
+
{ key: 'kb.search', version: '1.0.0' },
|
|
25
|
+
// Pipeline
|
|
26
|
+
{ key: 'kbPipeline.runWatch', version: '1.0.0' },
|
|
27
|
+
{ key: 'kbPipeline.createReviewTask', version: '1.0.0' },
|
|
28
|
+
{ key: 'kbPipeline.submitDecision', version: '1.0.0' },
|
|
29
|
+
{ key: 'kbPipeline.publishIfReady', version: '1.0.0' },
|
|
30
|
+
],
|
|
31
|
+
events: [
|
|
32
|
+
{ key: 'assistant.answer.requested', version: '1.0.0' },
|
|
33
|
+
{ key: 'assistant.answer.blocked', version: '1.0.0' },
|
|
34
|
+
{ key: 'assistant.answer.delivered', version: '1.0.0' },
|
|
35
|
+
{ key: 'kb.source.ingested', version: '1.0.0' },
|
|
36
|
+
{ key: 'kb.ruleVersion.created', version: '1.0.0' },
|
|
37
|
+
{ key: 'kb.ruleVersion.approved', version: '1.0.0' },
|
|
38
|
+
{ key: 'kb.snapshot.published', version: '1.0.0' },
|
|
39
|
+
{ key: 'kb.change.detected', version: '1.0.0' },
|
|
40
|
+
{ key: 'kb.review.requested', version: '1.0.0' },
|
|
41
|
+
{ key: 'kb.review.decided', version: '1.0.0' },
|
|
42
|
+
],
|
|
43
|
+
presentations: [],
|
|
44
|
+
opToPresentation: [],
|
|
45
|
+
presentationsTargets: [],
|
|
46
|
+
capabilities: {
|
|
47
|
+
requires: [
|
|
48
|
+
{ key: 'identity', version: '1.0.0' },
|
|
49
|
+
{ key: 'audit-trail', version: '1.0.0' },
|
|
50
|
+
{ key: 'notifications', version: '1.0.0' },
|
|
51
|
+
{ key: 'jobs', version: '1.0.0' },
|
|
52
|
+
{ key: 'feature-flags', version: '1.0.0' },
|
|
53
|
+
{ key: 'files', version: '1.0.0' },
|
|
54
|
+
{ key: 'metering', version: '1.0.0' },
|
|
55
|
+
{ key: 'learning-journey', version: '1.0.0' },
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
policies: [{ key: 'policy-safe.policy.gate', version: '1.0.0' }],
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
knowledge: [{ key: 'policy-safe.knowledge.rules', version: '1.0.0' }],
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
jobs: [{ key: 'policy-safe.job.pipeline-watch', version: '1.0.0' }],
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
docs: [
|
|
66
|
+
'docs.examples.policy-safe-knowledge-assistant.goal',
|
|
67
|
+
'docs.examples.policy-safe-knowledge-assistant.usage',
|
|
68
|
+
],
|
|
69
69
|
});
|
package/src/seed/fixtures.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
export const DEMO_FIXTURES = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
jurisdictions: ['EU', 'FR'] as const,
|
|
3
|
+
locales: ['en-GB', 'fr-FR'] as const,
|
|
4
|
+
demoOrgId: 'org_demo',
|
|
5
|
+
demoUserId: 'user_demo',
|
|
6
|
+
sources: {
|
|
7
|
+
EU_SOURCE_1: {
|
|
8
|
+
jurisdiction: 'EU',
|
|
9
|
+
authority: 'DemoAuthority',
|
|
10
|
+
title: 'EU Demo Source v1',
|
|
11
|
+
fetchedAt: new Date('2026-01-01T00:00:00.000Z'),
|
|
12
|
+
hash: 'hash_eu_v1',
|
|
13
|
+
fileId: 'file_eu_v1',
|
|
14
|
+
},
|
|
15
|
+
EU_SOURCE_2: {
|
|
16
|
+
jurisdiction: 'EU',
|
|
17
|
+
authority: 'DemoAuthority',
|
|
18
|
+
title: 'EU Demo Source v2',
|
|
19
|
+
fetchedAt: new Date('2026-02-01T00:00:00.000Z'),
|
|
20
|
+
hash: 'hash_eu_v2',
|
|
21
|
+
fileId: 'file_eu_v2',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
rules: {
|
|
25
|
+
EU_RULE_TAX: {
|
|
26
|
+
id: 'rule_eu_tax',
|
|
27
|
+
jurisdiction: 'EU',
|
|
28
|
+
topicKey: 'tax_reporting',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
31
|
} as const;
|