@formigio/fazemos-cli 0.10.11 → 0.10.13

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.
@@ -0,0 +1,314 @@
1
+ /**
2
+ * Permissive structural schema for Architecture Design Manifests
3
+ * (e.g., specs/tech/<area>/<feature>-manifest.yaml).
4
+ *
5
+ * Philosophy: require manifest_version + a feature block with id/title.
6
+ * Type top-level sections when present; do NOT reject unknown keys.
7
+ * Real defect-detection lives in checks.ts (audit math, AC traceability,
8
+ * duplicate IDs). The schema's job is to catch shape errors and missing
9
+ * load-bearing identifiers, not to prescribe every legitimate variation.
10
+ *
11
+ * Bumped together with the CLI version. Manifest authors pin
12
+ * manifest_version per-file; the CLI tolerates any version it knows about.
13
+ */
14
+ export declare const KNOWN_MANIFEST_VERSIONS: readonly ["0.1"];
15
+ export declare const manifestSchema: {
16
+ readonly $schema: "http://json-schema.org/draft-07/schema#";
17
+ readonly $id: "https://fazemos/schemas/manifest.json";
18
+ readonly type: "object";
19
+ readonly required: readonly ["feature"];
20
+ readonly additionalProperties: true;
21
+ readonly properties: {
22
+ readonly manifest_version: {
23
+ readonly type: "string";
24
+ };
25
+ readonly feature: {
26
+ readonly type: "object";
27
+ readonly required: readonly ["id", "title"];
28
+ readonly additionalProperties: true;
29
+ readonly properties: {
30
+ readonly id: {
31
+ readonly type: "string";
32
+ readonly minLength: 1;
33
+ };
34
+ readonly title: {
35
+ readonly type: "string";
36
+ readonly minLength: 1;
37
+ };
38
+ readonly priority: {
39
+ readonly type: "string";
40
+ };
41
+ readonly area: {
42
+ readonly type: "string";
43
+ };
44
+ readonly status: {
45
+ readonly type: "string";
46
+ };
47
+ readonly effort: {
48
+ readonly type: "string";
49
+ };
50
+ readonly estimated_hours: {
51
+ readonly type: "string";
52
+ };
53
+ readonly depends_on: {
54
+ readonly type: "array";
55
+ readonly items: {
56
+ readonly type: "string";
57
+ };
58
+ };
59
+ readonly related: {
60
+ readonly type: "array";
61
+ readonly items: {
62
+ readonly type: "string";
63
+ };
64
+ };
65
+ readonly repos_affected: {
66
+ readonly type: "array";
67
+ readonly items: {
68
+ readonly type: "string";
69
+ };
70
+ };
71
+ };
72
+ };
73
+ readonly phase_1_gate: {
74
+ readonly type: "object";
75
+ readonly additionalProperties: true;
76
+ readonly properties: {
77
+ readonly questions: {
78
+ readonly type: "array";
79
+ readonly items: {
80
+ readonly type: "object";
81
+ readonly required: readonly ["id"];
82
+ readonly additionalProperties: true;
83
+ readonly properties: {
84
+ readonly id: {
85
+ readonly type: "string";
86
+ };
87
+ readonly title: {
88
+ readonly type: "string";
89
+ };
90
+ };
91
+ };
92
+ };
93
+ };
94
+ };
95
+ readonly schema: {
96
+ readonly type: "object";
97
+ readonly additionalProperties: true;
98
+ };
99
+ readonly api: {
100
+ readonly type: "object";
101
+ readonly additionalProperties: true;
102
+ };
103
+ readonly permissions: {
104
+ readonly type: "object";
105
+ readonly additionalProperties: true;
106
+ };
107
+ readonly frontend: {
108
+ readonly type: "object";
109
+ readonly additionalProperties: true;
110
+ };
111
+ readonly agent_runner: {
112
+ readonly type: "object";
113
+ readonly additionalProperties: true;
114
+ };
115
+ readonly cli: {
116
+ readonly type: "object";
117
+ readonly additionalProperties: true;
118
+ };
119
+ readonly states: {
120
+ readonly type: "object";
121
+ readonly additionalProperties: true;
122
+ };
123
+ readonly rules: {
124
+ readonly anyOf: readonly [{
125
+ readonly type: "object";
126
+ readonly additionalProperties: {
127
+ readonly type: "object";
128
+ readonly additionalProperties: true;
129
+ };
130
+ }, {
131
+ readonly type: "array";
132
+ readonly items: {
133
+ readonly type: "object";
134
+ readonly additionalProperties: true;
135
+ readonly properties: {
136
+ readonly id: {
137
+ readonly type: "string";
138
+ };
139
+ };
140
+ };
141
+ }];
142
+ };
143
+ readonly entry_points: {
144
+ readonly anyOf: readonly [{
145
+ readonly type: "object";
146
+ readonly additionalProperties: true;
147
+ readonly properties: {
148
+ readonly added: {
149
+ readonly type: "array";
150
+ };
151
+ readonly modified: {
152
+ readonly type: "array";
153
+ };
154
+ readonly replaced: {
155
+ readonly type: "array";
156
+ };
157
+ readonly unchanged: {
158
+ readonly type: "array";
159
+ };
160
+ readonly audit_summary: {
161
+ readonly type: "object";
162
+ readonly additionalProperties: true;
163
+ readonly properties: {
164
+ readonly added: {
165
+ readonly type: "integer";
166
+ readonly minimum: 0;
167
+ };
168
+ readonly modified: {
169
+ readonly type: "integer";
170
+ readonly minimum: 0;
171
+ };
172
+ readonly replaced: {
173
+ readonly type: "integer";
174
+ readonly minimum: 0;
175
+ };
176
+ readonly unchanged: {
177
+ readonly type: "integer";
178
+ readonly minimum: 0;
179
+ };
180
+ readonly total_in_this_manifest: {
181
+ readonly type: "integer";
182
+ readonly minimum: 0;
183
+ };
184
+ };
185
+ };
186
+ };
187
+ }, {
188
+ readonly type: "array";
189
+ readonly items: {
190
+ readonly type: "object";
191
+ readonly additionalProperties: true;
192
+ };
193
+ }];
194
+ };
195
+ readonly edge_cases: {
196
+ readonly type: "array";
197
+ readonly items: {
198
+ readonly type: "object";
199
+ readonly required: readonly ["id"];
200
+ readonly additionalProperties: true;
201
+ readonly properties: {
202
+ readonly id: {
203
+ readonly type: "string";
204
+ };
205
+ };
206
+ };
207
+ };
208
+ readonly risks: {
209
+ readonly type: "array";
210
+ readonly items: {
211
+ readonly type: "object";
212
+ readonly additionalProperties: true;
213
+ readonly properties: {
214
+ readonly id: {
215
+ readonly type: "string";
216
+ };
217
+ };
218
+ };
219
+ };
220
+ readonly excluded: {
221
+ readonly type: readonly ["array", "object"];
222
+ };
223
+ readonly implementation: {
224
+ readonly type: "object";
225
+ readonly additionalProperties: true;
226
+ readonly properties: {
227
+ readonly sequencing: {
228
+ readonly type: "object";
229
+ readonly additionalProperties: true;
230
+ };
231
+ readonly phase_1_gate: {
232
+ readonly type: "object";
233
+ readonly additionalProperties: true;
234
+ };
235
+ readonly api: {
236
+ readonly $ref: "#/$defs/taskBucket";
237
+ };
238
+ readonly agent: {
239
+ readonly $ref: "#/$defs/taskBucket";
240
+ };
241
+ readonly frontend: {
242
+ readonly $ref: "#/$defs/taskBucket";
243
+ };
244
+ readonly cli: {
245
+ readonly $ref: "#/$defs/taskBucket";
246
+ };
247
+ readonly docs: {
248
+ readonly $ref: "#/$defs/taskBucket";
249
+ };
250
+ };
251
+ };
252
+ readonly traceability: {
253
+ readonly type: "object";
254
+ readonly additionalProperties: {
255
+ readonly anyOf: readonly [{
256
+ readonly type: "string";
257
+ }, {
258
+ readonly type: "object";
259
+ readonly additionalProperties: true;
260
+ }, {
261
+ readonly type: "array";
262
+ readonly items: {
263
+ readonly type: "object";
264
+ readonly additionalProperties: true;
265
+ };
266
+ }];
267
+ };
268
+ };
269
+ readonly nexo: {
270
+ readonly type: "object";
271
+ readonly additionalProperties: true;
272
+ };
273
+ };
274
+ readonly $defs: {
275
+ readonly taskBucket: {
276
+ readonly type: "object";
277
+ readonly additionalProperties: true;
278
+ readonly properties: {
279
+ readonly repo: {
280
+ readonly type: "string";
281
+ };
282
+ readonly tasks: {
283
+ readonly type: "array";
284
+ readonly items: {
285
+ readonly type: "object";
286
+ readonly required: readonly ["id"];
287
+ readonly additionalProperties: true;
288
+ readonly properties: {
289
+ readonly id: {
290
+ readonly type: "string";
291
+ readonly minLength: 1;
292
+ };
293
+ readonly title: {
294
+ readonly type: "string";
295
+ };
296
+ readonly file: {
297
+ readonly type: "string";
298
+ };
299
+ readonly effort: {
300
+ readonly type: "string";
301
+ };
302
+ readonly depends_on: {
303
+ readonly type: "array";
304
+ readonly items: {
305
+ readonly type: "string";
306
+ };
307
+ };
308
+ };
309
+ };
310
+ };
311
+ };
312
+ };
313
+ };
314
+ };
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Permissive structural schema for Architecture Design Manifests
3
+ * (e.g., specs/tech/<area>/<feature>-manifest.yaml).
4
+ *
5
+ * Philosophy: require manifest_version + a feature block with id/title.
6
+ * Type top-level sections when present; do NOT reject unknown keys.
7
+ * Real defect-detection lives in checks.ts (audit math, AC traceability,
8
+ * duplicate IDs). The schema's job is to catch shape errors and missing
9
+ * load-bearing identifiers, not to prescribe every legitimate variation.
10
+ *
11
+ * Bumped together with the CLI version. Manifest authors pin
12
+ * manifest_version per-file; the CLI tolerates any version it knows about.
13
+ */
14
+ export const KNOWN_MANIFEST_VERSIONS = ['0.1'];
15
+ export const manifestSchema = {
16
+ $schema: 'http://json-schema.org/draft-07/schema#',
17
+ $id: 'https://fazemos/schemas/manifest.json',
18
+ type: 'object',
19
+ // manifest_version is enforced as a separate rule (see checks.ts) so older
20
+ // manifests still validate the rest of their structure rather than failing
21
+ // up-front. Missing version surfaces as a warning, not a hard error.
22
+ required: ['feature'],
23
+ additionalProperties: true,
24
+ properties: {
25
+ manifest_version: { type: 'string' },
26
+ feature: {
27
+ type: 'object',
28
+ required: ['id', 'title'],
29
+ additionalProperties: true,
30
+ properties: {
31
+ id: { type: 'string', minLength: 1 },
32
+ title: { type: 'string', minLength: 1 },
33
+ priority: { type: 'string' },
34
+ area: { type: 'string' },
35
+ status: { type: 'string' },
36
+ effort: { type: 'string' },
37
+ estimated_hours: { type: 'string' },
38
+ depends_on: { type: 'array', items: { type: 'string' } },
39
+ related: { type: 'array', items: { type: 'string' } },
40
+ repos_affected: { type: 'array', items: { type: 'string' } },
41
+ },
42
+ },
43
+ phase_1_gate: {
44
+ type: 'object',
45
+ additionalProperties: true,
46
+ properties: {
47
+ questions: {
48
+ type: 'array',
49
+ items: {
50
+ type: 'object',
51
+ required: ['id'],
52
+ additionalProperties: true,
53
+ properties: {
54
+ id: { type: 'string' },
55
+ title: { type: 'string' },
56
+ },
57
+ },
58
+ },
59
+ },
60
+ },
61
+ schema: { type: 'object', additionalProperties: true },
62
+ api: { type: 'object', additionalProperties: true },
63
+ permissions: { type: 'object', additionalProperties: true },
64
+ frontend: { type: 'object', additionalProperties: true },
65
+ agent_runner: { type: 'object', additionalProperties: true },
66
+ cli: { type: 'object', additionalProperties: true },
67
+ states: { type: 'object', additionalProperties: true },
68
+ // `rules` appears as either a map (rule_id: { ... }) or a list of
69
+ // {id, name, description, ...} entries depending on author convention.
70
+ // Permissive: accept both. Duplicate-id check still enforces uniqueness
71
+ // when shape is array-of-objects.
72
+ rules: {
73
+ anyOf: [
74
+ {
75
+ type: 'object',
76
+ additionalProperties: {
77
+ type: 'object',
78
+ additionalProperties: true,
79
+ },
80
+ },
81
+ {
82
+ type: 'array',
83
+ items: {
84
+ type: 'object',
85
+ additionalProperties: true,
86
+ properties: { id: { type: 'string' } },
87
+ },
88
+ },
89
+ ],
90
+ },
91
+ // entry_points has two legitimate shapes in the wild:
92
+ // (a) Map: { added: [...], modified: [...], replaced: [...], unchanged: [...], audit_summary: {...} }
93
+ // (b) Flat list: [ { name|location, disposition, file, ... }, ... ]
94
+ // Both are accepted. The audit_summary numeric checks only fire on shape (a).
95
+ entry_points: {
96
+ anyOf: [
97
+ {
98
+ type: 'object',
99
+ additionalProperties: true,
100
+ properties: {
101
+ added: { type: 'array' },
102
+ modified: { type: 'array' },
103
+ replaced: { type: 'array' },
104
+ unchanged: { type: 'array' },
105
+ audit_summary: {
106
+ type: 'object',
107
+ additionalProperties: true,
108
+ properties: {
109
+ added: { type: 'integer', minimum: 0 },
110
+ modified: { type: 'integer', minimum: 0 },
111
+ replaced: { type: 'integer', minimum: 0 },
112
+ unchanged: { type: 'integer', minimum: 0 },
113
+ total_in_this_manifest: { type: 'integer', minimum: 0 },
114
+ },
115
+ },
116
+ },
117
+ },
118
+ {
119
+ type: 'array',
120
+ items: {
121
+ type: 'object',
122
+ additionalProperties: true,
123
+ },
124
+ },
125
+ ],
126
+ },
127
+ edge_cases: {
128
+ type: 'array',
129
+ items: {
130
+ type: 'object',
131
+ required: ['id'],
132
+ additionalProperties: true,
133
+ properties: { id: { type: 'string' } },
134
+ },
135
+ },
136
+ risks: {
137
+ type: 'array',
138
+ items: {
139
+ type: 'object',
140
+ additionalProperties: true,
141
+ properties: { id: { type: 'string' } },
142
+ },
143
+ },
144
+ excluded: { type: ['array', 'object'] },
145
+ implementation: {
146
+ type: 'object',
147
+ additionalProperties: true,
148
+ properties: {
149
+ sequencing: { type: 'object', additionalProperties: true },
150
+ phase_1_gate: { type: 'object', additionalProperties: true },
151
+ api: { $ref: '#/$defs/taskBucket' },
152
+ agent: { $ref: '#/$defs/taskBucket' },
153
+ frontend: { $ref: '#/$defs/taskBucket' },
154
+ cli: { $ref: '#/$defs/taskBucket' },
155
+ docs: { $ref: '#/$defs/taskBucket' },
156
+ },
157
+ },
158
+ // traceability values come in three legitimate shapes:
159
+ // - string (a single source pointer; e.g. requirements_source: "...")
160
+ // - object (a single AC block: { manifest, task, test, note })
161
+ // - array of objects (multi-row criterion: [{ req, manifest, task }, ...])
162
+ traceability: {
163
+ type: 'object',
164
+ additionalProperties: {
165
+ anyOf: [
166
+ { type: 'string' },
167
+ {
168
+ type: 'object',
169
+ additionalProperties: true,
170
+ },
171
+ {
172
+ type: 'array',
173
+ items: {
174
+ type: 'object',
175
+ additionalProperties: true,
176
+ },
177
+ },
178
+ ],
179
+ },
180
+ },
181
+ nexo: { type: 'object', additionalProperties: true },
182
+ },
183
+ $defs: {
184
+ taskBucket: {
185
+ type: 'object',
186
+ additionalProperties: true,
187
+ properties: {
188
+ repo: { type: 'string' },
189
+ tasks: {
190
+ type: 'array',
191
+ items: {
192
+ type: 'object',
193
+ required: ['id'],
194
+ additionalProperties: true,
195
+ properties: {
196
+ id: { type: 'string', minLength: 1 },
197
+ title: { type: 'string' },
198
+ file: { type: 'string' },
199
+ effort: { type: 'string' },
200
+ depends_on: { type: 'array', items: { type: 'string' } },
201
+ },
202
+ },
203
+ },
204
+ },
205
+ },
206
+ },
207
+ };
208
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/manifest/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAK,CAAU,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EAAE;KACrD;IAED,KAAK,EAAE;QACL,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,oBAAoB,EAAE,IAAI;YAC1B,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxB,KAAK,EAAE;oBACL,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,QAAQ,EAAE,CAAC,IAAI,CAAC;wBAChB,oBAAoB,EAAE,IAAI;wBAC1B,UAAU,EAAE;4BACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;4BACpC,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BACzB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BACxB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BAC1B,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;yBACzD;qBACF;iBACF;aACF;SACF;KACF;CACO,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Finding, FindingSummary } from './load.js';
2
+ export declare function formatFinding(f: Finding): string;
3
+ export declare function formatSummary(s: FindingSummary): string;
4
+ export declare function printFindings(source: string, findings: Finding[], summary: FindingSummary): void;
5
+ export declare function printJson(source: string, findings: Finding[], summary: FindingSummary): void;
@@ -0,0 +1,41 @@
1
+ import chalk from 'chalk';
2
+ const ICONS = {
3
+ error: chalk.red('✗'),
4
+ warning: chalk.yellow('⚠'),
5
+ info: chalk.dim('ℹ'),
6
+ };
7
+ export function formatFinding(f) {
8
+ const icon = ICONS[f.severity];
9
+ const loc = f.line !== undefined ? chalk.dim(`:${f.line}${f.column !== undefined ? `:${f.column}` : ''}`) : '';
10
+ const rule = chalk.dim(`[${f.rule}]`);
11
+ return ` ${icon} ${rule} ${f.message}${loc}`;
12
+ }
13
+ export function formatSummary(s) {
14
+ const parts = [];
15
+ if (s.errors)
16
+ parts.push(chalk.red(`${s.errors} error${s.errors !== 1 ? 's' : ''}`));
17
+ if (s.warnings)
18
+ parts.push(chalk.yellow(`${s.warnings} warning${s.warnings !== 1 ? 's' : ''}`));
19
+ if (s.infos)
20
+ parts.push(chalk.dim(`${s.infos} info`));
21
+ if (!parts.length)
22
+ return chalk.green('All checks passed');
23
+ return parts.join(', ');
24
+ }
25
+ export function printFindings(source, findings, summary) {
26
+ console.log(`Validating: ${chalk.cyan(source)}\n`);
27
+ if (!findings.length) {
28
+ console.log(chalk.green(' ✓ No issues found'));
29
+ }
30
+ else {
31
+ for (const f of findings) {
32
+ console.log(formatFinding(f));
33
+ }
34
+ }
35
+ console.log(`\n${formatSummary(summary)}`);
36
+ }
37
+ export function printJson(source, findings, summary) {
38
+ const ok = summary.errors === 0;
39
+ console.log(JSON.stringify({ source, ok, summary, findings }, null, 2));
40
+ }
41
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/yaml/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,KAAK,GAAG;IACZ,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;IACrB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;IAC1B,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;CACZ,CAAC;AAEX,MAAM,UAAU,aAAa,CAAC,CAAU;IACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAA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AAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,KAAK,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,MAAc,EAAE,QAAmB,EAAE,OAAuB;IACpF,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,28 @@
1
+ export interface Finding {
2
+ severity: 'error' | 'warning' | 'info';
3
+ rule: string;
4
+ message: string;
5
+ path?: string;
6
+ line?: number;
7
+ column?: number;
8
+ }
9
+ export interface LoadResult {
10
+ ok: boolean;
11
+ value?: unknown;
12
+ source: string;
13
+ findings: Finding[];
14
+ }
15
+ /**
16
+ * Load and parse a YAML file. Returns a LoadResult; non-throwing.
17
+ *
18
+ * On parse failure, populates `findings` with a single error carrying the
19
+ * line/column from js-yaml's mark when available. On read failure (missing
20
+ * file, not a regular file), returns ok: false with a `read.*` rule.
21
+ */
22
+ export declare function loadYaml(filePath: string): LoadResult;
23
+ export interface FindingSummary {
24
+ errors: number;
25
+ warnings: number;
26
+ infos: number;
27
+ }
28
+ export declare function summarize(findings: Finding[]): FindingSummary;