@anatomytool/validate 1.0.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 (156) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +127 -0
  3. package/dist/canonical.d.ts +21 -0
  4. package/dist/canonical.d.ts.map +1 -0
  5. package/dist/canonical.js +76 -0
  6. package/dist/canonical.js.map +1 -0
  7. package/dist/checks/commands-no-test-warn.d.ts +6 -0
  8. package/dist/checks/commands-no-test-warn.d.ts.map +1 -0
  9. package/dist/checks/commands-no-test-warn.js +35 -0
  10. package/dist/checks/commands-no-test-warn.js.map +1 -0
  11. package/dist/checks/description-warn.d.ts +6 -0
  12. package/dist/checks/description-warn.d.ts.map +1 -0
  13. package/dist/checks/description-warn.js +23 -0
  14. package/dist/checks/description-warn.js.map +1 -0
  15. package/dist/checks/entry-point-alias-warn.d.ts +6 -0
  16. package/dist/checks/entry-point-alias-warn.d.ts.map +1 -0
  17. package/dist/checks/entry-point-alias-warn.js +25 -0
  18. package/dist/checks/entry-point-alias-warn.js.map +1 -0
  19. package/dist/checks/fingerprint-check.d.ts +6 -0
  20. package/dist/checks/fingerprint-check.d.ts.map +1 -0
  21. package/dist/checks/fingerprint-check.js +59 -0
  22. package/dist/checks/fingerprint-check.js.map +1 -0
  23. package/dist/checks/hash-check.d.ts +6 -0
  24. package/dist/checks/hash-check.d.ts.map +1 -0
  25. package/dist/checks/hash-check.js +36 -0
  26. package/dist/checks/hash-check.js.map +1 -0
  27. package/dist/checks/interface-form-check.d.ts +6 -0
  28. package/dist/checks/interface-form-check.d.ts.map +1 -0
  29. package/dist/checks/interface-form-check.js +66 -0
  30. package/dist/checks/interface-form-check.js.map +1 -0
  31. package/dist/checks/memory-dangling-ref-check.d.ts +6 -0
  32. package/dist/checks/memory-dangling-ref-check.d.ts.map +1 -0
  33. package/dist/checks/memory-dangling-ref-check.js +34 -0
  34. package/dist/checks/memory-dangling-ref-check.js.map +1 -0
  35. package/dist/checks/memory-fingerprint-check.d.ts +6 -0
  36. package/dist/checks/memory-fingerprint-check.d.ts.map +1 -0
  37. package/dist/checks/memory-fingerprint-check.js +20 -0
  38. package/dist/checks/memory-fingerprint-check.js.map +1 -0
  39. package/dist/checks/memory-supersession-check.d.ts +6 -0
  40. package/dist/checks/memory-supersession-check.d.ts.map +1 -0
  41. package/dist/checks/memory-supersession-check.js +61 -0
  42. package/dist/checks/memory-supersession-check.js.map +1 -0
  43. package/dist/checks/memory-verification-check.d.ts +6 -0
  44. package/dist/checks/memory-verification-check.d.ts.map +1 -0
  45. package/dist/checks/memory-verification-check.js +61 -0
  46. package/dist/checks/memory-verification-check.js.map +1 -0
  47. package/dist/checks/nested-path-escape.d.ts +6 -0
  48. package/dist/checks/nested-path-escape.d.ts.map +1 -0
  49. package/dist/checks/nested-path-escape.js +76 -0
  50. package/dist/checks/nested-path-escape.js.map +1 -0
  51. package/dist/checks/schema-check.d.ts +6 -0
  52. package/dist/checks/schema-check.d.ts.map +1 -0
  53. package/dist/checks/schema-check.js +32 -0
  54. package/dist/checks/schema-check.js.map +1 -0
  55. package/dist/checks/source-cross-check.d.ts +52 -0
  56. package/dist/checks/source-cross-check.d.ts.map +1 -0
  57. package/dist/checks/source-cross-check.js +473 -0
  58. package/dist/checks/source-cross-check.js.map +1 -0
  59. package/dist/checks/source-path-check.d.ts +6 -0
  60. package/dist/checks/source-path-check.d.ts.map +1 -0
  61. package/dist/checks/source-path-check.js +62 -0
  62. package/dist/checks/source-path-check.js.map +1 -0
  63. package/dist/checks/structure-path-check.d.ts +6 -0
  64. package/dist/checks/structure-path-check.d.ts.map +1 -0
  65. package/dist/checks/structure-path-check.js +31 -0
  66. package/dist/checks/structure-path-check.js.map +1 -0
  67. package/dist/checks/verify/ast-grep-verifier.d.ts +4 -0
  68. package/dist/checks/verify/ast-grep-verifier.d.ts.map +1 -0
  69. package/dist/checks/verify/ast-grep-verifier.js +153 -0
  70. package/dist/checks/verify/ast-grep-verifier.js.map +1 -0
  71. package/dist/checks/verify/detect-ast-grep.d.ts +9 -0
  72. package/dist/checks/verify/detect-ast-grep.d.ts.map +1 -0
  73. package/dist/checks/verify/detect-ast-grep.js +26 -0
  74. package/dist/checks/verify/detect-ast-grep.js.map +1 -0
  75. package/dist/checks/verify/detect-semgrep.d.ts +8 -0
  76. package/dist/checks/verify/detect-semgrep.d.ts.map +1 -0
  77. package/dist/checks/verify/detect-semgrep.js +36 -0
  78. package/dist/checks/verify/detect-semgrep.js.map +1 -0
  79. package/dist/checks/verify/glob-verifier.d.ts +5 -0
  80. package/dist/checks/verify/glob-verifier.d.ts.map +1 -0
  81. package/dist/checks/verify/glob-verifier.js +58 -0
  82. package/dist/checks/verify/glob-verifier.js.map +1 -0
  83. package/dist/checks/verify/semgrep-pattern-verifier.d.ts +4 -0
  84. package/dist/checks/verify/semgrep-pattern-verifier.d.ts.map +1 -0
  85. package/dist/checks/verify/semgrep-pattern-verifier.js +121 -0
  86. package/dist/checks/verify/semgrep-pattern-verifier.js.map +1 -0
  87. package/dist/checks/verify/semgrep-rule-file-verifier.d.ts +9 -0
  88. package/dist/checks/verify/semgrep-rule-file-verifier.d.ts.map +1 -0
  89. package/dist/checks/verify/semgrep-rule-file-verifier.js +151 -0
  90. package/dist/checks/verify/semgrep-rule-file-verifier.js.map +1 -0
  91. package/dist/checks/verify/types.d.ts +44 -0
  92. package/dist/checks/verify/types.d.ts.map +1 -0
  93. package/dist/checks/verify/types.js +6 -0
  94. package/dist/checks/verify/types.js.map +1 -0
  95. package/dist/checks/verify-check.d.ts +9 -0
  96. package/dist/checks/verify-check.d.ts.map +1 -0
  97. package/dist/checks/verify-check.js +67 -0
  98. package/dist/checks/verify-check.js.map +1 -0
  99. package/dist/discovery.d.ts +13 -0
  100. package/dist/discovery.d.ts.map +1 -0
  101. package/dist/discovery.js +82 -0
  102. package/dist/discovery.js.map +1 -0
  103. package/dist/errors.d.ts +38 -0
  104. package/dist/errors.d.ts.map +1 -0
  105. package/dist/errors.js +5 -0
  106. package/dist/errors.js.map +1 -0
  107. package/dist/index.d.ts +43 -0
  108. package/dist/index.d.ts.map +1 -0
  109. package/dist/index.js +81 -0
  110. package/dist/index.js.map +1 -0
  111. package/dist/memory.d.ts +19 -0
  112. package/dist/memory.d.ts.map +1 -0
  113. package/dist/memory.js +80 -0
  114. package/dist/memory.js.map +1 -0
  115. package/dist/parse.d.ts +17 -0
  116. package/dist/parse.d.ts.map +1 -0
  117. package/dist/parse.js +47 -0
  118. package/dist/parse.js.map +1 -0
  119. package/dist/schema-0.10.json +194 -0
  120. package/dist/schema-0.11.json +203 -0
  121. package/dist/schema-0.12.json +243 -0
  122. package/dist/schema-0.13.json +267 -0
  123. package/dist/schema-0.14.json +288 -0
  124. package/dist/schema-0.15.json +347 -0
  125. package/dist/schema-0.2.json +283 -0
  126. package/dist/schema-0.4.json +280 -0
  127. package/dist/schema-0.5.json +300 -0
  128. package/dist/schema-0.6.json +328 -0
  129. package/dist/schema-0.7.json +311 -0
  130. package/dist/schema-0.8.json +245 -0
  131. package/dist/schema-0.9.json +172 -0
  132. package/dist/schema-1.0.json +347 -0
  133. package/dist/schema-memory-0.1.json +43 -0
  134. package/dist/schema-memory-0.2.json +49 -0
  135. package/dist/schema-memory.d.ts +5 -0
  136. package/dist/schema-memory.d.ts.map +1 -0
  137. package/dist/schema-memory.js +16 -0
  138. package/dist/schema-memory.js.map +1 -0
  139. package/dist/schema.d.ts +6 -0
  140. package/dist/schema.d.ts.map +1 -0
  141. package/dist/schema.js +62 -0
  142. package/dist/schema.js.map +1 -0
  143. package/dist/schema.json +129 -0
  144. package/dist/types.d.ts +2 -0
  145. package/dist/types.d.ts.map +1 -0
  146. package/dist/types.generated.d.ts +1103 -0
  147. package/dist/types.generated.d.ts.map +1 -0
  148. package/dist/types.generated.js +7 -0
  149. package/dist/types.generated.js.map +1 -0
  150. package/dist/types.js +7 -0
  151. package/dist/types.js.map +1 -0
  152. package/dist/validate-tree.d.ts +20 -0
  153. package/dist/validate-tree.d.ts.map +1 -0
  154. package/dist/validate-tree.js +64 -0
  155. package/dist/validate-tree.js.map +1 -0
  156. package/package.json +48 -0
@@ -0,0 +1,280 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://anatomy.dev/spec/0.4/schema.json",
4
+ "title": "Anatomy",
5
+ "description": "Schema for .anatomy files (v0.4). Additive over v0.2: adds [code_profile] section with four form-conditional variants.",
6
+ "type": "object",
7
+ "required": ["anatomy_version", "tagline", "identity", "generated"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "anatomy_version": { "type": "string", "const": "0.4" },
11
+ "tagline": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^[^\\n\\r]+$" },
12
+ "description": { "type": "string", "minLength": 1, "maxLength": 2000 },
13
+ "identity": { "$ref": "#/$defs/identity" },
14
+ "generated": { "$ref": "#/$defs/generated" },
15
+ "operation": { "$ref": "#/$defs/operation" },
16
+ "substance": { "$ref": "#/$defs/substance" },
17
+ "structure": { "$ref": "#/$defs/structure" },
18
+ "environment": { "$ref": "#/$defs/environment" },
19
+ "interface": { "$ref": "#/$defs/interface" },
20
+ "domain_model": { "$ref": "#/$defs/domain_model" },
21
+ "code_profile": { "$ref": "#/$defs/code_profile" }
22
+ },
23
+ "$defs": {
24
+ "identity": {
25
+ "type": "object",
26
+ "required": ["stack", "form", "domain", "function", "fingerprint"],
27
+ "additionalProperties": false,
28
+ "properties": {
29
+ "stack": { "$ref": "#/$defs/pillar" },
30
+ "form": { "$ref": "#/$defs/pillar" },
31
+ "domain": { "$ref": "#/$defs/pillar" },
32
+ "function": { "$ref": "#/$defs/pillar" },
33
+ "fingerprint": { "type": "string", "pattern": "^[a-z0-9]{20}$" }
34
+ }
35
+ },
36
+ "pillar": {
37
+ "type": "object",
38
+ "required": ["id", "hash"],
39
+ "additionalProperties": false,
40
+ "properties": {
41
+ "id": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
42
+ "hash": { "type": "string", "pattern": "^[a-z0-9]{5}$" }
43
+ }
44
+ },
45
+ "generated": {
46
+ "type": "object",
47
+ "required": ["at", "by", "model", "schema"],
48
+ "additionalProperties": false,
49
+ "properties": {
50
+ "at": { "type": "string", "format": "date-time" },
51
+ "by": { "type": "string", "minLength": 1 },
52
+ "model": { "type": "string", "minLength": 1 },
53
+ "schema": { "type": "string", "format": "uri" }
54
+ }
55
+ },
56
+ "operation": {
57
+ "type": "object",
58
+ "additionalProperties": false,
59
+ "properties": {
60
+ "entry_points": {
61
+ "type": "array", "maxItems": 10,
62
+ "items": { "$ref": "#/$defs/entry_point" }
63
+ },
64
+ "commands": {
65
+ "type": "object",
66
+ "propertyNames": { "pattern": "^[a-z0-9]+(-[a-z0-9]+)*(\\.[a-z0-9]+(-[a-z0-9]+)*)?$" },
67
+ "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 200 },
68
+ "maxProperties": 25
69
+ },
70
+ "conventions": {
71
+ "type": "object",
72
+ "propertyNames": { "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
73
+ "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 120 },
74
+ "maxProperties": 15
75
+ }
76
+ }
77
+ },
78
+ "entry_point": {
79
+ "type": "object",
80
+ "required": ["path", "role"],
81
+ "additionalProperties": false,
82
+ "not": { "required": ["description", "purpose"] },
83
+ "properties": {
84
+ "path": { "type": "string", "minLength": 1, "maxLength": 256 },
85
+ "role": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
86
+ "purpose": { "type": "string", "minLength": 1, "maxLength": 80, "pattern": "^[^\\n\\r]+$" },
87
+ "description": { "type": "string", "minLength": 1, "maxLength": 80, "pattern": "^[^\\n\\r]+$" }
88
+ }
89
+ },
90
+ "substance": {
91
+ "type": "object",
92
+ "additionalProperties": false,
93
+ "properties": {
94
+ "key_dependencies": { "type": "array", "maxItems": 10, "items": { "$ref": "#/$defs/key_dependency" } },
95
+ "capabilities": { "type": "array", "maxItems": 10, "items": { "$ref": "#/$defs/phrase_with_source" } },
96
+ "limitations": { "type": "array", "maxItems": 10, "items": { "$ref": "#/$defs/phrase_with_source" } }
97
+ }
98
+ },
99
+ "key_dependency": {
100
+ "type": "object", "required": ["name", "why"], "additionalProperties": false,
101
+ "properties": {
102
+ "name": { "type": "string", "minLength": 1, "maxLength": 200 },
103
+ "why": { "type": "string", "minLength": 1, "maxLength": 80 }
104
+ }
105
+ },
106
+ "phrase_with_source": {
107
+ "type": "object", "required": ["phrase"], "additionalProperties": false,
108
+ "properties": {
109
+ "phrase": { "type": "string", "minLength": 1, "maxLength": 120 },
110
+ "source": {
111
+ "oneOf": [
112
+ { "type": "string", "minLength": 1, "maxLength": 256 },
113
+ {
114
+ "type": "object", "required": ["path", "symbol"], "additionalProperties": false,
115
+ "properties": {
116
+ "path": { "type": "string", "minLength": 1, "maxLength": 256 },
117
+ "symbol": { "type": "string", "minLength": 1, "maxLength": 200 }
118
+ }
119
+ }
120
+ ]
121
+ }
122
+ }
123
+ },
124
+ "structure": {
125
+ "type": "object", "additionalProperties": false, "required": ["entries"],
126
+ "properties": {
127
+ "entries": {
128
+ "type": "array", "minItems": 1, "maxItems": 25,
129
+ "items": {
130
+ "type": "object", "required": ["path", "purpose", "kind"], "additionalProperties": false,
131
+ "properties": {
132
+ "path": { "type": "string", "minLength": 1, "maxLength": 256 },
133
+ "purpose": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^[^\\n\\r]+$" },
134
+ "kind": { "enum": ["source", "tests", "docs", "config", "build", "scripts", "examples", "generated", "other"] }
135
+ }
136
+ }
137
+ }
138
+ }
139
+ },
140
+ "environment": {
141
+ "type": "object", "additionalProperties": false,
142
+ "anyOf": [
143
+ { "required": ["language_version"] }, { "required": ["runtime"] },
144
+ { "required": ["os"] }, { "required": ["required_services"] }, { "required": ["required_env"] }
145
+ ],
146
+ "properties": {
147
+ "language_version": { "type": "string", "minLength": 1, "maxLength": 80 },
148
+ "runtime": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$", "maxLength": 40 },
149
+ "os": {
150
+ "oneOf": [
151
+ { "type": "array", "items": { "const": "any" }, "minItems": 1, "maxItems": 1 },
152
+ { "type": "array", "minItems": 1, "maxItems": 5, "uniqueItems": true, "items": { "enum": ["linux", "macos", "windows", "freebsd"] } }
153
+ ]
154
+ },
155
+ "required_services": {
156
+ "type": "array", "minItems": 1, "maxItems": 10,
157
+ "items": {
158
+ "type": "object", "required": ["name", "why"], "additionalProperties": false,
159
+ "properties": {
160
+ "name": { "type": "string", "minLength": 1, "maxLength": 80, "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
161
+ "why": { "type": "string", "minLength": 1, "maxLength": 80 }
162
+ }
163
+ }
164
+ },
165
+ "required_env": {
166
+ "type": "array", "minItems": 1, "maxItems": 25,
167
+ "items": {
168
+ "type": "object", "required": ["name", "why"], "additionalProperties": false,
169
+ "properties": {
170
+ "name": { "type": "string", "minLength": 1, "maxLength": 80, "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" },
171
+ "why": { "type": "string", "minLength": 1, "maxLength": 80 }
172
+ }
173
+ }
174
+ }
175
+ }
176
+ },
177
+ "interface": {
178
+ "type": "object", "additionalProperties": false,
179
+ "oneOf": [
180
+ { "required": ["exports"] }, { "required": ["endpoints"] }, { "required": ["subcommands"] }
181
+ ],
182
+ "properties": {
183
+ "exports": {
184
+ "type": "array", "minItems": 1, "maxItems": 25,
185
+ "items": {
186
+ "type": "object", "required": ["symbol", "kind", "summary"], "additionalProperties": false,
187
+ "properties": {
188
+ "symbol": { "type": "string", "minLength": 1, "maxLength": 120 },
189
+ "kind": { "enum": ["function", "class", "type", "constant", "namespace", "trait"] },
190
+ "summary": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^[^\\n\\r]+$" }
191
+ }
192
+ }
193
+ },
194
+ "endpoints": {
195
+ "type": "array", "minItems": 1, "maxItems": 50,
196
+ "items": {
197
+ "type": "object", "required": ["method", "path", "summary"], "additionalProperties": false,
198
+ "properties": {
199
+ "method": { "enum": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "WS", "GRPC", "OTHER"] },
200
+ "path": { "type": "string", "minLength": 1, "maxLength": 200 },
201
+ "summary": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^[^\\n\\r]+$" }
202
+ }
203
+ }
204
+ },
205
+ "subcommands": {
206
+ "type": "array", "minItems": 1, "maxItems": 30,
207
+ "items": {
208
+ "type": "object", "required": ["name", "summary"], "additionalProperties": false,
209
+ "properties": {
210
+ "name": { "type": "string", "minLength": 1, "maxLength": 60, "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
211
+ "summary": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^[^\\n\\r]+$" }
212
+ }
213
+ }
214
+ }
215
+ }
216
+ },
217
+ "domain_model": {
218
+ "type": "object", "additionalProperties": false, "required": ["entities"],
219
+ "properties": {
220
+ "entities": {
221
+ "type": "array", "minItems": 1, "maxItems": 25,
222
+ "items": {
223
+ "type": "object", "required": ["name", "summary"], "additionalProperties": false,
224
+ "properties": {
225
+ "name": { "type": "string", "minLength": 1, "maxLength": 80 },
226
+ "summary": { "type": "string", "minLength": 1, "maxLength": 200, "pattern": "^[^\\n\\r]+$" }
227
+ }
228
+ }
229
+ }
230
+ }
231
+ },
232
+ "code_profile": {
233
+ "type": "object",
234
+ "additionalProperties": false,
235
+ "oneOf": [
236
+ { "required": ["components"] },
237
+ { "required": ["commands"] },
238
+ { "required": ["endpoints"] },
239
+ { "required": ["exports"] }
240
+ ],
241
+ "properties": {
242
+ "components": { "$ref": "#/$defs/code_profile_components" },
243
+ "commands": { "$ref": "#/$defs/code_profile_commands" },
244
+ "endpoints": { "$ref": "#/$defs/code_profile_endpoints" },
245
+ "exports": { "$ref": "#/$defs/code_profile_exports" }
246
+ }
247
+ },
248
+ "code_profile_components": {
249
+ "type": "object", "additionalProperties": false, "required": ["count"],
250
+ "properties": {
251
+ "count": { "type": "integer", "minimum": 0 },
252
+ "styling": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$", "maxLength": 40 },
253
+ "sample": { "type": "array", "maxItems": 10, "items": { "type": "string", "minLength": 1, "maxLength": 80 } }
254
+ }
255
+ },
256
+ "code_profile_commands": {
257
+ "type": "object", "additionalProperties": false, "required": ["count"],
258
+ "properties": {
259
+ "count": { "type": "integer", "minimum": 0 },
260
+ "max_depth": { "type": "integer", "minimum": 2, "maximum": 10 },
261
+ "sample": { "type": "array", "maxItems": 10, "items": { "type": "string", "minLength": 1, "maxLength": 80 } }
262
+ }
263
+ },
264
+ "code_profile_endpoints": {
265
+ "type": "object", "additionalProperties": false, "required": ["count"],
266
+ "properties": {
267
+ "count": { "type": "integer", "minimum": 0 },
268
+ "auth_scheme": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$", "maxLength": 40 },
269
+ "sample": { "type": "array", "maxItems": 10, "items": { "type": "string", "minLength": 1, "maxLength": 80 } }
270
+ }
271
+ },
272
+ "code_profile_exports": {
273
+ "type": "object", "additionalProperties": false, "required": ["count"],
274
+ "properties": {
275
+ "count": { "type": "integer", "minimum": 0 },
276
+ "sample": { "type": "array", "maxItems": 10, "items": { "type": "string", "minLength": 1, "maxLength": 80 } }
277
+ }
278
+ }
279
+ }
280
+ }
@@ -0,0 +1,300 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://anatomy.dev/spec/0.5/schema.json",
4
+ "title": "Anatomy",
5
+ "description": "Schema for .anatomy files (v0.5). Additive over v0.4: adds generated.commit, architecture.invariants, interface.exports[].signature, and structure.entries[].convention.",
6
+ "type": "object",
7
+ "required": ["anatomy_version", "tagline", "identity", "generated"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "anatomy_version": { "type": "string", "const": "0.5" },
11
+ "tagline": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^[^\\n\\r]+$" },
12
+ "description": { "type": "string", "minLength": 1, "maxLength": 2000 },
13
+ "identity": { "$ref": "#/$defs/identity" },
14
+ "generated": { "$ref": "#/$defs/generated" },
15
+ "operation": { "$ref": "#/$defs/operation" },
16
+ "substance": { "$ref": "#/$defs/substance" },
17
+ "structure": { "$ref": "#/$defs/structure" },
18
+ "environment": { "$ref": "#/$defs/environment" },
19
+ "interface": { "$ref": "#/$defs/interface" },
20
+ "domain_model": { "$ref": "#/$defs/domain_model" },
21
+ "code_profile": { "$ref": "#/$defs/code_profile" },
22
+ "architecture": { "$ref": "#/$defs/architecture" }
23
+ },
24
+ "$defs": {
25
+ "identity": {
26
+ "type": "object",
27
+ "required": ["stack", "form", "domain", "function", "fingerprint"],
28
+ "additionalProperties": false,
29
+ "properties": {
30
+ "stack": { "$ref": "#/$defs/pillar" },
31
+ "form": { "$ref": "#/$defs/pillar" },
32
+ "domain": { "$ref": "#/$defs/pillar" },
33
+ "function": { "$ref": "#/$defs/pillar" },
34
+ "fingerprint": { "type": "string", "pattern": "^[a-z0-9]{20}$" }
35
+ }
36
+ },
37
+ "pillar": {
38
+ "type": "object",
39
+ "required": ["id", "hash"],
40
+ "additionalProperties": false,
41
+ "properties": {
42
+ "id": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
43
+ "hash": { "type": "string", "pattern": "^[a-z0-9]{5}$" }
44
+ }
45
+ },
46
+ "generated": {
47
+ "type": "object",
48
+ "required": ["at", "by", "model", "schema"],
49
+ "additionalProperties": false,
50
+ "properties": {
51
+ "at": { "type": "string", "format": "date-time" },
52
+ "commit": { "type": "string", "pattern": "^[0-9a-f]{7,12}$" },
53
+ "by": { "type": "string", "minLength": 1 },
54
+ "model": { "type": "string", "minLength": 1 },
55
+ "schema": { "type": "string", "format": "uri" }
56
+ }
57
+ },
58
+ "operation": {
59
+ "type": "object",
60
+ "additionalProperties": false,
61
+ "properties": {
62
+ "entry_points": {
63
+ "type": "array", "maxItems": 10,
64
+ "items": { "$ref": "#/$defs/entry_point" }
65
+ },
66
+ "commands": {
67
+ "type": "object",
68
+ "propertyNames": { "pattern": "^[a-z0-9]+(-[a-z0-9]+)*(\\.[a-z0-9]+(-[a-z0-9]+)*)?$" },
69
+ "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 200 },
70
+ "maxProperties": 25
71
+ },
72
+ "conventions": {
73
+ "type": "object",
74
+ "propertyNames": { "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
75
+ "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 120 },
76
+ "maxProperties": 15
77
+ }
78
+ }
79
+ },
80
+ "entry_point": {
81
+ "type": "object",
82
+ "required": ["path", "role"],
83
+ "additionalProperties": false,
84
+ "not": { "required": ["description", "purpose"] },
85
+ "properties": {
86
+ "path": { "type": "string", "minLength": 1, "maxLength": 256 },
87
+ "role": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
88
+ "purpose": { "type": "string", "minLength": 1, "maxLength": 80, "pattern": "^[^\\n\\r]+$" },
89
+ "description": { "type": "string", "minLength": 1, "maxLength": 80, "pattern": "^[^\\n\\r]+$" }
90
+ }
91
+ },
92
+ "substance": {
93
+ "type": "object",
94
+ "additionalProperties": false,
95
+ "properties": {
96
+ "key_dependencies": { "type": "array", "maxItems": 10, "items": { "$ref": "#/$defs/key_dependency" } },
97
+ "capabilities": { "type": "array", "maxItems": 10, "items": { "$ref": "#/$defs/phrase_with_source" } },
98
+ "limitations": { "type": "array", "maxItems": 10, "items": { "$ref": "#/$defs/phrase_with_source" } }
99
+ }
100
+ },
101
+ "key_dependency": {
102
+ "type": "object", "required": ["name", "why"], "additionalProperties": false,
103
+ "properties": {
104
+ "name": { "type": "string", "minLength": 1, "maxLength": 200 },
105
+ "why": { "type": "string", "minLength": 1, "maxLength": 80 }
106
+ }
107
+ },
108
+ "phrase_with_source": {
109
+ "type": "object", "required": ["phrase"], "additionalProperties": false,
110
+ "properties": {
111
+ "phrase": { "type": "string", "minLength": 1, "maxLength": 120 },
112
+ "source": {
113
+ "oneOf": [
114
+ { "type": "string", "minLength": 1, "maxLength": 256 },
115
+ {
116
+ "type": "object", "required": ["path", "symbol"], "additionalProperties": false,
117
+ "properties": {
118
+ "path": { "type": "string", "minLength": 1, "maxLength": 256 },
119
+ "symbol": { "type": "string", "minLength": 1, "maxLength": 200 }
120
+ }
121
+ }
122
+ ]
123
+ }
124
+ }
125
+ },
126
+ "structure": {
127
+ "type": "object", "additionalProperties": false, "required": ["entries"],
128
+ "properties": {
129
+ "entries": {
130
+ "type": "array", "minItems": 1, "maxItems": 25,
131
+ "items": {
132
+ "type": "object", "required": ["path", "purpose", "kind"], "additionalProperties": false,
133
+ "properties": {
134
+ "path": { "type": "string", "minLength": 1, "maxLength": 256 },
135
+ "purpose": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^[^\\n\\r]+$" },
136
+ "kind": { "enum": ["source", "tests", "docs", "config", "build", "scripts", "examples", "generated", "other"] },
137
+ "convention": { "type": "string", "minLength": 1, "maxLength": 200, "pattern": "^[^\\n\\r]+$" }
138
+ }
139
+ }
140
+ }
141
+ }
142
+ },
143
+ "environment": {
144
+ "type": "object", "additionalProperties": false,
145
+ "anyOf": [
146
+ { "required": ["language_version"] }, { "required": ["runtime"] },
147
+ { "required": ["os"] }, { "required": ["required_services"] }, { "required": ["required_env"] }
148
+ ],
149
+ "properties": {
150
+ "language_version": { "type": "string", "minLength": 1, "maxLength": 80 },
151
+ "runtime": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$", "maxLength": 40 },
152
+ "os": {
153
+ "oneOf": [
154
+ { "type": "array", "items": { "const": "any" }, "minItems": 1, "maxItems": 1 },
155
+ { "type": "array", "minItems": 1, "maxItems": 5, "uniqueItems": true, "items": { "enum": ["linux", "macos", "windows", "freebsd"] } }
156
+ ]
157
+ },
158
+ "required_services": {
159
+ "type": "array", "minItems": 1, "maxItems": 10,
160
+ "items": {
161
+ "type": "object", "required": ["name", "why"], "additionalProperties": false,
162
+ "properties": {
163
+ "name": { "type": "string", "minLength": 1, "maxLength": 80, "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
164
+ "why": { "type": "string", "minLength": 1, "maxLength": 80 }
165
+ }
166
+ }
167
+ },
168
+ "required_env": {
169
+ "type": "array", "minItems": 1, "maxItems": 25,
170
+ "items": {
171
+ "type": "object", "required": ["name", "why"], "additionalProperties": false,
172
+ "properties": {
173
+ "name": { "type": "string", "minLength": 1, "maxLength": 80, "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" },
174
+ "why": { "type": "string", "minLength": 1, "maxLength": 80 }
175
+ }
176
+ }
177
+ }
178
+ }
179
+ },
180
+ "interface": {
181
+ "type": "object", "additionalProperties": false,
182
+ "oneOf": [
183
+ { "required": ["exports"] }, { "required": ["endpoints"] }, { "required": ["subcommands"] }
184
+ ],
185
+ "properties": {
186
+ "exports": {
187
+ "type": "array", "minItems": 1, "maxItems": 25,
188
+ "items": {
189
+ "type": "object", "required": ["symbol", "kind", "summary"], "additionalProperties": false,
190
+ "properties": {
191
+ "symbol": { "type": "string", "minLength": 1, "maxLength": 120 },
192
+ "kind": { "enum": ["function", "class", "type", "constant", "namespace", "trait"] },
193
+ "summary": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^[^\\n\\r]+$" },
194
+ "signature": { "type": "string", "minLength": 1, "maxLength": 200 }
195
+ }
196
+ }
197
+ },
198
+ "endpoints": {
199
+ "type": "array", "minItems": 1, "maxItems": 50,
200
+ "items": {
201
+ "type": "object", "required": ["method", "path", "summary"], "additionalProperties": false,
202
+ "properties": {
203
+ "method": { "enum": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "WS", "GRPC", "OTHER"] },
204
+ "path": { "type": "string", "minLength": 1, "maxLength": 200 },
205
+ "summary": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^[^\\n\\r]+$" }
206
+ }
207
+ }
208
+ },
209
+ "subcommands": {
210
+ "type": "array", "minItems": 1, "maxItems": 30,
211
+ "items": {
212
+ "type": "object", "required": ["name", "summary"], "additionalProperties": false,
213
+ "properties": {
214
+ "name": { "type": "string", "minLength": 1, "maxLength": 60, "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
215
+ "summary": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^[^\\n\\r]+$" }
216
+ }
217
+ }
218
+ }
219
+ }
220
+ },
221
+ "domain_model": {
222
+ "type": "object", "additionalProperties": false, "required": ["entities"],
223
+ "properties": {
224
+ "entities": {
225
+ "type": "array", "minItems": 1, "maxItems": 25,
226
+ "items": {
227
+ "type": "object", "required": ["name", "summary"], "additionalProperties": false,
228
+ "properties": {
229
+ "name": { "type": "string", "minLength": 1, "maxLength": 80 },
230
+ "summary": { "type": "string", "minLength": 1, "maxLength": 200, "pattern": "^[^\\n\\r]+$" }
231
+ }
232
+ }
233
+ }
234
+ }
235
+ },
236
+ "code_profile": {
237
+ "type": "object",
238
+ "additionalProperties": false,
239
+ "oneOf": [
240
+ { "required": ["components"] },
241
+ { "required": ["commands"] },
242
+ { "required": ["endpoints"] },
243
+ { "required": ["exports"] }
244
+ ],
245
+ "properties": {
246
+ "components": { "$ref": "#/$defs/code_profile_components" },
247
+ "commands": { "$ref": "#/$defs/code_profile_commands" },
248
+ "endpoints": { "$ref": "#/$defs/code_profile_endpoints" },
249
+ "exports": { "$ref": "#/$defs/code_profile_exports" }
250
+ }
251
+ },
252
+ "code_profile_components": {
253
+ "type": "object", "additionalProperties": false, "required": ["count"],
254
+ "properties": {
255
+ "count": { "type": "integer", "minimum": 0 },
256
+ "styling": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$", "maxLength": 40 },
257
+ "sample": { "type": "array", "maxItems": 10, "items": { "type": "string", "minLength": 1, "maxLength": 80 } }
258
+ }
259
+ },
260
+ "code_profile_commands": {
261
+ "type": "object", "additionalProperties": false, "required": ["count"],
262
+ "properties": {
263
+ "count": { "type": "integer", "minimum": 0 },
264
+ "max_depth": { "type": "integer", "minimum": 2, "maximum": 10 },
265
+ "sample": { "type": "array", "maxItems": 10, "items": { "type": "string", "minLength": 1, "maxLength": 80 } }
266
+ }
267
+ },
268
+ "code_profile_endpoints": {
269
+ "type": "object", "additionalProperties": false, "required": ["count"],
270
+ "properties": {
271
+ "count": { "type": "integer", "minimum": 0 },
272
+ "auth_scheme": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$", "maxLength": 40 },
273
+ "sample": { "type": "array", "maxItems": 10, "items": { "type": "string", "minLength": 1, "maxLength": 80 } }
274
+ }
275
+ },
276
+ "code_profile_exports": {
277
+ "type": "object", "additionalProperties": false, "required": ["count"],
278
+ "properties": {
279
+ "count": { "type": "integer", "minimum": 0 },
280
+ "sample": { "type": "array", "maxItems": 10, "items": { "type": "string", "minLength": 1, "maxLength": 80 } }
281
+ }
282
+ },
283
+ "architecture": {
284
+ "type": "object",
285
+ "additionalProperties": false,
286
+ "required": ["invariants"],
287
+ "properties": {
288
+ "invariants": {
289
+ "type": "array", "minItems": 1, "maxItems": 25,
290
+ "items": {
291
+ "type": "object", "required": ["rule"], "additionalProperties": false,
292
+ "properties": {
293
+ "rule": { "type": "string", "minLength": 1, "maxLength": 300 }
294
+ }
295
+ }
296
+ }
297
+ }
298
+ }
299
+ }
300
+ }