iterate-kernel 0.1.4 → 0.1.5
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/README.md +14 -6
- package/dist/convergence.d.ts +90 -0
- package/dist/convergence.d.ts.map +1 -0
- package/dist/convergence.js +97 -0
- package/dist/convergence.js.map +1 -0
- package/dist/errors.d.ts +15 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +7 -0
- package/dist/errors.js.map +1 -1
- package/dist/evidence-pack.d.ts +19 -19
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/invariant-report.d.ts +271 -0
- package/dist/invariant-report.d.ts.map +1 -0
- package/dist/invariant-report.js +145 -0
- package/dist/invariant-report.js.map +1 -0
- package/dist/parse.d.ts +7 -0
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +18 -10
- package/dist/parse.js.map +1 -1
- package/dist/provider-registration.d.ts +132 -0
- package/dist/provider-registration.d.ts.map +1 -0
- package/dist/provider-registration.js +119 -0
- package/dist/provider-registration.js.map +1 -0
- package/dist/schemas.d.ts +8 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +8 -0
- package/dist/schemas.js.map +1 -1
- package/fixtures/convergence.ok-01.json +252 -0
- package/fixtures/invariant-report.ok-01.json +306 -0
- package/fixtures/provider-registration.ok-01.json +309 -0
- package/fixtures/run-plan.ok-01.json +1 -1
- package/package.json +13 -1
- package/schemas/convergence-round-state.schema.json +37 -0
- package/schemas/invariant-report.schema.json +108 -0
- package/schemas/provider-registration.schema.json +63 -0
- package/schemas/reverification-request.schema.json +89 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.iterate.dev/convergence-round-state-0.1.json",
|
|
4
|
+
"title": "ConvergenceRoundState",
|
|
5
|
+
"description": "What a caller states about the round that just finished, which the convergence rules turn into an action (5.7 R40 scenario 4). Every field is a verdict somebody else produced; this contract moves none of them. NOTE ON SOURCE OF TRUTH: the field constraints are duplicated from `src/convergence.ts`, which is the definition; this file mirrors it. The ordering that decides which verdict wins (breaker, then budget, then errored check, then findings, then evidence, then invariants, then converged) is arithmetic in the validator and cannot be expressed in JSON Schema — a schema-only implementation must re-implement `convergenceDecision` and be tested against the cases in `fixtures/convergence.ok-01.json`.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["round", "maxRounds", "invariantState", "openFindings", "evidenceComplete", "breakerLevel"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": {
|
|
11
|
+
"const": "iterate.convergence/0.1"
|
|
12
|
+
},
|
|
13
|
+
"round": {
|
|
14
|
+
"type": "integer",
|
|
15
|
+
"minimum": 1
|
|
16
|
+
},
|
|
17
|
+
"maxRounds": {
|
|
18
|
+
"type": "integer",
|
|
19
|
+
"minimum": 1
|
|
20
|
+
},
|
|
21
|
+
"invariantState": {
|
|
22
|
+
"enum": ["pass", "fail", "error", "unmeasured"]
|
|
23
|
+
},
|
|
24
|
+
"openFindings": {
|
|
25
|
+
"type": "integer",
|
|
26
|
+
"minimum": 0
|
|
27
|
+
},
|
|
28
|
+
"evidenceComplete": {
|
|
29
|
+
"type": "boolean"
|
|
30
|
+
},
|
|
31
|
+
"breakerLevel": {
|
|
32
|
+
"type": "integer",
|
|
33
|
+
"minimum": 0,
|
|
34
|
+
"maximum": 3
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.iterate.dev/invariant-report-0.1.json",
|
|
4
|
+
"title": "InvariantReport",
|
|
5
|
+
"description": "What the invariant runner observed when it checked a recipe's invariants (5.7 R40 scenario 1: the failure that has to reach the other harness). Whoever runs the checks produces this; whoever decides whether to re-verify reads it. A check kind of `refused` means the runner declined to execute a configured command because it carries shell metacharacters or is empty — it is a violation, so a report whose only failing check was refused is `fail`, never `error`. NOTE ON SOURCE OF TRUTH: the check-name and detail constraints are duplicated from `src/invariant-report.ts`, which is the definition; this file mirrors it. The outcome-vs-checks rule IS expressible here and is expressed twice on purpose: the `allOf` branches below and the zod `superRefine` must refuse the same reports, so a second implementation that only validates JSON Schema still cannot carry a pass over a failed check.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schemaVersion", "outcome", "checks"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": {
|
|
11
|
+
"const": "iterate.invariant-report/0.1"
|
|
12
|
+
},
|
|
13
|
+
"outcome": {
|
|
14
|
+
"enum": ["pass", "fail", "error"]
|
|
15
|
+
},
|
|
16
|
+
"checks": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"minItems": 1,
|
|
19
|
+
"maxItems": 256,
|
|
20
|
+
"items": {
|
|
21
|
+
"$ref": "#/$defs/invariantCheck"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"round": {
|
|
25
|
+
"type": "integer",
|
|
26
|
+
"minimum": 1
|
|
27
|
+
},
|
|
28
|
+
"durationMs": {
|
|
29
|
+
"type": "integer",
|
|
30
|
+
"minimum": 0
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"allOf": [
|
|
34
|
+
{
|
|
35
|
+
"if": {
|
|
36
|
+
"properties": {
|
|
37
|
+
"outcome": {
|
|
38
|
+
"const": "pass"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"required": ["outcome"]
|
|
42
|
+
},
|
|
43
|
+
"then": {
|
|
44
|
+
"properties": {
|
|
45
|
+
"checks": {
|
|
46
|
+
"items": {
|
|
47
|
+
"properties": {
|
|
48
|
+
"ok": {
|
|
49
|
+
"const": true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"required": ["ok"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"if": {
|
|
60
|
+
"properties": {
|
|
61
|
+
"outcome": {
|
|
62
|
+
"const": "fail"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"required": ["outcome"]
|
|
66
|
+
},
|
|
67
|
+
"then": {
|
|
68
|
+
"properties": {
|
|
69
|
+
"checks": {
|
|
70
|
+
"contains": {
|
|
71
|
+
"properties": {
|
|
72
|
+
"ok": {
|
|
73
|
+
"const": false
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"required": ["ok"]
|
|
77
|
+
},
|
|
78
|
+
"minContains": 1
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"$defs": {
|
|
85
|
+
"invariantCheck": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"additionalProperties": false,
|
|
88
|
+
"required": ["name", "kind", "ok"],
|
|
89
|
+
"properties": {
|
|
90
|
+
"name": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"minLength": 1,
|
|
93
|
+
"maxLength": 256
|
|
94
|
+
},
|
|
95
|
+
"kind": {
|
|
96
|
+
"enum": ["ensure", "command", "refused"]
|
|
97
|
+
},
|
|
98
|
+
"ok": {
|
|
99
|
+
"type": "boolean"
|
|
100
|
+
},
|
|
101
|
+
"detail": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"maxLength": 4096
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.iterate.dev/provider-registration-0.1.json",
|
|
4
|
+
"title": "ProviderRegistration",
|
|
5
|
+
"description": "Metadata for one judgement producer, so both harnesses can consume the same provider through the same shape (5.7 R40 scenario 5). It declares who provides what and what they need; it never carries a judgement, which stays in the engine and the reviewers. NOTE ON SOURCE OF TRUTH: the field constraints are duplicated from `src/provider-registration.ts`, which is the definition; this file mirrors it. METHOD-LEVEL UNIQUENESS IS ENFORCED BY ZOD ONLY: `uniqueItems` compares whole objects, so two methods with the same name but different `requires` pass this schema and are refused by `ProviderRegistrationSchema`. The registry semantics (refusing to overwrite an id, no default provider, no fuzzy resolve) are functions in the validator, not schema features.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schemaVersion", "id", "kind", "version", "methods"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": {
|
|
11
|
+
"const": "iterate.provider/0.1"
|
|
12
|
+
},
|
|
13
|
+
"id": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
|
|
16
|
+
"maxLength": 64
|
|
17
|
+
},
|
|
18
|
+
"kind": {
|
|
19
|
+
"enum": ["ae-diagnosis", "report-render", "evidence-source"]
|
|
20
|
+
},
|
|
21
|
+
"version": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"minLength": 1,
|
|
24
|
+
"maxLength": 64
|
|
25
|
+
},
|
|
26
|
+
"origin": {
|
|
27
|
+
"enum": ["kernel", "glasspane", "iterate", "plugin"]
|
|
28
|
+
},
|
|
29
|
+
"methods": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"minItems": 1,
|
|
32
|
+
"maxItems": 32,
|
|
33
|
+
"uniqueItems": true,
|
|
34
|
+
"items": {
|
|
35
|
+
"$ref": "#/$defs/providerMethod"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"$defs": {
|
|
40
|
+
"providerMethod": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"required": ["name", "requires"],
|
|
44
|
+
"properties": {
|
|
45
|
+
"name": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
|
|
48
|
+
"maxLength": 64
|
|
49
|
+
},
|
|
50
|
+
"requires": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"maxItems": 16,
|
|
53
|
+
"uniqueItems": true,
|
|
54
|
+
"items": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
|
|
57
|
+
"maxLength": 64
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.iterate.dev/reverification-request-0.1.json",
|
|
4
|
+
"title": "ReverificationRequest",
|
|
5
|
+
"description": "The ask that comes out of a failed invariant report (5.7 R40 scenario 1): re-run these recipe steps, dimensions, or operations. It cites the failure by digest rather than embedding it, so the ledger line that records the re-verification can be checked against the ledger line that records the failure. NOTE ON SOURCE OF TRUTH: the field constraints are duplicated from `src/invariant-report.ts`, which is the definition; this file mirrors it. The 'an empty target set is not a re-verification' rule IS expressible here and is expressed twice on purpose, via `anyOf`, so a schema-only implementation refuses it too.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schemaVersion", "trigger", "targets"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": {
|
|
11
|
+
"const": "iterate.reverification/0.1"
|
|
12
|
+
},
|
|
13
|
+
"trigger": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": ["kind", "reportDigest"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"kind": {
|
|
19
|
+
"const": "invariant"
|
|
20
|
+
},
|
|
21
|
+
"reportDigest": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"pattern": "^iv_[0-9a-f]{64}$"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"targets": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"additionalProperties": false,
|
|
30
|
+
"anyOf": [
|
|
31
|
+
{
|
|
32
|
+
"required": ["recipeSteps"]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"required": ["dimensions"]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"required": ["operationIds"]
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"properties": {
|
|
42
|
+
"recipeSteps": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"minItems": 1,
|
|
45
|
+
"maxItems": 64,
|
|
46
|
+
"items": {
|
|
47
|
+
"$ref": "#/$defs/recipeStep"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"dimensions": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"minItems": 1,
|
|
53
|
+
"maxItems": 64,
|
|
54
|
+
"uniqueItems": true,
|
|
55
|
+
"items": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
|
|
58
|
+
"maxLength": 64
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"operationIds": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"minItems": 1,
|
|
64
|
+
"maxItems": 64,
|
|
65
|
+
"uniqueItems": true,
|
|
66
|
+
"items": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"pattern": "^op_[0-9A-HJKMNP-TV-Z]{26}$"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"$defs": {
|
|
75
|
+
"recipeStep": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"additionalProperties": false,
|
|
78
|
+
"required": ["kind", "params"],
|
|
79
|
+
"properties": {
|
|
80
|
+
"kind": {
|
|
81
|
+
"enum": ["act", "observe", "assert", "diagnose"]
|
|
82
|
+
},
|
|
83
|
+
"params": {
|
|
84
|
+
"type": "object"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|