autotel-eventcatalog 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +196 -0
- package/CONTRIBUTING.md +212 -0
- package/README.md +307 -0
- package/action.yml +155 -0
- package/dist/cli.cjs +1071 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1065 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +794 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +267 -0
- package/dist/index.d.ts +267 -0
- package/dist/index.js +764 -0
- package/dist/index.js.map +1 -0
- package/docs/CONTRACT.md +280 -0
- package/docs/EXTENDING.md +248 -0
- package/docs/TROUBLESHOOTING.md +220 -0
- package/docs/UPGRADING.md +202 -0
- package/package.json +78 -0
- package/schemas/README.md +44 -0
- package/schemas/drift-report-v0.1.0.json +107 -0
- package/schemas/drift-report-v0.2.0.json +137 -0
- package/schemas/drift-summary-v0.1.0.json +74 -0
- package/schemas/drift-summary-v0.2.0.json +74 -0
- package/schemas/stamp-summary-v0.1.0.json +54 -0
- package/src/__fixtures__/drift-report-all.golden.json +33 -0
- package/src/__fixtures__/drift-summary-clean.golden.json +17 -0
- package/src/__fixtures__/drift-summary-drifty.golden.json +17 -0
- package/src/__fixtures__/stamp-summary-noop.golden.json +10 -0
- package/src/catalog.test.ts +63 -0
- package/src/catalog.ts +169 -0
- package/src/cli.e2e.test.ts +310 -0
- package/src/cli.ts +402 -0
- package/src/contract.test.ts +395 -0
- package/src/diff-vs-base.test.ts +145 -0
- package/src/diff-vs-base.ts +242 -0
- package/src/diff.test.ts +384 -0
- package/src/diff.ts +296 -0
- package/src/index.ts +73 -0
- package/src/policy.test.ts +75 -0
- package/src/policy.ts +41 -0
- package/src/renderers/index.ts +35 -0
- package/src/renderers/json.ts +33 -0
- package/src/renderers/markdown.ts +223 -0
- package/src/renderers/renderers.test.ts +79 -0
- package/src/renderers/terminal.ts +30 -0
- package/src/renderers/types.ts +26 -0
- package/src/report.test.ts +205 -0
- package/src/report.ts +27 -0
- package/src/snapshot.ts +25 -0
- package/src/stamp.test.ts +283 -0
- package/src/stamp.ts +232 -0
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "autotel-eventcatalog",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Diff your autotel architecture snapshot against an EventCatalog and report drift. Same model as Pact, for event architectures.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./cli": {
|
|
16
|
+
"types": "./dist/cli.d.ts",
|
|
17
|
+
"import": "./dist/cli.js",
|
|
18
|
+
"require": "./dist/cli.cjs"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"bin": {
|
|
22
|
+
"autotel-eventcatalog": "./dist/cli.js"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"src",
|
|
27
|
+
"schemas",
|
|
28
|
+
"docs",
|
|
29
|
+
"action.yml",
|
|
30
|
+
"README.md",
|
|
31
|
+
"CHANGELOG.md",
|
|
32
|
+
"CONTRIBUTING.md"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsup",
|
|
36
|
+
"dev": "tsup --watch",
|
|
37
|
+
"lint": "eslint src/**/*.ts",
|
|
38
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
39
|
+
"type-check": "tsc --noEmit",
|
|
40
|
+
"test": "vitest run --exclude **/*.e2e.test.ts",
|
|
41
|
+
"test:e2e": "pnpm build && vitest run cli.e2e",
|
|
42
|
+
"test:watch": "vitest --exclude **/*.e2e.test.ts",
|
|
43
|
+
"clean": "rimraf dist",
|
|
44
|
+
"format": "prettier --write .",
|
|
45
|
+
"format:check": "prettier --check src/**/*.ts",
|
|
46
|
+
"quality": "pnpm type-check && pnpm test && pnpm test:e2e && pnpm lint && pnpm format:check"
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"eventcatalog",
|
|
50
|
+
"opentelemetry",
|
|
51
|
+
"autotel",
|
|
52
|
+
"observability",
|
|
53
|
+
"architecture",
|
|
54
|
+
"drift",
|
|
55
|
+
"contract-testing"
|
|
56
|
+
],
|
|
57
|
+
"author": "Jag Reehal <jag@jagreehal.com> (https://jagreehal.com)",
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "git+https://github.com/jagreehal/autotel.git",
|
|
62
|
+
"directory": "packages/autotel-eventcatalog"
|
|
63
|
+
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"autotel-subscribers": "*"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@types/node": "^25.7.0",
|
|
69
|
+
"autotel-subscribers": "workspace:*",
|
|
70
|
+
"rimraf": "^6.0.1",
|
|
71
|
+
"tsup": "^8.5.1",
|
|
72
|
+
"typescript": "^6.0.3",
|
|
73
|
+
"vitest": "^4.1.6"
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"@eventcatalog/sdk": "^2.21.2"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Published JSON Schemas
|
|
2
|
+
|
|
3
|
+
These files are the **public contract** for `autotel-eventcatalog`'s JSON
|
|
4
|
+
output. Downstream tooling (your own GitHub Actions, dashboards, Slack
|
|
5
|
+
bots, CI scripts) should validate against them.
|
|
6
|
+
|
|
7
|
+
| File | Emitted by | `spec:` value |
|
|
8
|
+
| ---------------------------------------------------------- | ------------------------------- | ------------------------------------------- |
|
|
9
|
+
| [`drift-report-v0.1.0.json`](./drift-report-v0.1.0.json) | `drift --format json` | `autotel-eventcatalog-report/v0.1.0` |
|
|
10
|
+
| [`drift-summary-v0.1.0.json`](./drift-summary-v0.1.0.json) | `drift --summary-output <path>` | `autotel-eventcatalog-drift-summary/v0.1.0` |
|
|
11
|
+
| [`stamp-summary-v0.1.0.json`](./stamp-summary-v0.1.0.json) | `stamp --summary-output <path>` | `autotel-eventcatalog-stamp-summary/v0.1.0` |
|
|
12
|
+
|
|
13
|
+
For consumption examples and the version policy, see
|
|
14
|
+
[`docs/CONTRACT.md`](../docs/CONTRACT.md).
|
|
15
|
+
|
|
16
|
+
## Version policy in one sentence
|
|
17
|
+
|
|
18
|
+
The version segment in each schema's `$id` (`v0.1.0`) follows semver.
|
|
19
|
+
**Minor** bumps add optional fields; **major** bumps break shape. The
|
|
20
|
+
`spec:` field on every emitted envelope is your one-way gate against
|
|
21
|
+
unknown majors.
|
|
22
|
+
|
|
23
|
+
## Validation example
|
|
24
|
+
|
|
25
|
+
These schemas use only standard JSON Schema 2020-12 features, so any
|
|
26
|
+
mainstream validator works:
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import Ajv from 'ajv';
|
|
30
|
+
import schema from 'autotel-eventcatalog/schemas/drift-summary-v0.1.0.json';
|
|
31
|
+
|
|
32
|
+
const ajv = new Ajv();
|
|
33
|
+
const validate = ajv.compile(schema);
|
|
34
|
+
|
|
35
|
+
if (!validate(parsedJson)) {
|
|
36
|
+
throw new Error(`Invalid drift summary: ${ajv.errorsText(validate.errors)}`);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Why these live in the package, not on a CDN
|
|
41
|
+
|
|
42
|
+
So that the schema version you validate against is always exactly the
|
|
43
|
+
version your CLI emitted. `npm` is the source of truth; pin the package
|
|
44
|
+
version and the schemas are pinned with it.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://autotel.dev/schemas/eventcatalog/drift-report/v0.1.0.json",
|
|
4
|
+
"title": "Autotel EventCatalog Drift Report v0.1.0",
|
|
5
|
+
"description": "JSON output of `autotel-eventcatalog drift --format json`. Wraps a DriftReport (mode: all) or a DriftDelta (mode: new-only) in a versioned envelope.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["spec", "mode"],
|
|
8
|
+
"oneOf": [
|
|
9
|
+
{
|
|
10
|
+
"required": ["spec", "mode", "report"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"spec": { "const": "autotel-eventcatalog-report/v0.1.0" },
|
|
13
|
+
"mode": { "const": "all" },
|
|
14
|
+
"report": { "$ref": "#/$defs/DriftReport" }
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"required": ["spec", "mode", "delta"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"spec": { "const": "autotel-eventcatalog-report/v0.1.0" },
|
|
21
|
+
"mode": { "const": "new-only" },
|
|
22
|
+
"delta": { "$ref": "#/$defs/DriftDelta" }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"$defs": {
|
|
27
|
+
"FieldDrift": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"required": ["event", "extra", "missing"],
|
|
30
|
+
"properties": {
|
|
31
|
+
"event": { "type": "string" },
|
|
32
|
+
"extra": { "type": "array", "items": { "type": "string" } },
|
|
33
|
+
"missing": { "type": "array", "items": { "type": "string" } }
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"DriftEntries": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"required": ["events", "services", "channels"],
|
|
39
|
+
"properties": {
|
|
40
|
+
"events": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"required": [
|
|
43
|
+
"observedButUndocumented",
|
|
44
|
+
"documentedButUnseen",
|
|
45
|
+
"fieldDrift"
|
|
46
|
+
],
|
|
47
|
+
"properties": {
|
|
48
|
+
"observedButUndocumented": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": { "type": "string" }
|
|
51
|
+
},
|
|
52
|
+
"documentedButUnseen": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"items": { "type": "string" }
|
|
55
|
+
},
|
|
56
|
+
"fieldDrift": {
|
|
57
|
+
"type": "array",
|
|
58
|
+
"items": { "$ref": "#/$defs/FieldDrift" }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"services": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"required": ["observedButUndocumented"],
|
|
65
|
+
"properties": {
|
|
66
|
+
"observedButUndocumented": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"items": { "type": "string" }
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"channels": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"required": ["observedButUndocumented"],
|
|
75
|
+
"properties": {
|
|
76
|
+
"observedButUndocumented": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"items": { "type": "string" }
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"DriftReport": {
|
|
85
|
+
"allOf": [
|
|
86
|
+
{ "$ref": "#/$defs/DriftEntries" },
|
|
87
|
+
{
|
|
88
|
+
"type": "object",
|
|
89
|
+
"required": ["snapshotGeneratedAt", "snapshotService"],
|
|
90
|
+
"properties": {
|
|
91
|
+
"snapshotGeneratedAt": { "type": "string" },
|
|
92
|
+
"snapshotService": { "type": "string" }
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"DriftDelta": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"required": ["introduced", "resolved", "hasNewDrift"],
|
|
100
|
+
"properties": {
|
|
101
|
+
"introduced": { "$ref": "#/$defs/DriftEntries" },
|
|
102
|
+
"resolved": { "$ref": "#/$defs/DriftEntries" },
|
|
103
|
+
"hasNewDrift": { "type": "boolean" }
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://autotel.dev/schemas/eventcatalog/drift-report/v0.2.0.json",
|
|
4
|
+
"title": "Autotel EventCatalog Drift Report v0.2.0",
|
|
5
|
+
"description": "JSON output of `autotel-eventcatalog drift --format json`. Wraps a DriftReport (mode: all) or a DriftDelta (mode: new-only) in a versioned envelope.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["spec", "mode"],
|
|
8
|
+
"oneOf": [
|
|
9
|
+
{
|
|
10
|
+
"required": ["spec", "mode", "report"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"spec": { "const": "autotel-eventcatalog-report/v0.2.0" },
|
|
13
|
+
"mode": { "const": "all" },
|
|
14
|
+
"report": { "$ref": "#/$defs/DriftReport" }
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"required": ["spec", "mode", "delta"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"spec": { "const": "autotel-eventcatalog-report/v0.2.0" },
|
|
21
|
+
"mode": { "const": "new-only" },
|
|
22
|
+
"delta": { "$ref": "#/$defs/DriftDelta" }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"$defs": {
|
|
27
|
+
"FieldDrift": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"required": ["event", "extra", "missing"],
|
|
30
|
+
"properties": {
|
|
31
|
+
"event": { "type": "string" },
|
|
32
|
+
"extra": { "type": "array", "items": { "type": "string" } },
|
|
33
|
+
"missing": { "type": "array", "items": { "type": "string" } }
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"TypeDrift": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"required": ["event", "path", "declared", "observed"],
|
|
39
|
+
"properties": {
|
|
40
|
+
"event": { "type": "string" },
|
|
41
|
+
"path": { "type": "string" },
|
|
42
|
+
"declared": { "type": "array", "items": { "type": "string" } },
|
|
43
|
+
"observed": { "type": "array", "items": { "type": "string" } }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"ValueDrift": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"required": ["event", "path", "declared", "observed"],
|
|
49
|
+
"properties": {
|
|
50
|
+
"event": { "type": "string" },
|
|
51
|
+
"path": { "type": "string" },
|
|
52
|
+
"declared": { "type": "array", "items": {} },
|
|
53
|
+
"observed": { "type": "array", "items": {} }
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"DriftEntries": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"required": ["events", "services", "channels"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"events": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"required": [
|
|
63
|
+
"observedButUndocumented",
|
|
64
|
+
"documentedButUnseen",
|
|
65
|
+
"fieldDrift",
|
|
66
|
+
"typeDrift",
|
|
67
|
+
"valueDrift"
|
|
68
|
+
],
|
|
69
|
+
"properties": {
|
|
70
|
+
"observedButUndocumented": {
|
|
71
|
+
"type": "array",
|
|
72
|
+
"items": { "type": "string" }
|
|
73
|
+
},
|
|
74
|
+
"documentedButUnseen": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": { "type": "string" }
|
|
77
|
+
},
|
|
78
|
+
"fieldDrift": {
|
|
79
|
+
"type": "array",
|
|
80
|
+
"items": { "$ref": "#/$defs/FieldDrift" }
|
|
81
|
+
},
|
|
82
|
+
"typeDrift": {
|
|
83
|
+
"type": "array",
|
|
84
|
+
"items": { "$ref": "#/$defs/TypeDrift" }
|
|
85
|
+
},
|
|
86
|
+
"valueDrift": {
|
|
87
|
+
"type": "array",
|
|
88
|
+
"items": { "$ref": "#/$defs/ValueDrift" }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"services": {
|
|
93
|
+
"type": "object",
|
|
94
|
+
"required": ["observedButUndocumented"],
|
|
95
|
+
"properties": {
|
|
96
|
+
"observedButUndocumented": {
|
|
97
|
+
"type": "array",
|
|
98
|
+
"items": { "type": "string" }
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"channels": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"required": ["observedButUndocumented"],
|
|
105
|
+
"properties": {
|
|
106
|
+
"observedButUndocumented": {
|
|
107
|
+
"type": "array",
|
|
108
|
+
"items": { "type": "string" }
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"DriftReport": {
|
|
115
|
+
"allOf": [
|
|
116
|
+
{ "$ref": "#/$defs/DriftEntries" },
|
|
117
|
+
{
|
|
118
|
+
"type": "object",
|
|
119
|
+
"required": ["snapshotGeneratedAt", "snapshotService"],
|
|
120
|
+
"properties": {
|
|
121
|
+
"snapshotGeneratedAt": { "type": "string" },
|
|
122
|
+
"snapshotService": { "type": "string" }
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"DriftDelta": {
|
|
128
|
+
"type": "object",
|
|
129
|
+
"required": ["introduced", "resolved", "hasNewDrift"],
|
|
130
|
+
"properties": {
|
|
131
|
+
"introduced": { "$ref": "#/$defs/DriftEntries" },
|
|
132
|
+
"resolved": { "$ref": "#/$defs/DriftEntries" },
|
|
133
|
+
"hasNewDrift": { "type": "boolean" }
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://autotel.dev/schemas/eventcatalog/drift-summary/v0.1.0.json",
|
|
4
|
+
"title": "Autotel EventCatalog Drift Summary v0.1.0",
|
|
5
|
+
"description": "Machine-readable summary written by `autotel-eventcatalog drift --summary-output`. Downstream tooling (GitHub Actions, dashboards, Slack bots) should read this. Major-version bumps are breaking; minor-version bumps add optional fields only.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["spec", "mode", "shouldFail", "reason", "counts"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"spec": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"const": "autotel-eventcatalog-drift-summary/v0.1.0"
|
|
13
|
+
},
|
|
14
|
+
"mode": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"enum": ["all", "new-only"],
|
|
17
|
+
"description": "Which policy was applied. `all` = fail on any drift; `new-only` = fail only on drift introduced vs a baseline snapshot."
|
|
18
|
+
},
|
|
19
|
+
"shouldFail": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"description": "True iff the configured policy considers the current state a CI failure."
|
|
22
|
+
},
|
|
23
|
+
"reason": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Short human-readable line explaining why shouldFail is what it is."
|
|
26
|
+
},
|
|
27
|
+
"counts": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"required": [
|
|
30
|
+
"total",
|
|
31
|
+
"observedButUndocumentedEvents",
|
|
32
|
+
"documentedButUnseenEvents",
|
|
33
|
+
"fieldDriftEvents",
|
|
34
|
+
"fieldDriftPaths",
|
|
35
|
+
"typeDriftPaths",
|
|
36
|
+
"valueDriftPaths",
|
|
37
|
+
"undocumentedServices",
|
|
38
|
+
"undocumentedChannels"
|
|
39
|
+
],
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"properties": {
|
|
42
|
+
"total": {
|
|
43
|
+
"type": "integer",
|
|
44
|
+
"minimum": 0,
|
|
45
|
+
"description": "Sum of all individual drift findings. Matches the dashboard's `drift findings` badge."
|
|
46
|
+
},
|
|
47
|
+
"observedButUndocumentedEvents": { "type": "integer", "minimum": 0 },
|
|
48
|
+
"documentedButUnseenEvents": { "type": "integer", "minimum": 0 },
|
|
49
|
+
"fieldDriftEvents": {
|
|
50
|
+
"type": "integer",
|
|
51
|
+
"minimum": 0,
|
|
52
|
+
"description": "Distinct events with at least one field-path mismatch."
|
|
53
|
+
},
|
|
54
|
+
"fieldDriftPaths": {
|
|
55
|
+
"type": "integer",
|
|
56
|
+
"minimum": 0,
|
|
57
|
+
"description": "Sum of extra + missing field paths across every event with field drift."
|
|
58
|
+
},
|
|
59
|
+
"typeDriftPaths": {
|
|
60
|
+
"type": "integer",
|
|
61
|
+
"minimum": 0,
|
|
62
|
+
"description": "Count of field paths where observed runtime types do not match declared schema types."
|
|
63
|
+
},
|
|
64
|
+
"valueDriftPaths": {
|
|
65
|
+
"type": "integer",
|
|
66
|
+
"minimum": 0,
|
|
67
|
+
"description": "Count of field paths where observed primitive values fall outside declared enum values."
|
|
68
|
+
},
|
|
69
|
+
"undocumentedServices": { "type": "integer", "minimum": 0 },
|
|
70
|
+
"undocumentedChannels": { "type": "integer", "minimum": 0 }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://autotel.dev/schemas/eventcatalog/drift-summary/v0.2.0.json",
|
|
4
|
+
"title": "Autotel EventCatalog Drift Summary v0.2.0",
|
|
5
|
+
"description": "Machine-readable summary written by `autotel-eventcatalog drift --summary-output`. Downstream tooling (GitHub Actions, dashboards, Slack bots) should read this. Major-version bumps are breaking; minor-version bumps add optional fields only.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["spec", "mode", "shouldFail", "reason", "counts"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"spec": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"const": "autotel-eventcatalog-drift-summary/v0.2.0"
|
|
13
|
+
},
|
|
14
|
+
"mode": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"enum": ["all", "new-only"],
|
|
17
|
+
"description": "Which policy was applied. `all` = fail on any drift; `new-only` = fail only on drift introduced vs a baseline snapshot."
|
|
18
|
+
},
|
|
19
|
+
"shouldFail": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"description": "True iff the configured policy considers the current state a CI failure."
|
|
22
|
+
},
|
|
23
|
+
"reason": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Short human-readable line explaining why shouldFail is what it is."
|
|
26
|
+
},
|
|
27
|
+
"counts": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"required": [
|
|
30
|
+
"total",
|
|
31
|
+
"observedButUndocumentedEvents",
|
|
32
|
+
"documentedButUnseenEvents",
|
|
33
|
+
"fieldDriftEvents",
|
|
34
|
+
"fieldDriftPaths",
|
|
35
|
+
"typeDriftPaths",
|
|
36
|
+
"valueDriftPaths",
|
|
37
|
+
"undocumentedServices",
|
|
38
|
+
"undocumentedChannels"
|
|
39
|
+
],
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"properties": {
|
|
42
|
+
"total": {
|
|
43
|
+
"type": "integer",
|
|
44
|
+
"minimum": 0,
|
|
45
|
+
"description": "Sum of all individual drift findings. Matches the dashboard's `drift findings` badge."
|
|
46
|
+
},
|
|
47
|
+
"observedButUndocumentedEvents": { "type": "integer", "minimum": 0 },
|
|
48
|
+
"documentedButUnseenEvents": { "type": "integer", "minimum": 0 },
|
|
49
|
+
"fieldDriftEvents": {
|
|
50
|
+
"type": "integer",
|
|
51
|
+
"minimum": 0,
|
|
52
|
+
"description": "Distinct events with at least one field-path mismatch."
|
|
53
|
+
},
|
|
54
|
+
"fieldDriftPaths": {
|
|
55
|
+
"type": "integer",
|
|
56
|
+
"minimum": 0,
|
|
57
|
+
"description": "Sum of extra + missing field paths across every event with field drift."
|
|
58
|
+
},
|
|
59
|
+
"typeDriftPaths": {
|
|
60
|
+
"type": "integer",
|
|
61
|
+
"minimum": 0,
|
|
62
|
+
"description": "Count of field paths where observed runtime types do not match declared schema types."
|
|
63
|
+
},
|
|
64
|
+
"valueDriftPaths": {
|
|
65
|
+
"type": "integer",
|
|
66
|
+
"minimum": 0,
|
|
67
|
+
"description": "Count of field paths where observed primitive values fall outside declared enum values."
|
|
68
|
+
},
|
|
69
|
+
"undocumentedServices": { "type": "integer", "minimum": 0 },
|
|
70
|
+
"undocumentedChannels": { "type": "integer", "minimum": 0 }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://autotel.dev/schemas/eventcatalog/stamp-summary/v0.1.0.json",
|
|
4
|
+
"title": "Autotel EventCatalog Stamp Summary v0.1.0",
|
|
5
|
+
"description": "Machine-readable summary written by `autotel-eventcatalog stamp --summary-output`. CI workflows gate on `hadChanges` to detect 'this PR forgot to re-stamp'.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"spec",
|
|
9
|
+
"dryRun",
|
|
10
|
+
"attempted",
|
|
11
|
+
"skipped",
|
|
12
|
+
"inserts",
|
|
13
|
+
"replaces",
|
|
14
|
+
"changedFiles",
|
|
15
|
+
"hadChanges"
|
|
16
|
+
],
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"spec": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"const": "autotel-eventcatalog-stamp-summary/v0.1.0"
|
|
22
|
+
},
|
|
23
|
+
"dryRun": { "type": "boolean" },
|
|
24
|
+
"attempted": {
|
|
25
|
+
"type": "integer",
|
|
26
|
+
"minimum": 0,
|
|
27
|
+
"description": "Total snapshot events the stamp run considered (matched + skipped)."
|
|
28
|
+
},
|
|
29
|
+
"skipped": {
|
|
30
|
+
"type": "integer",
|
|
31
|
+
"minimum": 0,
|
|
32
|
+
"description": "Snapshot events with no matching catalog entry."
|
|
33
|
+
},
|
|
34
|
+
"inserts": {
|
|
35
|
+
"type": "integer",
|
|
36
|
+
"minimum": 0,
|
|
37
|
+
"description": "Files where a stamp block was inserted for the first time."
|
|
38
|
+
},
|
|
39
|
+
"replaces": {
|
|
40
|
+
"type": "integer",
|
|
41
|
+
"minimum": 0,
|
|
42
|
+
"description": "Files where an existing stamp block was replaced (regardless of whether content actually changed)."
|
|
43
|
+
},
|
|
44
|
+
"changedFiles": {
|
|
45
|
+
"type": "integer",
|
|
46
|
+
"minimum": 0,
|
|
47
|
+
"description": "Files whose contents actually changed on disk (or would change in dry-run)."
|
|
48
|
+
},
|
|
49
|
+
"hadChanges": {
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"description": "True iff the run produced (or would produce) at least one real change."
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"spec": "autotel-eventcatalog-report/v0.2.0",
|
|
3
|
+
"mode": "all",
|
|
4
|
+
"report": {
|
|
5
|
+
"snapshotGeneratedAt": "2026-05-22T00:00:00.000Z",
|
|
6
|
+
"snapshotService": "fixture",
|
|
7
|
+
"events": {
|
|
8
|
+
"observedButUndocumented": [
|
|
9
|
+
"order.cancelled"
|
|
10
|
+
],
|
|
11
|
+
"documentedButUnseen": [
|
|
12
|
+
"LegacyEvent"
|
|
13
|
+
],
|
|
14
|
+
"fieldDrift": [
|
|
15
|
+
{
|
|
16
|
+
"event": "recommendation.generated",
|
|
17
|
+
"extra": [
|
|
18
|
+
"personalization_seed"
|
|
19
|
+
],
|
|
20
|
+
"missing": []
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"typeDrift": [],
|
|
24
|
+
"valueDrift": []
|
|
25
|
+
},
|
|
26
|
+
"services": {
|
|
27
|
+
"observedButUndocumented": []
|
|
28
|
+
},
|
|
29
|
+
"channels": {
|
|
30
|
+
"observedButUndocumented": []
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"spec": "autotel-eventcatalog-drift-summary/v0.2.0",
|
|
3
|
+
"mode": "all",
|
|
4
|
+
"shouldFail": false,
|
|
5
|
+
"reason": "No drift detected.",
|
|
6
|
+
"counts": {
|
|
7
|
+
"observedButUndocumentedEvents": 0,
|
|
8
|
+
"documentedButUnseenEvents": 0,
|
|
9
|
+
"fieldDriftEvents": 0,
|
|
10
|
+
"fieldDriftPaths": 0,
|
|
11
|
+
"typeDriftPaths": 0,
|
|
12
|
+
"valueDriftPaths": 0,
|
|
13
|
+
"undocumentedServices": 0,
|
|
14
|
+
"undocumentedChannels": 0,
|
|
15
|
+
"total": 0
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"spec": "autotel-eventcatalog-drift-summary/v0.2.0",
|
|
3
|
+
"mode": "all",
|
|
4
|
+
"shouldFail": true,
|
|
5
|
+
"reason": "Drift detected in current snapshot.",
|
|
6
|
+
"counts": {
|
|
7
|
+
"observedButUndocumentedEvents": 1,
|
|
8
|
+
"documentedButUnseenEvents": 1,
|
|
9
|
+
"fieldDriftEvents": 1,
|
|
10
|
+
"fieldDriftPaths": 1,
|
|
11
|
+
"typeDriftPaths": 0,
|
|
12
|
+
"valueDriftPaths": 0,
|
|
13
|
+
"undocumentedServices": 0,
|
|
14
|
+
"undocumentedChannels": 0,
|
|
15
|
+
"total": 3
|
|
16
|
+
}
|
|
17
|
+
}
|