@transitrix/diagrams 1.8.4 → 1.8.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.
Files changed (254) hide show
  1. package/dist/edge-path.js +10 -1
  2. package/dist/webview/render-activities.d.ts +1 -1
  3. package/dist/webview/render-activities.js +2 -2
  4. package/dist/webview/render-fgca.js +1 -4
  5. package/package.json +7 -2
  6. package/src/edge-path.ts +15 -1
  7. package/src/webview/render-activities.ts +2 -2
  8. package/src/webview/render-fgca.ts +1 -4
  9. package/dist/__tests__/edge-path.test.d.ts +0 -1
  10. package/dist/__tests__/edge-path.test.js +0 -47
  11. package/dist/__tests__/node-size-presets.test.d.ts +0 -1
  12. package/dist/__tests__/node-size-presets.test.js +0 -30
  13. package/dist/__tests__/scope.test.d.ts +0 -1
  14. package/dist/__tests__/scope.test.js +0 -23
  15. package/dist/__tests__/yaml-normalize.test.d.ts +0 -1
  16. package/dist/__tests__/yaml-normalize.test.js +0 -148
  17. package/dist/activities/__tests__/cpm.test.d.ts +0 -1
  18. package/dist/activities/__tests__/cpm.test.js +0 -146
  19. package/dist/activities/__tests__/gantt.test.d.ts +0 -1
  20. package/dist/activities/__tests__/gantt.test.js +0 -263
  21. package/dist/activities/__tests__/layout.test.d.ts +0 -1
  22. package/dist/activities/__tests__/layout.test.js +0 -98
  23. package/dist/activities/__tests__/validate.test.d.ts +0 -1
  24. package/dist/activities/__tests__/validate.test.js +0 -397
  25. package/dist/activity-card/__tests__/example.test.d.ts +0 -1
  26. package/dist/activity-card/__tests__/example.test.js +0 -73
  27. package/dist/activity-card/__tests__/layout.test.d.ts +0 -1
  28. package/dist/activity-card/__tests__/layout.test.js +0 -141
  29. package/dist/activity-card/__tests__/resolver.test.d.ts +0 -1
  30. package/dist/activity-card/__tests__/resolver.test.js +0 -325
  31. package/dist/activity-card/__tests__/validate.test.d.ts +0 -1
  32. package/dist/activity-card/__tests__/validate.test.js +0 -149
  33. package/dist/actor/__tests__/validate.test.d.ts +0 -1
  34. package/dist/actor/__tests__/validate.test.js +0 -95
  35. package/dist/applications/__tests__/validate.test.d.ts +0 -1
  36. package/dist/applications/__tests__/validate.test.js +0 -223
  37. package/dist/assertion/__tests__/example.test.d.ts +0 -1
  38. package/dist/assertion/__tests__/example.test.js +0 -32
  39. package/dist/assertion/__tests__/validate.test.d.ts +0 -1
  40. package/dist/assertion/__tests__/validate.test.js +0 -130
  41. package/dist/blocks/__tests__/layout.test.d.ts +0 -1
  42. package/dist/blocks/__tests__/layout.test.js +0 -153
  43. package/dist/blocks/__tests__/validate.test.d.ts +0 -1
  44. package/dist/blocks/__tests__/validate.test.js +0 -235
  45. package/dist/business-service/__tests__/validate.test.d.ts +0 -1
  46. package/dist/business-service/__tests__/validate.test.js +0 -135
  47. package/dist/capability-map/__tests__/CapabilityMapView.test.d.ts +0 -1
  48. package/dist/capability-map/__tests__/CapabilityMapView.test.js +0 -217
  49. package/dist/capability-map/__tests__/address.test.d.ts +0 -1
  50. package/dist/capability-map/__tests__/address.test.js +0 -49
  51. package/dist/capability-map/__tests__/dsm-layout.test.d.ts +0 -1
  52. package/dist/capability-map/__tests__/dsm-layout.test.js +0 -46
  53. package/dist/capability-map/__tests__/dsm-mutations.test.d.ts +0 -1
  54. package/dist/capability-map/__tests__/dsm-mutations.test.js +0 -125
  55. package/dist/capability-map/__tests__/dsm-validate.test.d.ts +0 -1
  56. package/dist/capability-map/__tests__/dsm-validate.test.js +0 -56
  57. package/dist/capability-map/__tests__/validate.test.d.ts +0 -1
  58. package/dist/capability-map/__tests__/validate.test.js +0 -212
  59. package/dist/change/__tests__/validate.test.d.ts +0 -1
  60. package/dist/change/__tests__/validate.test.js +0 -79
  61. package/dist/codex/__tests__/example.test.d.ts +0 -1
  62. package/dist/codex/__tests__/example.test.js +0 -33
  63. package/dist/codex/__tests__/validate.test.d.ts +0 -1
  64. package/dist/codex/__tests__/validate.test.js +0 -68
  65. package/dist/compliance/__tests__/canon-catalog.test.d.ts +0 -1
  66. package/dist/compliance/__tests__/canon-catalog.test.js +0 -60
  67. package/dist/compliance/__tests__/classify.test.d.ts +0 -1
  68. package/dist/compliance/__tests__/classify.test.js +0 -58
  69. package/dist/compliance/__tests__/confidence.test.d.ts +0 -1
  70. package/dist/compliance/__tests__/confidence.test.js +0 -78
  71. package/dist/compliance/__tests__/coverage-metric.test.d.ts +0 -1
  72. package/dist/compliance/__tests__/coverage-metric.test.js +0 -264
  73. package/dist/compliance/__tests__/demo-scenario.test.d.ts +0 -1
  74. package/dist/compliance/__tests__/demo-scenario.test.js +0 -226
  75. package/dist/compliance/__tests__/example.test.d.ts +0 -1
  76. package/dist/compliance/__tests__/example.test.js +0 -51
  77. package/dist/compliance/__tests__/gap-report.test.d.ts +0 -1
  78. package/dist/compliance/__tests__/gap-report.test.js +0 -113
  79. package/dist/compliance/__tests__/html.test.d.ts +0 -1
  80. package/dist/compliance/__tests__/html.test.js +0 -122
  81. package/dist/compliance/__tests__/impact.test.d.ts +0 -1
  82. package/dist/compliance/__tests__/impact.test.js +0 -913
  83. package/dist/compliance/__tests__/markdown.test.d.ts +0 -1
  84. package/dist/compliance/__tests__/markdown.test.js +0 -85
  85. package/dist/compliance/__tests__/trace.test.d.ts +0 -1
  86. package/dist/compliance/__tests__/trace.test.js +0 -144
  87. package/dist/compliance/__tests__/view-resolution.test.d.ts +0 -1
  88. package/dist/compliance/__tests__/view-resolution.test.js +0 -59
  89. package/dist/compliance/__tests__/views.test.d.ts +0 -1
  90. package/dist/compliance/__tests__/views.test.js +0 -59
  91. package/dist/compliance-matrix/__tests__/build.test.d.ts +0 -1
  92. package/dist/compliance-matrix/__tests__/build.test.js +0 -183
  93. package/dist/compliance-matrix/__tests__/example.test.d.ts +0 -1
  94. package/dist/compliance-matrix/__tests__/example.test.js +0 -49
  95. package/dist/confidence/__tests__/score.test.d.ts +0 -1
  96. package/dist/confidence/__tests__/score.test.js +0 -188
  97. package/dist/constraint/__tests__/example.test.d.ts +0 -1
  98. package/dist/constraint/__tests__/example.test.js +0 -14
  99. package/dist/constraint/__tests__/validate.test.d.ts +0 -1
  100. package/dist/constraint/__tests__/validate.test.js +0 -58
  101. package/dist/factor/__tests__/validate.test.d.ts +0 -1
  102. package/dist/factor/__tests__/validate.test.js +0 -112
  103. package/dist/fgca/__tests__/chain-table.test.d.ts +0 -1
  104. package/dist/fgca/__tests__/chain-table.test.js +0 -158
  105. package/dist/fgca/__tests__/layout.test.d.ts +0 -1
  106. package/dist/fgca/__tests__/layout.test.js +0 -140
  107. package/dist/fgca/__tests__/parse-canonical.test.d.ts +0 -1
  108. package/dist/fgca/__tests__/parse-canonical.test.js +0 -268
  109. package/dist/fgca/__tests__/preview-layout.test.d.ts +0 -1
  110. package/dist/fgca/__tests__/preview-layout.test.js +0 -106
  111. package/dist/fgca/__tests__/resolver.test.d.ts +0 -1
  112. package/dist/fgca/__tests__/resolver.test.js +0 -185
  113. package/dist/fgca/__tests__/validate.test.d.ts +0 -1
  114. package/dist/fgca/__tests__/validate.test.js +0 -125
  115. package/dist/goals/__tests__/GoalTreeView.test.d.ts +0 -1
  116. package/dist/goals/__tests__/GoalTreeView.test.js +0 -337
  117. package/dist/goals/__tests__/layout.test.d.ts +0 -1
  118. package/dist/goals/__tests__/layout.test.js +0 -153
  119. package/dist/goals/__tests__/mutations.test.d.ts +0 -1
  120. package/dist/goals/__tests__/mutations.test.js +0 -134
  121. package/dist/goals/__tests__/parse-canonical.test.d.ts +0 -1
  122. package/dist/goals/__tests__/parse-canonical.test.js +0 -131
  123. package/dist/goals/__tests__/validate.test.d.ts +0 -1
  124. package/dist/goals/__tests__/validate.test.js +0 -183
  125. package/dist/integration/__tests__/validate.test.d.ts +0 -1
  126. package/dist/integration/__tests__/validate.test.js +0 -169
  127. package/dist/location/__tests__/validate.test.d.ts +0 -1
  128. package/dist/location/__tests__/validate.test.js +0 -107
  129. package/dist/node/__tests__/validate.test.d.ts +0 -1
  130. package/dist/node/__tests__/validate.test.js +0 -100
  131. package/dist/process-blueprint/__tests__/compliance-lane.test.d.ts +0 -1
  132. package/dist/process-blueprint/__tests__/compliance-lane.test.js +0 -272
  133. package/dist/process-blueprint/__tests__/layout.test.d.ts +0 -1
  134. package/dist/process-blueprint/__tests__/layout.test.js +0 -196
  135. package/dist/process-blueprint/__tests__/validate.test.d.ts +0 -1
  136. package/dist/process-blueprint/__tests__/validate.test.js +0 -280
  137. package/dist/process-map/__tests__/validate.test.d.ts +0 -1
  138. package/dist/process-map/__tests__/validate.test.js +0 -199
  139. package/dist/products/__tests__/validate.test.d.ts +0 -1
  140. package/dist/products/__tests__/validate.test.js +0 -210
  141. package/dist/repo-validate/__tests__/validate-repo.test.d.ts +0 -1
  142. package/dist/repo-validate/__tests__/validate-repo.test.js +0 -576
  143. package/dist/requirement/__tests__/example.test.d.ts +0 -1
  144. package/dist/requirement/__tests__/example.test.js +0 -21
  145. package/dist/requirement/__tests__/validate.test.d.ts +0 -1
  146. package/dist/requirement/__tests__/validate.test.js +0 -80
  147. package/dist/scenarios/__tests__/validate.test.d.ts +0 -1
  148. package/dist/scenarios/__tests__/validate.test.js +0 -183
  149. package/dist/stakeholder/__tests__/validate.test.d.ts +0 -1
  150. package/dist/stakeholder/__tests__/validate.test.js +0 -88
  151. package/dist/target-state/__tests__/validate.test.d.ts +0 -1
  152. package/dist/target-state/__tests__/validate.test.js +0 -78
  153. package/dist/technology-service/__tests__/validate.test.d.ts +0 -1
  154. package/dist/technology-service/__tests__/validate.test.js +0 -121
  155. package/dist/theme/__tests__/tokens.test.d.ts +0 -1
  156. package/dist/theme/__tests__/tokens.test.js +0 -159
  157. package/dist/webview/__tests__/entity-text-layout.test.d.ts +0 -1
  158. package/dist/webview/__tests__/entity-text-layout.test.js +0 -155
  159. package/dist/webview/__tests__/entry-notations.test.d.ts +0 -1
  160. package/dist/webview/__tests__/entry-notations.test.js +0 -62
  161. package/dist/webview/__tests__/entry.test.d.ts +0 -1
  162. package/dist/webview/__tests__/entry.test.js +0 -56
  163. package/dist/webview/__tests__/render-activities.test.d.ts +0 -1
  164. package/dist/webview/__tests__/render-activities.test.js +0 -91
  165. package/dist/webview/__tests__/render-blocks.test.d.ts +0 -1
  166. package/dist/webview/__tests__/render-blocks.test.js +0 -175
  167. package/dist/webview/__tests__/render-goals.test.d.ts +0 -1
  168. package/dist/webview/__tests__/render-goals.test.js +0 -120
  169. package/dist/webview/__tests__/render-process.test.d.ts +0 -1
  170. package/dist/webview/__tests__/render-process.test.js +0 -463
  171. package/dist/webview/__tests__/render-util.test.d.ts +0 -1
  172. package/dist/webview/__tests__/render-util.test.js +0 -54
  173. package/src/__tests__/edge-path.test.ts +0 -58
  174. package/src/__tests__/node-size-presets.test.ts +0 -50
  175. package/src/__tests__/scope.test.ts +0 -27
  176. package/src/__tests__/yaml-normalize.test.ts +0 -158
  177. package/src/activities/__tests__/cpm.test.ts +0 -164
  178. package/src/activities/__tests__/gantt.test.ts +0 -290
  179. package/src/activities/__tests__/layout.test.ts +0 -112
  180. package/src/activities/__tests__/validate.test.ts +0 -446
  181. package/src/activity-card/__tests__/example.test.ts +0 -83
  182. package/src/activity-card/__tests__/layout.test.ts +0 -162
  183. package/src/activity-card/__tests__/resolver.test.ts +0 -357
  184. package/src/activity-card/__tests__/validate.test.ts +0 -167
  185. package/src/actor/__tests__/validate.test.ts +0 -114
  186. package/src/applications/__tests__/validate.test.ts +0 -256
  187. package/src/assertion/__tests__/example.test.ts +0 -37
  188. package/src/assertion/__tests__/validate.test.ts +0 -142
  189. package/src/blocks/__tests__/layout.test.ts +0 -169
  190. package/src/blocks/__tests__/validate.test.ts +0 -260
  191. package/src/business-service/__tests__/validate.test.ts +0 -160
  192. package/src/capability-map/__tests__/CapabilityMapView.test.tsx +0 -232
  193. package/src/capability-map/__tests__/address.test.ts +0 -59
  194. package/src/capability-map/__tests__/dsm-layout.test.ts +0 -52
  195. package/src/capability-map/__tests__/dsm-mutations.test.ts +0 -141
  196. package/src/capability-map/__tests__/dsm-validate.test.ts +0 -65
  197. package/src/capability-map/__tests__/validate.test.ts +0 -238
  198. package/src/change/__tests__/validate.test.ts +0 -97
  199. package/src/codex/__tests__/example.test.ts +0 -40
  200. package/src/codex/__tests__/validate.test.ts +0 -84
  201. package/src/compliance/__tests__/canon-catalog.test.ts +0 -68
  202. package/src/compliance/__tests__/classify.test.ts +0 -64
  203. package/src/compliance/__tests__/confidence.test.ts +0 -98
  204. package/src/compliance/__tests__/coverage-metric.test.ts +0 -300
  205. package/src/compliance/__tests__/demo-scenario.test.ts +0 -273
  206. package/src/compliance/__tests__/example.test.ts +0 -57
  207. package/src/compliance/__tests__/gap-report.test.ts +0 -129
  208. package/src/compliance/__tests__/html.test.ts +0 -142
  209. package/src/compliance/__tests__/impact.test.ts +0 -1060
  210. package/src/compliance/__tests__/markdown.test.ts +0 -95
  211. package/src/compliance/__tests__/trace.test.ts +0 -157
  212. package/src/compliance/__tests__/view-resolution.test.ts +0 -80
  213. package/src/compliance/__tests__/views.test.ts +0 -64
  214. package/src/compliance-matrix/__tests__/build.test.ts +0 -200
  215. package/src/compliance-matrix/__tests__/example.test.ts +0 -57
  216. package/src/confidence/__tests__/score.test.ts +0 -254
  217. package/src/constraint/__tests__/example.test.ts +0 -19
  218. package/src/constraint/__tests__/validate.test.ts +0 -68
  219. package/src/factor/__tests__/validate.test.ts +0 -133
  220. package/src/fgca/__tests__/chain-table.test.ts +0 -172
  221. package/src/fgca/__tests__/layout.test.ts +0 -179
  222. package/src/fgca/__tests__/parse-canonical.test.ts +0 -296
  223. package/src/fgca/__tests__/preview-layout.test.ts +0 -124
  224. package/src/fgca/__tests__/resolver.test.ts +0 -209
  225. package/src/fgca/__tests__/validate.test.ts +0 -142
  226. package/src/goals/__tests__/GoalTreeView.test.tsx +0 -361
  227. package/src/goals/__tests__/layout.test.ts +0 -175
  228. package/src/goals/__tests__/mutations.test.ts +0 -153
  229. package/src/goals/__tests__/parse-canonical.test.ts +0 -147
  230. package/src/goals/__tests__/validate.test.ts +0 -202
  231. package/src/integration/__tests__/validate.test.ts +0 -203
  232. package/src/location/__tests__/validate.test.ts +0 -127
  233. package/src/node/__tests__/validate.test.ts +0 -118
  234. package/src/process-blueprint/__tests__/compliance-lane.test.ts +0 -320
  235. package/src/process-blueprint/__tests__/layout.test.ts +0 -240
  236. package/src/process-blueprint/__tests__/validate.test.ts +0 -310
  237. package/src/process-map/__tests__/validate.test.ts +0 -223
  238. package/src/products/__tests__/validate.test.ts +0 -239
  239. package/src/repo-validate/__tests__/validate-repo.test.ts +0 -699
  240. package/src/requirement/__tests__/example.test.ts +0 -24
  241. package/src/requirement/__tests__/validate.test.ts +0 -96
  242. package/src/scenarios/__tests__/validate.test.ts +0 -209
  243. package/src/stakeholder/__tests__/validate.test.ts +0 -105
  244. package/src/target-state/__tests__/validate.test.ts +0 -95
  245. package/src/technology-service/__tests__/validate.test.ts +0 -143
  246. package/src/theme/__tests__/tokens.test.ts +0 -185
  247. package/src/webview/__tests__/entity-text-layout.test.ts +0 -182
  248. package/src/webview/__tests__/entry-notations.test.ts +0 -77
  249. package/src/webview/__tests__/entry.test.ts +0 -64
  250. package/src/webview/__tests__/render-activities.test.ts +0 -100
  251. package/src/webview/__tests__/render-blocks.test.ts +0 -206
  252. package/src/webview/__tests__/render-goals.test.ts +0 -128
  253. package/src/webview/__tests__/render-process.test.ts +0 -538
  254. package/src/webview/__tests__/render-util.test.ts +0 -66
@@ -1,576 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { validateRepoModel } from '../validate-repo.js';
3
- function el(path, data, parseError) {
4
- return { path, data, parseError };
5
- }
6
- /** A small clean model mirroring the acme_corp shape: relations use `from`/`to`
7
- * and every endpoint resolves to an element. Should produce zero findings —
8
- * the parity bar against lint.py on the worked example. */
9
- function cleanModel() {
10
- return {
11
- elements: [
12
- el('canon/elements/01_motivation/goals/GOAL-OPS-1.yaml', { notation: 'goal', id: 'GOAL-OPS-1' }),
13
- el('canon/elements/01_motivation/assessments/ASSESSMENT-1.yaml', { notation: 'assessment', id: 'ASSESSMENT-1' }),
14
- el('canon/elements/02_business/capabilities/CAPABILITY-V1.yaml', { notation: 'capability', id: 'CAPABILITY-V1' }),
15
- // sidecar with no `id` — must be ignored (no duplicate, not an element)
16
- el('canon/elements/02_business/capabilities/CAPABILITY-V1.history.yaml', { target: 'CAPABILITY-V1', attribute_versions: [] }),
17
- ],
18
- relations: [
19
- el('canon/relations/REL-1.yaml', { notation: 'relation', id: 'REL-1', from: 'ASSESSMENT-1', to: 'GOAL-OPS-1' }),
20
- ],
21
- };
22
- }
23
- describe('validateRepoModel — parity / clean tree', () => {
24
- it('produces zero findings on a clean model (acme_corp parity)', () => {
25
- expect(validateRepoModel(cleanModel())).toEqual([]);
26
- });
27
- it('ignores sidecar docs without an id (no false duplicate)', () => {
28
- const findings = validateRepoModel(cleanModel());
29
- expect(findings.filter((f) => f.message.includes('Duplicate'))).toEqual([]);
30
- });
31
- it('every finding carries the frozen { scope, id, message } shape', () => {
32
- const model = cleanModel();
33
- model.relations.push(el('canon/relations/REL-BAD.yaml', { notation: 'relation', id: 'REL-BAD', from: 'NOPE', to: 'GOAL-OPS-1' }));
34
- const findings = validateRepoModel(model);
35
- expect(findings.length).toBeGreaterThan(0);
36
- for (const f of findings) {
37
- expect(Object.keys(f).sort()).toEqual(['id', 'message', 'scope']);
38
- expect(f.scope).toBe('repo');
39
- }
40
- });
41
- });
42
- describe('validateRepoModel — referential integrity', () => {
43
- it('flags a relation whose `from` endpoint is unknown', () => {
44
- const model = cleanModel();
45
- model.relations = [el('canon/relations/REL-X.yaml', { notation: 'relation', id: 'REL-X', from: 'MISSING-1', to: 'GOAL-OPS-1' })];
46
- const findings = validateRepoModel(model);
47
- expect(findings).toHaveLength(1);
48
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-X' });
49
- expect(findings[0].message).toContain('MISSING-1');
50
- expect(findings[0].message).toContain('(from)');
51
- });
52
- it('flags a relation whose `to` endpoint is unknown', () => {
53
- const model = cleanModel();
54
- model.relations = [el('canon/relations/REL-Y.yaml', { notation: 'relation', id: 'REL-Y', from: 'GOAL-OPS-1', to: 'MISSING-2' })];
55
- const findings = validateRepoModel(model);
56
- expect(findings).toHaveLength(1);
57
- expect(findings[0].message).toContain('(to)');
58
- });
59
- it('accepts lint.py-style `source`/`target` endpoint keys', () => {
60
- const model = cleanModel();
61
- model.relations = [el('canon/relations/REL-ST.yaml', { id: 'REL-ST', source: 'ASSESSMENT-1', target: 'GOAL-OPS-1' })];
62
- expect(validateRepoModel(model)).toEqual([]);
63
- });
64
- it('resolves `{ id }` object endpoints', () => {
65
- const model = cleanModel();
66
- model.relations = [el('canon/relations/REL-OBJ.yaml', { id: 'REL-OBJ', from: { id: 'ASSESSMENT-1' }, to: { id: 'GOAL-OPS-1' } })];
67
- expect(validateRepoModel(model)).toEqual([]);
68
- });
69
- });
70
- describe('validateRepoModel — atomicity', () => {
71
- it('flags an element file that contains an inline `relations` section', () => {
72
- const model = cleanModel();
73
- model.elements.push(el('canon/elements/02_business/E.yaml', { id: 'ELEMENT-1', relations: [{ to: 'GOAL-OPS-1' }] }));
74
- const findings = validateRepoModel(model);
75
- expect(findings).toHaveLength(1);
76
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'ELEMENT-1' });
77
- expect(findings[0].message).toContain('Atomicity');
78
- });
79
- });
80
- describe('validateRepoModel — id uniqueness', () => {
81
- it('flags the same id defined in two files', () => {
82
- const model = cleanModel();
83
- model.elements.push(el('canon/elements/dupe-a.yaml', { id: 'DUP-1' }));
84
- model.elements.push(el('canon/elements/dupe-b.yaml', { id: 'DUP-1' }));
85
- const findings = validateRepoModel(model);
86
- expect(findings).toHaveLength(1);
87
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'DUP-1' });
88
- expect(findings[0].message).toContain('dupe-a.yaml');
89
- expect(findings[0].message).toContain('dupe-b.yaml');
90
- });
91
- it('flags an element/relation id collision across zones', () => {
92
- const model = cleanModel();
93
- model.elements.push(el('canon/elements/clash.yaml', { id: 'CLASH-1' }));
94
- model.relations.push(el('canon/relations/clash.yaml', { id: 'CLASH-1', from: 'GOAL-OPS-1', to: 'ASSESSMENT-1' }));
95
- const findings = validateRepoModel(model);
96
- expect(findings.filter((f) => f.id === 'CLASH-1')).toHaveLength(1);
97
- });
98
- });
99
- describe('validateRepoModel — policy', () => {
100
- it('flags an Active element with no owner', () => {
101
- const model = cleanModel();
102
- model.elements.push(el('canon/elements/svc.yaml', { id: 'SVC-1', metadata: { status: 'Active' } }));
103
- const findings = validateRepoModel(model);
104
- expect(findings).toHaveLength(1);
105
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'SVC-1' });
106
- expect(findings[0].message).toContain('Policy');
107
- });
108
- it('does not flag an Active element that has an owner', () => {
109
- const model = cleanModel();
110
- model.elements.push(el('canon/elements/svc.yaml', { id: 'SVC-2', metadata: { status: 'Active', owner: 'team-a' } }));
111
- expect(validateRepoModel(model)).toEqual([]);
112
- });
113
- it('does not flag elements using the canon admission record (no metadata.status)', () => {
114
- // acme_corp elements use `zone`/`admitted_by`, not `metadata.status` — must not fire.
115
- const model = cleanModel();
116
- model.elements.push(el('canon/elements/g.yaml', { id: 'GOAL-X', zone: 'canon', admitted_by: 'v.korobeinikov' }));
117
- expect(validateRepoModel(model)).toEqual([]);
118
- });
119
- });
120
- describe('validateRepoModel — syntax', () => {
121
- it('reports a parse error and skips graph checks', () => {
122
- const model = cleanModel();
123
- model.elements.push(el('canon/elements/broken.yaml', null, 'bad indentation'));
124
- // also add a dangling relation that would otherwise fire — it must be suppressed
125
- model.relations.push(el('canon/relations/REL-Z.yaml', { id: 'REL-Z', from: 'MISSING', to: 'GOAL-OPS-1' }));
126
- const findings = validateRepoModel(model);
127
- expect(findings).toHaveLength(1);
128
- expect(findings[0]).toMatchObject({ scope: 'repo', id: '' });
129
- expect(findings[0].message).toContain('YAML syntax error');
130
- expect(findings[0].message).toContain('broken.yaml');
131
- });
132
- });
133
- describe('validateRepoModel — layer-semantics (unit_located_at / located_at)', () => {
134
- function locationModel() {
135
- const model = cleanModel();
136
- model.elements.push(el('canon/elements/02_business/actors/ACTOR-OPS-1.yaml', {
137
- notation: 'actor',
138
- id: 'ACTOR-OPS-1',
139
- type: 'business_unit',
140
- }), el('canon/elements/02_business/actors/ACTOR-JANE-1.yaml', {
141
- notation: 'actor',
142
- id: 'ACTOR-JANE-1',
143
- type: 'person',
144
- }), el('canon/elements/02_business/locations/LOCATION-TBILISI-1.yaml', {
145
- notation: 'location',
146
- id: 'LOCATION-TBILISI-1',
147
- }));
148
- return model;
149
- }
150
- it('accepts a valid unit_located_at (business_unit → LOCATION)', () => {
151
- const model = locationModel();
152
- model.relations.push(el('canon/relations/REL-LOC-1.yaml', {
153
- notation: 'relation',
154
- id: 'REL-LOC-1',
155
- type: 'unit_located_at',
156
- from: 'ACTOR-OPS-1',
157
- to: 'LOCATION-TBILISI-1',
158
- }));
159
- expect(validateRepoModel(model)).toEqual([]);
160
- });
161
- it('accepts a valid located_at for a business_unit', () => {
162
- const model = locationModel();
163
- model.relations.push(el('canon/relations/REL-LOC-2.yaml', {
164
- notation: 'relation',
165
- id: 'REL-LOC-2',
166
- type: 'located_at',
167
- from: 'ACTOR-OPS-1',
168
- to: 'LOCATION-TBILISI-1',
169
- }));
170
- expect(validateRepoModel(model)).toEqual([]);
171
- });
172
- it('accepts a valid located_at for a person', () => {
173
- const model = locationModel();
174
- model.relations.push(el('canon/relations/REL-LOC-3.yaml', {
175
- notation: 'relation',
176
- id: 'REL-LOC-3',
177
- type: 'located_at',
178
- from: 'ACTOR-JANE-1',
179
- to: 'LOCATION-TBILISI-1',
180
- }));
181
- expect(validateRepoModel(model)).toEqual([]);
182
- });
183
- it('flags unit_located_at with a wrong from type (person instead of business_unit)', () => {
184
- const model = locationModel();
185
- model.relations.push(el('canon/relations/REL-BAD-1.yaml', {
186
- notation: 'relation',
187
- id: 'REL-BAD-1',
188
- type: 'unit_located_at',
189
- from: 'ACTOR-JANE-1',
190
- to: 'LOCATION-TBILISI-1',
191
- }));
192
- const findings = validateRepoModel(model);
193
- expect(findings).toHaveLength(1);
194
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-BAD-1' });
195
- expect(findings[0].message).toContain('unit_located_at');
196
- expect(findings[0].message).toContain('business_unit');
197
- });
198
- it('flags unit_located_at with a non-ACTOR from element', () => {
199
- const model = locationModel();
200
- model.relations.push(el('canon/relations/REL-BAD-2.yaml', {
201
- notation: 'relation',
202
- id: 'REL-BAD-2',
203
- type: 'unit_located_at',
204
- from: 'GOAL-OPS-1',
205
- to: 'LOCATION-TBILISI-1',
206
- }));
207
- const findings = validateRepoModel(model);
208
- expect(findings).toHaveLength(1);
209
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-BAD-2' });
210
- expect(findings[0].message).toContain('unit_located_at');
211
- });
212
- it('flags unit_located_at with a non-LOCATION to element', () => {
213
- const model = locationModel();
214
- model.relations.push(el('canon/relations/REL-BAD-3.yaml', {
215
- notation: 'relation',
216
- id: 'REL-BAD-3',
217
- type: 'unit_located_at',
218
- from: 'ACTOR-OPS-1',
219
- to: 'GOAL-OPS-1',
220
- }));
221
- const findings = validateRepoModel(model);
222
- expect(findings).toHaveLength(1);
223
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-BAD-3' });
224
- expect(findings[0].message).toContain('LOCATION');
225
- });
226
- it('flags located_at with a non-actor from element', () => {
227
- const model = locationModel();
228
- model.relations.push(el('canon/relations/REL-BAD-4.yaml', {
229
- notation: 'relation',
230
- id: 'REL-BAD-4',
231
- type: 'located_at',
232
- from: 'CAPABILITY-V1',
233
- to: 'LOCATION-TBILISI-1',
234
- }));
235
- const findings = validateRepoModel(model);
236
- expect(findings).toHaveLength(1);
237
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-BAD-4' });
238
- expect(findings[0].message).toContain('located_at');
239
- });
240
- it('does not emit layer-semantic findings for unknown endpoints (ref-integrity handles those)', () => {
241
- const model = locationModel();
242
- model.relations.push(el('canon/relations/REL-MISSING.yaml', {
243
- notation: 'relation',
244
- id: 'REL-MISSING',
245
- type: 'unit_located_at',
246
- from: 'ACTOR-UNKNOWN-99',
247
- to: 'LOCATION-UNKNOWN-99',
248
- }));
249
- const findings = validateRepoModel(model);
250
- // ref-integrity fires for missing endpoints; no duplicate layer-semantic finding
251
- expect(findings.every((f) => !f.message.includes('Layer-semantics'))).toBe(true);
252
- expect(findings.some((f) => f.message.includes('ACTOR-UNKNOWN-99'))).toBe(true);
253
- });
254
- });
255
- describe('validateRepoModel — layer-semantics (offers / realizes)', () => {
256
- function serviceModel() {
257
- const model = cleanModel();
258
- model.elements.push(el('canon/elements/02_business/actors/ACTOR-OPS-1.yaml', {
259
- notation: 'actor',
260
- id: 'ACTOR-OPS-1',
261
- type: 'business_unit',
262
- }), el('canon/elements/02_business/roles/ROLE-OWNER-1.yaml', {
263
- notation: 'role',
264
- id: 'ROLE-OWNER-1',
265
- }), el('canon/elements/02_business/business-services/BUSINESS_SERVICE-CRM-1.yaml', {
266
- notation: 'business-service',
267
- id: 'BUSINESS_SERVICE-CRM-1',
268
- }), el('canon/elements/02_business/capabilities/CAPABILITY-V2.yaml', {
269
- notation: 'capability',
270
- id: 'CAPABILITY-V2',
271
- }));
272
- return model;
273
- }
274
- it('accepts a valid offers (ACTOR(business_unit) → BUSINESS_SERVICE)', () => {
275
- const model = serviceModel();
276
- model.relations.push(el('canon/relations/REL-SVC-1.yaml', {
277
- notation: 'relation',
278
- id: 'REL-SVC-1',
279
- type: 'offers',
280
- from: 'ACTOR-OPS-1',
281
- to: 'BUSINESS_SERVICE-CRM-1',
282
- }));
283
- expect(validateRepoModel(model)).toEqual([]);
284
- });
285
- it('accepts a valid offers (ROLE → BUSINESS_SERVICE)', () => {
286
- const model = serviceModel();
287
- model.relations.push(el('canon/relations/REL-SVC-2.yaml', {
288
- notation: 'relation',
289
- id: 'REL-SVC-2',
290
- type: 'offers',
291
- from: 'ROLE-OWNER-1',
292
- to: 'BUSINESS_SERVICE-CRM-1',
293
- }));
294
- expect(validateRepoModel(model)).toEqual([]);
295
- });
296
- it('accepts a valid realizes (BUSINESS_SERVICE → CAPABILITY)', () => {
297
- const model = serviceModel();
298
- model.relations.push(el('canon/relations/REL-SVC-3.yaml', {
299
- notation: 'relation',
300
- id: 'REL-SVC-3',
301
- type: 'realizes',
302
- from: 'BUSINESS_SERVICE-CRM-1',
303
- to: 'CAPABILITY-V2',
304
- }));
305
- expect(validateRepoModel(model)).toEqual([]);
306
- });
307
- it('flags offers with a non-ACTOR/non-ROLE from element', () => {
308
- const model = serviceModel();
309
- model.relations.push(el('canon/relations/REL-SVC-BAD-1.yaml', {
310
- notation: 'relation',
311
- id: 'REL-SVC-BAD-1',
312
- type: 'offers',
313
- from: 'CAPABILITY-V2',
314
- to: 'BUSINESS_SERVICE-CRM-1',
315
- }));
316
- const findings = validateRepoModel(model);
317
- expect(findings).toHaveLength(1);
318
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-SVC-BAD-1' });
319
- expect(findings[0].message).toContain('offers');
320
- expect(findings[0].message).toContain('ACTOR');
321
- });
322
- it('flags offers with a non-BUSINESS_SERVICE to element', () => {
323
- const model = serviceModel();
324
- model.relations.push(el('canon/relations/REL-SVC-BAD-2.yaml', {
325
- notation: 'relation',
326
- id: 'REL-SVC-BAD-2',
327
- type: 'offers',
328
- from: 'ACTOR-OPS-1',
329
- to: 'CAPABILITY-V2',
330
- }));
331
- const findings = validateRepoModel(model);
332
- expect(findings).toHaveLength(1);
333
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-SVC-BAD-2' });
334
- expect(findings[0].message).toContain('BUSINESS_SERVICE');
335
- });
336
- it('flags realizes with a non-BUSINESS_SERVICE from element', () => {
337
- const model = serviceModel();
338
- model.relations.push(el('canon/relations/REL-SVC-BAD-3.yaml', {
339
- notation: 'relation',
340
- id: 'REL-SVC-BAD-3',
341
- type: 'realizes',
342
- from: 'ACTOR-OPS-1',
343
- to: 'CAPABILITY-V2',
344
- }));
345
- const findings = validateRepoModel(model);
346
- expect(findings).toHaveLength(1);
347
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-SVC-BAD-3' });
348
- expect(findings[0].message).toContain('realizes');
349
- expect(findings[0].message).toContain('BUSINESS_SERVICE');
350
- });
351
- });
352
- describe('validateRepoModel — layer-semantics (INT-002 integration endpoints)', () => {
353
- function integrationModel() {
354
- const model = cleanModel();
355
- model.elements.push(el('canon/elements/03_application/applications/APPLICATION-OMS-1.yaml', {
356
- notation: 'application',
357
- id: 'APPLICATION-OMS-1',
358
- }), el('canon/elements/03_application/applications/APPLICATION-CRM-1.yaml', {
359
- notation: 'application',
360
- id: 'APPLICATION-CRM-1',
361
- }), el('canon/elements/02_business/actors/ACTOR-OPS-1.yaml', {
362
- notation: 'actor',
363
- id: 'ACTOR-OPS-1',
364
- type: 'business_unit',
365
- }));
366
- return model;
367
- }
368
- it('accepts an interface_semantics integration whose endpoints resolve to APPLICATION elements', () => {
369
- const model = integrationModel();
370
- model.elements.push(el('canon/elements/03_application/integrations/INTEGRATION-OMS-EVENTS-1.yaml', {
371
- notation: 'integration',
372
- id: 'INTEGRATION-OMS-EVENTS-1',
373
- interface_semantics: true,
374
- source: 'APPLICATION-OMS-1',
375
- target: 'APPLICATION-CRM-1',
376
- }));
377
- expect(validateRepoModel(model)).toEqual([]);
378
- });
379
- it('does not fire INT-002 for an integration without interface_semantics', () => {
380
- const model = integrationModel();
381
- model.elements.push(el('canon/elements/03_application/integrations/INTEGRATION-PLAIN-1.yaml', {
382
- notation: 'integration',
383
- id: 'INTEGRATION-PLAIN-1',
384
- source: 'ACTOR-OPS-1',
385
- target: 'APPLICATION-CRM-1',
386
- }));
387
- expect(validateRepoModel(model)).toEqual([]);
388
- });
389
- it('flags INT-002 when source resolves to a non-APPLICATION element', () => {
390
- const model = integrationModel();
391
- model.elements.push(el('canon/elements/03_application/integrations/INTEGRATION-BAD-1.yaml', {
392
- notation: 'integration',
393
- id: 'INTEGRATION-BAD-1',
394
- interface_semantics: true,
395
- source: 'ACTOR-OPS-1',
396
- target: 'APPLICATION-CRM-1',
397
- }));
398
- const findings = validateRepoModel(model);
399
- expect(findings).toHaveLength(1);
400
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'INTEGRATION-BAD-1' });
401
- expect(findings[0].message).toContain('INT-002');
402
- expect(findings[0].message).toContain('ACTOR-OPS-1');
403
- expect(findings[0].message).toContain('source');
404
- });
405
- it('flags INT-002 when target resolves to a non-APPLICATION element', () => {
406
- const model = integrationModel();
407
- model.elements.push(el('canon/elements/03_application/integrations/INTEGRATION-BAD-2.yaml', {
408
- notation: 'integration',
409
- id: 'INTEGRATION-BAD-2',
410
- interface_semantics: true,
411
- source: 'APPLICATION-OMS-1',
412
- target: 'ACTOR-OPS-1',
413
- }));
414
- const findings = validateRepoModel(model);
415
- expect(findings).toHaveLength(1);
416
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'INTEGRATION-BAD-2' });
417
- expect(findings[0].message).toContain('INT-002');
418
- expect(findings[0].message).toContain('ACTOR-OPS-1');
419
- expect(findings[0].message).toContain('target');
420
- });
421
- it('flags INT-002 for both endpoints when neither resolves to APPLICATION', () => {
422
- const model = integrationModel();
423
- model.elements.push(el('canon/elements/03_application/integrations/INTEGRATION-BAD-3.yaml', {
424
- notation: 'integration',
425
- id: 'INTEGRATION-BAD-3',
426
- interface_semantics: true,
427
- source: 'ACTOR-OPS-1',
428
- target: 'GOAL-OPS-1',
429
- }));
430
- const findings = validateRepoModel(model);
431
- expect(findings).toHaveLength(2);
432
- expect(findings.every(f => f.message.includes('INT-002'))).toBe(true);
433
- });
434
- it('does not flag INT-002 when endpoint id is not in the element registry', () => {
435
- // Unresolved IDs are caught by phase 4 (referential integrity), not INT-002.
436
- const model = integrationModel();
437
- model.elements.push(el('canon/elements/03_application/integrations/INTEGRATION-UNRESOLVED-1.yaml', {
438
- notation: 'integration',
439
- id: 'INTEGRATION-UNRESOLVED-1',
440
- interface_semantics: true,
441
- source: 'APPLICATION-MISSING-99',
442
- target: 'APPLICATION-CRM-1',
443
- }));
444
- const findings = validateRepoModel(model).filter(f => f.message.includes('INT-002'));
445
- expect(findings).toHaveLength(0);
446
- });
447
- });
448
- describe('validateRepoModel — layer-semantics (hosts / uses / TSVC-003)', () => {
449
- function techModel() {
450
- const model = cleanModel();
451
- model.elements.push(el('canon/elements/04_technology/nodes/NODE-KAFKA-HOST-1.yaml', {
452
- notation: 'node',
453
- id: 'NODE-KAFKA-HOST-1',
454
- type: 'cloud_instance',
455
- }), el('canon/elements/04_technology/services/TECHNOLOGY_SERVICE-KAFKA-1.yaml', {
456
- notation: 'technology-service',
457
- id: 'TECHNOLOGY_SERVICE-KAFKA-1',
458
- type: 'messaging',
459
- node: 'NODE-KAFKA-HOST-1',
460
- }), el('canon/elements/03_application/applications/APPLICATION-OMS-1.yaml', {
461
- notation: 'application',
462
- id: 'APPLICATION-OMS-1',
463
- }));
464
- return model;
465
- }
466
- it('accepts a valid hosts relation (NODE → TECHNOLOGY_SERVICE)', () => {
467
- const model = techModel();
468
- model.relations.push(el('canon/relations/REL-HOSTS-1.yaml', {
469
- notation: 'relation',
470
- id: 'REL-HOSTS-1',
471
- type: 'hosts',
472
- from: 'NODE-KAFKA-HOST-1',
473
- to: 'TECHNOLOGY_SERVICE-KAFKA-1',
474
- }));
475
- expect(validateRepoModel(model)).toEqual([]);
476
- });
477
- it('accepts a valid uses relation (APPLICATION → TECHNOLOGY_SERVICE)', () => {
478
- const model = techModel();
479
- model.relations.push(el('canon/relations/REL-USES-1.yaml', {
480
- notation: 'relation',
481
- id: 'REL-USES-1',
482
- type: 'uses',
483
- from: 'APPLICATION-OMS-1',
484
- to: 'TECHNOLOGY_SERVICE-KAFKA-1',
485
- }));
486
- expect(validateRepoModel(model)).toEqual([]);
487
- });
488
- it('flags hosts with a non-NODE from element', () => {
489
- const model = techModel();
490
- model.relations.push(el('canon/relations/REL-HOSTS-BAD-1.yaml', {
491
- notation: 'relation',
492
- id: 'REL-HOSTS-BAD-1',
493
- type: 'hosts',
494
- from: 'APPLICATION-OMS-1',
495
- to: 'TECHNOLOGY_SERVICE-KAFKA-1',
496
- }));
497
- const findings = validateRepoModel(model);
498
- expect(findings).toHaveLength(1);
499
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-HOSTS-BAD-1' });
500
- expect(findings[0].message).toContain('hosts');
501
- expect(findings[0].message).toContain('NODE');
502
- });
503
- it('flags hosts with a non-TECHNOLOGY_SERVICE to element', () => {
504
- const model = techModel();
505
- model.relations.push(el('canon/relations/REL-HOSTS-BAD-2.yaml', {
506
- notation: 'relation',
507
- id: 'REL-HOSTS-BAD-2',
508
- type: 'hosts',
509
- from: 'NODE-KAFKA-HOST-1',
510
- to: 'APPLICATION-OMS-1',
511
- }));
512
- const findings = validateRepoModel(model);
513
- expect(findings).toHaveLength(1);
514
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-HOSTS-BAD-2' });
515
- expect(findings[0].message).toContain('hosts');
516
- expect(findings[0].message).toContain('TECHNOLOGY_SERVICE');
517
- });
518
- it('flags uses with a non-APPLICATION from element', () => {
519
- const model = techModel();
520
- model.relations.push(el('canon/relations/REL-USES-BAD-1.yaml', {
521
- notation: 'relation',
522
- id: 'REL-USES-BAD-1',
523
- type: 'uses',
524
- from: 'NODE-KAFKA-HOST-1',
525
- to: 'TECHNOLOGY_SERVICE-KAFKA-1',
526
- }));
527
- const findings = validateRepoModel(model);
528
- expect(findings).toHaveLength(1);
529
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-USES-BAD-1' });
530
- expect(findings[0].message).toContain('uses');
531
- expect(findings[0].message).toContain('APPLICATION');
532
- });
533
- it('flags uses with a non-TECHNOLOGY_SERVICE to element', () => {
534
- const model = techModel();
535
- model.relations.push(el('canon/relations/REL-USES-BAD-2.yaml', {
536
- notation: 'relation',
537
- id: 'REL-USES-BAD-2',
538
- type: 'uses',
539
- from: 'APPLICATION-OMS-1',
540
- to: 'NODE-KAFKA-HOST-1',
541
- }));
542
- const findings = validateRepoModel(model);
543
- expect(findings).toHaveLength(1);
544
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'REL-USES-BAD-2' });
545
- expect(findings[0].message).toContain('uses');
546
- expect(findings[0].message).toContain('TECHNOLOGY_SERVICE');
547
- });
548
- it('TSVC-003: does not flag a technology-service whose node resolves to a NODE element', () => {
549
- const model = techModel();
550
- expect(validateRepoModel(model)).toEqual([]);
551
- });
552
- it('TSVC-003: flags a technology-service whose node resolves to a non-NODE element', () => {
553
- const model = techModel();
554
- model.elements.push(el('canon/elements/04_technology/services/TECHNOLOGY_SERVICE-BAD-1.yaml', {
555
- notation: 'technology-service',
556
- id: 'TECHNOLOGY_SERVICE-BAD-1',
557
- type: 'messaging',
558
- node: 'APPLICATION-OMS-1',
559
- }));
560
- const findings = validateRepoModel(model).filter(f => f.message.includes('TSVC-003'));
561
- expect(findings).toHaveLength(1);
562
- expect(findings[0]).toMatchObject({ scope: 'repo', id: 'TECHNOLOGY_SERVICE-BAD-1' });
563
- expect(findings[0].message).toContain('APPLICATION-OMS-1');
564
- });
565
- it('TSVC-003: does not flag a technology-service with an unresolved node (phase 4 handles that)', () => {
566
- const model = techModel();
567
- model.elements.push(el('canon/elements/04_technology/services/TECHNOLOGY_SERVICE-UNRESOLVED-1.yaml', {
568
- notation: 'technology-service',
569
- id: 'TECHNOLOGY_SERVICE-UNRESOLVED-1',
570
- type: 'storage',
571
- node: 'NODE-MISSING-99',
572
- }));
573
- const findings = validateRepoModel(model).filter(f => f.message.includes('TSVC-003'));
574
- expect(findings).toHaveLength(0);
575
- });
576
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
1
- // Conformance test for the shipped REQUIREMENT worked examples — the
2
- // acme_corp canon files mirrored under `tests/fixtures/notation-corpus/requirement/`. Pins the
3
- // success signal of vkgeorgia/strategy#84 Phase 1: the library consumes the
4
- // canonical example files without error.
5
- import { describe, it, expect } from 'vitest';
6
- import { readFileSync } from 'node:fs';
7
- import { fileURLToPath } from 'node:url';
8
- import path from 'node:path';
9
- import yaml from 'js-yaml';
10
- import { validateRequirement } from '../validate.js';
11
- const dir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../../tests/fixtures/notation-corpus/requirement');
12
- const load = (f) => yaml.load(readFileSync(path.join(dir, f), 'utf-8'));
13
- describe('requirement worked examples (acme_corp)', () => {
14
- for (const f of ['REQUIREMENT-DATA-ERASURE-1.yaml', 'REQUIREMENT-AUDIT-LOG-RETENTION-1.yaml']) {
15
- it(`validates ${f} without error`, () => {
16
- const v = validateRequirement(load(f));
17
- expect(v.valid, JSON.stringify(v.errors)).toBe(true);
18
- expect(v.errors).toHaveLength(0);
19
- });
20
- }
21
- });
@@ -1 +0,0 @@
1
- export {};