@portll/cobolwork 0.6.0 → 0.7.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 (140) hide show
  1. package/README.md +49 -18
  2. package/STABILITY.md +76 -0
  3. package/bin/cobolwork.mjs +30 -7
  4. package/lib/bms.mjs +21 -7
  5. package/lib/build.mjs +108 -53
  6. package/lib/capabilities.mjs +9 -10
  7. package/lib/cics-commands.mjs +501 -9
  8. package/lib/compliance.mjs +11 -0
  9. package/lib/consequence.mjs +13 -0
  10. package/lib/control-workers.mjs +161 -0
  11. package/lib/control.mjs +52 -3
  12. package/lib/dataflow.mjs +176 -125
  13. package/lib/db2/cursor.mjs +15 -0
  14. package/lib/db2/read.mjs +170 -0
  15. package/lib/db2/rules.mjs +77 -0
  16. package/lib/db2/stmt/alter.mjs +473 -0
  17. package/lib/db2/stmt/grant.mjs +125 -0
  18. package/lib/db2/stmt/index.mjs +141 -0
  19. package/lib/db2/stmt/misc.mjs +325 -0
  20. package/lib/db2/stmt/routine.mjs +564 -0
  21. package/lib/db2/stmt/storage.mjs +146 -0
  22. package/lib/db2/stmt/table.mjs +540 -0
  23. package/lib/db2/stmt/view.mjs +146 -0
  24. package/lib/diff.mjs +17 -5
  25. package/lib/evidence/cli.mjs +14 -3
  26. package/lib/evidence/record.mjs +1 -1
  27. package/lib/evidence/store.mjs +44 -31
  28. package/lib/exec-reading.mjs +51 -0
  29. package/lib/execution.mjs +3 -2
  30. package/lib/explain.mjs +2 -0
  31. package/lib/exploitability.mjs +11 -2
  32. package/lib/hlasm/asm/data.mjs +13 -1
  33. package/lib/hlasm/asm/sections.mjs +3 -1
  34. package/lib/hlasm/instr.mjs +25 -0
  35. package/lib/hlasm/macro/authorization.mjs +24 -4
  36. package/lib/hlasm/macro/datasets.mjs +30 -17
  37. package/lib/hlasm/macro/io.mjs +68 -45
  38. package/lib/hlasm/macro/le.mjs +2 -2
  39. package/lib/hlasm/macro/operator.mjs +32 -21
  40. package/lib/hlasm/macro/program.mjs +126 -84
  41. package/lib/hlasm/macro/recovery.mjs +10 -5
  42. package/lib/hlasm/macro/storage.mjs +64 -14
  43. package/lib/hlasm/macro/structured.mjs +1 -1
  44. package/lib/hlasm/model.mjs +35 -10
  45. package/lib/hlasm/mvs38.mjs +47 -0
  46. package/lib/hlasm/operands.mjs +10 -0
  47. package/lib/hlasm/optable.mjs +61 -0
  48. package/lib/hlasm/read.mjs +22 -8
  49. package/lib/hlasm.mjs +44 -7
  50. package/lib/ims/dli.mjs +37 -0
  51. package/lib/ims/macro/dbd.mjs +299 -0
  52. package/lib/ims/macro/psb.mjs +286 -0
  53. package/lib/ims/model.mjs +149 -0
  54. package/lib/ims/operands.mjs +23 -0
  55. package/lib/ims/read.mjs +37 -0
  56. package/lib/ims/rules.mjs +135 -0
  57. package/lib/ironwork.mjs +17 -13
  58. package/lib/kernel/pds-archive.mjs +256 -0
  59. package/lib/kernel/registry.mjs +14 -8
  60. package/lib/kernel/shared-pass.mjs +34 -9
  61. package/lib/kernel/source-tree.mjs +104 -36
  62. package/lib/kernel/version-key.mjs +17 -0
  63. package/lib/layout.mjs +26 -31
  64. package/lib/parser.mjs +136 -17
  65. package/lib/pli/cursor.mjs +15 -0
  66. package/lib/pli/expr.mjs +101 -0
  67. package/lib/pli/include.mjs +82 -0
  68. package/lib/pli/layout.mjs +125 -0
  69. package/lib/pli/lex.mjs +198 -0
  70. package/lib/pli/program.mjs +280 -0
  71. package/lib/pli/rules/based.mjs +95 -0
  72. package/lib/pli/rules/conditions.mjs +68 -0
  73. package/lib/pli/rules/entry.mjs +130 -0
  74. package/lib/pli/rules/index.mjs +24 -0
  75. package/lib/pli/rules/preprocessor.mjs +55 -0
  76. package/lib/pli/statements.mjs +130 -0
  77. package/lib/pli/stmt/alloc.mjs +45 -0
  78. package/lib/pli/stmt/assignment.mjs +56 -0
  79. package/lib/pli/stmt/call.mjs +104 -0
  80. package/lib/pli/stmt/conditions.mjs +94 -0
  81. package/lib/pli/stmt/control.mjs +219 -0
  82. package/lib/pli/stmt/declare.mjs +149 -0
  83. package/lib/pli/stmt/exec.mjs +55 -0
  84. package/lib/pli/stmt/io.mjs +239 -0
  85. package/lib/pli/stmt/misc.mjs +4 -0
  86. package/lib/pli/stmt/preprocessor.mjs +242 -0
  87. package/lib/pli/stmt/procedure.mjs +258 -0
  88. package/lib/pli/stmt/stream.mjs +283 -0
  89. package/lib/pli/storage.mjs +129 -0
  90. package/lib/precompile-check.mjs +124 -0
  91. package/lib/precompile-cics.mjs +7 -3
  92. package/lib/reach.mjs +11 -2
  93. package/lib/revision.json +1 -1
  94. package/lib/sarif.mjs +41 -3
  95. package/lib/scan.mjs +7 -1
  96. package/lib/sets/abend.mjs +16 -6
  97. package/lib/sets/cics.mjs +15 -35
  98. package/lib/sets/compile.mjs +41 -15
  99. package/lib/sets/crypto.mjs +5 -3
  100. package/lib/sets/ddl.mjs +36 -0
  101. package/lib/sets/flow.mjs +18 -1
  102. package/lib/sets/hidden.mjs +5 -3
  103. package/lib/sets/hlasm.mjs +72 -12
  104. package/lib/sets/ims.mjs +139 -0
  105. package/lib/sets/log.mjs +6 -6
  106. package/lib/sets/opaque.mjs +27 -7
  107. package/lib/sets/pli.mjs +40 -0
  108. package/lib/sets/recon.mjs +5 -3
  109. package/lib/sets/secrets.mjs +5 -3
  110. package/lib/sets/semantics.mjs +3 -0
  111. package/lib/sets/web.mjs +36 -22
  112. package/lib/site.mjs +10 -0
  113. package/lib/sources.mjs +80 -20
  114. package/lib/statement-cursor.mjs +67 -0
  115. package/lib/verify.mjs +3 -2
  116. package/lib/version.mjs +6 -0
  117. package/package.json +3 -2
  118. package/rules/compliance-cobit2019.json +432 -1
  119. package/rules/compliance-dora.json +414 -1
  120. package/rules/compliance-ffiec.json +414 -1
  121. package/rules/compliance-nist80053.json +466 -1
  122. package/rules/hlasm-optables.json +8024 -0
  123. package/schema/cobolwork-baseline.schema.json +36 -0
  124. package/schema/cobolwork-build-provenance.schema.json +187 -0
  125. package/schema/cobolwork-build.schema.json +382 -0
  126. package/schema/cobolwork-capabilities.schema.json +239 -0
  127. package/schema/cobolwork-diff.schema.json +217 -0
  128. package/schema/cobolwork-evidence.schema.json +161 -0
  129. package/schema/cobolwork-execution.schema.json +53 -0
  130. package/schema/cobolwork-explain.schema.json +360 -0
  131. package/schema/cobolwork-finding.schema.json +465 -0
  132. package/schema/cobolwork-flow.schema.json +465 -0
  133. package/schema/cobolwork-gate.schema.json +211 -0
  134. package/schema/cobolwork-inventory.schema.json +206 -0
  135. package/schema/cobolwork-parse.schema.json +105 -0
  136. package/schema/cobolwork-reach.schema.json +74 -0
  137. package/schema/cobolwork-report.schema.json +559 -0
  138. package/schema/cobolwork-witness.schema.json +107 -0
  139. package/schema/cobolwork.baseline.schema.json +101 -0
  140. package/schema/cobolwork.site.schema.json +116 -0
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/Portll/cobolwork/schema/cobolwork-baseline.schema.json",
4
+ "title": "cobolwork baseline output",
5
+ "description": "The line cobolwork baseline writes after it updates the baseline file. A later minor release may add keys; a reader ignores keys it does not know.",
6
+ "type": "object",
7
+ "required": [
8
+ "tool",
9
+ "schemaVersion",
10
+ "path",
11
+ "added",
12
+ "entries"
13
+ ],
14
+ "properties": {
15
+ "tool": {
16
+ "const": "cobolwork-baseline"
17
+ },
18
+ "schemaVersion": {
19
+ "const": 1
20
+ },
21
+ "path": {
22
+ "type": "string",
23
+ "description": "The baseline file written."
24
+ },
25
+ "added": {
26
+ "type": "integer",
27
+ "minimum": 0,
28
+ "description": "Entries this run added."
29
+ },
30
+ "entries": {
31
+ "type": "integer",
32
+ "minimum": 0,
33
+ "description": "Entries the file now holds."
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,187 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/Portll/cobolwork/schema/cobolwork-build-provenance.schema.json",
4
+ "title": "cobolwork build provenance",
5
+ "description": "What a build verdict was given: the revisions, policy, sources, waivers and compiler. docs/spec/build-gate.md. A later minor release may add keys; a reader ignores keys it does not know.",
6
+ "type": "object",
7
+ "required": [
8
+ "tool",
9
+ "schemaVersion",
10
+ "toolVersion",
11
+ "flowModel",
12
+ "revisions",
13
+ "policy",
14
+ "sources",
15
+ "waivers",
16
+ "compiler",
17
+ "verdict",
18
+ "relaxed"
19
+ ],
20
+ "properties": {
21
+ "tool": {
22
+ "const": "cobolwork-build-provenance"
23
+ },
24
+ "schemaVersion": {
25
+ "const": 1
26
+ },
27
+ "toolVersion": {
28
+ "type": "string"
29
+ },
30
+ "flowModel": {
31
+ "type": "string"
32
+ },
33
+ "builtAt": {
34
+ "type": "string",
35
+ "description": "From SOURCE_DATE_EPOCH, when set."
36
+ },
37
+ "revisions": {
38
+ "type": "object",
39
+ "properties": {
40
+ "base": {
41
+ "type": [
42
+ "string",
43
+ "null"
44
+ ]
45
+ },
46
+ "head": {
47
+ "type": "string"
48
+ }
49
+ }
50
+ },
51
+ "policy": {
52
+ "type": "object",
53
+ "properties": {
54
+ "canonical": {
55
+ "type": "string"
56
+ },
57
+ "sha256": {
58
+ "type": "string"
59
+ },
60
+ "setBy": {
61
+ "type": "object",
62
+ "additionalProperties": {
63
+ "type": "string"
64
+ }
65
+ }
66
+ }
67
+ },
68
+ "sources": {
69
+ "type": "array",
70
+ "items": {
71
+ "type": "object",
72
+ "required": [
73
+ "path",
74
+ "sha256"
75
+ ],
76
+ "properties": {
77
+ "path": {
78
+ "type": "string"
79
+ },
80
+ "sha256": {
81
+ "type": "string",
82
+ "pattern": "^[0-9a-f]{64}$"
83
+ }
84
+ }
85
+ }
86
+ },
87
+ "copylibs": {
88
+ "type": "array"
89
+ },
90
+ "waivers": {
91
+ "type": "array",
92
+ "items": {
93
+ "type": "object",
94
+ "properties": {
95
+ "fingerprint": {
96
+ "type": "string"
97
+ },
98
+ "rule": {
99
+ "type": "string"
100
+ },
101
+ "who": {
102
+ "type": "string"
103
+ },
104
+ "reason": {
105
+ "type": "string"
106
+ },
107
+ "expires": {
108
+ "type": "string"
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "compiler": {
114
+ "type": [
115
+ "object",
116
+ "null"
117
+ ]
118
+ },
119
+ "verdict": {
120
+ "enum": [
121
+ "pass",
122
+ "fail",
123
+ "undecided"
124
+ ]
125
+ },
126
+ "relaxed": {
127
+ "type": "array",
128
+ "items": {
129
+ "type": "string"
130
+ }
131
+ },
132
+ "toolRevision": {
133
+ "type": [
134
+ "object",
135
+ "null"
136
+ ],
137
+ "description": "A commit and whether its tree held changes, with where it was read.",
138
+ "properties": {
139
+ "commit": {
140
+ "type": [
141
+ "string",
142
+ "null"
143
+ ]
144
+ },
145
+ "dirty": {
146
+ "type": [
147
+ "boolean",
148
+ "null"
149
+ ]
150
+ },
151
+ "tag": {
152
+ "type": "string"
153
+ },
154
+ "from": {
155
+ "type": "string"
156
+ }
157
+ }
158
+ },
159
+ "revision": {
160
+ "type": [
161
+ "object",
162
+ "null"
163
+ ],
164
+ "description": "A commit and whether its tree held changes, with where it was read.",
165
+ "properties": {
166
+ "commit": {
167
+ "type": [
168
+ "string",
169
+ "null"
170
+ ]
171
+ },
172
+ "dirty": {
173
+ "type": [
174
+ "boolean",
175
+ "null"
176
+ ]
177
+ },
178
+ "tag": {
179
+ "type": "string"
180
+ },
181
+ "from": {
182
+ "type": "string"
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
@@ -0,0 +1,382 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/Portll/cobolwork/schema/cobolwork-build.schema.json",
4
+ "title": "cobolwork build verdict",
5
+ "description": "The verdict cobolwork build gives a tree or a change, and why. docs/spec/build-gate.md. A later minor release may add keys; a reader ignores keys it does not know.",
6
+ "type": "object",
7
+ "required": [
8
+ "tool",
9
+ "schemaVersion",
10
+ "verdict",
11
+ "relaxed",
12
+ "mode",
13
+ "checks",
14
+ "blocking",
15
+ "findings",
16
+ "waived",
17
+ "policy",
18
+ "reasons",
19
+ "summary"
20
+ ],
21
+ "properties": {
22
+ "tool": {
23
+ "const": "cobolwork-build"
24
+ },
25
+ "schemaVersion": {
26
+ "const": 1
27
+ },
28
+ "verdict": {
29
+ "enum": [
30
+ "pass",
31
+ "fail",
32
+ "undecided"
33
+ ]
34
+ },
35
+ "relaxed": {
36
+ "type": "array",
37
+ "items": {
38
+ "type": "string"
39
+ },
40
+ "description": "Checks the policy turned to warnings."
41
+ },
42
+ "mode": {
43
+ "enum": [
44
+ "absolute",
45
+ "ratchet"
46
+ ]
47
+ },
48
+ "checks": {
49
+ "type": "object",
50
+ "description": "Each check and its result: true passed, false failed, null undecided.",
51
+ "additionalProperties": {
52
+ "type": [
53
+ "boolean",
54
+ "null"
55
+ ]
56
+ }
57
+ },
58
+ "blocking": {
59
+ "type": "array",
60
+ "items": {
61
+ "$ref": "#/$defs/finding"
62
+ }
63
+ },
64
+ "findings": {
65
+ "type": "array",
66
+ "items": {
67
+ "$ref": "#/$defs/finding"
68
+ }
69
+ },
70
+ "waived": {
71
+ "type": "array",
72
+ "items": {
73
+ "type": "object",
74
+ "properties": {
75
+ "fingerprint": {
76
+ "type": "string"
77
+ },
78
+ "rule": {
79
+ "type": "string"
80
+ },
81
+ "tier": {
82
+ "type": "string"
83
+ },
84
+ "who": {
85
+ "type": "string"
86
+ },
87
+ "reason": {
88
+ "type": "string"
89
+ },
90
+ "expires": {
91
+ "type": "string"
92
+ }
93
+ }
94
+ }
95
+ },
96
+ "expired": {
97
+ "type": "array",
98
+ "items": {
99
+ "type": "object",
100
+ "properties": {
101
+ "fingerprint": {
102
+ "type": "string"
103
+ },
104
+ "rule": {
105
+ "type": "string"
106
+ },
107
+ "who": {
108
+ "type": "string"
109
+ },
110
+ "expired": {
111
+ "type": "string"
112
+ }
113
+ }
114
+ }
115
+ },
116
+ "overlong": {
117
+ "type": "array",
118
+ "items": {
119
+ "type": "object",
120
+ "properties": {
121
+ "fingerprint": {
122
+ "type": "string"
123
+ },
124
+ "rule": {
125
+ "type": "string"
126
+ },
127
+ "who": {
128
+ "type": "string"
129
+ },
130
+ "at": {
131
+ "type": "string"
132
+ },
133
+ "expires": {
134
+ "type": "string"
135
+ }
136
+ }
137
+ }
138
+ },
139
+ "optionsAdded": {
140
+ "type": "array"
141
+ },
142
+ "optionsChanged": {
143
+ "type": "array"
144
+ },
145
+ "equivalence": {
146
+ "type": "object",
147
+ "description": "The equivalence statement and each program's result."
148
+ },
149
+ "configurationChanged": {
150
+ "type": "array",
151
+ "items": {
152
+ "type": "string"
153
+ }
154
+ },
155
+ "policy": {
156
+ "type": "object",
157
+ "description": "The policy applied, its hash, which file set each key, and keys it ignored.",
158
+ "properties": {
159
+ "sha256": {
160
+ "type": "string"
161
+ },
162
+ "setBy": {
163
+ "type": "object",
164
+ "additionalProperties": {
165
+ "type": "string"
166
+ }
167
+ },
168
+ "ignored": {
169
+ "type": "array"
170
+ },
171
+ "applied": {
172
+ "type": "object",
173
+ "description": "As schema/cobolwork.policy.schema.json describes it."
174
+ }
175
+ }
176
+ },
177
+ "precompiled": {
178
+ "type": "object",
179
+ "description": "build --precompile: the argument vector the compiler checked each translation with, each program holding EXEC SQL or CICS with whether the compiler accepted its translation and its first errors, and the programs left untranslated with why.",
180
+ "required": ["argv", "programs", "skipped"],
181
+ "properties": {
182
+ "argv": { "type": "array", "items": { "type": "string" } },
183
+ "programs": { "type": "array", "items": { "type": "object", "required": ["path", "ok"], "properties": { "path": { "type": "string" }, "ok": { "type": "boolean" }, "errors": { "type": "array", "items": { "type": "string" } } } } },
184
+ "skipped": { "type": "array", "items": { "type": "object", "required": ["path", "why"], "properties": { "path": { "type": "string" }, "why": { "type": "string" } } } }
185
+ }
186
+ },
187
+ "compiled": {
188
+ "type": [
189
+ "object",
190
+ "null"
191
+ ],
192
+ "description": "The compiler run: its path, arguments and status, or ironwork's results."
193
+ },
194
+ "reasons": {
195
+ "type": "array",
196
+ "items": {
197
+ "type": "string"
198
+ }
199
+ },
200
+ "reasonsNotShown": {
201
+ "type": "integer",
202
+ "minimum": 0
203
+ },
204
+ "repositoryText": {
205
+ "type": "array",
206
+ "items": {
207
+ "type": "string"
208
+ },
209
+ "description": "The fields that quote text from the repository."
210
+ },
211
+ "summary": {
212
+ "type": "object",
213
+ "required": [
214
+ "flowModel",
215
+ "toolVersion",
216
+ "findings",
217
+ "blocking",
218
+ "waived",
219
+ "byTier",
220
+ "coverageIncomplete"
221
+ ],
222
+ "properties": {
223
+ "flowModel": {
224
+ "type": "string"
225
+ },
226
+ "toolVersion": {
227
+ "type": "string"
228
+ },
229
+ "findings": {
230
+ "type": "integer",
231
+ "minimum": 0
232
+ },
233
+ "blocking": {
234
+ "type": "integer",
235
+ "minimum": 0
236
+ },
237
+ "waived": {
238
+ "type": "integer",
239
+ "minimum": 0
240
+ },
241
+ "byTier": {
242
+ "type": "object",
243
+ "additionalProperties": {
244
+ "type": "integer",
245
+ "minimum": 0
246
+ }
247
+ },
248
+ "coverageIncomplete": {
249
+ "type": "boolean"
250
+ },
251
+ "baselineProblems": {
252
+ "type": "array",
253
+ "items": {
254
+ "type": "string"
255
+ }
256
+ },
257
+ "base": {
258
+ "type": "string"
259
+ },
260
+ "head": {
261
+ "type": "string"
262
+ },
263
+ "toolRevision": {
264
+ "type": [
265
+ "object",
266
+ "null"
267
+ ],
268
+ "description": "A commit and whether its tree held changes, with where it was read.",
269
+ "properties": {
270
+ "commit": {
271
+ "type": [
272
+ "string",
273
+ "null"
274
+ ]
275
+ },
276
+ "dirty": {
277
+ "type": [
278
+ "boolean",
279
+ "null"
280
+ ]
281
+ },
282
+ "tag": {
283
+ "type": "string"
284
+ },
285
+ "from": {
286
+ "type": "string"
287
+ }
288
+ }
289
+ },
290
+ "revision": {
291
+ "type": [
292
+ "object",
293
+ "null"
294
+ ],
295
+ "description": "A commit and whether its tree held changes, with where it was read.",
296
+ "properties": {
297
+ "commit": {
298
+ "type": [
299
+ "string",
300
+ "null"
301
+ ]
302
+ },
303
+ "dirty": {
304
+ "type": [
305
+ "boolean",
306
+ "null"
307
+ ]
308
+ },
309
+ "tag": {
310
+ "type": "string"
311
+ },
312
+ "from": {
313
+ "type": "string"
314
+ }
315
+ }
316
+ }
317
+ }
318
+ }
319
+ },
320
+ "$defs": {
321
+ "finding": {
322
+ "type": "object",
323
+ "required": [
324
+ "fingerprint",
325
+ "rule",
326
+ "tier",
327
+ "sev",
328
+ "classes",
329
+ "path",
330
+ "line",
331
+ "blocking"
332
+ ],
333
+ "properties": {
334
+ "fingerprint": {
335
+ "type": "string",
336
+ "pattern": "^[0-9a-f]{32}$"
337
+ },
338
+ "rule": {
339
+ "type": "string"
340
+ },
341
+ "tier": {
342
+ "enum": [
343
+ "info",
344
+ "low",
345
+ "med",
346
+ "high",
347
+ "crit",
348
+ "known-exploitable"
349
+ ]
350
+ },
351
+ "sev": {
352
+ "type": "string"
353
+ },
354
+ "classes": {
355
+ "type": "array",
356
+ "items": {
357
+ "type": "string"
358
+ }
359
+ },
360
+ "path": {
361
+ "type": "string"
362
+ },
363
+ "line": {
364
+ "type": "integer",
365
+ "minimum": 0
366
+ },
367
+ "exploitability": {
368
+ "type": "string"
369
+ },
370
+ "introduced": {
371
+ "type": "boolean"
372
+ },
373
+ "blocking": {
374
+ "type": "boolean"
375
+ },
376
+ "because": {
377
+ "type": "string"
378
+ }
379
+ }
380
+ }
381
+ }
382
+ }