@flyingrobots/footprint 0.0.0-stage → 0.6.1

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,98 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://flyingrobots.dev/footprint/schemas/footprint.landing/1.0.0",
4
+ "title": "footprint.landing 1.0.0",
5
+ "description": "How a change lands: what the diff itself says must be looked at before merging, and the steps to take after, read from the repository's own RELEASE.md and AGENTS.md rather than invented. Every figure and every step is computed or quoted; nothing here is estimated or inferred.",
6
+ "type": "object",
7
+ "required": ["event", "t", "seq", "run", "range", "before_merge", "after_merge", "digest", "_schema"],
8
+ "properties": {
9
+ "event": { "const": "result" },
10
+ "t": { "type": "integer", "minimum": 0 },
11
+ "seq": { "type": "integer", "minimum": 1 },
12
+ "run": { "type": "string", "minLength": 1 },
13
+ "range": { "type": "string", "minLength": 1, "description": "The git range compared, as given to git diff" },
14
+ "before_merge": {
15
+ "type": "object",
16
+ "description": "Observations about the changed files themselves. Never a verdict and never a gate.",
17
+ "required": ["items", "guards", "unguarded", "unguarded_because"],
18
+ "properties": {
19
+ "items": {
20
+ "type": "array",
21
+ "description": "One entry per before-merge rule that matched the changed-file list, in rule order",
22
+ "items": {
23
+ "type": "object",
24
+ "required": ["kind", "paths", "says"],
25
+ "properties": {
26
+ "kind": {
27
+ "enum": ["migration", "generated", "regenerate"],
28
+ "description": "migration: a changed file matches a migration path pattern. generated: a changed file classifies as generated. regenerate: a dependency manifest changed with no lockfile beside it in the same change."
29
+ },
30
+ "paths": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "description": "The changed files that matched, in diff order" },
31
+ "says": { "type": "string", "minLength": 1, "description": "What matched and what it means for the merge, naming the paths" }
32
+ }
33
+ }
34
+ },
35
+ "guards": {
36
+ "type": "array",
37
+ "description": "The changed files that match the guard rule, in diff order; one entry per file, with the first matching kind",
38
+ "items": {
39
+ "type": "object",
40
+ "required": ["path", "kind"],
41
+ "properties": {
42
+ "path": { "type": "string", "minLength": 1 },
43
+ "kind": { "enum": ["migration", "flag", "version"] }
44
+ }
45
+ }
46
+ },
47
+ "unguarded": {
48
+ "type": "boolean",
49
+ "description": "True when at least one changed file classifies as source and no changed file matches the guard rule. The rule is path patterns only, documented in docs/topics/landing/README.md; it is never a judgement about the change."
50
+ },
51
+ "unguarded_because": { "type": "string", "minLength": 1, "description": "Why the change is, or is not, unguarded; always stated, naming the guards found or the rule that found none" }
52
+ }
53
+ },
54
+ "after_merge": {
55
+ "type": "object",
56
+ "description": "Steps read from the repository, never invented.",
57
+ "required": ["read", "steps", "declared", "nothing_to_do", "statement"],
58
+ "properties": {
59
+ "read": {
60
+ "type": "array",
61
+ "description": "Every document footprint looked in, in the order it read them, whether or not it was there",
62
+ "items": {
63
+ "type": "object",
64
+ "required": ["file", "present", "headings"],
65
+ "properties": {
66
+ "file": { "type": "string", "minLength": 1 },
67
+ "present": { "type": "boolean" },
68
+ "headings": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "The headings inside the document's landing sections, including the heading that opened each one" }
69
+ }
70
+ }
71
+ },
72
+ "steps": {
73
+ "type": "array",
74
+ "description": "The steps that apply to this change, in document order, each quoting the document verbatim",
75
+ "items": {
76
+ "type": "object",
77
+ "required": ["step", "file", "heading"],
78
+ "properties": {
79
+ "step": { "type": "string", "minLength": 1, "description": "The list item as the document wrote it" },
80
+ "file": { "type": "string", "minLength": 1, "description": "The document it was read from" },
81
+ "heading": { "type": "string", "minLength": 1, "description": "The nearest heading above it" }
82
+ }
83
+ }
84
+ },
85
+ "declared": { "type": "boolean", "description": "True when any document read declared at least one step. False means the fallback was stated, not that there is nothing to do." },
86
+ "nothing_to_do": { "type": "boolean", "description": "True when the change touches no executable surface, so no declared step applies; `statement` then says so plainly" },
87
+ "statement": { "type": "string", "minLength": 1, "description": "The one plain sentence: the steps and where they came from, the stated fallback, or that there is nothing to do after merge" }
88
+ }
89
+ },
90
+ "digest": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 over the canonical JSON of range, before_merge and after_merge (spec §7.1)" },
91
+ "_schema": {
92
+ "type": "object",
93
+ "required": ["id", "version"],
94
+ "additionalProperties": false,
95
+ "properties": { "id": { "const": "footprint.landing" }, "version": { "const": "1.0.0" } }
96
+ }
97
+ }
98
+ }
@@ -0,0 +1,489 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://flyingrobots.dev/footprint/schemas/footprint.overlap/2.2.0",
4
+ "title": "footprint.overlap 2.2.0",
5
+ "description": "The fourth result of a footprint run: which open pull requests touch a file this change touches, the conflict graph between the open pull requests, and a proposed merge order as waves. Every figure comes from gh pr list --json and gh pr diff --name-only; each shared file of a pair is also compared at the symbol level, from git diff -U0 and graft read outline's jump table at each side's merge base and head (flyingrobots/footprint#33). When gh cannot answer, available is false and the reason is stated rather than the section being omitted.",
6
+ "type": "object",
7
+ "required": [
8
+ "event",
9
+ "t",
10
+ "seq",
11
+ "run",
12
+ "range",
13
+ "overlap",
14
+ "digest",
15
+ "_schema"
16
+ ],
17
+ "properties": {
18
+ "event": {
19
+ "const": "result"
20
+ },
21
+ "t": {
22
+ "type": "integer",
23
+ "minimum": 0
24
+ },
25
+ "seq": {
26
+ "type": "integer",
27
+ "minimum": 1
28
+ },
29
+ "run": {
30
+ "type": "string",
31
+ "minLength": 1
32
+ },
33
+ "range": {
34
+ "type": "string",
35
+ "minLength": 1,
36
+ "description": "The git range whose files were compared against the open pull requests"
37
+ },
38
+ "overlap": {
39
+ "type": "object",
40
+ "required": [
41
+ "available",
42
+ "summary"
43
+ ],
44
+ "oneOf": [
45
+ {
46
+ "properties": {
47
+ "available": {
48
+ "const": true
49
+ }
50
+ },
51
+ "required": [
52
+ "self",
53
+ "openPullRequests",
54
+ "limit",
55
+ "truncated",
56
+ "overlapping",
57
+ "conflicts",
58
+ "waves",
59
+ "undetermined",
60
+ "symbolAnalysis"
61
+ ]
62
+ },
63
+ {
64
+ "properties": {
65
+ "available": {
66
+ "const": false
67
+ }
68
+ },
69
+ "required": [
70
+ "code",
71
+ "reason"
72
+ ]
73
+ }
74
+ ],
75
+ "properties": {
76
+ "available": {
77
+ "type": "boolean",
78
+ "description": "False when gh is absent, unauthenticated, rate-limited or unreadable; the section is stated, never omitted"
79
+ },
80
+ "code": {
81
+ "enum": [
82
+ "gh.not_found",
83
+ "gh.unauthenticated",
84
+ "gh.rate_limited",
85
+ "gh.no_remote",
86
+ "gh.list_failed",
87
+ "gh.list_unreadable"
88
+ ],
89
+ "description": "Why the overlap is unavailable; present only when available is false"
90
+ },
91
+ "reason": {
92
+ "type": "string",
93
+ "minLength": 1,
94
+ "description": "gh's own message, or why gh could not be found"
95
+ },
96
+ "summary": {
97
+ "type": "string",
98
+ "minLength": 1,
99
+ "description": "The plain statement: the counts, or that there is no overlap, or the limitation. Never an empty section."
100
+ },
101
+ "self": {
102
+ "type": [
103
+ "integer",
104
+ "null"
105
+ ],
106
+ "description": "The pull request under review: the open pull request whose head commit is the range's head commit, or, when no head commit matches, the same-repository pull request whose head branch is the range's head branch. Excluded from overlapping and kept in the waves; always present, null when none matches."
107
+ },
108
+ "openPullRequests": {
109
+ "type": "integer",
110
+ "minimum": 0,
111
+ "description": "How many open pull requests gh listed"
112
+ },
113
+ "limit": {
114
+ "type": "integer",
115
+ "minimum": 1,
116
+ "description": "The gh pr list --limit used"
117
+ },
118
+ "truncated": {
119
+ "type": "boolean",
120
+ "description": "True when the list came back at the limit, so there may be more open pull requests than were considered"
121
+ },
122
+ "overlapping": {
123
+ "type": "array",
124
+ "description": "Open pull requests that change a file this change changes, ascending by number",
125
+ "items": {
126
+ "type": "object",
127
+ "required": [
128
+ "number",
129
+ "title",
130
+ "isDraft",
131
+ "sharedFiles",
132
+ "symbolLevel"
133
+ ],
134
+ "properties": {
135
+ "number": {
136
+ "type": "integer",
137
+ "minimum": 1
138
+ },
139
+ "title": {
140
+ "type": "string"
141
+ },
142
+ "isDraft": {
143
+ "type": "boolean",
144
+ "description": "An observation, not a verdict"
145
+ },
146
+ "sharedFiles": {
147
+ "type": "array",
148
+ "minItems": 1,
149
+ "items": {
150
+ "type": "string",
151
+ "minLength": 1
152
+ }
153
+ },
154
+ "symbolLevel": {
155
+ "$ref": "#/$defs/symbolLevel",
156
+ "description": "The shared files at the symbol level; side a is this change, side b this pull request"
157
+ }
158
+ }
159
+ }
160
+ },
161
+ "conflicts": {
162
+ "type": "array",
163
+ "description": "One edge per pair of open pull requests that change the same file, with the files named and each compared at the symbol level",
164
+ "items": {
165
+ "type": "object",
166
+ "required": [
167
+ "a",
168
+ "b",
169
+ "sharedFiles",
170
+ "reason",
171
+ "symbolLevel"
172
+ ],
173
+ "properties": {
174
+ "a": {
175
+ "type": "integer",
176
+ "minimum": 1
177
+ },
178
+ "b": {
179
+ "type": "integer",
180
+ "minimum": 1
181
+ },
182
+ "sharedFiles": {
183
+ "type": "array",
184
+ "minItems": 1,
185
+ "items": {
186
+ "type": "string",
187
+ "minLength": 1
188
+ }
189
+ },
190
+ "reason": {
191
+ "type": "string",
192
+ "minLength": 1,
193
+ "description": "Why the edge exists, in prose"
194
+ },
195
+ "symbolLevel": {
196
+ "$ref": "#/$defs/symbolLevel",
197
+ "description": "The shared files at the symbol level. A symbol-disjoint edge is reported and does not separate waves; it is not a claim that git will merge the two cleanly"
198
+ }
199
+ }
200
+ }
201
+ },
202
+ "waves": {
203
+ "type": "array",
204
+ "description": "The proposed merge order. No two pull requests in a wave share a file unless the edge between them is symbol-disjoint; an undetermined or overlapping edge separates them. Wave N+1 lands after wave N. Greedy first-fit, so a proposal rather than a minimum.",
205
+ "items": {
206
+ "type": "object",
207
+ "required": [
208
+ "wave",
209
+ "pullRequests"
210
+ ],
211
+ "properties": {
212
+ "wave": {
213
+ "type": "integer",
214
+ "minimum": 1
215
+ },
216
+ "pullRequests": {
217
+ "type": "array",
218
+ "minItems": 1,
219
+ "items": {
220
+ "type": "integer",
221
+ "minimum": 1
222
+ }
223
+ }
224
+ }
225
+ }
226
+ },
227
+ "undetermined": {
228
+ "type": "array",
229
+ "description": "Open pull requests whose changed files gh would not report. Kept out of the conflict graph and the waves rather than assumed disjoint.",
230
+ "items": {
231
+ "type": "object",
232
+ "required": [
233
+ "number",
234
+ "title",
235
+ "reason"
236
+ ],
237
+ "properties": {
238
+ "number": {
239
+ "type": "integer",
240
+ "minimum": 1
241
+ },
242
+ "title": {
243
+ "type": "string"
244
+ },
245
+ "reason": {
246
+ "type": "string",
247
+ "minLength": 1
248
+ }
249
+ }
250
+ }
251
+ },
252
+ "symbolAnalysis": {
253
+ "type": "object",
254
+ "required": [
255
+ "outlinesRun",
256
+ "outlineBudget",
257
+ "outlineTimeoutMs",
258
+ "remoteCalls",
259
+ "remoteBudget",
260
+ "remoteTimeoutMs"
261
+ ],
262
+ "additionalProperties": false,
263
+ "description": "How the symbol level was bounded this run: graft outline calls started, the most a run may start, and the timeout on each; and the same three for the read-only gh api calls that read a pull request whose commits are not in the local clone (flyingrobots/footprint#55). All zero when no analysis was run.",
264
+ "properties": {
265
+ "outlinesRun": {
266
+ "type": "integer",
267
+ "minimum": 0
268
+ },
269
+ "outlineBudget": {
270
+ "type": "integer",
271
+ "minimum": 0
272
+ },
273
+ "outlineTimeoutMs": {
274
+ "type": "integer",
275
+ "minimum": 0
276
+ },
277
+ "remoteCalls": {
278
+ "type": "integer",
279
+ "minimum": 0
280
+ },
281
+ "remoteBudget": {
282
+ "type": "integer",
283
+ "minimum": 0
284
+ },
285
+ "remoteTimeoutMs": {
286
+ "type": "integer",
287
+ "minimum": 0
288
+ }
289
+ }
290
+ }
291
+ }
292
+ },
293
+ "digest": {
294
+ "type": "string",
295
+ "pattern": "^[0-9a-f]{64}$",
296
+ "description": "SHA-256 over the canonical JSON of range and overlap (spec §7.1). Unlike inv, it moves with the live state of the open pull requests."
297
+ },
298
+ "_schema": {
299
+ "type": "object",
300
+ "required": [
301
+ "id",
302
+ "version"
303
+ ],
304
+ "additionalProperties": false,
305
+ "properties": {
306
+ "id": {
307
+ "const": "footprint.overlap"
308
+ },
309
+ "version": {
310
+ "const": "2.2.0"
311
+ }
312
+ }
313
+ }
314
+ },
315
+ "$defs": {
316
+ "touched": {
317
+ "type": "object",
318
+ "required": [
319
+ "symbols",
320
+ "outside"
321
+ ],
322
+ "additionalProperties": false,
323
+ "properties": {
324
+ "symbols": {
325
+ "type": "array",
326
+ "items": {
327
+ "type": "string",
328
+ "minLength": 1
329
+ },
330
+ "description": "The top-level symbols whose spans hold one of this side's changed lines, at the merge base for removed lines and at the head for added ones, sorted. A rename names both the old and the new symbol."
331
+ },
332
+ "outside": {
333
+ "type": "integer",
334
+ "minimum": 0,
335
+ "description": "Changed lines outside every top-level symbol (comments, imports, top-level code), counted as git diff --numstat counts them: a modified line is one removed and one added. Whitespace-only lines are not counted."
336
+ }
337
+ }
338
+ },
339
+ "fileLevel": {
340
+ "type": "object",
341
+ "required": [
342
+ "path",
343
+ "level"
344
+ ],
345
+ "additionalProperties": false,
346
+ "oneOf": [
347
+ {
348
+ "properties": {
349
+ "level": {
350
+ "const": "symbol-disjoint"
351
+ }
352
+ },
353
+ "required": [
354
+ "a",
355
+ "b"
356
+ ]
357
+ },
358
+ {
359
+ "properties": {
360
+ "level": {
361
+ "const": "symbol-overlapping"
362
+ }
363
+ },
364
+ "required": [
365
+ "a",
366
+ "b",
367
+ "shared"
368
+ ]
369
+ },
370
+ {
371
+ "properties": {
372
+ "level": {
373
+ "const": "undetermined"
374
+ }
375
+ },
376
+ "required": [
377
+ "code",
378
+ "reason"
379
+ ]
380
+ }
381
+ ],
382
+ "properties": {
383
+ "path": {
384
+ "type": "string",
385
+ "minLength": 1
386
+ },
387
+ "level": {
388
+ "enum": [
389
+ "symbol-disjoint",
390
+ "symbol-overlapping",
391
+ "undetermined"
392
+ ]
393
+ },
394
+ "a": {
395
+ "$ref": "#/$defs/touched",
396
+ "description": "Side a: this change in overlapping, the edge's a in conflicts"
397
+ },
398
+ "b": {
399
+ "$ref": "#/$defs/touched",
400
+ "description": "Side b: the other pull request in overlapping, the edge's b in conflicts"
401
+ },
402
+ "shared": {
403
+ "type": "array",
404
+ "minItems": 1,
405
+ "items": {
406
+ "type": "string",
407
+ "minLength": 1
408
+ },
409
+ "description": "The symbols both sides change"
410
+ },
411
+ "code": {
412
+ "enum": [
413
+ "symbols.not_analysed",
414
+ "graft.not_resolved",
415
+ "language.unsupported",
416
+ "graft.outline_failed",
417
+ "graft.outline_timeout",
418
+ "graft.outline_refused",
419
+ "graft.outline_partial",
420
+ "graft.outline_unreadable",
421
+ "budget.spent",
422
+ "gh.head_unknown",
423
+ "gh.head_moved",
424
+ "gh.base_unknown",
425
+ "git.head_missing",
426
+ "git.base_missing",
427
+ "git.merge_base",
428
+ "git.diff_failed",
429
+ "git.show_failed",
430
+ "git.binary",
431
+ "symbols.outside",
432
+ "symbols.file_unchanged",
433
+ "gh.remote_failed",
434
+ "gh.rate_limited",
435
+ "gh.timeout",
436
+ "gh.budget_spent",
437
+ "gh.compare_unpinned",
438
+ "gh.compare_incomplete",
439
+ "gh.patch_unavailable",
440
+ "gh.content_too_large"
441
+ ],
442
+ "description": "Why the symbol level could not be decided; present only when undetermined"
443
+ },
444
+ "reason": {
445
+ "type": "string",
446
+ "minLength": 1
447
+ },
448
+ "github": {
449
+ "type": "array",
450
+ "minItems": 1,
451
+ "maxItems": 2,
452
+ "uniqueItems": true,
453
+ "items": {
454
+ "enum": [
455
+ "a",
456
+ "b"
457
+ ]
458
+ },
459
+ "description": "The sides read over the GitHub API (gh api compare and contents, by exact commit id) because their commits are not in the local clone; absent when every side was read from local git"
460
+ }
461
+ }
462
+ },
463
+ "symbolLevel": {
464
+ "type": "object",
465
+ "required": [
466
+ "level",
467
+ "files"
468
+ ],
469
+ "additionalProperties": false,
470
+ "properties": {
471
+ "level": {
472
+ "enum": [
473
+ "symbol-disjoint",
474
+ "symbol-overlapping",
475
+ "undetermined"
476
+ ],
477
+ "description": "symbol-overlapping when any shared file is; symbol-disjoint only when every shared file is; otherwise undetermined"
478
+ },
479
+ "files": {
480
+ "type": "array",
481
+ "minItems": 1,
482
+ "items": {
483
+ "$ref": "#/$defs/fileLevel"
484
+ }
485
+ }
486
+ }
487
+ }
488
+ }
489
+ }