@contractspec/example.kb-update-pipeline 1.44.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.
Files changed (70) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +55 -0
  2. package/.turbo/turbo-build.log +56 -0
  3. package/CHANGELOG.md +195 -0
  4. package/LICENSE +21 -0
  5. package/README.md +28 -0
  6. package/dist/docs/index.d.ts +1 -0
  7. package/dist/docs/index.js +1 -0
  8. package/dist/docs/kb-update-pipeline.docblock.d.ts +1 -0
  9. package/dist/docs/kb-update-pipeline.docblock.js +31 -0
  10. package/dist/docs/kb-update-pipeline.docblock.js.map +1 -0
  11. package/dist/entities/index.d.ts +2 -0
  12. package/dist/entities/index.js +3 -0
  13. package/dist/entities/models.d.ts +61 -0
  14. package/dist/entities/models.d.ts.map +1 -0
  15. package/dist/entities/models.js +74 -0
  16. package/dist/entities/models.js.map +1 -0
  17. package/dist/events.d.ts +74 -0
  18. package/dist/events.d.ts.map +1 -0
  19. package/dist/events.js +150 -0
  20. package/dist/events.js.map +1 -0
  21. package/dist/example.d.ts +36 -0
  22. package/dist/example.d.ts.map +1 -0
  23. package/dist/example.js +43 -0
  24. package/dist/example.js.map +1 -0
  25. package/dist/feature.d.ts +7 -0
  26. package/dist/feature.d.ts.map +1 -0
  27. package/dist/feature.js +80 -0
  28. package/dist/feature.js.map +1 -0
  29. package/dist/handlers/index.d.ts +2 -0
  30. package/dist/handlers/index.js +3 -0
  31. package/dist/handlers/memory.handlers.d.ts +68 -0
  32. package/dist/handlers/memory.handlers.d.ts.map +1 -0
  33. package/dist/handlers/memory.handlers.js +93 -0
  34. package/dist/handlers/memory.handlers.js.map +1 -0
  35. package/dist/index.d.ts +10 -0
  36. package/dist/index.js +12 -0
  37. package/dist/kb-update-pipeline.feature.d.ts +7 -0
  38. package/dist/kb-update-pipeline.feature.d.ts.map +1 -0
  39. package/dist/kb-update-pipeline.feature.js +140 -0
  40. package/dist/kb-update-pipeline.feature.js.map +1 -0
  41. package/dist/operations/index.d.ts +2 -0
  42. package/dist/operations/index.js +3 -0
  43. package/dist/operations/pipeline.d.ts +137 -0
  44. package/dist/operations/pipeline.d.ts.map +1 -0
  45. package/dist/operations/pipeline.js +183 -0
  46. package/dist/operations/pipeline.js.map +1 -0
  47. package/dist/presentations.d.ts +9 -0
  48. package/dist/presentations.d.ts.map +1 -0
  49. package/dist/presentations.js +71 -0
  50. package/dist/presentations.js.map +1 -0
  51. package/example.ts +1 -0
  52. package/package.json +79 -0
  53. package/src/docs/index.ts +1 -0
  54. package/src/docs/kb-update-pipeline.docblock.ts +30 -0
  55. package/src/entities/index.ts +1 -0
  56. package/src/entities/models.ts +53 -0
  57. package/src/events.ts +134 -0
  58. package/src/example.ts +27 -0
  59. package/src/feature.ts +38 -0
  60. package/src/handlers/index.ts +1 -0
  61. package/src/handlers/memory.handlers.test.ts +81 -0
  62. package/src/handlers/memory.handlers.ts +186 -0
  63. package/src/index.ts +15 -0
  64. package/src/kb-update-pipeline.feature.ts +59 -0
  65. package/src/operations/index.ts +1 -0
  66. package/src/operations/pipeline.ts +159 -0
  67. package/src/presentations.ts +69 -0
  68. package/tsconfig.json +19 -0
  69. package/tsconfig.tsbuildinfo +1 -0
  70. package/tsdown.config.js +17 -0
@@ -0,0 +1,55 @@
1
+ $ tsdown
2
+ ℹ tsdown v0.18.3 powered by rolldown v1.0.0-beta.57
3
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/kb-update-pipeline/tsdown.config.js
4
+ ℹ entry: src/events.ts, src/example.ts, src/feature.ts, src/index.ts, src/kb-update-pipeline.feature.ts, src/presentations.ts, src/docs/index.ts, src/docs/kb-update-pipeline.docblock.ts, src/entities/index.ts, src/entities/models.ts, src/handlers/index.ts, src/handlers/memory.handlers.ts, src/operations/index.ts, src/operations/pipeline.ts
5
+ ℹ target: esnext
6
+ ℹ tsconfig: tsconfig.json
7
+ ℹ Build start
8
+ ℹ Cleaning 49 files
9
+ ℹ dist/operations/pipeline.js 4.92 kB │ gzip: 1.36 kB
10
+ ℹ dist/events.js 3.66 kB │ gzip: 0.72 kB
11
+ ℹ dist/handlers/memory.handlers.js 3.37 kB │ gzip: 1.12 kB
12
+ ℹ dist/kb-update-pipeline.feature.js 2.12 kB │ gzip: 0.64 kB
13
+ ℹ dist/entities/models.js 1.81 kB │ gzip: 0.53 kB
14
+ ℹ dist/presentations.js 1.80 kB │ gzip: 0.61 kB
15
+ ℹ dist/docs/kb-update-pipeline.docblock.js 1.49 kB │ gzip: 0.71 kB
16
+ ℹ dist/index.js 1.44 kB │ gzip: 0.42 kB
17
+ ℹ dist/feature.js 1.30 kB │ gzip: 0.54 kB
18
+ ℹ dist/example.js 0.86 kB │ gzip: 0.47 kB
19
+ ℹ dist/operations/index.js 0.31 kB │ gzip: 0.14 kB
20
+ ℹ dist/entities/index.js 0.25 kB │ gzip: 0.13 kB
21
+ ℹ dist/handlers/index.js 0.16 kB │ gzip: 0.10 kB
22
+ ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
23
+ ℹ dist/handlers/memory.handlers.js.map 8.17 kB │ gzip: 2.35 kB
24
+ ℹ dist/operations/pipeline.js.map 7.18 kB │ gzip: 1.80 kB
25
+ ℹ dist/events.js.map 5.62 kB │ gzip: 1.04 kB
26
+ ℹ dist/kb-update-pipeline.feature.js.map 3.38 kB │ gzip: 1.02 kB
27
+ ℹ dist/presentations.js.map 3.00 kB │ gzip: 0.84 kB
28
+ ℹ dist/entities/models.js.map 2.68 kB │ gzip: 0.81 kB
29
+ ℹ dist/feature.js.map 2.10 kB │ gzip: 0.83 kB
30
+ ℹ dist/docs/kb-update-pipeline.docblock.js.map 2.00 kB │ gzip: 0.89 kB
31
+ ℹ dist/example.js.map 1.24 kB │ gzip: 0.64 kB
32
+ ℹ dist/handlers/memory.handlers.d.ts.map 0.92 kB │ gzip: 0.44 kB
33
+ ℹ dist/events.d.ts.map 0.81 kB │ gzip: 0.33 kB
34
+ ℹ dist/operations/pipeline.d.ts.map 0.76 kB │ gzip: 0.33 kB
35
+ ℹ dist/entities/models.d.ts.map 0.47 kB │ gzip: 0.28 kB
36
+ ℹ dist/presentations.d.ts.map 0.19 kB │ gzip: 0.16 kB
37
+ ℹ dist/kb-update-pipeline.feature.d.ts.map 0.16 kB │ gzip: 0.14 kB
38
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
39
+ ℹ dist/feature.d.ts.map 0.13 kB │ gzip: 0.12 kB
40
+ ℹ dist/operations/pipeline.d.ts 4.33 kB │ gzip: 0.58 kB
41
+ ℹ dist/events.d.ts 2.54 kB │ gzip: 0.42 kB
42
+ ℹ dist/entities/models.d.ts 2.00 kB │ gzip: 0.41 kB
43
+ ℹ dist/handlers/memory.handlers.d.ts 1.94 kB │ gzip: 0.64 kB
44
+ ℹ dist/index.d.ts 1.48 kB │ gzip: 0.41 kB
45
+ ℹ dist/example.d.ts 1.11 kB │ gzip: 0.47 kB
46
+ ℹ dist/presentations.d.ts 0.41 kB │ gzip: 0.19 kB
47
+ ℹ dist/operations/index.d.ts 0.31 kB │ gzip: 0.13 kB
48
+ ℹ dist/kb-update-pipeline.feature.d.ts 0.28 kB │ gzip: 0.18 kB
49
+ ℹ dist/handlers/index.d.ts 0.25 kB │ gzip: 0.10 kB
50
+ ℹ dist/entities/index.d.ts 0.25 kB │ gzip: 0.13 kB
51
+ ℹ dist/feature.d.ts 0.24 kB │ gzip: 0.17 kB
52
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
53
+ ℹ dist/docs/kb-update-pipeline.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
54
+ ℹ 45 files, total: 77.63 kB
55
+ ✔ Build complete in 19368ms
@@ -0,0 +1,56 @@
1
+ $ bun build:types && bun build:bundle
2
+ $ tsc --noEmit
3
+ $ tsdown
4
+ ℹ tsdown v0.18.3 powered by rolldown v1.0.0-beta.57
5
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/kb-update-pipeline/tsdown.config.js
6
+ ℹ entry: src/events.ts, src/example.ts, src/feature.ts, src/index.ts, src/kb-update-pipeline.feature.ts, src/presentations.ts, src/docs/index.ts, src/docs/kb-update-pipeline.docblock.ts, src/entities/index.ts, src/entities/models.ts, src/handlers/index.ts, src/handlers/memory.handlers.ts, src/operations/index.ts, src/operations/pipeline.ts
7
+ ℹ target: esnext
8
+ ℹ tsconfig: tsconfig.json
9
+ ℹ Build start
10
+ ℹ dist/operations/pipeline.js 4.92 kB │ gzip: 1.36 kB
11
+ ℹ dist/events.js 3.66 kB │ gzip: 0.72 kB
12
+ ℹ dist/handlers/memory.handlers.js 3.37 kB │ gzip: 1.12 kB
13
+ ℹ dist/kb-update-pipeline.feature.js 2.12 kB │ gzip: 0.64 kB
14
+ ℹ dist/entities/models.js 1.81 kB │ gzip: 0.53 kB
15
+ ℹ dist/presentations.js 1.80 kB │ gzip: 0.61 kB
16
+ ℹ dist/docs/kb-update-pipeline.docblock.js 1.49 kB │ gzip: 0.71 kB
17
+ ℹ dist/index.js 1.44 kB │ gzip: 0.42 kB
18
+ ℹ dist/feature.js 1.30 kB │ gzip: 0.54 kB
19
+ ℹ dist/example.js 0.86 kB │ gzip: 0.47 kB
20
+ ℹ dist/operations/index.js 0.31 kB │ gzip: 0.14 kB
21
+ ℹ dist/entities/index.js 0.25 kB │ gzip: 0.13 kB
22
+ ℹ dist/handlers/index.js 0.16 kB │ gzip: 0.10 kB
23
+ ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
24
+ ℹ dist/handlers/memory.handlers.js.map 8.17 kB │ gzip: 2.35 kB
25
+ ℹ dist/operations/pipeline.js.map 7.18 kB │ gzip: 1.80 kB
26
+ ℹ dist/events.js.map 5.62 kB │ gzip: 1.04 kB
27
+ ℹ dist/kb-update-pipeline.feature.js.map 3.38 kB │ gzip: 1.02 kB
28
+ ℹ dist/presentations.js.map 3.00 kB │ gzip: 0.84 kB
29
+ ℹ dist/entities/models.js.map 2.68 kB │ gzip: 0.81 kB
30
+ ℹ dist/feature.js.map 2.10 kB │ gzip: 0.83 kB
31
+ ℹ dist/docs/kb-update-pipeline.docblock.js.map 2.00 kB │ gzip: 0.89 kB
32
+ ℹ dist/example.js.map 1.24 kB │ gzip: 0.64 kB
33
+ ℹ dist/handlers/memory.handlers.d.ts.map 0.92 kB │ gzip: 0.44 kB
34
+ ℹ dist/events.d.ts.map 0.81 kB │ gzip: 0.33 kB
35
+ ℹ dist/operations/pipeline.d.ts.map 0.76 kB │ gzip: 0.33 kB
36
+ ℹ dist/entities/models.d.ts.map 0.47 kB │ gzip: 0.28 kB
37
+ ℹ dist/presentations.d.ts.map 0.19 kB │ gzip: 0.16 kB
38
+ ℹ dist/kb-update-pipeline.feature.d.ts.map 0.16 kB │ gzip: 0.14 kB
39
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
40
+ ℹ dist/feature.d.ts.map 0.13 kB │ gzip: 0.12 kB
41
+ ℹ dist/operations/pipeline.d.ts 4.33 kB │ gzip: 0.58 kB
42
+ ℹ dist/events.d.ts 2.54 kB │ gzip: 0.42 kB
43
+ ℹ dist/entities/models.d.ts 2.00 kB │ gzip: 0.41 kB
44
+ ℹ dist/handlers/memory.handlers.d.ts 1.94 kB │ gzip: 0.64 kB
45
+ ℹ dist/index.d.ts 1.48 kB │ gzip: 0.41 kB
46
+ ℹ dist/example.d.ts 1.11 kB │ gzip: 0.47 kB
47
+ ℹ dist/presentations.d.ts 0.41 kB │ gzip: 0.19 kB
48
+ ℹ dist/operations/index.d.ts 0.31 kB │ gzip: 0.13 kB
49
+ ℹ dist/kb-update-pipeline.feature.d.ts 0.28 kB │ gzip: 0.18 kB
50
+ ℹ dist/handlers/index.d.ts 0.25 kB │ gzip: 0.10 kB
51
+ ℹ dist/entities/index.d.ts 0.25 kB │ gzip: 0.13 kB
52
+ ℹ dist/feature.d.ts 0.24 kB │ gzip: 0.17 kB
53
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
54
+ ℹ dist/docs/kb-update-pipeline.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
55
+ ℹ 45 files, total: 77.63 kB
56
+ ✔ Build complete in 22381ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,195 @@
1
+ # @contractspec/example.kb-update-pipeline
2
+
3
+ ## 1.44.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5f3a868: chore: isolate branding to contractspec.io
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [5f3a868]
12
+ - @contractspec/module.notifications@1.44.0
13
+ - @contractspec/lib.identity-rbac@1.44.0
14
+ - @contractspec/lib.contracts@1.44.0
15
+ - @contractspec/lib.schema@1.44.0
16
+
17
+ ## 1.43.4
18
+
19
+ ### Patch Changes
20
+
21
+ - 9216062: fix: cross-platform compatibility
22
+ - Updated dependencies [9216062]
23
+ - @contractspec/module.notifications@1.43.4
24
+ - @contractspec/lib.identity-rbac@1.43.4
25
+ - @contractspec/lib.contracts@1.43.4
26
+ - @contractspec/lib.schema@1.43.3
27
+
28
+ ## 1.43.3
29
+
30
+ ### Patch Changes
31
+
32
+ - 24d9759: improve documentation
33
+ - Updated dependencies [24d9759]
34
+ - @contractspec/module.notifications@1.43.3
35
+ - @contractspec/lib.identity-rbac@1.43.3
36
+ - @contractspec/lib.contracts@1.43.3
37
+ - @contractspec/lib.schema@1.43.2
38
+
39
+ ## 1.43.2
40
+
41
+ ### Patch Changes
42
+
43
+ - e147271: fix: improve stability
44
+ - Updated dependencies [e147271]
45
+ - @contractspec/module.notifications@1.43.2
46
+ - @contractspec/lib.identity-rbac@1.43.2
47
+ - @contractspec/lib.contracts@1.43.2
48
+ - @contractspec/lib.schema@1.43.1
49
+
50
+ ## 1.43.1
51
+
52
+ ### Patch Changes
53
+
54
+ - Updated dependencies [f28fdad]
55
+ - @contractspec/lib.contracts@1.43.1
56
+ - @contractspec/lib.identity-rbac@1.43.1
57
+ - @contractspec/module.notifications@1.43.1
58
+
59
+ ## 1.43.0
60
+
61
+ ### Minor Changes
62
+
63
+ - 042d072: feat: schema declaration using json schema, including zod
64
+
65
+ ### Patch Changes
66
+
67
+ - Updated dependencies [042d072]
68
+ - @contractspec/module.notifications@1.43.0
69
+ - @contractspec/lib.identity-rbac@1.43.0
70
+ - @contractspec/lib.contracts@1.43.0
71
+ - @contractspec/lib.schema@1.43.0
72
+
73
+ ## 1.42.10
74
+
75
+ ### Patch Changes
76
+
77
+ - 1e6a0f1: fix: mcp server
78
+ - Updated dependencies [1e6a0f1]
79
+ - @contractspec/module.notifications@1.42.10
80
+ - @contractspec/lib.identity-rbac@1.42.10
81
+ - @contractspec/lib.contracts@1.42.10
82
+ - @contractspec/lib.schema@1.42.10
83
+
84
+ ## 1.42.9
85
+
86
+ ### Patch Changes
87
+
88
+ - 9281db7: fix ModelRegistry
89
+ - Updated dependencies [9281db7]
90
+ - @contractspec/module.notifications@1.42.9
91
+ - @contractspec/lib.identity-rbac@1.42.9
92
+ - @contractspec/lib.contracts@1.42.9
93
+ - @contractspec/lib.schema@1.42.9
94
+
95
+ ## 1.42.8
96
+
97
+ ### Patch Changes
98
+
99
+ - e07b5ac: fix
100
+ - Updated dependencies [e07b5ac]
101
+ - @contractspec/module.notifications@1.42.8
102
+ - @contractspec/lib.identity-rbac@1.42.8
103
+ - @contractspec/lib.contracts@1.42.8
104
+ - @contractspec/lib.schema@1.42.8
105
+
106
+ ## 1.42.7
107
+
108
+ ### Patch Changes
109
+
110
+ - e9b575d: fix release
111
+ - Updated dependencies [e9b575d]
112
+ - @contractspec/module.notifications@1.42.7
113
+ - @contractspec/lib.identity-rbac@1.42.7
114
+ - @contractspec/lib.contracts@1.42.7
115
+ - @contractspec/lib.schema@1.42.7
116
+
117
+ ## 1.42.6
118
+
119
+ ### Patch Changes
120
+
121
+ - 1500242: fix tooling
122
+ - Updated dependencies [1500242]
123
+ - @contractspec/module.notifications@1.42.6
124
+ - @contractspec/lib.identity-rbac@1.42.6
125
+ - @contractspec/lib.contracts@1.42.6
126
+ - @contractspec/lib.schema@1.42.6
127
+
128
+ ## 1.42.5
129
+
130
+ ### Patch Changes
131
+
132
+ - 1299719: fix vscode
133
+ - Updated dependencies [1299719]
134
+ - @contractspec/module.notifications@1.42.5
135
+ - @contractspec/lib.identity-rbac@1.42.5
136
+ - @contractspec/lib.contracts@1.42.5
137
+ - @contractspec/lib.schema@1.42.5
138
+
139
+ ## 1.42.4
140
+
141
+ ### Patch Changes
142
+
143
+ - ac28b99: fix: generate from openapi
144
+ - Updated dependencies [ac28b99]
145
+ - @contractspec/module.notifications@1.42.4
146
+ - @contractspec/lib.identity-rbac@1.42.4
147
+ - @contractspec/lib.contracts@1.42.4
148
+ - @contractspec/lib.schema@1.42.4
149
+
150
+ ## 1.42.3
151
+
152
+ ### Patch Changes
153
+
154
+ - 3f5d015: fix(tooling): cicd
155
+ - Updated dependencies [3f5d015]
156
+ - @contractspec/lib.contracts@1.42.3
157
+ - @contractspec/lib.identity-rbac@1.42.3
158
+ - @contractspec/lib.schema@1.42.3
159
+ - @contractspec/module.notifications@1.42.3
160
+
161
+ ## 1.42.2
162
+
163
+ ### Patch Changes
164
+
165
+ - 1f9ac4c: fix
166
+ - Updated dependencies [1f9ac4c]
167
+ - @contractspec/lib.contracts@1.42.2
168
+ - @contractspec/lib.identity-rbac@1.42.2
169
+ - @contractspec/lib.schema@1.42.2
170
+ - @contractspec/module.notifications@1.42.2
171
+
172
+ ## 1.42.1
173
+
174
+ ### Patch Changes
175
+
176
+ - f043995: Fix release
177
+ - Updated dependencies [f043995]
178
+ - @contractspec/module.notifications@1.42.1
179
+ - @contractspec/lib.identity-rbac@1.42.1
180
+ - @contractspec/lib.contracts@1.42.1
181
+ - @contractspec/lib.schema@1.42.1
182
+
183
+ ## 1.42.0
184
+
185
+ ### Minor Changes
186
+
187
+ - 8eefd9c: initial release
188
+
189
+ ### Patch Changes
190
+
191
+ - Updated dependencies [8eefd9c]
192
+ - @contractspec/lib.contracts@1.42.0
193
+ - @contractspec/lib.identity-rbac@1.42.0
194
+ - @contractspec/lib.schema@1.42.0
195
+ - @contractspec/module.notifications@1.42.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Chaman Ventures, SASU
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # `@contractspec/example.kb-update-pipeline`
2
+
3
+ Website: https://contractspec.io/
4
+
5
+ Spec-first example for a **knowledge base update pipeline** where:
6
+
7
+ - automation **proposes** changes (watch/diff/summarize/propose patches)\n+- humans **verify** (HITL) with role-based rules\n+- snapshots are published only when rule versions are approved\n+- notifications + audit trails provide traceability\n+
8
+ ## Contracts
9
+
10
+ - `kbPipeline.runWatch()`\n+- `kbPipeline.createReviewTask(changeCandidateId)`\n+- `kbPipeline.submitDecision(reviewTaskId, decision)`\n+- `kbPipeline.publishIfReady(jurisdiction)`\n+
11
+ ## Tests
12
+
13
+ - high-risk change cannot be approved by curator role\n+- publish fails if any included rule versions are unapproved\n+- notifications fire on review requested\n+
14
+ ## Running tests
15
+
16
+ ```bash
17
+ bun test
18
+ ```
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ import "./kb-update-pipeline.docblock.js";
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,31 @@
1
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
2
+
3
+ //#region src/docs/kb-update-pipeline.docblock.ts
4
+ registerDocBlocks([{
5
+ id: "docs.examples.kb-update-pipeline.goal",
6
+ title: "KB Update Pipeline — Goal",
7
+ summary: "Automation proposes KB patches; humans verify; publishing is blocked until approvals are complete.",
8
+ kind: "goal",
9
+ visibility: "public",
10
+ route: "/docs/examples/kb-update-pipeline/goal",
11
+ tags: [
12
+ "knowledge",
13
+ "pipeline",
14
+ "hitl",
15
+ "audit"
16
+ ],
17
+ body: `## Why it matters
18
+ - Keeps humans as the verifiers (HITL) while automation does the busywork.\n- Produces an auditable chain: source change -> diff -> proposal -> review -> publish.\n\n## Guardrails\n- High-risk changes require expert approval.\n- Publishing fails if any included rule versions are not approved.\n- Review requests emit notifications/events.`
19
+ }, {
20
+ id: "docs.examples.kb-update-pipeline.reference",
21
+ title: "KB Update Pipeline — Reference",
22
+ summary: "Entities, contracts, and events for the KB update pipeline example.",
23
+ kind: "reference",
24
+ visibility: "public",
25
+ route: "/docs/examples/kb-update-pipeline",
26
+ tags: ["knowledge", "reference"],
27
+ body: `## Contracts\n- kbPipeline.runWatch\n- kbPipeline.createReviewTask\n- kbPipeline.submitDecision\n- kbPipeline.publishIfReady\n\n## Events\n- kb.change.detected\n- kb.change.summarized\n- kb.patch.proposed\n- kb.review.requested\n- kb.review.decided`
28
+ }]);
29
+
30
+ //#endregion
31
+ //# sourceMappingURL=kb-update-pipeline.docblock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kb-update-pipeline.docblock.js","names":[],"sources":["../../src/docs/kb-update-pipeline.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst docBlocks: DocBlock[] = [\n {\n id: 'docs.examples.kb-update-pipeline.goal',\n title: 'KB Update Pipeline — Goal',\n summary:\n 'Automation proposes KB patches; humans verify; publishing is blocked until approvals are complete.',\n kind: 'goal',\n visibility: 'public',\n route: '/docs/examples/kb-update-pipeline/goal',\n tags: ['knowledge', 'pipeline', 'hitl', 'audit'],\n body: `## Why it matters\n- Keeps humans as the verifiers (HITL) while automation does the busywork.\\n- Produces an auditable chain: source change -> diff -> proposal -> review -> publish.\\n\\n## Guardrails\\n- High-risk changes require expert approval.\\n- Publishing fails if any included rule versions are not approved.\\n- Review requests emit notifications/events.`,\n },\n {\n id: 'docs.examples.kb-update-pipeline.reference',\n title: 'KB Update Pipeline — Reference',\n summary:\n 'Entities, contracts, and events for the KB update pipeline example.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/kb-update-pipeline',\n tags: ['knowledge', 'reference'],\n body: `## Contracts\\n- kbPipeline.runWatch\\n- kbPipeline.createReviewTask\\n- kbPipeline.submitDecision\\n- kbPipeline.publishIfReady\\n\\n## Events\\n- kb.change.detected\\n- kb.change.summarized\\n- kb.patch.proposed\\n- kb.review.requested\\n- kb.review.decided`,\n },\n];\n\nregisterDocBlocks(docBlocks);\n"],"mappings":";;;AA6BA,kBA1B8B,CAC5B;CACE,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EAAC;EAAa;EAAY;EAAQ;EAAQ;CAChD,MAAM;;CAEP,EACD;CACE,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM,CAAC,aAAa,YAAY;CAChC,MAAM;CACP,CACF,CAE2B"}
@@ -0,0 +1,2 @@
1
+ import { ChangeCandidateModel, ChangeRiskLevelEnum, ReviewAssignedRoleEnum, ReviewDecisionEnum, ReviewTaskModel } from "./models.js";
2
+ export { ChangeCandidateModel, ChangeRiskLevelEnum, ReviewAssignedRoleEnum, ReviewDecisionEnum, ReviewTaskModel };
@@ -0,0 +1,3 @@
1
+ import { ChangeCandidateModel, ChangeRiskLevelEnum, ReviewAssignedRoleEnum, ReviewDecisionEnum, ReviewTaskModel } from "./models.js";
2
+
3
+ export { ChangeCandidateModel, ChangeRiskLevelEnum, ReviewAssignedRoleEnum, ReviewDecisionEnum, ReviewTaskModel };
@@ -0,0 +1,61 @@
1
+ import * as _contractspec_lib_schema55 from "@contractspec/lib.schema";
2
+
3
+ //#region src/entities/models.d.ts
4
+ declare const ChangeRiskLevelEnum: _contractspec_lib_schema55.EnumType<[string, string, string]>;
5
+ declare const ReviewAssignedRoleEnum: _contractspec_lib_schema55.EnumType<[string, string]>;
6
+ declare const ReviewDecisionEnum: _contractspec_lib_schema55.EnumType<[string, string]>;
7
+ declare const ChangeCandidateModel: _contractspec_lib_schema55.SchemaModel<{
8
+ id: {
9
+ type: _contractspec_lib_schema55.FieldType<string, string>;
10
+ isOptional: false;
11
+ };
12
+ sourceDocumentId: {
13
+ type: _contractspec_lib_schema55.FieldType<string, string>;
14
+ isOptional: false;
15
+ };
16
+ detectedAt: {
17
+ type: _contractspec_lib_schema55.FieldType<Date, string>;
18
+ isOptional: false;
19
+ };
20
+ diffSummary: {
21
+ type: _contractspec_lib_schema55.FieldType<string, string>;
22
+ isOptional: false;
23
+ };
24
+ riskLevel: {
25
+ type: _contractspec_lib_schema55.EnumType<[string, string, string]>;
26
+ isOptional: false;
27
+ };
28
+ }>;
29
+ declare const ReviewTaskModel: _contractspec_lib_schema55.SchemaModel<{
30
+ id: {
31
+ type: _contractspec_lib_schema55.FieldType<string, string>;
32
+ isOptional: false;
33
+ };
34
+ changeCandidateId: {
35
+ type: _contractspec_lib_schema55.FieldType<string, string>;
36
+ isOptional: false;
37
+ };
38
+ status: {
39
+ type: _contractspec_lib_schema55.FieldType<string, string>;
40
+ isOptional: false;
41
+ };
42
+ assignedRole: {
43
+ type: _contractspec_lib_schema55.EnumType<[string, string]>;
44
+ isOptional: false;
45
+ };
46
+ decision: {
47
+ type: _contractspec_lib_schema55.EnumType<[string, string]>;
48
+ isOptional: true;
49
+ };
50
+ decidedAt: {
51
+ type: _contractspec_lib_schema55.FieldType<Date, string>;
52
+ isOptional: true;
53
+ };
54
+ decidedBy: {
55
+ type: _contractspec_lib_schema55.FieldType<string, string>;
56
+ isOptional: true;
57
+ };
58
+ }>;
59
+ //#endregion
60
+ export { ChangeCandidateModel, ChangeRiskLevelEnum, ReviewAssignedRoleEnum, ReviewDecisionEnum, ReviewTaskModel };
61
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","names":[],"sources":["../../src/entities/models.ts"],"sourcesContent":[],"mappings":";;;cAMa,qBAIX,0BAAA,CAJ8B;cAMnB,wBAGX,0BAAA,CAHiC;cAKtB,oBAGX,0BAAA,CAH6B;AAXlB,cAgBA,oBAZX,6BAY+B,WAhBD,CAAA;EAMnB,EAAA,EAAA;IAKA,IAAA,EAkBX,0BAAA,CAAA,SAfA,CAAA,MAH6B,EAAA,MAAA,CAAA;IAKlB,UAAA,EAAA,KAAA;EAaX,CAAA;;;;;;8CAb+B,KAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAepB,CAAA;EAeX,WAAA,EAAA;;;;;;;;;AAf0B,cAAf,eAAe,6BAAA,WAAA,CAAA;;UAe1B,0BAAA,CAAA"}
@@ -0,0 +1,74 @@
1
+ import { ScalarTypeEnum, defineEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+
3
+ //#region src/entities/models.ts
4
+ const ChangeRiskLevelEnum = defineEnum("ChangeRiskLevel", [
5
+ "low",
6
+ "medium",
7
+ "high"
8
+ ]);
9
+ const ReviewAssignedRoleEnum = defineEnum("ReviewAssignedRole", ["curator", "expert"]);
10
+ const ReviewDecisionEnum = defineEnum("ReviewDecision", ["approve", "reject"]);
11
+ const ChangeCandidateModel = defineSchemaModel({
12
+ name: "ChangeCandidate",
13
+ description: "Candidate change detected in a source document.",
14
+ fields: {
15
+ id: {
16
+ type: ScalarTypeEnum.String_unsecure(),
17
+ isOptional: false
18
+ },
19
+ sourceDocumentId: {
20
+ type: ScalarTypeEnum.String_unsecure(),
21
+ isOptional: false
22
+ },
23
+ detectedAt: {
24
+ type: ScalarTypeEnum.DateTime(),
25
+ isOptional: false
26
+ },
27
+ diffSummary: {
28
+ type: ScalarTypeEnum.String_unsecure(),
29
+ isOptional: false
30
+ },
31
+ riskLevel: {
32
+ type: ChangeRiskLevelEnum,
33
+ isOptional: false
34
+ }
35
+ }
36
+ });
37
+ const ReviewTaskModel = defineSchemaModel({
38
+ name: "ReviewTask",
39
+ description: "Human verification task for a change candidate.",
40
+ fields: {
41
+ id: {
42
+ type: ScalarTypeEnum.String_unsecure(),
43
+ isOptional: false
44
+ },
45
+ changeCandidateId: {
46
+ type: ScalarTypeEnum.String_unsecure(),
47
+ isOptional: false
48
+ },
49
+ status: {
50
+ type: ScalarTypeEnum.String_unsecure(),
51
+ isOptional: false
52
+ },
53
+ assignedRole: {
54
+ type: ReviewAssignedRoleEnum,
55
+ isOptional: false
56
+ },
57
+ decision: {
58
+ type: ReviewDecisionEnum,
59
+ isOptional: true
60
+ },
61
+ decidedAt: {
62
+ type: ScalarTypeEnum.DateTime(),
63
+ isOptional: true
64
+ },
65
+ decidedBy: {
66
+ type: ScalarTypeEnum.String_unsecure(),
67
+ isOptional: true
68
+ }
69
+ }
70
+ });
71
+
72
+ //#endregion
73
+ export { ChangeCandidateModel, ChangeRiskLevelEnum, ReviewAssignedRoleEnum, ReviewDecisionEnum, ReviewTaskModel };
74
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","names":[],"sources":["../../src/entities/models.ts"],"sourcesContent":["import {\n ScalarTypeEnum,\n defineEnum,\n defineSchemaModel,\n} from '@contractspec/lib.schema';\n\nexport const ChangeRiskLevelEnum = defineEnum('ChangeRiskLevel', [\n 'low',\n 'medium',\n 'high',\n]);\n\nexport const ReviewAssignedRoleEnum = defineEnum('ReviewAssignedRole', [\n 'curator',\n 'expert',\n]);\n\nexport const ReviewDecisionEnum = defineEnum('ReviewDecision', [\n 'approve',\n 'reject',\n]);\n\nexport const ChangeCandidateModel = defineSchemaModel({\n name: 'ChangeCandidate',\n description: 'Candidate change detected in a source document.',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n sourceDocumentId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n detectedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n diffSummary: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n riskLevel: { type: ChangeRiskLevelEnum, isOptional: false },\n },\n});\n\nexport const ReviewTaskModel = defineSchemaModel({\n name: 'ReviewTask',\n description: 'Human verification task for a change candidate.',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n changeCandidateId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // open|decided\n assignedRole: { type: ReviewAssignedRoleEnum, isOptional: false },\n decision: { type: ReviewDecisionEnum, isOptional: true },\n decidedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n decidedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n"],"mappings":";;;AAMA,MAAa,sBAAsB,WAAW,mBAAmB;CAC/D;CACA;CACA;CACD,CAAC;AAEF,MAAa,yBAAyB,WAAW,sBAAsB,CACrE,WACA,SACD,CAAC;AAEF,MAAa,qBAAqB,WAAW,kBAAkB,CAC7D,WACA,SACD,CAAC;AAEF,MAAa,uBAAuB,kBAAkB;CACpD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,kBAAkB;GAChB,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,YAAY;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E,WAAW;GAAE,MAAM;GAAqB,YAAY;GAAO;EAC5D;CACF,CAAC;AAEF,MAAa,kBAAkB,kBAAkB;CAC/C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,mBAAmB;GACjB,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,cAAc;GAAE,MAAM;GAAwB,YAAY;GAAO;EACjE,UAAU;GAAE,MAAM;GAAoB,YAAY;GAAM;EACxD,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EAChE,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACxE;CACF,CAAC"}
@@ -0,0 +1,74 @@
1
+ import * as _contractspec_lib_contracts3 from "@contractspec/lib.contracts";
2
+ import * as _contractspec_lib_schema36 from "@contractspec/lib.schema";
3
+
4
+ //#region src/events.d.ts
5
+ declare const KbChangeDetectedEvent: _contractspec_lib_contracts3.EventSpec<_contractspec_lib_schema36.SchemaModel<{
6
+ changeCandidateId: {
7
+ type: _contractspec_lib_schema36.FieldType<string, string>;
8
+ isOptional: false;
9
+ };
10
+ sourceDocumentId: {
11
+ type: _contractspec_lib_schema36.FieldType<string, string>;
12
+ isOptional: false;
13
+ };
14
+ riskLevel: {
15
+ type: _contractspec_lib_schema36.FieldType<string, string>;
16
+ isOptional: false;
17
+ };
18
+ }>>;
19
+ declare const KbChangeSummarizedEvent: _contractspec_lib_contracts3.EventSpec<_contractspec_lib_schema36.SchemaModel<{
20
+ changeCandidateId: {
21
+ type: _contractspec_lib_schema36.FieldType<string, string>;
22
+ isOptional: false;
23
+ };
24
+ summary: {
25
+ type: _contractspec_lib_schema36.FieldType<string, string>;
26
+ isOptional: false;
27
+ };
28
+ riskLevel: {
29
+ type: _contractspec_lib_schema36.FieldType<string, string>;
30
+ isOptional: false;
31
+ };
32
+ }>>;
33
+ declare const KbPatchProposedEvent: _contractspec_lib_contracts3.EventSpec<_contractspec_lib_schema36.SchemaModel<{
34
+ changeCandidateId: {
35
+ type: _contractspec_lib_schema36.FieldType<string, string>;
36
+ isOptional: false;
37
+ };
38
+ proposedRuleVersionIds: {
39
+ type: _contractspec_lib_schema36.FieldType<string, string>;
40
+ isArray: true;
41
+ isOptional: false;
42
+ };
43
+ }>>;
44
+ declare const KbReviewRequestedEvent: _contractspec_lib_contracts3.EventSpec<_contractspec_lib_schema36.SchemaModel<{
45
+ reviewTaskId: {
46
+ type: _contractspec_lib_schema36.FieldType<string, string>;
47
+ isOptional: false;
48
+ };
49
+ changeCandidateId: {
50
+ type: _contractspec_lib_schema36.FieldType<string, string>;
51
+ isOptional: false;
52
+ };
53
+ assignedRole: {
54
+ type: _contractspec_lib_schema36.FieldType<string, string>;
55
+ isOptional: false;
56
+ };
57
+ }>>;
58
+ declare const KbReviewDecidedEvent: _contractspec_lib_contracts3.EventSpec<_contractspec_lib_schema36.SchemaModel<{
59
+ reviewTaskId: {
60
+ type: _contractspec_lib_schema36.FieldType<string, string>;
61
+ isOptional: false;
62
+ };
63
+ decision: {
64
+ type: _contractspec_lib_schema36.FieldType<string, string>;
65
+ isOptional: false;
66
+ };
67
+ decidedBy: {
68
+ type: _contractspec_lib_schema36.FieldType<string, string>;
69
+ isOptional: false;
70
+ };
71
+ }>>;
72
+ //#endregion
73
+ export { KbChangeDetectedEvent, KbChangeSummarizedEvent, KbPatchProposedEvent, KbReviewDecidedEvent, KbReviewRequestedEvent };
74
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","names":[],"sources":["../src/events.ts"],"sourcesContent":[],"mappings":";;;;cAuBa,uBAAqB,4BAAA,CAAA,qCAAA;;UAUhC,0BAAA,CAAA;;EAVW,CAAA;EAUX,gBAAA,EAAA;;;;EAVgC,SAAA,EAAA;IAAA,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAyBrB,UAAA,EAAA,KAAA;EAUX,CAAA;;cAVW,yBAAuB,4BAAA,CAAA,qCAAA;;IAAA,IAAA,EAUlC,0BAAA,CAAA,SAVkC,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EA4BvB,CAAA;EAUX,OAAA,EAAA;;;EAV+B,CAAA;EAAA,SAAA,EAAA;IAyBpB,IAAA,sCAUX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;cAnCW,oBAyBsB,EAzBF,4BAAA,CAAA,SAyBE,4BAzBF,WAyBE,CAAA;EAAA,iBAAA,EAAA;IAAA,IAAA,EAfjC,0BAAA,CAAA,SAeiC,CAAA,MAAA,EAAA,MAAA,CAAA;IAsBtB,UAAA,EAAA,KAAA;EAUX,CAAA;;;;IAV+B,UAAA,EAAA,KAAA;EAAA,CAAA;;cAtBpB,wBAAsB,4BAAA,CAAA,qCAAA;;UAUjC,0BAAA,CAAA;;;;;;;;;;;;cAYW,sBAAoB,4BAAA,CAAA,qCAAA;;UAU/B,0BAAA,CAAA"}