@substrat-run/model-view 0.6.67 → 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.
- package/dist/bump.d.ts +108 -0
- package/dist/bump.d.ts.map +1 -0
- package/dist/bump.js +1032 -0
- package/dist/bump.js.map +1 -0
- package/package.json +7 -3
package/dist/bump.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export type Level = 'patch' | 'minor' | 'major';
|
|
2
|
+
export type Bump = 'none' | Level;
|
|
3
|
+
export type Artifact = 'model' | 'openapi' | 'permissions';
|
|
4
|
+
export interface Change {
|
|
5
|
+
readonly level: Level;
|
|
6
|
+
readonly artifact: Artifact;
|
|
7
|
+
/** Where in the artifact, as a reader would name it (`POST /api/lists`, `entities.item.fields.text`). */
|
|
8
|
+
readonly path: string;
|
|
9
|
+
readonly detail: string;
|
|
10
|
+
/** A permission change the human checkpoint must read, whatever the bump. */
|
|
11
|
+
readonly flagged?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface Classification {
|
|
14
|
+
readonly bump: Bump;
|
|
15
|
+
readonly changes: readonly Change[];
|
|
16
|
+
}
|
|
17
|
+
export declare const rank: (b: Bump) => number;
|
|
18
|
+
export declare const maxBump: (a: Bump, b: Bump) => Bump;
|
|
19
|
+
export declare const isBump: (s: string) => s is Bump;
|
|
20
|
+
/**
|
|
21
|
+
* Every local `$ref` (`#/…`) replaced by its target, recursively, against `root`. Compared
|
|
22
|
+
* unresolved, a break inside a shared component reads as an unchanged `{"$ref": …}` on both
|
|
23
|
+
* sides. A reference that loops back is left as the reference.
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveRefs(node: unknown, root?: unknown, seen?: readonly string[]): unknown;
|
|
26
|
+
/**
|
|
27
|
+
* Which way a schema's values travel. An `input` is what a caller SENDS: requiring more of it
|
|
28
|
+
* breaks the caller, accepting more does not. An `output` is what a caller READS (a response, a
|
|
29
|
+
* stored row, an event payload): promising less of it breaks the reader, promising more does not.
|
|
30
|
+
*/
|
|
31
|
+
export type Direction = 'input' | 'output';
|
|
32
|
+
export declare function classifyModel(baseText: string | null, headText: string | null): Classification;
|
|
33
|
+
export declare function classifyOpenApi(baseText: string | null, headText: string | null): Classification;
|
|
34
|
+
/**
|
|
35
|
+
* The parts of `PERMISSIONS.md` that carry a fact: one map per section, from a row's first
|
|
36
|
+
* cell (a key, a role, an entity type, a scheduled operation) to the row.
|
|
37
|
+
*/
|
|
38
|
+
export interface PermissionSnapshot {
|
|
39
|
+
/** Permission key → its description and declaring module, and whether it is reserved to a system principal. */
|
|
40
|
+
readonly registry: Record<string, {
|
|
41
|
+
terms: string[];
|
|
42
|
+
reserved: boolean;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* The Registry table is not one the emitter writes ({@link readRegistryTable}, the judgement
|
|
46
|
+
* model-view shares). Judged major, never read as nothing reserved.
|
|
47
|
+
*/
|
|
48
|
+
registryUnreadable?: string;
|
|
49
|
+
/** Role → the keys it holds: the roles a person can be given. */
|
|
50
|
+
readonly roles: Record<string, string[]>;
|
|
51
|
+
/** System-held role (K-55, a platform host's standing principal) → the keys it holds. */
|
|
52
|
+
readonly systemRoles: Record<string, string[]>;
|
|
53
|
+
/** Entity type → keys granted per entity, then its remaining cells as written. */
|
|
54
|
+
readonly grantShapes: Record<string, {
|
|
55
|
+
keys: string[];
|
|
56
|
+
terms: string[];
|
|
57
|
+
}>;
|
|
58
|
+
/** Scheduled operation → the keys its system principal holds, then the remaining cells. */
|
|
59
|
+
readonly schedules: Record<string, {
|
|
60
|
+
keys: string[];
|
|
61
|
+
terms: string[];
|
|
62
|
+
}>;
|
|
63
|
+
/** Peer vertical and its declaring module (#1706) → the keys it holds here, then what it may invoke. */
|
|
64
|
+
readonly peers: Record<string, {
|
|
65
|
+
keys: string[];
|
|
66
|
+
terms: string[];
|
|
67
|
+
}>;
|
|
68
|
+
/** #3161: an app that may act for a person here, and its declaring module → the keys it may act with, and its channels. */
|
|
69
|
+
readonly delegations: Record<string, {
|
|
70
|
+
keys: string[];
|
|
71
|
+
channels: string[];
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* Operation → the key it declares it checks, then how it narrows and who declares it (#2384).
|
|
75
|
+
* `undefined` when the artifact has no Operations section: an emitter that predates it.
|
|
76
|
+
*/
|
|
77
|
+
operations?: Record<string, {
|
|
78
|
+
keys: string[];
|
|
79
|
+
terms: string[];
|
|
80
|
+
}>;
|
|
81
|
+
/**
|
|
82
|
+
* The Operations heading is present but its table is not the one the emitter writes — header
|
|
83
|
+
* gone or renamed, a row with the wrong number of cells, or no rows and no "none" line. What
|
|
84
|
+
* cannot be read is judged major, never read as every operation removed.
|
|
85
|
+
*/
|
|
86
|
+
operationsUnreadable?: string;
|
|
87
|
+
/** Modules the section says are registered as a bare manifest, so their operations are not known. */
|
|
88
|
+
operationsUnknownFor?: string[];
|
|
89
|
+
/** Sections this parser does not read, by heading, with their text: judged whole. */
|
|
90
|
+
readonly unread: Record<string, string>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Parse a `PERMISSIONS.md` that `tools/permission-diff.mts` emitted. Sections are found by
|
|
94
|
+
* their heading's words, not their number: the numbering shifts with which sections a vertical
|
|
95
|
+
* has (§4 is grant shapes in one file and "not covered" in another). They are split by
|
|
96
|
+
* model-view's `permissionsSections`, so each table here is the one model-view reads under the
|
|
97
|
+
* same heading; a sub-section no branch below claims is judged whole, like an unknown section.
|
|
98
|
+
*/
|
|
99
|
+
export declare function parsePermissions(text: string): PermissionSnapshot;
|
|
100
|
+
export declare function classifyPermissions(baseText: string | null, headText: string | null): Classification;
|
|
101
|
+
/** One vertical's three artifacts as text, `null` where the file does not exist. */
|
|
102
|
+
export interface Artifacts {
|
|
103
|
+
readonly model: string | null;
|
|
104
|
+
readonly openapi: string | null;
|
|
105
|
+
readonly permissions: string | null;
|
|
106
|
+
}
|
|
107
|
+
export declare function classify(base: Artifacts, head: Artifacts): Classification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C;IAC7E;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IACjE;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qGAAqG;IACrG,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AA4BD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAmEjE;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,cAAc,CA8GpG;AAID,oFAAoF;AACpF,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,cAAc,CAOzE"}
|
package/dist/bump.js
ADDED
|
@@ -0,0 +1,1032 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The semver bump a vertical's change calls for, computed from its artifacts of record (#2364).
|
|
3
|
+
*
|
|
4
|
+
* Choosing a bump is a judgement an agent makes with confidence and gets wrong, and a breaking
|
|
5
|
+
* change marked `patch` looks exactly like a green release. A vertical already checks in every
|
|
6
|
+
* fact the judgement needs — `model.json` (`lint:model`), `openapi.json` (`lint:api`) and
|
|
7
|
+
* `PERMISSIONS.md` (`lint:permissions`), each held to the source by a `--check` re-emit — so the
|
|
8
|
+
* bump is read off the diff of those three files instead of asked for.
|
|
9
|
+
*
|
|
10
|
+
* The rules, one level per change, the bump being the highest. An INPUT is what a caller sends
|
|
11
|
+
* (parameters, request bodies); an OUTPUT is what a caller reads (responses, stored rows in
|
|
12
|
+
* `model.json`, event payloads).
|
|
13
|
+
*
|
|
14
|
+
* - **major**: something removed or narrowed. An operation, field, entity, state, transition,
|
|
15
|
+
* response, media type, enum value, parent edge, derived handler or export; an input that
|
|
16
|
+
* became required, tighter (`minLength` up, `maxLength` down, …), closed to unnamed
|
|
17
|
+
* properties or `readOnly`; an output that may now be omitted, looser, or `writeOnly`; a
|
|
18
|
+
* type, key, table, initial state or `operationId` changed; trash terms changed.
|
|
19
|
+
* - **minor**: something added. An operation, field, entity, state, transition, enum value,
|
|
20
|
+
* response or stamp; an input that became optional or looser; an output that became required
|
|
21
|
+
* or tighter; a `default` added, changed or dropped (a caller who omits the value gets other
|
|
22
|
+
* behaviour); `readOnly`/`writeOnly` dropped, or set in the direction that does not use the
|
|
23
|
+
* field; `erasable` gained or lost (lost is flagged). Every permission change is at least
|
|
24
|
+
* minor and FLAGGED for the human checkpoint (CLAUDE.md, "Two human checkpoints") — a
|
|
25
|
+
* narrowing and a widening alike, since a key gaining a role is the risk surface it exists for.
|
|
26
|
+
* - **patch**: only what describes: the schema keywords `description`, `title`, `examples`,
|
|
27
|
+
* `example`, `$comment`, `deprecated` and any `x-*`; an operation's `summary`, `description`,
|
|
28
|
+
* `tags`, `externalDocs` and `deprecated`; `info`; a permission key's description.
|
|
29
|
+
*
|
|
30
|
+
* **What it cannot read is major.** A keyword, section or key this module does not know is
|
|
31
|
+
* judged as a breaking change, never skipped. The CI check refuses a changeset that declares
|
|
32
|
+
* LESS than this, so an unknown shape that read as "no change" would let a real break ship as a
|
|
33
|
+
* patch. A false major costs a reviewed override line in the changeset; a false patch costs a
|
|
34
|
+
* broken consumer. Teach this file the new shape instead.
|
|
35
|
+
*
|
|
36
|
+
* **Alternatives are a set** (#3569). `anyOf`, `oneOf` and `allOf` branches are matched whatever
|
|
37
|
+
* order they are written in, so a reorder ranks no change, and only the branches left over are
|
|
38
|
+
* ranked: an alternative removed from what a caller sends, or added to what a caller reads, is
|
|
39
|
+
* major; the other way round is minor; an `allOf` branch, being a constraint, the opposite. A
|
|
40
|
+
* `oneOf` change ranks below major only where its branches provably cannot overlap
|
|
41
|
+
* (`compareBranches`). A promote of a listed app has no override (K-65), so a false major here is
|
|
42
|
+
* a refused release: fix it in this file, never by ranking a real narrowing lower.
|
|
43
|
+
*
|
|
44
|
+
* One known limit, stated rather than fixed:
|
|
45
|
+
*
|
|
46
|
+
* - **A component renamed with identical content ranks none.** `$ref`s are resolved before
|
|
47
|
+
* comparing, so `#/components/schemas/A` → `B` is invisible, although a client generated from
|
|
48
|
+
* `openapi.json` names its types after components. Nothing a caller sends or reads changed,
|
|
49
|
+
* and this repo's browser client is generated from `spec/model.ts`, not from component names.
|
|
50
|
+
*
|
|
51
|
+
* Pure: two texts in, a classification out. The filesystem and git half is the CLI's
|
|
52
|
+
* `changeset.ts`. It reads the artifacts, never the TypeScript, which is what keeps it valid
|
|
53
|
+
* across a change of authoring notation (`tools/model-diff.mts`). The same classifier is what
|
|
54
|
+
* `substrat changeset` writes, what `--check` holds a hand-written changeset to, what a status
|
|
55
|
+
* line can show, and what a promote of a LISTED app is ranked by (K-65, #3539): both hosts import
|
|
56
|
+
* it from here, which is why it lives in this Apache-2.0 package and not in the CLI. It is its own
|
|
57
|
+
* subpath (`@substrat-run/model-view/bump`), so a host importing it pulls in none of the renderer.
|
|
58
|
+
*/
|
|
59
|
+
import { operationsTableProblem, operationsUnknownFor, permissionsSections, readRegistryTable, readRolesSection, } from './concept.js';
|
|
60
|
+
const ORDER = ['none', 'patch', 'minor', 'major'];
|
|
61
|
+
export const rank = (b) => ORDER.indexOf(b);
|
|
62
|
+
export const maxBump = (a, b) => (rank(a) >= rank(b) ? a : b);
|
|
63
|
+
export const isBump = (s) => ORDER.includes(s);
|
|
64
|
+
/** The highest level among the changes; `none` when there are none. */
|
|
65
|
+
function bumpOf(changes) {
|
|
66
|
+
return changes.reduce((acc, c) => maxBump(acc, c.level), 'none');
|
|
67
|
+
}
|
|
68
|
+
const classification = (changes) => ({ bump: bumpOf(changes), changes });
|
|
69
|
+
// ─── JSON Schema ──────────────────────────────────────────────────────────────────────────────
|
|
70
|
+
/** Keywords that describe a schema without constraining it. A change to one is documentation. */
|
|
71
|
+
const ANNOTATIONS = new Set(['description', 'title', 'examples', 'example', '$comment', 'deprecated']);
|
|
72
|
+
const isRecord = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
73
|
+
/** Keywords whose keys are NAMES (a field called `title`), never keywords to strip. */
|
|
74
|
+
const NAME_MAPS = new Set(['properties', 'patternProperties', '$defs', 'definitions', 'schemas', 'responses', 'content']);
|
|
75
|
+
/**
|
|
76
|
+
* Keywords whose value is DATA (an enum member, a constant, a default): compared verbatim — nothing
|
|
77
|
+
* stripped, nothing sorted. A default of `{ enum: ['a', 'b'] }` is a value, not a schema.
|
|
78
|
+
*/
|
|
79
|
+
const LITERALS = new Set(['enum', 'const', 'default']);
|
|
80
|
+
/**
|
|
81
|
+
* Keywords whose array value is a SET: order carries no meaning, so it is sorted before comparing.
|
|
82
|
+
* The emitter writes `required` and `enum` in declaration order, so moving a field or a member
|
|
83
|
+
* in `spec/model.ts` reorders them without changing anything — and the enum's consumers read it
|
|
84
|
+
* as a set too (`emit-sql`'s `CHECK (col IN (…))`, `emit-client`'s `'a' | 'b'` union).
|
|
85
|
+
*/
|
|
86
|
+
const SET_VALUED = new Set(['required', 'enum', 'type']);
|
|
87
|
+
/**
|
|
88
|
+
* Keywords whose branches are a SET of schemas (#3569): `anyOf` accepts a value one branch
|
|
89
|
+
* accepts, `allOf` one every branch accepts, `oneOf` one exactly one branch accepts — none of them
|
|
90
|
+
* reads the order. Sorted before comparing, like {@link SET_VALUED}; a branch written twice counts
|
|
91
|
+
* once in `anyOf` and `allOf`, where a second copy accepts nothing the first does not. Not in
|
|
92
|
+
* `oneOf`: there a value matching a duplicated branch matches two branches and is refused, so the
|
|
93
|
+
* copy is a real narrowing and stays counted.
|
|
94
|
+
*/
|
|
95
|
+
const SCHEMA_SETS = new Set(['anyOf', 'oneOf', 'allOf']);
|
|
96
|
+
const DUPLICATES_COUNT_ONCE = new Set(['anyOf', 'allOf']);
|
|
97
|
+
const byJson = (a, b) => {
|
|
98
|
+
const [sa, sb] = [JSON.stringify(a), JSON.stringify(b)];
|
|
99
|
+
return sa < sb ? -1 : sa > sb ? 1 : 0;
|
|
100
|
+
};
|
|
101
|
+
/** `false` is these keywords' default: written out, it says nothing more than absent. */
|
|
102
|
+
const FALSE_IS_ABSENT = new Set(['readOnly', 'writeOnly']);
|
|
103
|
+
/** A value as a comparable string, keys sorted, optionally without annotations at any depth. */
|
|
104
|
+
function canon(v, stripAnnotations) {
|
|
105
|
+
const walk = (x, mode = 'schema') => {
|
|
106
|
+
if (Array.isArray(x))
|
|
107
|
+
return x.map((y) => walk(y, mode === 'literal' ? 'literal' : 'schema'));
|
|
108
|
+
if (!isRecord(x))
|
|
109
|
+
return x;
|
|
110
|
+
const out = {};
|
|
111
|
+
for (const k of Object.keys(x).sort()) {
|
|
112
|
+
if (mode === 'schema' && stripAnnotations && (ANNOTATIONS.has(k) || k.startsWith('x-')))
|
|
113
|
+
continue;
|
|
114
|
+
if (mode === 'schema' && FALSE_IS_ABSENT.has(k) && x[k] === false)
|
|
115
|
+
continue;
|
|
116
|
+
const next = mode === 'literal' ? 'literal' : mode === 'names' ? 'schema' : LITERALS.has(k) ? 'literal' : NAME_MAPS.has(k) ? 'names' : 'schema';
|
|
117
|
+
const value = walk(x[k], next);
|
|
118
|
+
if (mode === 'schema' && SCHEMA_SETS.has(k) && Array.isArray(value)) {
|
|
119
|
+
const sorted = [...value].sort(byJson);
|
|
120
|
+
out[k] = DUPLICATES_COUNT_ONCE.has(k)
|
|
121
|
+
? sorted.filter((b, i) => i === 0 || JSON.stringify(b) !== JSON.stringify(sorted[i - 1]))
|
|
122
|
+
: sorted;
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
out[k] = mode === 'schema' && SET_VALUED.has(k) && Array.isArray(value) ? [...value].sort(byJson) : value;
|
|
126
|
+
}
|
|
127
|
+
return out;
|
|
128
|
+
};
|
|
129
|
+
return JSON.stringify(walk(v)) ?? 'undefined';
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Every local `$ref` (`#/…`) replaced by its target, recursively, against `root`. Compared
|
|
133
|
+
* unresolved, a break inside a shared component reads as an unchanged `{"$ref": …}` on both
|
|
134
|
+
* sides. A reference that loops back is left as the reference.
|
|
135
|
+
*/
|
|
136
|
+
export function resolveRefs(node, root = node, seen = []) {
|
|
137
|
+
if (Array.isArray(node))
|
|
138
|
+
return node.map((v) => resolveRefs(v, root, seen));
|
|
139
|
+
if (!isRecord(node))
|
|
140
|
+
return node;
|
|
141
|
+
const ref = node.$ref;
|
|
142
|
+
if (typeof ref === 'string' && ref.startsWith('#/') && !seen.includes(ref)) {
|
|
143
|
+
let target = root;
|
|
144
|
+
for (const part of ref.slice(2).split('/')) {
|
|
145
|
+
target = isRecord(target) ? target[part.replace(/~1/g, '/').replace(/~0/g, '~')] : undefined;
|
|
146
|
+
}
|
|
147
|
+
if (target !== undefined) {
|
|
148
|
+
const { $ref: _ref, ...siblings } = node;
|
|
149
|
+
const resolved = resolveRefs(target, root, [...seen, ref]);
|
|
150
|
+
return Object.keys(siblings).length && isRecord(resolved)
|
|
151
|
+
? { ...resolved, ...resolveRefs(siblings, root, seen) }
|
|
152
|
+
: resolved;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const out = {};
|
|
156
|
+
for (const [k, v] of Object.entries(node)) {
|
|
157
|
+
if (k === '$defs' || k === 'definitions')
|
|
158
|
+
continue;
|
|
159
|
+
out[k] = resolveRefs(v, root, seen);
|
|
160
|
+
}
|
|
161
|
+
return out;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Numeric limits, and which way is tighter. A lower bound rising or an upper bound falling
|
|
165
|
+
* accepts less: that breaks a caller sending it (input) and is safe for a reader (output).
|
|
166
|
+
*/
|
|
167
|
+
const LOWER_BOUNDS = new Set(['minLength', 'minItems', 'minProperties', 'minimum', 'exclusiveMinimum']);
|
|
168
|
+
const UPPER_BOUNDS = new Set(['maxLength', 'maxItems', 'maxProperties', 'maximum', 'exclusiveMaximum']);
|
|
169
|
+
const COMPOSITIONS = ['anyOf', 'oneOf', 'allOf'];
|
|
170
|
+
/** The keywords `compareSchema` judges on their meaning. Any other constraint change is major. */
|
|
171
|
+
const UNDERSTOOD = new Set([
|
|
172
|
+
'type', 'enum', 'properties', 'required', 'additionalProperties', 'items', 'default', 'readOnly', 'writeOnly',
|
|
173
|
+
...LOWER_BOUNDS, ...UPPER_BOUNDS, ...COMPOSITIONS,
|
|
174
|
+
]);
|
|
175
|
+
const requiredOf = (s) => new Set(Array.isArray(s.required) ? s.required.filter((x) => typeof x === 'string') : []);
|
|
176
|
+
const propertiesOf = (s) => isRecord(s.properties) ? s.properties : {};
|
|
177
|
+
/**
|
|
178
|
+
* One schema against its base, keyword by keyword, pushing a change for each difference. `push`
|
|
179
|
+
* carries the artifact; `path` names the place for a reader. Both schemas must be resolved.
|
|
180
|
+
*/
|
|
181
|
+
function compareSchema(push, dir, path, base, head) {
|
|
182
|
+
if (canon(base, false) === canon(head, false))
|
|
183
|
+
return;
|
|
184
|
+
if (canon(base, true) === canon(head, true)) {
|
|
185
|
+
push('patch', path, 'documentation only');
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (!isRecord(base) || !isRecord(head)) {
|
|
189
|
+
push('major', path, `changed from ${canon(base, true)} to ${canon(head, true)}`);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
// The safety net, checked at the end: the two schemas differ in more than documentation, so
|
|
193
|
+
// if no rule below ranked anything, the difference is one this classifier did not read (a
|
|
194
|
+
// `required` naming a property declared in another `allOf` branch, say) — and that is major.
|
|
195
|
+
const outer = push;
|
|
196
|
+
let ranked = false;
|
|
197
|
+
push = (level, at, detail) => {
|
|
198
|
+
ranked = true;
|
|
199
|
+
outer(level, at, detail);
|
|
200
|
+
};
|
|
201
|
+
// Compared under its key, so an array `type` is compared as the set it is.
|
|
202
|
+
if (canon({ type: base.type }, false) !== canon({ type: head.type }, false)) {
|
|
203
|
+
push('major', path, `type changed from ${canon(base.type, false)} to ${canon(head.type, false)}`);
|
|
204
|
+
}
|
|
205
|
+
if (Array.isArray(base.enum) || Array.isArray(head.enum)) {
|
|
206
|
+
if (!Array.isArray(base.enum) || !Array.isArray(head.enum)) {
|
|
207
|
+
// An enum appearing narrows the values to a list; one disappearing loses the promise.
|
|
208
|
+
push('major', path, Array.isArray(head.enum) ? 'is now restricted to an enum' : 'is no longer an enum');
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
const b = new Set(base.enum.map((v) => canon(v, false)));
|
|
212
|
+
const h = new Set(head.enum.map((v) => canon(v, false)));
|
|
213
|
+
const removed = [...b].filter((v) => !h.has(v));
|
|
214
|
+
const added = [...h].filter((v) => !b.has(v));
|
|
215
|
+
if (removed.length)
|
|
216
|
+
push('major', path, `enum value(s) removed: ${removed.join(', ')}`);
|
|
217
|
+
if (added.length)
|
|
218
|
+
push('minor', path, `enum value(s) added: ${added.join(', ')}`);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
const bp = propertiesOf(base);
|
|
222
|
+
const hp = propertiesOf(head);
|
|
223
|
+
const br = requiredOf(base);
|
|
224
|
+
const hr = requiredOf(head);
|
|
225
|
+
const at = (field) => (path ? `${path}.${field}` : field);
|
|
226
|
+
for (const field of Object.keys(bp).sort()) {
|
|
227
|
+
if (!(field in hp))
|
|
228
|
+
push('major', at(field), 'removed');
|
|
229
|
+
else
|
|
230
|
+
compareSchema(push, dir, at(field), bp[field], hp[field]);
|
|
231
|
+
}
|
|
232
|
+
for (const field of Object.keys(hp).sort()) {
|
|
233
|
+
if (field in bp)
|
|
234
|
+
continue;
|
|
235
|
+
if (dir === 'input' && hr.has(field))
|
|
236
|
+
push('major', at(field), 'added as a required input — a caller that omits it is refused');
|
|
237
|
+
else
|
|
238
|
+
push('minor', at(field), 'added');
|
|
239
|
+
}
|
|
240
|
+
for (const field of [...hr].sort()) {
|
|
241
|
+
if (br.has(field) || !(field in bp) || !(field in hp))
|
|
242
|
+
continue;
|
|
243
|
+
push(dir === 'input' ? 'major' : 'minor', at(field), 'is now required');
|
|
244
|
+
}
|
|
245
|
+
for (const field of [...br].sort()) {
|
|
246
|
+
if (hr.has(field) || !(field in hp))
|
|
247
|
+
continue;
|
|
248
|
+
push(dir === 'input' ? 'minor' : 'major', at(field), dir === 'input' ? 'is now optional' : 'may now be omitted');
|
|
249
|
+
}
|
|
250
|
+
const ba = base.additionalProperties;
|
|
251
|
+
const ha = head.additionalProperties;
|
|
252
|
+
if (canon(ba, false) !== canon(ha, false)) {
|
|
253
|
+
if (isRecord(ba) && isRecord(ha)) {
|
|
254
|
+
compareSchema(push, dir, `${path}[*]`, ba, ha);
|
|
255
|
+
}
|
|
256
|
+
else if (dir === 'input' && ha === false) {
|
|
257
|
+
push('major', path, 'no longer accepts properties it does not name');
|
|
258
|
+
}
|
|
259
|
+
else if (isRecord(ba) || isRecord(ha)) {
|
|
260
|
+
push('major', `${path}[*]`, `value schema changed from ${canon(ba, true)} to ${canon(ha, true)}`);
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
push('minor', path, `additionalProperties changed from ${canon(ba, false)} to ${canon(ha, false)}`);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (base.items !== undefined || head.items !== undefined) {
|
|
267
|
+
if (base.items === undefined || head.items === undefined)
|
|
268
|
+
push('major', `${path}[]`, 'items changed');
|
|
269
|
+
else
|
|
270
|
+
compareSchema(push, dir, `${path}[]`, base.items, head.items);
|
|
271
|
+
}
|
|
272
|
+
// `default` is what a caller who omits the value gets: changed, added or dropped, every such
|
|
273
|
+
// caller now sees different behaviour without having broken any contract — minor.
|
|
274
|
+
// Under its key, so the value is walked as the data it is (LITERALS), never as a schema.
|
|
275
|
+
if (canon({ default: base.default }, false) !== canon({ default: head.default }, false)) {
|
|
276
|
+
push('minor', path, `default changed from ${canon(base.default, false)} to ${canon(head.default, false)}`);
|
|
277
|
+
}
|
|
278
|
+
// `readOnly` is never sent, `writeOnly` is never returned. Each narrows one direction: a
|
|
279
|
+
// field becoming readOnly can no longer be sent (input), becoming writeOnly is no longer read
|
|
280
|
+
// (output). The reverse flip, or a flip in the direction that does not use the field, is minor.
|
|
281
|
+
for (const [k, narrows] of [['readOnly', 'input'], ['writeOnly', 'output']]) {
|
|
282
|
+
if (!!base[k] === !!head[k])
|
|
283
|
+
continue;
|
|
284
|
+
push(dir === narrows && head[k] ? 'major' : 'minor', path, head[k] ? `became ${k}` : `is no longer ${k}`);
|
|
285
|
+
}
|
|
286
|
+
for (const k of [...LOWER_BOUNDS, ...UPPER_BOUNDS]) {
|
|
287
|
+
const bv = base[k];
|
|
288
|
+
const hv = head[k];
|
|
289
|
+
if (bv === hv)
|
|
290
|
+
continue;
|
|
291
|
+
if ((bv !== undefined && typeof bv !== 'number') || (hv !== undefined && typeof hv !== 'number')) {
|
|
292
|
+
push('major', path, `'${k}' changed from ${canon(bv, false)} to ${canon(hv, false)}`);
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
// An absent bound is no limit at all: the loosest value there is.
|
|
296
|
+
const lower = LOWER_BOUNDS.has(k);
|
|
297
|
+
const loose = lower ? -Infinity : Infinity;
|
|
298
|
+
const b = bv ?? loose;
|
|
299
|
+
const h = hv ?? loose;
|
|
300
|
+
const tighter = lower ? h > b : h < b;
|
|
301
|
+
const breaks = dir === 'input' ? tighter : !tighter;
|
|
302
|
+
push(breaks ? 'major' : 'minor', path, `'${k}' ${tighter ? 'tightened' : 'loosened'} from ${bv ?? 'none'} to ${hv ?? 'none'}`);
|
|
303
|
+
}
|
|
304
|
+
// Alternatives are a set, whatever order they are written in (#3569): see compareBranches.
|
|
305
|
+
for (const k of COMPOSITIONS) {
|
|
306
|
+
const ba = base[k];
|
|
307
|
+
const ha = head[k];
|
|
308
|
+
if (ba === undefined && ha === undefined)
|
|
309
|
+
continue;
|
|
310
|
+
if (!Array.isArray(ba) || !Array.isArray(ha)) {
|
|
311
|
+
if (canon(ba, true) !== canon(ha, true))
|
|
312
|
+
push('major', path, `'${k}' alternatives changed`);
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
compareBranches(push, dir, path, k, ba, ha);
|
|
316
|
+
}
|
|
317
|
+
for (const k of [...new Set([...Object.keys(base), ...Object.keys(head)])].sort()) {
|
|
318
|
+
if (UNDERSTOOD.has(k) || ANNOTATIONS.has(k) || k.startsWith('x-'))
|
|
319
|
+
continue;
|
|
320
|
+
if (canon(base[k], true) !== canon(head[k], true)) {
|
|
321
|
+
push('major', path, `'${k}' changed — not a change this classifier can rank, so judged as breaking`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (!ranked)
|
|
325
|
+
outer('major', path, 'changed in a way no rule here reads, so judged as breaking');
|
|
326
|
+
}
|
|
327
|
+
/** The single JSON type a schema names, or `null` when it names none or several. */
|
|
328
|
+
const soleType = (s) => typeof s.type === 'string' ? s.type : Array.isArray(s.type) && s.type.length === 1 && typeof s.type[0] === 'string' ? s.type[0] : null;
|
|
329
|
+
/**
|
|
330
|
+
* Whether no value can match both schemas, by one of two shapes this classifier can prove: each
|
|
331
|
+
* names a single JSON type and the two differ (`integer` and `number` overlap), or each requires a
|
|
332
|
+
* property whose `const` differs — the discriminator of a tagged union. Anything else may overlap.
|
|
333
|
+
*/
|
|
334
|
+
function disjoint(a, b) {
|
|
335
|
+
if (!isRecord(a) || !isRecord(b))
|
|
336
|
+
return false;
|
|
337
|
+
const [ta, tb] = [soleType(a), soleType(b)];
|
|
338
|
+
const numeric = new Set(['integer', 'number']);
|
|
339
|
+
if (ta && tb && ta !== tb && !(numeric.has(ta) && numeric.has(tb)))
|
|
340
|
+
return true;
|
|
341
|
+
const [pa, pb, ra, rb] = [propertiesOf(a), propertiesOf(b), requiredOf(a), requiredOf(b)];
|
|
342
|
+
return Object.keys(pa).some((p) => {
|
|
343
|
+
const [x, y] = [pa[p], pb[p]];
|
|
344
|
+
return ra.has(p) && rb.has(p) && isRecord(x) && isRecord(y) && 'const' in x && 'const' in y &&
|
|
345
|
+
canon({ const: x.const }, false) !== canon({ const: y.const }, false);
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* The alternatives of one `anyOf`, `oneOf` or `allOf`, compared as the set they are (#3569). The
|
|
350
|
+
* order carries no meaning, so a reorder is no change at all, and a branch written twice counts
|
|
351
|
+
* once in `anyOf` and `allOf` (see {@link DUPLICATES_COUNT_ONCE}).
|
|
352
|
+
*
|
|
353
|
+
* 1. Each base branch equal to a head branch after normalisation (annotations aside) is matched
|
|
354
|
+
* to it, and ranks at most a documentation change.
|
|
355
|
+
* 2. If as many branches are left on each side, each base branch is paired with the head branch
|
|
356
|
+
* it changed into — the one whose comparison ranks lowest — and the pair is compared as any
|
|
357
|
+
* schema is. Every pair being sound, the set is: in an input each head branch then accepts all
|
|
358
|
+
* its base branch did. A wrong pairing can only rank too high, never too low.
|
|
359
|
+
* 3. Otherwise each branch left over is removed or added. Which way that bends depends on the
|
|
360
|
+
* keyword and on the direction: a removed `anyOf` alternative accepts less (major for an
|
|
361
|
+
* input, minor for an output), an added one accepts more (minor for an input, major for an
|
|
362
|
+
* output); an `allOf` branch is a constraint, so the other way round.
|
|
363
|
+
*
|
|
364
|
+
* `oneOf` refuses a value two branches match, so the branches are not independent: one that
|
|
365
|
+
* accepts more can get another branch's values refused, and one that accepts less (or is gone)
|
|
366
|
+
* can get values two branches shared accepted. A `oneOf` change that would otherwise rank below
|
|
367
|
+
* major ranks major unless the branches it touches are provably {@link disjoint} from every other
|
|
368
|
+
* branch on their side — the tagged union the emitter writes is.
|
|
369
|
+
*/
|
|
370
|
+
function compareBranches(push, dir, path, k, base, head) {
|
|
371
|
+
const once = DUPLICATES_COUNT_ONCE.has(k);
|
|
372
|
+
const branches = (xs) => {
|
|
373
|
+
const out = [];
|
|
374
|
+
xs.forEach((schema, i) => {
|
|
375
|
+
const key = canon(schema, true);
|
|
376
|
+
if (once && out.some((b) => b.key === key))
|
|
377
|
+
return;
|
|
378
|
+
out.push({ schema, i, key });
|
|
379
|
+
});
|
|
380
|
+
return out;
|
|
381
|
+
};
|
|
382
|
+
const at = (b) => `${path}|${k}[${b.i}]`;
|
|
383
|
+
const oneOf = k === 'oneOf';
|
|
384
|
+
const alone = (b, side) => side.every((s, i) => i === b.i || disjoint(b.schema, s));
|
|
385
|
+
// 1. Equal after normalisation: the same alternative, wherever it is written.
|
|
386
|
+
const headLeft = branches(head);
|
|
387
|
+
const baseLeft = [];
|
|
388
|
+
for (const b of branches(base)) {
|
|
389
|
+
const j = headLeft.findIndex((h) => h.key === b.key);
|
|
390
|
+
if (j < 0) {
|
|
391
|
+
baseLeft.push(b);
|
|
392
|
+
continue;
|
|
393
|
+
}
|
|
394
|
+
const [h] = headLeft.splice(j, 1);
|
|
395
|
+
compareSchema(push, dir, at(h), b.schema, h.schema);
|
|
396
|
+
}
|
|
397
|
+
// 2. As many left on each side: each base branch against the head branch it changed into.
|
|
398
|
+
if (baseLeft.length === headLeft.length) {
|
|
399
|
+
for (const b of baseLeft) {
|
|
400
|
+
let best = null;
|
|
401
|
+
headLeft.forEach((h, j) => {
|
|
402
|
+
const changes = [];
|
|
403
|
+
compareSchema((level, p, detail) => changes.push([level, p, detail]), dir, at(h), b.schema, h.schema);
|
|
404
|
+
const top = changes.reduce((acc, [level]) => Math.max(acc, rank(level)), 0);
|
|
405
|
+
if (!best || top < best.top)
|
|
406
|
+
best = { j, top, changes };
|
|
407
|
+
});
|
|
408
|
+
const { j, top, changes } = best;
|
|
409
|
+
const [h] = headLeft.splice(j, 1);
|
|
410
|
+
for (const [level, p, detail] of changes)
|
|
411
|
+
push(level, p, detail);
|
|
412
|
+
// Accepting more can newly overlap; accepting less frees values another branch shared.
|
|
413
|
+
if (oneOf && top === rank('minor') && !(alone(b, base) && alone(h, head))) {
|
|
414
|
+
push('major', at(h), "changed in a 'oneOf' it may now overlap, and a value two branches match is refused");
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
// 3. Different counts: what is left over was removed or added.
|
|
420
|
+
const anyway = k === 'allOf' ? { removed: 'output', added: 'input' } : { removed: 'input', added: 'output' };
|
|
421
|
+
for (const b of baseLeft) {
|
|
422
|
+
const level = dir === anyway.removed || (oneOf && !alone(b, base)) ? 'major' : 'minor';
|
|
423
|
+
push(level, at(b), `'${k}' alternative removed: ${b.key}`);
|
|
424
|
+
}
|
|
425
|
+
for (const h of headLeft) {
|
|
426
|
+
const level = dir === anyway.added || (oneOf && !alone(h, head)) ? 'major' : 'minor';
|
|
427
|
+
push(level, at(h), `'${k}' alternative added: ${h.key}`);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
function pusher(artifact, out) {
|
|
431
|
+
return (level, path, detail, flagged) => out.push({ level, artifact, path, detail, ...(flagged ? { flagged: true } : {}) });
|
|
432
|
+
}
|
|
433
|
+
/** Removed keys → `removed`, added → `added`, both sides present → `both`. Sorted. */
|
|
434
|
+
function keyed(base, head, on) {
|
|
435
|
+
for (const k of Object.keys(base).sort()) {
|
|
436
|
+
if (!(k in head))
|
|
437
|
+
on.removed(k, base[k]);
|
|
438
|
+
else
|
|
439
|
+
on.both(k, base[k], head[k]);
|
|
440
|
+
}
|
|
441
|
+
for (const k of Object.keys(head).sort())
|
|
442
|
+
if (!(k in base))
|
|
443
|
+
on.added(k, head[k]);
|
|
444
|
+
}
|
|
445
|
+
const recordOf = (v) => (isRecord(v) ? v : {});
|
|
446
|
+
/** A value judged whole: annotations → patch, anything else → major. The unrecognised fallback. */
|
|
447
|
+
function wholeValue(push, path, base, head, what = 'changed') {
|
|
448
|
+
if (canon(base, false) === canon(head, false))
|
|
449
|
+
return;
|
|
450
|
+
if (canon(base, true) === canon(head, true))
|
|
451
|
+
push('patch', path, 'documentation only');
|
|
452
|
+
else
|
|
453
|
+
push('major', path, `${what} (not a shape this classifier reads, so judged as breaking)`);
|
|
454
|
+
}
|
|
455
|
+
function setDiff(base, head) {
|
|
456
|
+
const b = new Set(Array.isArray(base) ? base.map(String) : []);
|
|
457
|
+
const h = new Set(Array.isArray(head) ? head.map(String) : []);
|
|
458
|
+
return { removed: [...b].filter((x) => !h.has(x)).sort(), added: [...h].filter((x) => !b.has(x)).sort() };
|
|
459
|
+
}
|
|
460
|
+
function parseJson(text, what) {
|
|
461
|
+
if (text === null)
|
|
462
|
+
return null;
|
|
463
|
+
let parsed;
|
|
464
|
+
try {
|
|
465
|
+
parsed = JSON.parse(text);
|
|
466
|
+
}
|
|
467
|
+
catch (err) {
|
|
468
|
+
throw new Error(`${what} does not parse as JSON: ${err.message}`);
|
|
469
|
+
}
|
|
470
|
+
if (!isRecord(parsed))
|
|
471
|
+
throw new Error(`${what} is not a JSON object`);
|
|
472
|
+
return parsed;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* The artifact appearing or disappearing, judged before its contents: a vertical gaining its
|
|
476
|
+
* first `openapi.json` adds a surface (minor), one losing it removes one (major).
|
|
477
|
+
*/
|
|
478
|
+
function presence(artifact, base, head, out) {
|
|
479
|
+
if (base === null && head === null)
|
|
480
|
+
return true;
|
|
481
|
+
const file = { model: 'model.json', openapi: 'openapi.json', permissions: 'PERMISSIONS.md' }[artifact];
|
|
482
|
+
if (base === null) {
|
|
483
|
+
out.push({ level: 'minor', artifact, path: file, detail: 'added', ...(artifact === 'permissions' ? { flagged: true } : {}) });
|
|
484
|
+
return true;
|
|
485
|
+
}
|
|
486
|
+
if (head === null) {
|
|
487
|
+
out.push({ level: 'major', artifact, path: file, detail: 'removed', ...(artifact === 'permissions' ? { flagged: true } : {}) });
|
|
488
|
+
return true;
|
|
489
|
+
}
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
// ─── model.json ───────────────────────────────────────────────────────────────────────────────
|
|
493
|
+
/** Top-level `model.json` keys this classifier reads. Any other key changing is judged major. */
|
|
494
|
+
const MODEL_KEYS = new Set(['entities', 'lifecycles', 'handlers', 'exports', 'version']);
|
|
495
|
+
/** Entity keys read on their meaning. */
|
|
496
|
+
const ENTITY_KEYS = new Set([
|
|
497
|
+
'table', 'fields', 'erasable', 'erasure', 'parents', 'key', 'primaryKey', 'archive', 'trash', 'stamps', 'outsideText',
|
|
498
|
+
]);
|
|
499
|
+
export function classifyModel(baseText, headText) {
|
|
500
|
+
const out = [];
|
|
501
|
+
const base = parseJson(baseText, 'model.json (base)');
|
|
502
|
+
const head = parseJson(headText, 'model.json');
|
|
503
|
+
if (presence('model', base, head, out))
|
|
504
|
+
return classification(out);
|
|
505
|
+
const push = pusher('model', out);
|
|
506
|
+
const b = base;
|
|
507
|
+
const h = head;
|
|
508
|
+
const baseEntities = recordOf(b.entities);
|
|
509
|
+
keyed(baseEntities, recordOf(h.entities), {
|
|
510
|
+
removed: (name) => push('major', `entities.${name}`, 'entity removed'),
|
|
511
|
+
added: (name) => push('minor', `entities.${name}`, 'entity added'),
|
|
512
|
+
both: (name, be, he) => classifyEntity(push, `entities.${name}`, recordOf(be), recordOf(he)),
|
|
513
|
+
});
|
|
514
|
+
keyed(recordOf(b.lifecycles), recordOf(h.lifecycles), {
|
|
515
|
+
removed: (name) => push('major', `lifecycles.${name}`, 'lifecycle removed — its states are no longer enforced'),
|
|
516
|
+
// A state machine on an entity that existed without one refuses operations it used to accept.
|
|
517
|
+
added: (name) => name in baseEntities
|
|
518
|
+
? push('major', `lifecycles.${name}`, 'an existing entity gained a lifecycle, which refuses transitions it used to allow')
|
|
519
|
+
: push('minor', `lifecycles.${name}`, 'lifecycle added with its entity'),
|
|
520
|
+
both: (name, bl, hl) => classifyLifecycle(push, `lifecycles.${name}`, recordOf(bl), recordOf(hl)),
|
|
521
|
+
});
|
|
522
|
+
keyed(recordOf(b.handlers), recordOf(h.handlers), {
|
|
523
|
+
removed: (op) => push('major', `handlers.${op}`, 'derived handler removed'),
|
|
524
|
+
added: (op) => push('minor', `handlers.${op}`, 'derived handler added'),
|
|
525
|
+
both: (op, bh, hh) => {
|
|
526
|
+
if (canon(bh, false) === canon(hh, false))
|
|
527
|
+
return;
|
|
528
|
+
// `authored` holds the reason a handler is written by hand. Two reasons are prose.
|
|
529
|
+
const authored = (v) => isRecord(v) && Object.keys(v).length === 1 && typeof v.authored === 'string';
|
|
530
|
+
if (authored(bh) && authored(hh))
|
|
531
|
+
push('patch', `handlers.${op}`, 'documentation only');
|
|
532
|
+
// The same operation answered by a different implementation: todo's `list-shares` went
|
|
533
|
+
// from answering a missing list with a 404 to answering it with an empty page this way.
|
|
534
|
+
else
|
|
535
|
+
push('major', `handlers.${op}`, `implementation changed from ${canon(bh, false)} to ${canon(hh, false)}`);
|
|
536
|
+
},
|
|
537
|
+
});
|
|
538
|
+
keyed(recordOf(b.exports), recordOf(h.exports), {
|
|
539
|
+
removed: (type) => push('major', `exports.${type}`, 'exported event removed'),
|
|
540
|
+
added: (type) => push('minor', `exports.${type}`, 'exported event added'),
|
|
541
|
+
both: (type, bx, hx) => {
|
|
542
|
+
const be = recordOf(bx);
|
|
543
|
+
const he = recordOf(hx);
|
|
544
|
+
if (be.schemaVersion !== he.schemaVersion) {
|
|
545
|
+
// K-39: a bump is a replace, and a consumer on the old version stops receiving it.
|
|
546
|
+
push('major', `exports.${type}`, `schemaVersion changed from ${String(be.schemaVersion)} to ${String(he.schemaVersion)}`);
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
compareSchema(push, 'output', `exports.${type}.payload`, resolveRefs(be.payload), resolveRefs(he.payload));
|
|
550
|
+
const { schemaVersion: _a, payload: _b, ...bRest } = be;
|
|
551
|
+
const { schemaVersion: _c, payload: _d, ...hRest } = he;
|
|
552
|
+
wholeValue(push, `exports.${type}`, bRest, hRest);
|
|
553
|
+
},
|
|
554
|
+
});
|
|
555
|
+
// `version` is an engine's manifest version: the RESULT of a bump, never a reason for one.
|
|
556
|
+
for (const k of [...new Set([...Object.keys(b), ...Object.keys(h)])].sort()) {
|
|
557
|
+
if (!MODEL_KEYS.has(k))
|
|
558
|
+
wholeValue(push, k, b[k], h[k]);
|
|
559
|
+
}
|
|
560
|
+
return classification(out);
|
|
561
|
+
}
|
|
562
|
+
function classifyEntity(push, path, b, h) {
|
|
563
|
+
if (b.table !== h.table)
|
|
564
|
+
push('major', `${path}.table`, `table renamed from ${String(b.table)} to ${String(h.table)}`);
|
|
565
|
+
compareSchema(push, 'output', `${path}.fields`, resolveRefs(b.fields), resolveRefs(h.fields));
|
|
566
|
+
const erasable = setDiff(b.erasable, h.erasable);
|
|
567
|
+
if (erasable.added.length)
|
|
568
|
+
push('minor', `${path}.erasable`, `now erasable: ${erasable.added.join(', ')}`);
|
|
569
|
+
if (erasable.removed.length) {
|
|
570
|
+
push('minor', `${path}.erasable`, `no longer erasable — a subject erasure stops reaching: ${erasable.removed.join(', ')}`, true);
|
|
571
|
+
}
|
|
572
|
+
if (canon(b.erasure, false) !== canon(h.erasure, false))
|
|
573
|
+
push('minor', `${path}.erasure`, 'subject erasure declaration changed');
|
|
574
|
+
const parents = setDiff(b.parents, h.parents);
|
|
575
|
+
if (parents.removed.length)
|
|
576
|
+
push('major', `${path}.parents`, `parent edge removed: ${parents.removed.join(', ')}`);
|
|
577
|
+
if (parents.added.length)
|
|
578
|
+
push('minor', `${path}.parents`, `parent edge added: ${parents.added.join(', ')}`);
|
|
579
|
+
for (const k of ['key', 'primaryKey']) {
|
|
580
|
+
if (canon(b[k], false) !== canon(h[k], false))
|
|
581
|
+
push('major', `${path}.${k}`, `${k} changed`);
|
|
582
|
+
}
|
|
583
|
+
for (const k of ['archive', 'trash']) {
|
|
584
|
+
if (b[k] === undefined && h[k] !== undefined)
|
|
585
|
+
push('minor', `${path}.${k}`, `${k} declared`);
|
|
586
|
+
else if (b[k] !== undefined && h[k] === undefined)
|
|
587
|
+
push('major', `${path}.${k}`, `${k} no longer declared`);
|
|
588
|
+
// Its permission, its purge horizon or its purge floor: each decides who loses what, when.
|
|
589
|
+
else if (canon(b[k], false) !== canon(h[k], false)) {
|
|
590
|
+
push('major', `${path}.${k}`, `${k} terms changed from ${canon(b[k], false)} to ${canon(h[k], false)}`);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
// Columns the kernel fills: a new one is a fact added, a dropped or re-pointed one is taken away.
|
|
594
|
+
keyed(recordOf(b.stamps), recordOf(h.stamps), {
|
|
595
|
+
removed: (col) => push('major', `${path}.stamps.${col}`, 'no longer stamped'),
|
|
596
|
+
added: (col) => push('minor', `${path}.stamps.${col}`, 'stamped by the kernel'),
|
|
597
|
+
both: (col, bs, hs) => {
|
|
598
|
+
if (bs !== hs)
|
|
599
|
+
push('major', `${path}.stamps.${col}`, `stamp changed from ${String(bs)} to ${String(hs)}`);
|
|
600
|
+
},
|
|
601
|
+
});
|
|
602
|
+
// Who wrote a field's text: a declaration about provenance, which keeps the field off events.
|
|
603
|
+
const outside = setDiff(b.outsideText, h.outsideText);
|
|
604
|
+
if (outside.added.length || outside.removed.length) {
|
|
605
|
+
push('minor', `${path}.outsideText`, `outside-written text: +[${outside.added.join(', ')}] -[${outside.removed.join(', ')}]`);
|
|
606
|
+
}
|
|
607
|
+
for (const k of [...new Set([...Object.keys(b), ...Object.keys(h)])].sort()) {
|
|
608
|
+
if (!ENTITY_KEYS.has(k))
|
|
609
|
+
wholeValue(push, `${path}.${k}`, b[k], h[k]);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
const LIFECYCLE_KEYS = new Set(['field', 'initial', 'states']);
|
|
613
|
+
const STATE_KEYS = new Set(['on', 'allow', 'terminal']);
|
|
614
|
+
function classifyLifecycle(push, path, b, h) {
|
|
615
|
+
if (b.field !== h.field)
|
|
616
|
+
push('major', `${path}.field`, `state field changed from ${String(b.field)} to ${String(h.field)}`);
|
|
617
|
+
if (b.initial !== h.initial)
|
|
618
|
+
push('major', `${path}.initial`, `initial state changed from ${String(b.initial)} to ${String(h.initial)}`);
|
|
619
|
+
keyed(recordOf(b.states), recordOf(h.states), {
|
|
620
|
+
removed: (s) => push('major', `${path}.states.${s}`, 'state removed'),
|
|
621
|
+
added: (s) => push('minor', `${path}.states.${s}`, 'state added'),
|
|
622
|
+
both: (s, bs, hs) => {
|
|
623
|
+
const at = `${path}.states.${s}`;
|
|
624
|
+
const bS = recordOf(bs);
|
|
625
|
+
const hS = recordOf(hs);
|
|
626
|
+
keyed(recordOf(bS.on), recordOf(hS.on), {
|
|
627
|
+
removed: (op) => push('major', `${at}.on.${op}`, 'transition removed'),
|
|
628
|
+
added: (op) => push('minor', `${at}.on.${op}`, 'transition added'),
|
|
629
|
+
both: (op, bt, ht) => {
|
|
630
|
+
if (bt !== ht)
|
|
631
|
+
push('major', `${at}.on.${op}`, `now leads to ${String(ht)} instead of ${String(bt)}`);
|
|
632
|
+
},
|
|
633
|
+
});
|
|
634
|
+
const allow = setDiff(bS.allow, hS.allow);
|
|
635
|
+
if (allow.removed.length)
|
|
636
|
+
push('major', `${at}.allow`, `no longer allowed here: ${allow.removed.join(', ')}`);
|
|
637
|
+
if (allow.added.length)
|
|
638
|
+
push('minor', `${at}.allow`, `now allowed here: ${allow.added.join(', ')}`);
|
|
639
|
+
if (!!bS.terminal !== !!hS.terminal) {
|
|
640
|
+
push(hS.terminal ? 'major' : 'minor', `${at}.terminal`, hS.terminal ? 'became terminal' : 'is no longer terminal');
|
|
641
|
+
}
|
|
642
|
+
for (const k of [...new Set([...Object.keys(bS), ...Object.keys(hS)])].sort()) {
|
|
643
|
+
if (!STATE_KEYS.has(k))
|
|
644
|
+
wholeValue(push, `${at}.${k}`, bS[k], hS[k]);
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
});
|
|
648
|
+
for (const k of [...new Set([...Object.keys(b), ...Object.keys(h)])].sort()) {
|
|
649
|
+
if (!LIFECYCLE_KEYS.has(k))
|
|
650
|
+
wholeValue(push, `${path}.${k}`, b[k], h[k]);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
// ─── openapi.json ─────────────────────────────────────────────────────────────────────────────
|
|
654
|
+
const METHODS = ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'];
|
|
655
|
+
/** Operation keys that only describe it. `operationId` is NOT one: a generated client is named by it. */
|
|
656
|
+
const OP_DOCS = new Set(['summary', 'description', 'tags', 'externalDocs', 'deprecated']);
|
|
657
|
+
const OP_KEYS = new Set([...OP_DOCS, 'parameters', 'requestBody', 'responses', 'operationId']);
|
|
658
|
+
export function classifyOpenApi(baseText, headText) {
|
|
659
|
+
const out = [];
|
|
660
|
+
const base = parseJson(baseText, 'openapi.json (base)');
|
|
661
|
+
const head = parseJson(headText, 'openapi.json');
|
|
662
|
+
if (presence('openapi', base, head, out))
|
|
663
|
+
return classification(out);
|
|
664
|
+
const push = pusher('openapi', out);
|
|
665
|
+
const b = base;
|
|
666
|
+
const h = head;
|
|
667
|
+
/** Each operation, refs resolved, plus whatever else a path item carries (path-level parameters). */
|
|
668
|
+
const surface = (doc) => {
|
|
669
|
+
const ops = {};
|
|
670
|
+
const extras = {};
|
|
671
|
+
for (const [p, item] of Object.entries(recordOf(doc.paths))) {
|
|
672
|
+
for (const [m, op] of Object.entries(recordOf(resolveRefs(item, doc)))) {
|
|
673
|
+
if (METHODS.includes(m))
|
|
674
|
+
ops[`${m.toUpperCase()} ${p}`] = recordOf(resolveRefs(op, doc));
|
|
675
|
+
else
|
|
676
|
+
(extras[p] ??= {})[m] = op;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
return { ops, extras };
|
|
680
|
+
};
|
|
681
|
+
const bs = surface(b);
|
|
682
|
+
const hs = surface(h);
|
|
683
|
+
keyed(bs.ops, hs.ops, {
|
|
684
|
+
removed: (op) => push('major', op, 'operation removed'),
|
|
685
|
+
added: (op) => push('minor', op, 'operation added'),
|
|
686
|
+
both: (op, bo, ho) => classifyOperation(push, op, bo, ho),
|
|
687
|
+
});
|
|
688
|
+
for (const p of [...new Set([...Object.keys(bs.extras), ...Object.keys(hs.extras)])].sort()) {
|
|
689
|
+
wholeValue(push, p, bs.extras[p], hs.extras[p]);
|
|
690
|
+
}
|
|
691
|
+
// `info` describes the document. `paths` was judged above, and `components` is judged where
|
|
692
|
+
// it is referenced (an unreferenced component reaches no caller), except its security schemes,
|
|
693
|
+
// which change how every call authenticates.
|
|
694
|
+
if (canon(b.info, false) !== canon(h.info, false))
|
|
695
|
+
push('patch', 'info', 'documentation only');
|
|
696
|
+
wholeValue(push, 'components.securitySchemes', recordOf(b.components).securitySchemes, recordOf(h.components).securitySchemes);
|
|
697
|
+
for (const k of [...new Set([...Object.keys(b), ...Object.keys(h)])].sort()) {
|
|
698
|
+
if (k === 'paths' || k === 'components' || k === 'info')
|
|
699
|
+
continue;
|
|
700
|
+
wholeValue(push, k, b[k], h[k]);
|
|
701
|
+
}
|
|
702
|
+
return classification(out);
|
|
703
|
+
}
|
|
704
|
+
function classifyOperation(push, op, b, h) {
|
|
705
|
+
if (b.operationId !== h.operationId) {
|
|
706
|
+
push('major', `${op} operationId`, `renamed from ${String(b.operationId)} to ${String(h.operationId)}`);
|
|
707
|
+
}
|
|
708
|
+
for (const k of OP_DOCS) {
|
|
709
|
+
if (canon(b[k], false) !== canon(h[k], false))
|
|
710
|
+
push('patch', `${op} ${k}`, 'documentation only');
|
|
711
|
+
}
|
|
712
|
+
// Parameters, keyed by where they travel and their name.
|
|
713
|
+
const params = (o) => {
|
|
714
|
+
const found = {};
|
|
715
|
+
for (const p of Array.isArray(o.parameters) ? o.parameters : []) {
|
|
716
|
+
const r = recordOf(p);
|
|
717
|
+
found[`${String(r.in)} ${String(r.name)}`] = r;
|
|
718
|
+
}
|
|
719
|
+
return found;
|
|
720
|
+
};
|
|
721
|
+
keyed(params(b), params(h), {
|
|
722
|
+
removed: (p) => push('major', `${op} parameter ${p}`, 'removed'),
|
|
723
|
+
added: (p, hp) => hp.required === true
|
|
724
|
+
? push('major', `${op} parameter ${p}`, 'added as required — a caller that omits it is refused')
|
|
725
|
+
: push('minor', `${op} parameter ${p}`, 'added'),
|
|
726
|
+
both: (p, bp, hp) => {
|
|
727
|
+
const at = `${op} parameter ${p}`;
|
|
728
|
+
if (!!bp.required !== !!hp.required)
|
|
729
|
+
push(hp.required ? 'major' : 'minor', at, hp.required ? 'is now required' : 'is now optional');
|
|
730
|
+
compareSchema(push, 'input', at, bp.schema, hp.schema);
|
|
731
|
+
const { schema: _a, required: _b, ...bRest } = bp;
|
|
732
|
+
const { schema: _c, required: _d, ...hRest } = hp;
|
|
733
|
+
wholeValue(push, at, bRest, hRest);
|
|
734
|
+
},
|
|
735
|
+
});
|
|
736
|
+
// The request body: what the caller sends.
|
|
737
|
+
const bb = b.requestBody === undefined ? undefined : recordOf(b.requestBody);
|
|
738
|
+
const hb = h.requestBody === undefined ? undefined : recordOf(h.requestBody);
|
|
739
|
+
const body = `${op} requestBody`;
|
|
740
|
+
if (bb && !hb)
|
|
741
|
+
push('major', body, 'removed');
|
|
742
|
+
else if (!bb && hb)
|
|
743
|
+
push(hb.required ? 'major' : 'minor', body, hb.required ? 'added as required' : 'added');
|
|
744
|
+
else if (bb && hb) {
|
|
745
|
+
if (!!bb.required !== !!hb.required)
|
|
746
|
+
push(hb.required ? 'major' : 'minor', body, hb.required ? 'is now required' : 'is now optional');
|
|
747
|
+
classifyContent(push, 'input', body, bb.content, hb.content);
|
|
748
|
+
const { content: _a, required: _b, ...bRest } = bb;
|
|
749
|
+
const { content: _c, required: _d, ...hRest } = hb;
|
|
750
|
+
wholeValue(push, body, bRest, hRest);
|
|
751
|
+
}
|
|
752
|
+
// Responses: what the caller reads.
|
|
753
|
+
keyed(recordOf(b.responses), recordOf(h.responses), {
|
|
754
|
+
removed: (status) => push('major', `${op} ${status}`, 'response removed'),
|
|
755
|
+
added: (status) => push('minor', `${op} ${status}`, 'response added'),
|
|
756
|
+
both: (status, br, hr) => {
|
|
757
|
+
const at = `${op} ${status}`;
|
|
758
|
+
const bR = recordOf(br);
|
|
759
|
+
const hR = recordOf(hr);
|
|
760
|
+
classifyContent(push, 'output', at, bR.content, hR.content);
|
|
761
|
+
const { content: _a, ...bRest } = bR;
|
|
762
|
+
const { content: _b, ...hRest } = hR;
|
|
763
|
+
wholeValue(push, at, bRest, hRest);
|
|
764
|
+
},
|
|
765
|
+
});
|
|
766
|
+
for (const k of [...new Set([...Object.keys(b), ...Object.keys(h)])].sort()) {
|
|
767
|
+
if (!OP_KEYS.has(k))
|
|
768
|
+
wholeValue(push, `${op} ${k}`, b[k], h[k]);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
function classifyContent(push, dir, at, base, head) {
|
|
772
|
+
keyed(recordOf(base), recordOf(head), {
|
|
773
|
+
removed: (type) => push('major', `${at} ${type}`, 'media type removed'),
|
|
774
|
+
added: (type) => push('minor', `${at} ${type}`, 'media type added'),
|
|
775
|
+
both: (type, bm, hm) => {
|
|
776
|
+
const bM = recordOf(bm);
|
|
777
|
+
const hM = recordOf(hm);
|
|
778
|
+
compareSchema(push, dir, `${at} ${type}`, bM.schema, hM.schema);
|
|
779
|
+
const { schema: _a, ...bRest } = bM;
|
|
780
|
+
const { schema: _b, ...hRest } = hM;
|
|
781
|
+
wholeValue(push, `${at} ${type}`, bRest, hRest);
|
|
782
|
+
},
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* Sections whose content is derived from, or says nothing beyond, the ones read above: §3
|
|
787
|
+
* Coverage is §2 inverted, and the "not covered" notes are prose about the artifact itself.
|
|
788
|
+
*/
|
|
789
|
+
const DERIVED_SECTIONS = [/^Coverage\b/, /^Not covered by this artifact/, /^No permission surface/];
|
|
790
|
+
const codesIn = (cell) => [...cell.matchAll(/`([^`]+)`/g)].map((m) => m[1]).sort();
|
|
791
|
+
function rowsOf(section) {
|
|
792
|
+
const rows = [];
|
|
793
|
+
for (const line of section.split('\n')) {
|
|
794
|
+
const t = line.trim();
|
|
795
|
+
if (!t.startsWith('|'))
|
|
796
|
+
continue;
|
|
797
|
+
// Split on UNESCAPED pipes, and unescape the rest: a declared reason may carry `\|` (#2384),
|
|
798
|
+
// and model-view's reader honours the escape the same way, so the two read one row alike.
|
|
799
|
+
const cells = t
|
|
800
|
+
.replace(/^\|/, '')
|
|
801
|
+
.replace(/(?<!\\)\|$/, '')
|
|
802
|
+
.split(/(?<!\\)\|/)
|
|
803
|
+
.map((c) => c.trim().replace(/\\\|/g, '|'));
|
|
804
|
+
if (cells.every((c) => /^:?-+:?$/.test(c)))
|
|
805
|
+
continue; // the separator
|
|
806
|
+
rows.push(cells);
|
|
807
|
+
}
|
|
808
|
+
return rows.slice(1); // the header row
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Parse a `PERMISSIONS.md` that `tools/permission-diff.mts` emitted. Sections are found by
|
|
812
|
+
* their heading's words, not their number: the numbering shifts with which sections a vertical
|
|
813
|
+
* has (§4 is grant shapes in one file and "not covered" in another). They are split by
|
|
814
|
+
* model-view's `permissionsSections`, so each table here is the one model-view reads under the
|
|
815
|
+
* same heading; a sub-section no branch below claims is judged whole, like an unknown section.
|
|
816
|
+
*/
|
|
817
|
+
export function parsePermissions(text) {
|
|
818
|
+
const snap = {
|
|
819
|
+
registry: {},
|
|
820
|
+
roles: {},
|
|
821
|
+
systemRoles: {},
|
|
822
|
+
grantShapes: {},
|
|
823
|
+
schedules: {},
|
|
824
|
+
peers: {},
|
|
825
|
+
delegations: {},
|
|
826
|
+
unread: {},
|
|
827
|
+
};
|
|
828
|
+
for (const section of permissionsSections(text)) {
|
|
829
|
+
const { title: heading, body } = section;
|
|
830
|
+
let unclaimed = section.subsections;
|
|
831
|
+
// The FIRST code span names the row: a schedule's cell reads "`op` — purges a trashed `list`".
|
|
832
|
+
const firstKey = (cells) => /`([^`]+)`/.exec(cells[0] ?? '')?.[1] ?? cells[0] ?? '';
|
|
833
|
+
if (/^Registry\b/.test(heading)) {
|
|
834
|
+
const read = readRegistryTable(body);
|
|
835
|
+
if ('unreadable' in read)
|
|
836
|
+
snap.registryUnreadable = read.unreadable;
|
|
837
|
+
else
|
|
838
|
+
for (const r of read.rows)
|
|
839
|
+
snap.registry[r.key] = { terms: [...r.terms], reserved: r.reserved };
|
|
840
|
+
}
|
|
841
|
+
else if (/^Roles\b/.test(heading)) {
|
|
842
|
+
const read = readRolesSection(section);
|
|
843
|
+
for (const r of read.roles)
|
|
844
|
+
snap.roles[r.role] = [...r.keys].sort();
|
|
845
|
+
for (const r of read.systemRoles)
|
|
846
|
+
snap.systemRoles[r.role] = [...r.keys].sort();
|
|
847
|
+
unclaimed = read.unknown;
|
|
848
|
+
}
|
|
849
|
+
else if (/^Entity-narrowed grant shapes\b/.test(heading)) {
|
|
850
|
+
for (const cells of rowsOf(body))
|
|
851
|
+
snap.grantShapes[firstKey(cells)] = { keys: codesIn(cells[1] ?? ''), terms: cells.slice(2) };
|
|
852
|
+
}
|
|
853
|
+
else if (/^Scheduled work\b/.test(heading)) {
|
|
854
|
+
// | Operation | Cadence | System principal | Permissions |
|
|
855
|
+
for (const cells of rowsOf(body)) {
|
|
856
|
+
snap.schedules[firstKey(cells)] = { keys: codesIn(cells[cells.length - 1] ?? ''), terms: cells.slice(0, -1) };
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
else if (/^Other verticals\b/.test(heading)) {
|
|
860
|
+
// | Vertical | Declared by | May invoke | Holds | — one row per declaring module, so the
|
|
861
|
+
// entry is named by both: two modules naming one vertical are two declarations.
|
|
862
|
+
for (const cells of rowsOf(body)) {
|
|
863
|
+
snap.peers[`${firstKey(cells)} (declared by ${firstKey(cells.slice(1))})`] = {
|
|
864
|
+
keys: codesIn(cells[cells.length - 1] ?? ''),
|
|
865
|
+
terms: cells.slice(2, -1),
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
else if (/^Delegations\b/.test(heading)) {
|
|
870
|
+
// | Actor | Declared by | May act with | Channels | — one row per declaring module, named by both, as a peer's is.
|
|
871
|
+
for (const cells of rowsOf(body)) {
|
|
872
|
+
snap.delegations[`${firstKey(cells)} (declared by ${firstKey(cells.slice(1))})`] = {
|
|
873
|
+
keys: codesIn(cells[2] ?? ''),
|
|
874
|
+
channels: codesIn(cells[3] ?? ''),
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
else if (/^Operations\b/.test(heading)) {
|
|
879
|
+
// | Operation | Key | Checked on | Declared by | — the key cell's prose ("checked in code,
|
|
880
|
+
// not declared") is a term, so an operation losing its declaration is still a change.
|
|
881
|
+
const why = operationsTableProblem(body);
|
|
882
|
+
if (why !== undefined) {
|
|
883
|
+
snap.operationsUnreadable = why;
|
|
884
|
+
}
|
|
885
|
+
else {
|
|
886
|
+
const ops = {};
|
|
887
|
+
for (const cells of rowsOf(body))
|
|
888
|
+
ops[firstKey(cells)] = { keys: codesIn(cells[1] ?? ''), terms: cells.slice(1) };
|
|
889
|
+
snap.operations = ops;
|
|
890
|
+
snap.operationsUnknownFor = operationsUnknownFor(body);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
else if (!DERIVED_SECTIONS.some((re) => re.test(heading))) {
|
|
894
|
+
snap.unread[heading] = body.trim();
|
|
895
|
+
}
|
|
896
|
+
for (const sub of unclaimed)
|
|
897
|
+
snap.unread[`${heading} › ${sub.title}`] = sub.body.trim();
|
|
898
|
+
}
|
|
899
|
+
return snap;
|
|
900
|
+
}
|
|
901
|
+
export function classifyPermissions(baseText, headText) {
|
|
902
|
+
const out = [];
|
|
903
|
+
if (presence('permissions', baseText, headText, out))
|
|
904
|
+
return classification(out);
|
|
905
|
+
const b = parsePermissions(baseText);
|
|
906
|
+
const h = parsePermissions(headText);
|
|
907
|
+
const push = pusher('permissions', out);
|
|
908
|
+
// Every permission change is at least minor and flagged: the human checkpoint reads both ways.
|
|
909
|
+
const flag = (path, detail) => push('minor', path, detail, true);
|
|
910
|
+
if (b.registryUnreadable !== undefined || h.registryUnreadable !== undefined) {
|
|
911
|
+
const side = h.registryUnreadable !== undefined ? 'now' : 'at the base';
|
|
912
|
+
push('major', 'registry', `section cannot be read ${side} (${h.registryUnreadable ?? b.registryUnreadable}) — judged as breaking`, true);
|
|
913
|
+
}
|
|
914
|
+
else {
|
|
915
|
+
keyed(b.registry, h.registry, {
|
|
916
|
+
removed: (k) => flag(`key ${k}`, 'removed from the registry — whoever held it loses what it gated'),
|
|
917
|
+
added: (k, hd) => flag(`key ${k}`, hd.reserved ? 'added to the registry, reserved to a system principal' : 'added to the registry'),
|
|
918
|
+
both: (k, bd, hd) => {
|
|
919
|
+
if (canon(bd.terms, false) !== canon(hd.terms, false))
|
|
920
|
+
push('patch', `key ${k}`, 'description or declaring module changed');
|
|
921
|
+
// Reserved to a system principal means no person may be given the key: losing that widens
|
|
922
|
+
// who may hold it, as a role gaining a key does, and gaining it narrows.
|
|
923
|
+
if (!bd.reserved && hd.reserved)
|
|
924
|
+
flag(`key ${k}`, "now reserved to a system principal — narrowing: no person's role or grant shape may hold it");
|
|
925
|
+
if (bd.reserved && !hd.reserved)
|
|
926
|
+
flag(`key ${k}`, "no longer reserved to a system principal — widening: a person's role or grant shape may now hold it");
|
|
927
|
+
},
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
const holders = (what, base, head) => keyed(base, head, {
|
|
931
|
+
removed: (name, keys) => flag(`${what} ${name}`, `removed (held: ${keys.join(', ') || 'nothing'}) — narrowing`),
|
|
932
|
+
added: (name, keys) => flag(`${what} ${name}`, `added (holds: ${keys.join(', ') || 'nothing'}) — widening`),
|
|
933
|
+
both: (name, bk, hk) => {
|
|
934
|
+
const d = setDiff(bk, hk);
|
|
935
|
+
if (d.removed.length)
|
|
936
|
+
flag(`${what} ${name}`, `no longer holds ${d.removed.join(', ')} — narrowing`);
|
|
937
|
+
if (d.added.length)
|
|
938
|
+
flag(`${what} ${name}`, `now holds ${d.added.join(', ')} — widening`);
|
|
939
|
+
},
|
|
940
|
+
});
|
|
941
|
+
holders('role', b.roles, h.roles);
|
|
942
|
+
// A platform host's standing principal is ranked as a person's role is: what it may do is the
|
|
943
|
+
// keys shown, so it gaining one widens, and a key leaving it for a person's role is that role's
|
|
944
|
+
// widening, each flagged.
|
|
945
|
+
holders('system-held role', b.systemRoles, h.systemRoles);
|
|
946
|
+
const keysOf = (m) => Object.fromEntries(Object.entries(m).map(([k, v]) => [k, v.keys]));
|
|
947
|
+
holders('entity grant shape', keysOf(b.grantShapes), keysOf(h.grantShapes));
|
|
948
|
+
holders('scheduled operation', keysOf(b.schedules), keysOf(h.schedules));
|
|
949
|
+
// Another vertical of the tenant is ranked as a role is: what it may do here is the keys shown.
|
|
950
|
+
holders('peer vertical', keysOf(b.peers), keysOf(h.peers));
|
|
951
|
+
for (const [what, bm, hm] of [
|
|
952
|
+
['entity grant shape', b.grantShapes, h.grantShapes],
|
|
953
|
+
['scheduled operation', b.schedules, h.schedules],
|
|
954
|
+
['peer vertical', b.peers, h.peers],
|
|
955
|
+
]) {
|
|
956
|
+
for (const name of Object.keys(bm)) {
|
|
957
|
+
if (name in hm && canon(bm[name].terms, false) !== canon(hm[name].terms, false)) {
|
|
958
|
+
flag(`${what} ${name}`, 'its terms changed (how it is given, bound or scheduled, or what it may invoke)');
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
// #3161: another app acting for the people here. Gaining a key or a channel widens what it may do
|
|
963
|
+
// as them, flagged minor like any widening. Losing one, or the delegation going, breaks the app
|
|
964
|
+
// that acts: its calls are refused from the next promote, so that is major.
|
|
965
|
+
keyed(b.delegations, h.delegations, {
|
|
966
|
+
removed: (name, d) => push('major', `delegation ${name}`, `removed (acted with: ${d.keys.join(', ')}) — the acting app's calls are refused`, true),
|
|
967
|
+
added: (name, d) => flag(`delegation ${name}`, `added (may act with: ${d.keys.join(', ')}; over ${d.channels.join(', ')}) — widening`),
|
|
968
|
+
both: (name, bd, hd) => {
|
|
969
|
+
const keys = setDiff(bd.keys, hd.keys);
|
|
970
|
+
const channels = setDiff(bd.channels, hd.channels);
|
|
971
|
+
if (keys.removed.length)
|
|
972
|
+
push('major', `delegation ${name}`, `may no longer act with ${keys.removed.join(', ')} — the acting app's calls with it are refused`, true);
|
|
973
|
+
if (channels.removed.length)
|
|
974
|
+
push('major', `delegation ${name}`, `no longer over ${channels.removed.join(', ')} — the acting app's calls over it are refused`, true);
|
|
975
|
+
if (keys.added.length)
|
|
976
|
+
flag(`delegation ${name}`, `may now act with ${keys.added.join(', ')} — widening`);
|
|
977
|
+
if (channels.added.length)
|
|
978
|
+
flag(`delegation ${name}`, `now over ${channels.added.join(', ')} — widening`);
|
|
979
|
+
},
|
|
980
|
+
});
|
|
981
|
+
// #2384: which key each operation checks. An operation moved to another key, or checked on
|
|
982
|
+
// something else, is a permission change the checkpoint reads — never an unread section.
|
|
983
|
+
if (b.operationsUnreadable !== undefined || h.operationsUnreadable !== undefined) {
|
|
984
|
+
const side = h.operationsUnreadable !== undefined ? 'now' : 'at the base';
|
|
985
|
+
push('major', 'operations', `section cannot be read ${side} (${h.operationsUnreadable ?? b.operationsUnreadable}) — judged as breaking`, true);
|
|
986
|
+
}
|
|
987
|
+
else if (b.operations && h.operations) {
|
|
988
|
+
// A module whose operations stop or start being knowable: what it lets anyone do is no longer,
|
|
989
|
+
// or now for the first time, in the artifact — either way the checkpoint reads it.
|
|
990
|
+
const unknown = setDiff(b.operationsUnknownFor ?? [], h.operationsUnknownFor ?? []);
|
|
991
|
+
for (const m of unknown.removed)
|
|
992
|
+
flag(`operations of ${m}`, 'now known (it registers its operation map)');
|
|
993
|
+
for (const m of unknown.added)
|
|
994
|
+
flag(`operations of ${m}`, 'no longer known (registered as a bare manifest)');
|
|
995
|
+
keyed(b.operations, h.operations, {
|
|
996
|
+
removed: (op, o) => flag(`operation ${op}`, `removed (checked: ${o.keys.join(', ') || 'no declared key'})`),
|
|
997
|
+
added: (op, o) => flag(`operation ${op}`, `added (checks: ${o.keys.join(', ') || 'no declared key'})`),
|
|
998
|
+
both: (op, bo, ho) => {
|
|
999
|
+
if (canon(bo.keys, false) !== canon(ho.keys, false)) {
|
|
1000
|
+
flag(`operation ${op}`, `now checks ${ho.keys.join(', ') || 'no declared key'} (was ${bo.keys.join(', ') || 'no declared key'})`);
|
|
1001
|
+
}
|
|
1002
|
+
else if (canon(bo.terms, false) !== canon(ho.terms, false)) {
|
|
1003
|
+
flag(`operation ${op}`, 'its check changed (what it narrows to, or whether it is declared)');
|
|
1004
|
+
}
|
|
1005
|
+
},
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
else if (h.operations) {
|
|
1009
|
+
// The base's emitter had no such section: nothing to compare, and nothing about an operation moved.
|
|
1010
|
+
push('patch', 'operations', 'section added — the artifact now names the key each operation checks');
|
|
1011
|
+
}
|
|
1012
|
+
else if (b.operations) {
|
|
1013
|
+
push('major', 'operations', 'section removed — which key each operation checks can no longer be compared', true);
|
|
1014
|
+
}
|
|
1015
|
+
for (const heading of [...new Set([...Object.keys(b.unread), ...Object.keys(h.unread)])].sort()) {
|
|
1016
|
+
if (b.unread[heading] !== h.unread[heading]) {
|
|
1017
|
+
push('major', `section "${heading}"`, 'changed (not a section this classifier reads, so judged as breaking)', true);
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
if (out.length === 0 && baseText !== headText)
|
|
1021
|
+
push('patch', 'PERMISSIONS.md', 'prose only');
|
|
1022
|
+
return classification(out);
|
|
1023
|
+
}
|
|
1024
|
+
export function classify(base, head) {
|
|
1025
|
+
const changes = [
|
|
1026
|
+
...classifyModel(base.model, head.model).changes,
|
|
1027
|
+
...classifyOpenApi(base.openapi, head.openapi).changes,
|
|
1028
|
+
...classifyPermissions(base.permissions, head.permissions).changes,
|
|
1029
|
+
];
|
|
1030
|
+
return classification(changes);
|
|
1031
|
+
}
|
|
1032
|
+
//# sourceMappingURL=bump.js.map
|
package/dist/bump.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bump.js","sourceRoot":"","sources":["../src/bump.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAqBtB,MAAM,KAAK,GAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAO,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAO,EAAE,CAAO,EAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAS,EAAa,EAAE,CAAE,KAA2B,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAEzF,uEAAuE;AACvE,SAAS,MAAM,CAAC,OAA0B;IACxC,OAAO,OAAO,CAAC,MAAM,CAAO,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,cAAc,GAAG,CAAC,OAAiB,EAAkB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAEnG,iGAAiG;AA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AAO,GAAG,EAAE,sEAAsE,EAAE,IAAI,CAAC,CAAC;QACtH,CAAC;IACH,CAAC;IACD,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,KAAK,QAAQ;QAAE,IAAI,CAAC,OAAO,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;IAC7F,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AAWD,MAAM,UAAU,QAAQ,CAAC,IAAe,EAAE,IAAe;IACvD,MAAM,OAAO,GAAG;QACd,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO;QAChD,GAAG,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO;QACtD,GAAG,mBAAmB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO;KACnE,CAAC;IACF,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@substrat-run/model-view",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Render an emitted Substrat model.json as one self-contained HTML page — the ER diagram, the entity cards, the declared lifecycles",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -16,18 +16,22 @@
|
|
|
16
16
|
".": {
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"default": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./bump": {
|
|
21
|
+
"types": "./dist/bump.d.ts",
|
|
22
|
+
"default": "./dist/bump.js"
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
25
|
"files": [
|
|
22
26
|
"dist"
|
|
23
27
|
],
|
|
24
28
|
"dependencies": {
|
|
25
|
-
"@substrat-run/contracts": "0.
|
|
29
|
+
"@substrat-run/contracts": "0.217.0"
|
|
26
30
|
},
|
|
27
31
|
"devDependencies": {
|
|
28
32
|
"@types/node": "^22.20.5",
|
|
29
33
|
"typescript": "^7.0.0",
|
|
30
|
-
"vitest": "
|
|
34
|
+
"vitest": "5.0.5"
|
|
31
35
|
},
|
|
32
36
|
"publishConfig": {
|
|
33
37
|
"access": "public"
|