@contractspec/example.versioned-knowledge-base 1.44.1 → 1.45.1

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,42 +6,42 @@ $ tsdown
6
6
  ℹ tsconfig: tsconfig.json
7
7
  ℹ Build start
8
8
  ℹ Cleaning 41 files
9
- ℹ dist/operations/kb.js 6.43 kB │ gzip: 1.57 kB
10
- ℹ dist/handlers/memory.handlers.js 3.50 kB │ gzip: 1.21 kB
11
- ℹ dist/entities/models.js 3.38 kB │ gzip: 0.68 kB
12
- ℹ dist/events.js 3.13 kB │ gzip: 0.67 kB
9
+ ℹ dist/operations/kb.js 6.46 kB │ gzip: 1.58 kB
10
+ ℹ dist/handlers/memory.handlers.js 3.45 kB │ gzip: 1.20 kB
11
+ ℹ dist/entities/models.js 3.39 kB │ gzip: 0.67 kB
12
+ ℹ dist/events.js 3.15 kB │ gzip: 0.67 kB
13
13
  ℹ dist/docs/versioned-knowledge-base.docblock.js 1.52 kB │ gzip: 0.66 kB
14
- ℹ dist/versioned-knowledge-base.feature.js 1.19 kB │ gzip: 0.46 kB
14
+ ℹ dist/versioned-knowledge-base.feature.js 1.26 kB │ gzip: 0.47 kB
15
15
  ℹ dist/index.js 1.16 kB │ gzip: 0.35 kB
16
- ℹ dist/example.js 0.89 kB │ gzip: 0.46 kB
16
+ ℹ dist/example.js 1.00 kB │ gzip: 0.51 kB
17
17
  ℹ dist/operations/index.js 0.29 kB │ gzip: 0.13 kB
18
18
  ℹ dist/entities/index.js 0.21 kB │ gzip: 0.11 kB
19
19
  ℹ dist/handlers/index.js 0.14 kB │ gzip: 0.09 kB
20
20
  ℹ dist/docs/index.js 0.05 kB │ gzip: 0.07 kB
21
- ℹ dist/operations/kb.js.map 9.48 kB │ gzip: 2.10 kB
22
- ℹ dist/handlers/memory.handlers.js.map 8.62 kB │ gzip: 2.48 kB
23
- ℹ dist/entities/models.js.map 5.08 kB │ gzip: 1.01 kB
24
- ℹ dist/events.js.map 4.70 kB │ gzip: 0.98 kB
21
+ ℹ dist/operations/kb.js.map 9.51 kB │ gzip: 2.10 kB
22
+ ℹ dist/handlers/memory.handlers.js.map 8.54 kB │ gzip: 2.46 kB
23
+ ℹ dist/entities/models.js.map 5.09 kB │ gzip: 1.00 kB
24
+ ℹ dist/events.js.map 4.72 kB │ gzip: 0.98 kB
25
25
  ℹ dist/docs/versioned-knowledge-base.docblock.js.map 2.02 kB │ gzip: 0.84 kB
26
- ℹ dist/versioned-knowledge-base.feature.js.map 1.92 kB │ gzip: 0.72 kB
27
- ℹ dist/example.js.map 1.27 kB │ gzip: 0.63 kB
26
+ ℹ dist/versioned-knowledge-base.feature.js.map 1.99 kB │ gzip: 0.73 kB
27
+ ℹ dist/example.js.map 1.54 kB │ gzip: 0.74 kB
28
28
  ℹ dist/handlers/memory.handlers.d.ts.map 1.17 kB │ gzip: 0.53 kB
29
29
  ℹ dist/operations/kb.d.ts.map 1.11 kB │ gzip: 0.39 kB
30
30
  ℹ dist/entities/models.d.ts.map 0.69 kB │ gzip: 0.32 kB
31
31
  ℹ dist/events.d.ts.map 0.67 kB │ gzip: 0.28 kB
32
32
  ℹ dist/versioned-knowledge-base.feature.d.ts.map 0.18 kB │ gzip: 0.14 kB
33
- ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
34
- ℹ dist/operations/kb.d.ts 7.68 kB │ gzip: 0.63 kB
35
- ℹ dist/entities/models.d.ts 3.88 kB │ gzip: 0.52 kB
36
- ℹ dist/events.d.ts 2.17 kB │ gzip: 0.39 kB
33
+ ℹ dist/example.d.ts.map 0.12 kB │ gzip: 0.12 kB
34
+ ℹ dist/operations/kb.d.ts 7.68 kB │ gzip: 0.62 kB
35
+ ℹ dist/entities/models.d.ts 3.88 kB │ gzip: 0.51 kB
36
+ ℹ dist/events.d.ts 2.15 kB │ gzip: 0.39 kB
37
37
  ℹ dist/handlers/memory.handlers.d.ts 1.94 kB │ gzip: 0.61 kB
38
38
  ℹ dist/index.d.ts 1.18 kB │ gzip: 0.35 kB
39
- ℹ dist/example.d.ts 1.14 kB │ gzip: 0.46 kB
40
39
  ℹ dist/versioned-knowledge-base.feature.d.ts 0.30 kB │ gzip: 0.18 kB
41
40
  ℹ dist/operations/index.d.ts 0.29 kB │ gzip: 0.13 kB
42
41
  ℹ dist/entities/index.d.ts 0.21 kB │ gzip: 0.11 kB
43
42
  ℹ dist/handlers/index.d.ts 0.20 kB │ gzip: 0.10 kB
43
+ ℹ dist/example.d.ts 0.20 kB │ gzip: 0.16 kB
44
44
  ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
45
45
  ℹ dist/docs/versioned-knowledge-base.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
46
- ℹ 37 files, total: 77.96 kB
47
- ✔ Build complete in 23134ms
46
+ ℹ 37 files, total: 77.49 kB
47
+ ✔ Build complete in 24579ms
@@ -7,42 +7,42 @@ $ tsdown
7
7
  ℹ target: esnext
8
8
  ℹ tsconfig: tsconfig.json
9
9
  ℹ Build start
10
- ℹ dist/operations/kb.js 6.43 kB │ gzip: 1.57 kB
11
- ℹ dist/handlers/memory.handlers.js 3.50 kB │ gzip: 1.21 kB
12
- ℹ dist/entities/models.js 3.38 kB │ gzip: 0.68 kB
13
- ℹ dist/events.js 3.13 kB │ gzip: 0.67 kB
10
+ ℹ dist/operations/kb.js 6.46 kB │ gzip: 1.58 kB
11
+ ℹ dist/handlers/memory.handlers.js 3.45 kB │ gzip: 1.20 kB
12
+ ℹ dist/entities/models.js 3.39 kB │ gzip: 0.67 kB
13
+ ℹ dist/events.js 3.15 kB │ gzip: 0.67 kB
14
14
  ℹ dist/docs/versioned-knowledge-base.docblock.js 1.52 kB │ gzip: 0.66 kB
15
- ℹ dist/versioned-knowledge-base.feature.js 1.19 kB │ gzip: 0.46 kB
15
+ ℹ dist/versioned-knowledge-base.feature.js 1.26 kB │ gzip: 0.47 kB
16
16
  ℹ dist/index.js 1.16 kB │ gzip: 0.35 kB
17
- ℹ dist/example.js 0.89 kB │ gzip: 0.46 kB
17
+ ℹ dist/example.js 1.00 kB │ gzip: 0.51 kB
18
18
  ℹ dist/operations/index.js 0.29 kB │ gzip: 0.13 kB
19
19
  ℹ dist/entities/index.js 0.21 kB │ gzip: 0.11 kB
20
20
  ℹ dist/handlers/index.js 0.14 kB │ gzip: 0.09 kB
21
21
  ℹ dist/docs/index.js 0.05 kB │ gzip: 0.07 kB
22
- ℹ dist/operations/kb.js.map 9.48 kB │ gzip: 2.10 kB
23
- ℹ dist/handlers/memory.handlers.js.map 8.62 kB │ gzip: 2.48 kB
24
- ℹ dist/entities/models.js.map 5.08 kB │ gzip: 1.01 kB
25
- ℹ dist/events.js.map 4.70 kB │ gzip: 0.98 kB
22
+ ℹ dist/operations/kb.js.map 9.51 kB │ gzip: 2.10 kB
23
+ ℹ dist/handlers/memory.handlers.js.map 8.54 kB │ gzip: 2.46 kB
24
+ ℹ dist/entities/models.js.map 5.09 kB │ gzip: 1.00 kB
25
+ ℹ dist/events.js.map 4.72 kB │ gzip: 0.98 kB
26
26
  ℹ dist/docs/versioned-knowledge-base.docblock.js.map 2.02 kB │ gzip: 0.84 kB
27
- ℹ dist/versioned-knowledge-base.feature.js.map 1.92 kB │ gzip: 0.72 kB
28
- ℹ dist/example.js.map 1.27 kB │ gzip: 0.63 kB
27
+ ℹ dist/versioned-knowledge-base.feature.js.map 1.99 kB │ gzip: 0.73 kB
28
+ ℹ dist/example.js.map 1.54 kB │ gzip: 0.74 kB
29
29
  ℹ dist/handlers/memory.handlers.d.ts.map 1.17 kB │ gzip: 0.53 kB
30
30
  ℹ dist/operations/kb.d.ts.map 1.11 kB │ gzip: 0.39 kB
31
31
  ℹ dist/entities/models.d.ts.map 0.69 kB │ gzip: 0.32 kB
32
32
  ℹ dist/events.d.ts.map 0.67 kB │ gzip: 0.28 kB
33
33
  ℹ dist/versioned-knowledge-base.feature.d.ts.map 0.18 kB │ gzip: 0.14 kB
34
- ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
35
- ℹ dist/operations/kb.d.ts 7.68 kB │ gzip: 0.63 kB
36
- ℹ dist/entities/models.d.ts 3.88 kB │ gzip: 0.52 kB
34
+ ℹ dist/example.d.ts.map 0.12 kB │ gzip: 0.12 kB
35
+ ℹ dist/operations/kb.d.ts 7.68 kB │ gzip: 0.62 kB
36
+ ℹ dist/entities/models.d.ts 3.88 kB │ gzip: 0.51 kB
37
37
  ℹ dist/events.d.ts 2.15 kB │ gzip: 0.39 kB
38
38
  ℹ dist/handlers/memory.handlers.d.ts 1.94 kB │ gzip: 0.61 kB
39
39
  ℹ dist/index.d.ts 1.18 kB │ gzip: 0.35 kB
40
- ℹ dist/example.d.ts 1.14 kB │ gzip: 0.46 kB
41
40
  ℹ dist/versioned-knowledge-base.feature.d.ts 0.30 kB │ gzip: 0.18 kB
42
41
  ℹ dist/operations/index.d.ts 0.29 kB │ gzip: 0.13 kB
43
42
  ℹ dist/entities/index.d.ts 0.21 kB │ gzip: 0.11 kB
44
43
  ℹ dist/handlers/index.d.ts 0.20 kB │ gzip: 0.10 kB
44
+ ℹ dist/example.d.ts 0.20 kB │ gzip: 0.16 kB
45
45
  ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
46
46
  ℹ dist/docs/versioned-knowledge-base.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
47
- ℹ 37 files, total: 77.94 kB
48
- ✔ Build complete in 25781ms
47
+ ℹ 37 files, total: 77.49 kB
48
+ ✔ Build complete in 24665ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @contractspec/example.versioned-knowledge-base
2
2
 
3
+ ## 1.45.1
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: improve app config and examples contracts
8
+ - Updated dependencies
9
+ - @contractspec/lib.contracts@1.45.1
10
+ - @contractspec/lib.schema@1.45.1
11
+
12
+ ## 1.45.0
13
+
14
+ ### Minor Changes
15
+
16
+ - e73ca1d: feat: improve app config and examples contracts
17
+ feat: Contract layers support (features, examples, app-configs)
18
+
19
+ ### New CLI Commands
20
+ - `contractspec list layers` - List all contract layers with filtering
21
+
22
+ ### Enhanced Commands
23
+ - `contractspec ci` - New `layers` check category validates features/examples/config
24
+ - `contractspec doctor` - New `layers` health checks
25
+ - `contractspec integrity` - Now shows layer statistics
26
+
27
+ ### New APIs
28
+ - `discoverLayers()` - Scan workspace for all layer files
29
+ - `scanExampleSource()` - Parse ExampleSpec from source code
30
+ - `isExampleFile()` - Check if file is an example spec
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [e73ca1d]
35
+ - @contractspec/lib.contracts@1.45.0
36
+ - @contractspec/lib.schema@1.45.0
37
+
3
38
  ## 1.44.1
4
39
 
5
40
  ### Patch Changes
@@ -1,93 +1,93 @@
1
- import * as _contractspec_lib_schema68 from "@contractspec/lib.schema";
1
+ import * as _contractspec_lib_schema84 from "@contractspec/lib.schema";
2
2
 
3
3
  //#region src/entities/models.d.ts
4
- declare const SourceDocumentModel: _contractspec_lib_schema68.SchemaModel<{
4
+ declare const SourceDocumentModel: _contractspec_lib_schema84.SchemaModel<{
5
5
  id: {
6
- type: _contractspec_lib_schema68.FieldType<string, string>;
6
+ type: _contractspec_lib_schema84.FieldType<string, string>;
7
7
  isOptional: false;
8
8
  };
9
9
  jurisdiction: {
10
- type: _contractspec_lib_schema68.FieldType<string, string>;
10
+ type: _contractspec_lib_schema84.FieldType<string, string>;
11
11
  isOptional: false;
12
12
  };
13
13
  authority: {
14
- type: _contractspec_lib_schema68.FieldType<string, string>;
14
+ type: _contractspec_lib_schema84.FieldType<string, string>;
15
15
  isOptional: false;
16
16
  };
17
17
  title: {
18
- type: _contractspec_lib_schema68.FieldType<string, string>;
18
+ type: _contractspec_lib_schema84.FieldType<string, string>;
19
19
  isOptional: false;
20
20
  };
21
21
  fetchedAt: {
22
- type: _contractspec_lib_schema68.FieldType<Date, string>;
22
+ type: _contractspec_lib_schema84.FieldType<Date, string>;
23
23
  isOptional: false;
24
24
  };
25
25
  hash: {
26
- type: _contractspec_lib_schema68.FieldType<string, string>;
26
+ type: _contractspec_lib_schema84.FieldType<string, string>;
27
27
  isOptional: false;
28
28
  };
29
29
  fileId: {
30
- type: _contractspec_lib_schema68.FieldType<string, string>;
30
+ type: _contractspec_lib_schema84.FieldType<string, string>;
31
31
  isOptional: false;
32
32
  };
33
33
  }>;
34
- declare const SourceRefModel: _contractspec_lib_schema68.SchemaModel<{
34
+ declare const SourceRefModel: _contractspec_lib_schema84.SchemaModel<{
35
35
  sourceDocumentId: {
36
- type: _contractspec_lib_schema68.FieldType<string, string>;
36
+ type: _contractspec_lib_schema84.FieldType<string, string>;
37
37
  isOptional: false;
38
38
  };
39
39
  excerpt: {
40
- type: _contractspec_lib_schema68.FieldType<string, string>;
40
+ type: _contractspec_lib_schema84.FieldType<string, string>;
41
41
  isOptional: true;
42
42
  };
43
43
  }>;
44
- declare const RuleModel: _contractspec_lib_schema68.SchemaModel<{
44
+ declare const RuleModel: _contractspec_lib_schema84.SchemaModel<{
45
45
  id: {
46
- type: _contractspec_lib_schema68.FieldType<string, string>;
46
+ type: _contractspec_lib_schema84.FieldType<string, string>;
47
47
  isOptional: false;
48
48
  };
49
49
  jurisdiction: {
50
- type: _contractspec_lib_schema68.FieldType<string, string>;
50
+ type: _contractspec_lib_schema84.FieldType<string, string>;
51
51
  isOptional: false;
52
52
  };
53
53
  topicKey: {
54
- type: _contractspec_lib_schema68.FieldType<string, string>;
54
+ type: _contractspec_lib_schema84.FieldType<string, string>;
55
55
  isOptional: false;
56
56
  };
57
57
  }>;
58
- declare const RuleVersionModel: _contractspec_lib_schema68.SchemaModel<{
58
+ declare const RuleVersionModel: _contractspec_lib_schema84.SchemaModel<{
59
59
  id: {
60
- type: _contractspec_lib_schema68.FieldType<string, string>;
60
+ type: _contractspec_lib_schema84.FieldType<string, string>;
61
61
  isOptional: false;
62
62
  };
63
63
  ruleId: {
64
- type: _contractspec_lib_schema68.FieldType<string, string>;
64
+ type: _contractspec_lib_schema84.FieldType<string, string>;
65
65
  isOptional: false;
66
66
  };
67
67
  jurisdiction: {
68
- type: _contractspec_lib_schema68.FieldType<string, string>;
68
+ type: _contractspec_lib_schema84.FieldType<string, string>;
69
69
  isOptional: false;
70
70
  };
71
71
  topicKey: {
72
- type: _contractspec_lib_schema68.FieldType<string, string>;
72
+ type: _contractspec_lib_schema84.FieldType<string, string>;
73
73
  isOptional: false;
74
74
  };
75
75
  version: {
76
- type: _contractspec_lib_schema68.FieldType<number, number>;
76
+ type: _contractspec_lib_schema84.FieldType<string, string>;
77
77
  isOptional: false;
78
78
  };
79
79
  content: {
80
- type: _contractspec_lib_schema68.FieldType<string, string>;
80
+ type: _contractspec_lib_schema84.FieldType<string, string>;
81
81
  isOptional: false;
82
82
  };
83
83
  sourceRefs: {
84
- type: _contractspec_lib_schema68.SchemaModel<{
84
+ type: _contractspec_lib_schema84.SchemaModel<{
85
85
  sourceDocumentId: {
86
- type: _contractspec_lib_schema68.FieldType<string, string>;
86
+ type: _contractspec_lib_schema84.FieldType<string, string>;
87
87
  isOptional: false;
88
88
  };
89
89
  excerpt: {
90
- type: _contractspec_lib_schema68.FieldType<string, string>;
90
+ type: _contractspec_lib_schema84.FieldType<string, string>;
91
91
  isOptional: true;
92
92
  };
93
93
  }>;
@@ -95,42 +95,42 @@ declare const RuleVersionModel: _contractspec_lib_schema68.SchemaModel<{
95
95
  isOptional: false;
96
96
  };
97
97
  status: {
98
- type: _contractspec_lib_schema68.FieldType<string, string>;
98
+ type: _contractspec_lib_schema84.FieldType<string, string>;
99
99
  isOptional: false;
100
100
  };
101
101
  approvedBy: {
102
- type: _contractspec_lib_schema68.FieldType<string, string>;
102
+ type: _contractspec_lib_schema84.FieldType<string, string>;
103
103
  isOptional: true;
104
104
  };
105
105
  approvedAt: {
106
- type: _contractspec_lib_schema68.FieldType<Date, string>;
106
+ type: _contractspec_lib_schema84.FieldType<Date, string>;
107
107
  isOptional: true;
108
108
  };
109
109
  createdAt: {
110
- type: _contractspec_lib_schema68.FieldType<Date, string>;
110
+ type: _contractspec_lib_schema84.FieldType<Date, string>;
111
111
  isOptional: false;
112
112
  };
113
113
  }>;
114
- declare const KBSnapshotModel: _contractspec_lib_schema68.SchemaModel<{
114
+ declare const KBSnapshotModel: _contractspec_lib_schema84.SchemaModel<{
115
115
  id: {
116
- type: _contractspec_lib_schema68.FieldType<string, string>;
116
+ type: _contractspec_lib_schema84.FieldType<string, string>;
117
117
  isOptional: false;
118
118
  };
119
119
  jurisdiction: {
120
- type: _contractspec_lib_schema68.FieldType<string, string>;
120
+ type: _contractspec_lib_schema84.FieldType<string, string>;
121
121
  isOptional: false;
122
122
  };
123
123
  asOfDate: {
124
- type: _contractspec_lib_schema68.FieldType<Date, string>;
124
+ type: _contractspec_lib_schema84.FieldType<Date, string>;
125
125
  isOptional: false;
126
126
  };
127
127
  includedRuleVersionIds: {
128
- type: _contractspec_lib_schema68.FieldType<string, string>;
128
+ type: _contractspec_lib_schema84.FieldType<string, string>;
129
129
  isArray: true;
130
130
  isOptional: false;
131
131
  };
132
132
  publishedAt: {
133
- type: _contractspec_lib_schema68.FieldType<Date, string>;
133
+ type: _contractspec_lib_schema84.FieldType<Date, string>;
134
134
  isOptional: false;
135
135
  };
136
136
  }>;
@@ -88,7 +88,7 @@ const RuleVersionModel = defineSchemaModel({
88
88
  isOptional: false
89
89
  },
90
90
  version: {
91
- type: ScalarTypeEnum.Int_unsecure(),
91
+ type: ScalarTypeEnum.String_unsecure(),
92
92
  isOptional: false
93
93
  },
94
94
  content: {
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","names":[],"sources":["../../src/entities/models.ts"],"sourcesContent":["import { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';\n\nexport const SourceDocumentModel = defineSchemaModel({\n name: 'SourceDocument',\n description:\n 'Immutable raw source document metadata referencing a stored file.',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n authority: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n fetchedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n hash: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const SourceRefModel = defineSchemaModel({\n name: 'SourceRef',\n description: 'Reference to a source document used to justify a rule version.',\n fields: {\n sourceDocumentId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n excerpt: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nexport const RuleModel = defineSchemaModel({\n name: 'Rule',\n description:\n 'Curated rule (stable identity) with topic + jurisdiction scope.',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n topicKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const RuleVersionModel = defineSchemaModel({\n name: 'RuleVersion',\n description:\n 'A versioned rule content with source references and approval status.',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n ruleId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n topicKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n version: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n content: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n sourceRefs: { type: SourceRefModel, isArray: true, isOptional: false },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // draft|approved|rejected\n approvedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n approvedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const KBSnapshotModel = defineSchemaModel({\n name: 'KBSnapshot',\n description:\n 'Published KB snapshot (as-of) referencing approved rule versions.',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n asOfDate: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n includedRuleVersionIds: {\n type: ScalarTypeEnum.String_unsecure(),\n isArray: true,\n isOptional: false,\n },\n publishedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n"],"mappings":";;;AAEA,MAAa,sBAAsB,kBAAkB;CACnD,MAAM;CACN,aACE;CACF,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE;CACF,CAAC;AAEF,MAAa,iBAAiB,kBAAkB;CAC9C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,kBAAkB;GAChB,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE;CACF,CAAC;AAEF,MAAa,YAAY,kBAAkB;CACzC,MAAM;CACN,aACE;CACF,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE;CACF,CAAC;AAEF,MAAa,mBAAmB,kBAAkB;CAChD,MAAM;CACN,aACE;CACF,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,SAAS;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACnE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,YAAY;GAAE,MAAM;GAAgB,SAAS;GAAM,YAAY;GAAO;EACtE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACxE,YAAY;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EACjE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAa,kBAAkB,kBAAkB;CAC/C,MAAM;CACN,aACE;CACF,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,UAAU;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAChE,wBAAwB;GACtB,MAAM,eAAe,iBAAiB;GACtC,SAAS;GACT,YAAY;GACb;EACD,aAAa;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EACpE;CACF,CAAC"}
1
+ {"version":3,"file":"models.js","names":[],"sources":["../../src/entities/models.ts"],"sourcesContent":["import { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';\n\nexport const SourceDocumentModel = defineSchemaModel({\n name: 'SourceDocument',\n description:\n 'Immutable raw source document metadata referencing a stored file.',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n authority: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n fetchedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n hash: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n fileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const SourceRefModel = defineSchemaModel({\n name: 'SourceRef',\n description: 'Reference to a source document used to justify a rule version.',\n fields: {\n sourceDocumentId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n excerpt: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nexport const RuleModel = defineSchemaModel({\n name: 'Rule',\n description:\n 'Curated rule (stable identity) with topic + jurisdiction scope.',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n topicKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const RuleVersionModel = defineSchemaModel({\n name: 'RuleVersion',\n description:\n 'A versioned rule content with source references and approval status.',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n ruleId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n topicKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n version: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n content: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n sourceRefs: { type: SourceRefModel, isArray: true, isOptional: false },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // draft|approved|rejected\n approvedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n approvedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const KBSnapshotModel = defineSchemaModel({\n name: 'KBSnapshot',\n description:\n 'Published KB snapshot (as-of) referencing approved rule versions.',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n asOfDate: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n includedRuleVersionIds: {\n type: ScalarTypeEnum.String_unsecure(),\n isArray: true,\n isOptional: false,\n },\n publishedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n"],"mappings":";;;AAEA,MAAa,sBAAsB,kBAAkB;CACnD,MAAM;CACN,aACE;CACF,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE;CACF,CAAC;AAEF,MAAa,iBAAiB,kBAAkB;CAC9C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,kBAAkB;GAChB,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE;CACF,CAAC;AAEF,MAAa,YAAY,kBAAkB;CACzC,MAAM;CACN,aACE;CACF,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE;CACF,CAAC;AAEF,MAAa,mBAAmB,kBAAkB;CAChD,MAAM;CACN,aACE;CACF,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,YAAY;GAAE,MAAM;GAAgB,SAAS;GAAM,YAAY;GAAO;EACtE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACxE,YAAY;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EACjE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAa,kBAAkB,kBAAkB;CAC/C,MAAM;CACN,aACE;CACF,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,UAAU;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAChE,wBAAwB;GACtB,MAAM,eAAe,iBAAiB;GACtC,SAAS;GACT,YAAY;GACb;EACD,aAAa;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EACpE;CACF,CAAC"}
package/dist/events.d.ts CHANGED
@@ -1,60 +1,60 @@
1
1
  import * as _contractspec_lib_contracts4 from "@contractspec/lib.contracts";
2
- import * as _contractspec_lib_schema103 from "@contractspec/lib.schema";
2
+ import * as _contractspec_lib_schema68 from "@contractspec/lib.schema";
3
3
 
4
4
  //#region src/events.d.ts
5
- declare const KbSourceIngestedEvent: _contractspec_lib_contracts4.EventSpec<_contractspec_lib_schema103.SchemaModel<{
5
+ declare const KbSourceIngestedEvent: _contractspec_lib_contracts4.EventSpec<_contractspec_lib_schema68.SchemaModel<{
6
6
  sourceDocumentId: {
7
- type: _contractspec_lib_schema103.FieldType<string, string>;
7
+ type: _contractspec_lib_schema68.FieldType<string, string>;
8
8
  isOptional: false;
9
9
  };
10
10
  jurisdiction: {
11
- type: _contractspec_lib_schema103.FieldType<string, string>;
11
+ type: _contractspec_lib_schema68.FieldType<string, string>;
12
12
  isOptional: false;
13
13
  };
14
14
  hash: {
15
- type: _contractspec_lib_schema103.FieldType<string, string>;
15
+ type: _contractspec_lib_schema68.FieldType<string, string>;
16
16
  isOptional: false;
17
17
  };
18
18
  }>>;
19
- declare const KbRuleVersionCreatedEvent: _contractspec_lib_contracts4.EventSpec<_contractspec_lib_schema103.SchemaModel<{
19
+ declare const KbRuleVersionCreatedEvent: _contractspec_lib_contracts4.EventSpec<_contractspec_lib_schema68.SchemaModel<{
20
20
  ruleVersionId: {
21
- type: _contractspec_lib_schema103.FieldType<string, string>;
21
+ type: _contractspec_lib_schema68.FieldType<string, string>;
22
22
  isOptional: false;
23
23
  };
24
24
  ruleId: {
25
- type: _contractspec_lib_schema103.FieldType<string, string>;
25
+ type: _contractspec_lib_schema68.FieldType<string, string>;
26
26
  isOptional: false;
27
27
  };
28
28
  jurisdiction: {
29
- type: _contractspec_lib_schema103.FieldType<string, string>;
29
+ type: _contractspec_lib_schema68.FieldType<string, string>;
30
30
  isOptional: false;
31
31
  };
32
32
  status: {
33
- type: _contractspec_lib_schema103.FieldType<string, string>;
33
+ type: _contractspec_lib_schema68.FieldType<string, string>;
34
34
  isOptional: false;
35
35
  };
36
36
  }>>;
37
- declare const KbRuleVersionApprovedEvent: _contractspec_lib_contracts4.EventSpec<_contractspec_lib_schema103.SchemaModel<{
37
+ declare const KbRuleVersionApprovedEvent: _contractspec_lib_contracts4.EventSpec<_contractspec_lib_schema68.SchemaModel<{
38
38
  ruleVersionId: {
39
- type: _contractspec_lib_schema103.FieldType<string, string>;
39
+ type: _contractspec_lib_schema68.FieldType<string, string>;
40
40
  isOptional: false;
41
41
  };
42
42
  approver: {
43
- type: _contractspec_lib_schema103.FieldType<string, string>;
43
+ type: _contractspec_lib_schema68.FieldType<string, string>;
44
44
  isOptional: false;
45
45
  };
46
46
  }>>;
47
- declare const KbSnapshotPublishedEvent: _contractspec_lib_contracts4.EventSpec<_contractspec_lib_schema103.SchemaModel<{
47
+ declare const KbSnapshotPublishedEvent: _contractspec_lib_contracts4.EventSpec<_contractspec_lib_schema68.SchemaModel<{
48
48
  snapshotId: {
49
- type: _contractspec_lib_schema103.FieldType<string, string>;
49
+ type: _contractspec_lib_schema68.FieldType<string, string>;
50
50
  isOptional: false;
51
51
  };
52
52
  jurisdiction: {
53
- type: _contractspec_lib_schema103.FieldType<string, string>;
53
+ type: _contractspec_lib_schema68.FieldType<string, string>;
54
54
  isOptional: false;
55
55
  };
56
56
  includedRuleVersionsCount: {
57
- type: _contractspec_lib_schema103.FieldType<number, number>;
57
+ type: _contractspec_lib_schema68.FieldType<number, number>;
58
58
  isOptional: false;
59
59
  };
60
60
  }>>;
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","names":[],"sources":["../src/events.ts"],"sourcesContent":[],"mappings":";;;;cAgBa,uBAAqB,4BAAA,CAAA,sCAAA;;UAUhC,2BAAA,CAAA;;EAVW,CAAA;EAUX,YAAA,EAAA;;;;EAVgC,IAAA,EAAA;IAAA,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IA0BrB,UAAA,EAAA,KAAA;EAUX,CAAA;;cAVW,2BAAyB,4BAAA,CAAA,sCAAA;;UAUpC,2BAAA,CAAA,SAVoC,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAAA,CAAA;EAwBzB,MAAA,EAAA;IAUX,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;EAVqC,YAAA,EAAA;IAAA,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAyB1B,UAAA,EAAA,KAAA;EAUX,CAAA;;;;EAVmC,CAAA;CAAA,CAAA,CAAA;cAzBxB,4BAA0B,4BAAA,CAAA,sCAAA;;UAUrC,2BAAA,CAAA;;;;;;;;cAeW,0BAAwB,4BAAA,CAAA,sCAAA;;UAUnC,2BAAA,CAAA"}
1
+ {"version":3,"file":"events.d.ts","names":[],"sources":["../src/events.ts"],"sourcesContent":[],"mappings":";;;;cAgBa,uBAAqB,4BAAA,CAAA,qCAAA;;UAUhC,0BAAA,CAAA;;EAVW,CAAA;EAUX,YAAA,EAAA;;;;EAVgC,IAAA,EAAA;IAAA,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IA0BrB,UAAA,EAAA,KAAA;EAUX,CAAA;;cAVW,2BAAyB,4BAAA,CAAA,qCAAA;;UAUpC,0BAAA,CAAA,SAVoC,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAAA,CAAA;EAwBzB,MAAA,EAAA;IAUX,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;EAVqC,YAAA,EAAA;IAAA,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAyB1B,UAAA,EAAA,KAAA;EAUX,CAAA;;;;EAVmC,CAAA;CAAA,CAAA,CAAA;cAzBxB,4BAA0B,4BAAA,CAAA,qCAAA;;UAUrC,0BAAA,CAAA;;;;;;;;cAeW,0BAAwB,4BAAA,CAAA,qCAAA;;UAUnC,0BAAA,CAAA"}
package/dist/events.js CHANGED
@@ -23,7 +23,7 @@ const KbSourceIngestedPayload = defineSchemaModel({
23
23
  const KbSourceIngestedEvent = defineEvent({
24
24
  meta: {
25
25
  key: "kb.source.ingested",
26
- version: 1,
26
+ version: "1.0.0",
27
27
  description: "Source document ingested (immutable).",
28
28
  stability: "experimental",
29
29
  owners: ["@examples"],
@@ -56,7 +56,7 @@ const KbRuleVersionCreatedPayload = defineSchemaModel({
56
56
  const KbRuleVersionCreatedEvent = defineEvent({
57
57
  meta: {
58
58
  key: "kb.ruleVersion.created",
59
- version: 1,
59
+ version: "1.0.0",
60
60
  description: "Rule version created (draft).",
61
61
  stability: "experimental",
62
62
  owners: ["@examples"],
@@ -81,7 +81,7 @@ const KbRuleVersionApprovedPayload = defineSchemaModel({
81
81
  const KbRuleVersionApprovedEvent = defineEvent({
82
82
  meta: {
83
83
  key: "kb.ruleVersion.approved",
84
- version: 1,
84
+ version: "1.0.0",
85
85
  description: "Rule version approved (human verified).",
86
86
  stability: "experimental",
87
87
  owners: ["@examples"],
@@ -110,7 +110,7 @@ const KbSnapshotPublishedPayload = defineSchemaModel({
110
110
  const KbSnapshotPublishedEvent = defineEvent({
111
111
  meta: {
112
112
  key: "kb.snapshot.published",
113
- version: 1,
113
+ version: "1.0.0",
114
114
  description: "KB snapshot published.",
115
115
  stability: "experimental",
116
116
  owners: ["@examples"],
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","names":[],"sources":["../src/events.ts"],"sourcesContent":["import { defineEvent, defineSchemaModel } from '@contractspec/lib.contracts';\nimport { ScalarTypeEnum } from '@contractspec/lib.schema';\n\nconst KbSourceIngestedPayload = defineSchemaModel({\n name: 'KbSourceIngestedPayload',\n description: 'Emitted when a source document is ingested.',\n fields: {\n sourceDocumentId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n hash: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const KbSourceIngestedEvent = defineEvent({\n meta: {\n key: 'kb.source.ingested',\n version: 1,\n description: 'Source document ingested (immutable).',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['knowledge'],\n },\n payload: KbSourceIngestedPayload,\n});\n\nconst KbRuleVersionCreatedPayload = defineSchemaModel({\n name: 'KbRuleVersionCreatedPayload',\n description: 'Emitted when a rule version draft is created.',\n fields: {\n ruleVersionId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n ruleId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const KbRuleVersionCreatedEvent = defineEvent({\n meta: {\n key: 'kb.ruleVersion.created',\n version: 1,\n description: 'Rule version created (draft).',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['knowledge'],\n },\n payload: KbRuleVersionCreatedPayload,\n});\n\nconst KbRuleVersionApprovedPayload = defineSchemaModel({\n name: 'KbRuleVersionApprovedPayload',\n description: 'Emitted when a rule version is approved.',\n fields: {\n ruleVersionId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n approver: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const KbRuleVersionApprovedEvent = defineEvent({\n meta: {\n key: 'kb.ruleVersion.approved',\n version: 1,\n description: 'Rule version approved (human verified).',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['knowledge'],\n },\n payload: KbRuleVersionApprovedPayload,\n});\n\nconst KbSnapshotPublishedPayload = defineSchemaModel({\n name: 'KbSnapshotPublishedPayload',\n description: 'Emitted when a KB snapshot is published.',\n fields: {\n snapshotId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n includedRuleVersionsCount: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: false,\n },\n },\n});\n\nexport const KbSnapshotPublishedEvent = defineEvent({\n meta: {\n key: 'kb.snapshot.published',\n version: 1,\n description: 'KB snapshot published.',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['knowledge'],\n },\n payload: KbSnapshotPublishedPayload,\n});\n"],"mappings":";;;;AAGA,MAAM,0BAA0B,kBAAkB;CAChD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,kBAAkB;GAChB,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE;CACF,CAAC;AAEF,MAAa,wBAAwB,YAAY;CAC/C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,YAAY;EACpB;CACD,SAAS;CACV,CAAC;AAEF,MAAM,8BAA8B,kBAAkB;CACpD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,eAAe;GACb,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE;CACF,CAAC;AAEF,MAAa,4BAA4B,YAAY;CACnD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,YAAY;EACpB;CACD,SAAS;CACV,CAAC;AAEF,MAAM,+BAA+B,kBAAkB;CACrD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,eAAe;GACb,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE;CACF,CAAC;AAEF,MAAa,6BAA6B,YAAY;CACpD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,YAAY;EACpB;CACD,SAAS;CACV,CAAC;AAEF,MAAM,6BAA6B,kBAAkB;CACnD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACzE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,2BAA2B;GACzB,MAAM,eAAe,cAAc;GACnC,YAAY;GACb;EACF;CACF,CAAC;AAEF,MAAa,2BAA2B,YAAY;CAClD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,YAAY;EACpB;CACD,SAAS;CACV,CAAC"}
1
+ {"version":3,"file":"events.js","names":[],"sources":["../src/events.ts"],"sourcesContent":["import { defineEvent, defineSchemaModel } from '@contractspec/lib.contracts';\nimport { ScalarTypeEnum } from '@contractspec/lib.schema';\n\nconst KbSourceIngestedPayload = defineSchemaModel({\n name: 'KbSourceIngestedPayload',\n description: 'Emitted when a source document is ingested.',\n fields: {\n sourceDocumentId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n hash: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const KbSourceIngestedEvent = defineEvent({\n meta: {\n key: 'kb.source.ingested',\n version: '1.0.0',\n description: 'Source document ingested (immutable).',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['knowledge'],\n },\n payload: KbSourceIngestedPayload,\n});\n\nconst KbRuleVersionCreatedPayload = defineSchemaModel({\n name: 'KbRuleVersionCreatedPayload',\n description: 'Emitted when a rule version draft is created.',\n fields: {\n ruleVersionId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n ruleId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const KbRuleVersionCreatedEvent = defineEvent({\n meta: {\n key: 'kb.ruleVersion.created',\n version: '1.0.0',\n description: 'Rule version created (draft).',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['knowledge'],\n },\n payload: KbRuleVersionCreatedPayload,\n});\n\nconst KbRuleVersionApprovedPayload = defineSchemaModel({\n name: 'KbRuleVersionApprovedPayload',\n description: 'Emitted when a rule version is approved.',\n fields: {\n ruleVersionId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n approver: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const KbRuleVersionApprovedEvent = defineEvent({\n meta: {\n key: 'kb.ruleVersion.approved',\n version: '1.0.0',\n description: 'Rule version approved (human verified).',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['knowledge'],\n },\n payload: KbRuleVersionApprovedPayload,\n});\n\nconst KbSnapshotPublishedPayload = defineSchemaModel({\n name: 'KbSnapshotPublishedPayload',\n description: 'Emitted when a KB snapshot is published.',\n fields: {\n snapshotId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n jurisdiction: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n includedRuleVersionsCount: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: false,\n },\n },\n});\n\nexport const KbSnapshotPublishedEvent = defineEvent({\n meta: {\n key: 'kb.snapshot.published',\n version: '1.0.0',\n description: 'KB snapshot published.',\n stability: 'experimental',\n owners: ['@examples'],\n tags: ['knowledge'],\n },\n payload: KbSnapshotPublishedPayload,\n});\n"],"mappings":";;;;AAGA,MAAM,0BAA0B,kBAAkB;CAChD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,kBAAkB;GAChB,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE;CACF,CAAC;AAEF,MAAa,wBAAwB,YAAY;CAC/C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,YAAY;EACpB;CACD,SAAS;CACV,CAAC;AAEF,MAAM,8BAA8B,kBAAkB;CACpD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,eAAe;GACb,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE;CACF,CAAC;AAEF,MAAa,4BAA4B,YAAY;CACnD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,YAAY;EACpB;CACD,SAAS;CACV,CAAC;AAEF,MAAM,+BAA+B,kBAAkB;CACrD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,eAAe;GACb,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE;CACF,CAAC;AAEF,MAAa,6BAA6B,YAAY;CACpD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,YAAY;EACpB;CACD,SAAS;CACV,CAAC;AAEF,MAAM,6BAA6B,kBAAkB;CACnD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACzE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,2BAA2B;GACzB,MAAM,eAAe,cAAc;GACnC,YAAY;GACb;EACF;CACF,CAAC;AAEF,MAAa,2BAA2B,YAAY;CAClD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,YAAY;EACpB;CACD,SAAS;CACV,CAAC"}
package/dist/example.d.ts CHANGED
@@ -1,36 +1,7 @@
1
+ import { ExampleSpec } from "@contractspec/lib.contracts";
2
+
1
3
  //#region src/example.d.ts
2
- declare const example: {
3
- readonly id: "versioned-knowledge-base";
4
- readonly title: "Versioned Knowledge Base";
5
- readonly summary: "Curated KB with immutable sources, reviewable rule versions, and published snapshots.";
6
- readonly tags: readonly ["knowledge", "versioning", "snapshots"];
7
- readonly kind: "knowledge";
8
- readonly visibility: "public";
9
- readonly docs: {
10
- readonly rootDocId: "docs.examples.versioned-knowledge-base";
11
- };
12
- readonly entrypoints: {
13
- readonly packageName: "@contractspec/example.versioned-knowledge-base";
14
- readonly feature: "./feature";
15
- readonly contracts: "./contracts";
16
- readonly handlers: "./handlers";
17
- readonly docs: "./docs";
18
- };
19
- readonly surfaces: {
20
- readonly templates: true;
21
- readonly sandbox: {
22
- readonly enabled: true;
23
- readonly modes: readonly ["markdown", "specs", "builder"];
24
- };
25
- readonly studio: {
26
- readonly enabled: true;
27
- readonly installable: true;
28
- };
29
- readonly mcp: {
30
- readonly enabled: true;
31
- };
32
- };
33
- };
4
+ declare const example: ExampleSpec;
34
5
  //#endregion
35
6
  export { example as default };
36
7
  //# sourceMappingURL=example.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";cAAM;EAAA,SAAA,EAwBI,EAAA,0BAAA"}
1
+ {"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";;;cAEM,SAAS"}
package/dist/example.js CHANGED
@@ -1,15 +1,20 @@
1
1
  //#region src/example.ts
2
2
  const example = {
3
- id: "versioned-knowledge-base",
4
- title: "Versioned Knowledge Base",
5
- summary: "Curated KB with immutable sources, reviewable rule versions, and published snapshots.",
6
- tags: [
7
- "knowledge",
8
- "versioning",
9
- "snapshots"
10
- ],
11
- kind: "knowledge",
12
- visibility: "public",
3
+ meta: {
4
+ key: "versioned-knowledge-base",
5
+ version: "1.0.0",
6
+ title: "Versioned Knowledge Base",
7
+ description: "Curated KB with immutable sources, reviewable rule versions, and published snapshots.",
8
+ kind: "knowledge",
9
+ visibility: "public",
10
+ stability: "experimental",
11
+ owners: ["@platform.core"],
12
+ tags: [
13
+ "knowledge",
14
+ "versioning",
15
+ "snapshots"
16
+ ]
17
+ },
13
18
  docs: { rootDocId: "docs.examples.versioned-knowledge-base" },
14
19
  entrypoints: {
15
20
  packageName: "@contractspec/example.versioned-knowledge-base",
@@ -1 +1 @@
1
- {"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["const example = {\n id: 'versioned-knowledge-base',\n title: 'Versioned Knowledge Base',\n summary:\n 'Curated KB with immutable sources, reviewable rule versions, and published snapshots.',\n tags: ['knowledge', 'versioning', 'snapshots'],\n kind: 'knowledge',\n visibility: 'public',\n docs: {\n rootDocId: 'docs.examples.versioned-knowledge-base',\n },\n entrypoints: {\n packageName: '@contractspec/example.versioned-knowledge-base',\n feature: './feature',\n contracts: './contracts',\n handlers: './handlers',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: { enabled: true, modes: ['markdown', 'specs', 'builder'] },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n} as const;\n\nexport default example;\n"],"mappings":";AAAA,MAAM,UAAU;CACd,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;EAAC;EAAa;EAAc;EAAY;CAC9C,MAAM;CACN,YAAY;CACZ,MAAM,EACJ,WAAW,0CACZ;CACD,aAAa;EACX,aAAa;EACb,SAAS;EACT,WAAW;EACX,UAAU;EACV,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GAAE,SAAS;GAAM,OAAO;IAAC;IAAY;IAAS;IAAU;GAAE;EACnE,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF;AAED,sBAAe"}
1
+ {"version":3,"file":"example.js","names":["example: ExampleSpec"],"sources":["../src/example.ts"],"sourcesContent":["import type { ExampleSpec } from '@contractspec/lib.contracts';\n\nconst example: ExampleSpec = {\n meta: {\n key: 'versioned-knowledge-base',\n version: '1.0.0',\n title: 'Versioned Knowledge Base',\n description:\n 'Curated KB with immutable sources, reviewable rule versions, and published snapshots.',\n kind: 'knowledge',\n visibility: 'public',\n stability: 'experimental',\n owners: ['@platform.core'],\n tags: ['knowledge', 'versioning', 'snapshots'],\n },\n docs: {\n rootDocId: 'docs.examples.versioned-knowledge-base',\n },\n entrypoints: {\n packageName: '@contractspec/example.versioned-knowledge-base',\n feature: './feature',\n contracts: './contracts',\n handlers: './handlers',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: { enabled: true, modes: ['markdown', 'specs', 'builder'] },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n};\n\nexport default example;\n"],"mappings":";AAEA,MAAMA,UAAuB;CAC3B,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,YAAY;EACZ,WAAW;EACX,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAa;GAAc;GAAY;EAC/C;CACD,MAAM,EACJ,WAAW,0CACZ;CACD,aAAa;EACX,aAAa;EACb,SAAS;EACT,WAAW;EACX,UAAU;EACV,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GAAE,SAAS;GAAM,OAAO;IAAC;IAAY;IAAS;IAAU;GAAE;EACnE,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF;AAED,sBAAe"}
@@ -22,7 +22,7 @@ interface RuleVersion {
22
22
  ruleId: string;
23
23
  jurisdiction: string;
24
24
  topicKey: string;
25
- version: number;
25
+ version: string;
26
26
  content: string;
27
27
  sourceRefs: SourceRef[];
28
28
  status: 'draft' | 'approved' | 'rejected';