@contractspec/example.versioned-knowledge-base 1.44.0 → 1.45.0

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/src/events.ts CHANGED
@@ -17,7 +17,7 @@ const KbSourceIngestedPayload = defineSchemaModel({
17
17
  export const KbSourceIngestedEvent = defineEvent({
18
18
  meta: {
19
19
  key: 'kb.source.ingested',
20
- version: 1,
20
+ version: '1.0.0',
21
21
  description: 'Source document ingested (immutable).',
22
22
  stability: 'experimental',
23
23
  owners: ['@examples'],
@@ -43,7 +43,7 @@ const KbRuleVersionCreatedPayload = defineSchemaModel({
43
43
  export const KbRuleVersionCreatedEvent = defineEvent({
44
44
  meta: {
45
45
  key: 'kb.ruleVersion.created',
46
- version: 1,
46
+ version: '1.0.0',
47
47
  description: 'Rule version created (draft).',
48
48
  stability: 'experimental',
49
49
  owners: ['@examples'],
@@ -67,7 +67,7 @@ const KbRuleVersionApprovedPayload = defineSchemaModel({
67
67
  export const KbRuleVersionApprovedEvent = defineEvent({
68
68
  meta: {
69
69
  key: 'kb.ruleVersion.approved',
70
- version: 1,
70
+ version: '1.0.0',
71
71
  description: 'Rule version approved (human verified).',
72
72
  stability: 'experimental',
73
73
  owners: ['@examples'],
@@ -92,7 +92,7 @@ const KbSnapshotPublishedPayload = defineSchemaModel({
92
92
  export const KbSnapshotPublishedEvent = defineEvent({
93
93
  meta: {
94
94
  key: 'kb.snapshot.published',
95
- version: 1,
95
+ version: '1.0.0',
96
96
  description: 'KB snapshot published.',
97
97
  stability: 'experimental',
98
98
  owners: ['@examples'],
package/src/example.ts CHANGED
@@ -1,11 +1,18 @@
1
- const example = {
2
- id: 'versioned-knowledge-base',
3
- title: 'Versioned Knowledge Base',
4
- summary:
5
- 'Curated KB with immutable sources, reviewable rule versions, and published snapshots.',
6
- tags: ['knowledge', 'versioning', 'snapshots'],
7
- kind: 'knowledge',
8
- visibility: 'public',
1
+ import type { ExampleSpec } from '@contractspec/lib.contracts';
2
+
3
+ const example: ExampleSpec = {
4
+ meta: {
5
+ key: 'versioned-knowledge-base',
6
+ version: '1.0.0',
7
+ title: 'Versioned Knowledge Base',
8
+ description:
9
+ 'Curated KB with immutable sources, reviewable rule versions, and published snapshots.',
10
+ kind: 'knowledge',
11
+ visibility: 'public',
12
+ stability: 'experimental',
13
+ owners: ['@platform.core'],
14
+ tags: ['knowledge', 'versioning', 'snapshots'],
15
+ },
9
16
  docs: {
10
17
  rootDocId: 'docs.examples.versioned-knowledge-base',
11
18
  },
@@ -22,6 +29,6 @@ const example = {
22
29
  studio: { enabled: true, installable: true },
23
30
  mcp: { enabled: true },
24
31
  },
25
- } as const;
32
+ };
26
33
 
27
34
  export default example;
@@ -21,7 +21,7 @@ interface RuleVersion {
21
21
  ruleId: string;
22
22
  jurisdiction: string;
23
23
  topicKey: string;
24
- version: number;
24
+ version: string;
25
25
  content: string;
26
26
  sourceRefs: SourceRef[];
27
27
  status: 'draft' | 'approved' | 'rejected';
@@ -111,14 +111,13 @@ export function createMemoryKbHandlers(store: MemoryKbStore): MemoryKbHandlers {
111
111
  }
112
112
  const next =
113
113
  (store.nextRuleVersionNumberByRuleId.get(input.ruleId) ?? 0) + 1;
114
- store.nextRuleVersionNumberByRuleId.set(input.ruleId, next);
115
114
  const id = stableId('rv', `${input.ruleId}_${next}`);
116
115
  const ruleVersion: RuleVersion = {
117
116
  id,
118
117
  ruleId: input.ruleId,
119
118
  jurisdiction: rule.jurisdiction,
120
119
  topicKey: rule.topicKey,
121
- version: next,
120
+ version: next.toString(),
122
121
  content: input.content,
123
122
  sourceRefs: input.sourceRefs,
124
123
  status: 'draft',
@@ -86,7 +86,7 @@ export const KbIngestSourceContract = defineCommand({
86
86
  meta: {
87
87
  key: 'kb.ingestSource',
88
88
  title: 'Ingest Source',
89
- version: 1,
89
+ version: '1.0.0',
90
90
  stability: 'experimental',
91
91
  owners: ['@examples'],
92
92
  tags: ['knowledge', 'sources', 'ingestion'],
@@ -105,7 +105,7 @@ export const KbUpsertRuleVersionContract = defineCommand({
105
105
  meta: {
106
106
  key: 'kb.upsertRuleVersion',
107
107
  title: 'Upsert Rule Version',
108
- version: 1,
108
+ version: '1.0.0',
109
109
  stability: 'experimental',
110
110
  owners: ['@examples'],
111
111
  tags: ['knowledge', 'rules', 'versioning'],
@@ -138,7 +138,7 @@ export const KbApproveRuleVersionContract = defineCommand({
138
138
  meta: {
139
139
  key: 'kb.approveRuleVersion',
140
140
  title: 'Approve Rule Version',
141
- version: 1,
141
+ version: '1.0.0',
142
142
  stability: 'experimental',
143
143
  owners: ['@examples'],
144
144
  tags: ['knowledge', 'rules', 'approval'],
@@ -157,7 +157,7 @@ export const KbPublishSnapshotContract = defineCommand({
157
157
  meta: {
158
158
  key: 'kb.publishSnapshot',
159
159
  title: 'Publish Snapshot',
160
- version: 1,
160
+ version: '1.0.0',
161
161
  stability: 'experimental',
162
162
  owners: ['@examples'],
163
163
  tags: ['knowledge', 'snapshots', 'publishing'],
@@ -185,7 +185,7 @@ export const KbSearchContract = defineQuery({
185
185
  meta: {
186
186
  key: 'kb.search',
187
187
  title: 'Search KB',
188
- version: 1,
188
+ version: '1.0.0',
189
189
  stability: 'experimental',
190
190
  owners: ['@examples'],
191
191
  tags: ['knowledge', 'search', 'snapshots'],
@@ -3,7 +3,7 @@ import type { FeatureModuleSpec } from '@contractspec/lib.contracts';
3
3
  export const VersionedKnowledgeBaseFeature: FeatureModuleSpec = {
4
4
  meta: {
5
5
  key: 'versioned-knowledge-base',
6
- version: 1,
6
+ version: '1.0.0',
7
7
  title: 'Versioned Knowledge Base',
8
8
  description:
9
9
  'Curated KB with immutable sources, rule versions, and published snapshots.',
@@ -13,22 +13,22 @@ export const VersionedKnowledgeBaseFeature: FeatureModuleSpec = {
13
13
  stability: 'experimental',
14
14
  },
15
15
  operations: [
16
- { key: 'kb.ingestSource', version: 1 },
17
- { key: 'kb.upsertRuleVersion', version: 1 },
18
- { key: 'kb.approveRuleVersion', version: 1 },
19
- { key: 'kb.publishSnapshot', version: 1 },
20
- { key: 'kb.search', version: 1 },
16
+ { key: 'kb.ingestSource', version: '1.0.0' },
17
+ { key: 'kb.upsertRuleVersion', version: '1.0.0' },
18
+ { key: 'kb.approveRuleVersion', version: '1.0.0' },
19
+ { key: 'kb.publishSnapshot', version: '1.0.0' },
20
+ { key: 'kb.search', version: '1.0.0' },
21
21
  ],
22
22
  events: [
23
- { key: 'kb.source.ingested', version: 1 },
24
- { key: 'kb.ruleVersion.created', version: 1 },
25
- { key: 'kb.ruleVersion.approved', version: 1 },
26
- { key: 'kb.snapshot.published', version: 1 },
23
+ { key: 'kb.source.ingested', version: '1.0.0' },
24
+ { key: 'kb.ruleVersion.created', version: '1.0.0' },
25
+ { key: 'kb.ruleVersion.approved', version: '1.0.0' },
26
+ { key: 'kb.snapshot.published', version: '1.0.0' },
27
27
  ],
28
28
  presentations: [],
29
29
  opToPresentation: [],
30
30
  presentationsTargets: [],
31
31
  capabilities: {
32
- requires: [{ key: 'knowledge', version: 1 }],
32
+ requires: [{ key: 'knowledge', version: '1.0.0' }],
33
33
  },
34
34
  };