@consiliency/contract 0.6.2 → 0.6.4
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 +6 -1
- package/core/contract.json +7 -2
- package/core/schemas/certificate.schema.json +106 -0
- package/core/schemas/git-discipline-protocol.schema.json +1 -1
- package/core/schemas/manifest.schema.json +261 -43
- package/core/schemas/result-state.schema.json +105 -0
- package/core/schemas/version-skew-protocol.schema.json +1 -1
- package/core/spec-parity/provenance.json +30 -0
- package/package.json +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,12 @@ The Consiliency cross-repo **contract package** — the single, neutral rulebook
|
|
|
19
19
|
|
|
20
20
|
Dual-published: **npm** [`@consiliency/contract`](https://www.npmjs.com/package/@consiliency/contract) + **PyPI** [`consiliency-contract`](https://pypi.org/project/consiliency-contract/), from shared JSON data + conformance vectors so the two language readers stay byte-identical.
|
|
21
21
|
|
|
22
|
-
> **Status — `0.6.
|
|
22
|
+
> **Status — `0.6.4` distributes the frozen parity `certificate` schema and
|
|
23
|
+
> its `result-state` `$ref` closure (verbatim from spec, digest-pinned in
|
|
24
|
+
> `core/spec-parity/provenance.json`) so external consumers (e.g. greenfield
|
|
25
|
+
> XG-6) validate against the real parity-cert schema instead of a hand-rolled,
|
|
26
|
+
> repo-owned proof cert — additive only, no existing schema semantics change.
|
|
27
|
+
> `0.6.0` splits the `certified` evidence label into
|
|
23
28
|
> `parity-certified` (byte-parity cert, no authority event — what CS proj-S
|
|
24
29
|
> certification ships today) and `authority-certified` (parity PLUS a
|
|
25
30
|
> verified, human-ratified authority event — reserved until the XG-1
|
package/core/contract.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"contract_id": "consiliency.contract.v1",
|
|
3
|
-
"contract_version": "0.6.
|
|
3
|
+
"contract_version": "0.6.4",
|
|
4
4
|
"package_names": {
|
|
5
5
|
"npm": "@consiliency/contract",
|
|
6
6
|
"pypi": "consiliency-contract"
|
|
@@ -36,7 +36,9 @@
|
|
|
36
36
|
"coordination_scenario": "core/schemas/coordination-scenario.schema.json",
|
|
37
37
|
"projections_index_v1": "core/schemas/projections-index-v1.schema.json",
|
|
38
38
|
"git_discipline_protocol": "core/schemas/git-discipline-protocol.schema.json",
|
|
39
|
-
"authority_event_protocol": "core/schemas/authority-event-protocol.schema.json"
|
|
39
|
+
"authority_event_protocol": "core/schemas/authority-event-protocol.schema.json",
|
|
40
|
+
"certificate": "core/schemas/certificate.schema.json",
|
|
41
|
+
"result_state": "core/schemas/result-state.schema.json"
|
|
40
42
|
},
|
|
41
43
|
"registries": {
|
|
42
44
|
"document_classes": "core/registries/document-classes.json",
|
|
@@ -63,6 +65,9 @@
|
|
|
63
65
|
"authority_canon": {
|
|
64
66
|
"provenance": "core/authority-canon/provenance.json"
|
|
65
67
|
},
|
|
68
|
+
"spec_parity": {
|
|
69
|
+
"provenance": "core/spec-parity/provenance.json"
|
|
70
|
+
},
|
|
66
71
|
"conformance": {
|
|
67
72
|
"vector_root": "conformance/vectors",
|
|
68
73
|
"decision_schema": "core/schemas/decision.schema.json"
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://spec.consiliency/spec-parity/certificate.schema.json",
|
|
4
|
+
"title": "Parity certificate (Phase 3a)",
|
|
5
|
+
"description": "What a parity certificate MUST pin. This is the UNION of SPEC-ROADMAP.md Storage `certificates` record shape (line ~326) and Phase-3a task item 8 (richer: canon/idmodel versions, projection-algo version, per-dim results). The certificate is a DIGEST-BEARING record: its top-level `digest` field is computed with the canon `certificate` profile (`spec-canon:v2:certificate\\n`) and is EXCLUDED from its own preimage (canon sec 8). PRODUCE ONCE, STORE VERBATIM, never recompute (canon sec 9). NO JSON FLOATS. This schema is co-designed with Phase 0C; fields here that 0C also needs (digest byte-match domain, parity-gate vs policy-gate) are flagged OPEN, see SEMANTICS.md sec 9.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"schema_version",
|
|
10
|
+
"projection_algo_version",
|
|
11
|
+
"canon_version",
|
|
12
|
+
"idmodel_version",
|
|
13
|
+
"kind_alignment_version",
|
|
14
|
+
"permitted_freedom_vocab_version",
|
|
15
|
+
"ec_revision_id",
|
|
16
|
+
"spec_revision_digest",
|
|
17
|
+
"desired_graph_digest",
|
|
18
|
+
"ec_digest",
|
|
19
|
+
"code_head_sha",
|
|
20
|
+
"overall_result_state",
|
|
21
|
+
"dimension_results",
|
|
22
|
+
"findings_ref",
|
|
23
|
+
"digest"
|
|
24
|
+
],
|
|
25
|
+
"properties": {
|
|
26
|
+
"schema_version": { "const": "1", "description": "This certificate schema version." },
|
|
27
|
+
"projection_algo_version": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Version of the P/N projection+parity ALGORITHM that produced this result. Pinning this makes a certificate reproducible: two certificates over the same inputs but different algo versions are legitimately allowed to differ. (Task item 8.)"
|
|
30
|
+
},
|
|
31
|
+
"canon_version": { "type": "string", "description": "canon contract version used (`v2` since NFCBOUNDARY: NFC at the ingest boundary, digest prefix `spec-canon:v2:`). v1 certificates stay valid as v1 records; a v1 digest is never compared to a v2 digest and a mixed-canon_version graph is rejected." },
|
|
32
|
+
"idmodel_version": { "type": "string", "description": "idmodel contract version used (e.g. `v1`)." },
|
|
33
|
+
"kind_alignment_version": { "type": "string", "description": "Version of kind-alignment.json used. (The matrix is part of the parity semantics; a matrix change can change results, so it is pinned.)" },
|
|
34
|
+
"permitted_freedom_vocab_version": { "type": "string", "description": "Version of spec-parity/permitted-freedom-vocab.json used. The vocabulary defines which permitted_freedom tokens (and thus which below-frontier deviations) the soundness matcher excuses; a vocab change can change the result, so it is pinned (SEMANTICS.md sec 3 / sec 9)." },
|
|
35
|
+
"ec_revision_id": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "The REALIZED-side revision_id this certificate is about (the storage `revisions.revision_id` for E(C)). Distinct from the spec/desired revision, which is pinned by spec_revision_digest. revision_alignment (sec 7.5) relates this E(C) revision to the spec revision."
|
|
38
|
+
},
|
|
39
|
+
"spec_revision_digest": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Digest pinning the exact spec/desired-graph REVISION (the canon digest of the desired graph's revision record). Distinct from desired_graph_digest: this pins the revision identity, that pins the graph content."
|
|
42
|
+
},
|
|
43
|
+
"desired_graph_digest": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "canon semantic-content digest of the desired-state graph S that was checked."
|
|
46
|
+
},
|
|
47
|
+
"ec_digest": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"description": "canon semantic-content digest of E(C) -- the realized Interface Boundary IR extract that was checked. For fixture runs this is the fixture's digest. PARITY OVER A NON-REPRODUCIBLE E(C) IS MEANINGLESS (SPEC-ROADMAP Phase 1 / Benchmark C): a certificate over an E(C) that is not byte-reproducible is advisory only and MUST set ec_reproducible=false."
|
|
50
|
+
},
|
|
51
|
+
"ec_reproducible": {
|
|
52
|
+
"type": "boolean",
|
|
53
|
+
"description": "true iff E(C) is byte-reproducible (Benchmark C green / fixture). When false the certificate is ADVISORY and downstream gates MUST NOT treat it as authoritative."
|
|
54
|
+
},
|
|
55
|
+
"code_head_sha": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "The code repo HEAD sha the E(C) was extracted from (provenance pin)."
|
|
58
|
+
},
|
|
59
|
+
"overall_result_state": {
|
|
60
|
+
"$ref": "result-state.schema.json#/$defs/result_state",
|
|
61
|
+
"description": "Aggregated state per SEMANTICS.md sec 6.4. Anything other than `pass` (and `not_applicable` which is neutral) makes the certificate NON-GREEN. INVARIANT: byte-equal to the referenced finding_set.overall_result_state (the certificate copy is derived from, never recomputed against, the finding_set at findings_ref)."
|
|
62
|
+
},
|
|
63
|
+
"dimension_results": {
|
|
64
|
+
"type": "array",
|
|
65
|
+
"items": { "$ref": "result-state.schema.json#/$defs/dimension_result" },
|
|
66
|
+
"minItems": 5,
|
|
67
|
+
"maxItems": 5,
|
|
68
|
+
"description": "Per-dimension results embedded for at-a-glance gating; the full findings live behind findings_ref. INVARIANT: byte-equal (after canon canonicalization) to the referenced finding_set.dimension_results."
|
|
69
|
+
},
|
|
70
|
+
"findings_ref": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"description": "Digest ref to the finding_set artifact (result-state.schema.json finding_set). Pointer, not payload (portal metadata_only)."
|
|
73
|
+
},
|
|
74
|
+
"waivers_ref": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"description": "Optional digest ref to the set of waivers in effect for this run. Waived findings remain non-pass in dimension_results; this ref records WHY they are not gating. Absent if no waivers."
|
|
77
|
+
},
|
|
78
|
+
"digest": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"description": "The AUTHORITATIVE identity of the certificate: the certificate-profile content digest = lowercase hex SHA-256 over `spec-canon:v2:certificate\\n` || canonical_bytes(certificate-without-this-top-level-`digest`-field). EXCLUDED from its own preimage (canon sec 8). There is deliberately NO separate hashed `certificate_id` field (that would be circular: it would sit inside the preimage). A `certificate_id` mirror, if a storage index needs one, lives in the non-hashed `locator` (below) and equals this `digest`."
|
|
81
|
+
},
|
|
82
|
+
"vacuity": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"description": "OPTIONAL, HASHED (inside the certificate digest preimage). Present (is_vacuous=true) ONLY when the certify VACUITY TRIPWIRE fired: E(C) had NO kind-aligned realized boundary (no real code to certify), so overall_result_state is not_applicable across every dimension. This is what lets a consumer tell a vacuous refusal from an ordinary single-revision not_applicable WITHOUT trusting the unhashed finding_set — it is NOT a fake-green. Absent on every non-vacuous certificate (so existing certificates are byte-identical and their digests unchanged). Mirrors finding_set.vacuity.",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"required": ["is_vacuous", "reason", "realized_boundary_count", "kind_aligned_realized_count"],
|
|
87
|
+
"properties": {
|
|
88
|
+
"is_vacuous": { "const": true },
|
|
89
|
+
"reason": { "type": "string" },
|
|
90
|
+
"realized_boundary_count": { "type": "integer", "minimum": 0 },
|
|
91
|
+
"kind_aligned_realized_count": { "type": "integer", "minimum": 0, "const": 0 }
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"locator": {
|
|
95
|
+
"type": "object",
|
|
96
|
+
"description": "NON-HASHED envelope (canon sec 10): wall-clock created time, producer host/version display, run_id, and an optional `certificate_id` mirror of `digest`. Changing these MUST NOT change `digest`. The hashed `run` digest (if a run is associated) lives in the runs record, not here.",
|
|
97
|
+
"additionalProperties": true,
|
|
98
|
+
"properties": {
|
|
99
|
+
"certificate_id": { "type": "string", "description": "Optional storage-index mirror of the top-level `digest`. Non-hashed; equals `digest`. Avoids the circularity of a hashed id field." },
|
|
100
|
+
"created_at": { "type": "string" },
|
|
101
|
+
"producer": { "type": "string" },
|
|
102
|
+
"run_id": { "type": "string" }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"additionalProperties": false,
|
|
19
19
|
"properties": {
|
|
20
20
|
"schema": {"const": "consiliency.git_discipline_protocol.v1"},
|
|
21
|
-
"contract_version": {"const": "0.6.
|
|
21
|
+
"contract_version": {"const": "0.6.4"},
|
|
22
22
|
"ref_class_registry": {
|
|
23
23
|
"const": "pipeline-ref-classes",
|
|
24
24
|
"description": "loadRegistry('pipeline_ref_classes') enumerates the pipeline-owned ref families and the human default. Both runtimes (harness + gp) read it to agree on ownership."
|
|
@@ -3,46 +3,101 @@
|
|
|
3
3
|
"$id": "https://consiliency.io/contracts/manifest.schema.json",
|
|
4
4
|
"title": ".consiliency manifest",
|
|
5
5
|
"type": "object",
|
|
6
|
-
"required": [
|
|
6
|
+
"required": [
|
|
7
|
+
"schema",
|
|
8
|
+
"contract_version",
|
|
9
|
+
"repo",
|
|
10
|
+
"declaration",
|
|
11
|
+
"documents",
|
|
12
|
+
"interfaces"
|
|
13
|
+
],
|
|
7
14
|
"additionalProperties": false,
|
|
8
15
|
"properties": {
|
|
9
|
-
"schema": {
|
|
10
|
-
|
|
16
|
+
"schema": {
|
|
17
|
+
"const": "consiliency.manifest.v1"
|
|
18
|
+
},
|
|
19
|
+
"contract_version": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"pattern": "^0\\.\\d+\\.\\d+$"
|
|
22
|
+
},
|
|
11
23
|
"repo": {
|
|
12
24
|
"type": "object",
|
|
13
|
-
"required": [
|
|
25
|
+
"required": [
|
|
26
|
+
"id",
|
|
27
|
+
"display_name",
|
|
28
|
+
"default_branch"
|
|
29
|
+
],
|
|
14
30
|
"additionalProperties": false,
|
|
15
31
|
"properties": {
|
|
16
|
-
"id": {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
32
|
+
"id": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"pattern": "^[a-z0-9][a-z0-9_.-]*$"
|
|
35
|
+
},
|
|
36
|
+
"display_name": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"minLength": 1
|
|
39
|
+
},
|
|
40
|
+
"default_branch": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"minLength": 1
|
|
43
|
+
},
|
|
44
|
+
"homepage": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
}
|
|
20
47
|
}
|
|
21
48
|
},
|
|
22
49
|
"declaration": {
|
|
23
50
|
"oneOf": [
|
|
24
51
|
{
|
|
25
52
|
"type": "object",
|
|
26
|
-
"required": [
|
|
53
|
+
"required": [
|
|
54
|
+
"mode"
|
|
55
|
+
],
|
|
27
56
|
"additionalProperties": false,
|
|
28
|
-
"properties": {
|
|
57
|
+
"properties": {
|
|
58
|
+
"mode": {
|
|
59
|
+
"const": "baseline-only"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
29
62
|
},
|
|
30
63
|
{
|
|
31
64
|
"type": "object",
|
|
32
|
-
"required": [
|
|
65
|
+
"required": [
|
|
66
|
+
"mode",
|
|
67
|
+
"archetypes"
|
|
68
|
+
],
|
|
33
69
|
"additionalProperties": false,
|
|
34
70
|
"properties": {
|
|
35
|
-
"mode": {
|
|
71
|
+
"mode": {
|
|
72
|
+
"const": "archetyped"
|
|
73
|
+
},
|
|
36
74
|
"archetypes": {
|
|
37
75
|
"type": "array",
|
|
38
76
|
"minItems": 1,
|
|
39
77
|
"uniqueItems": true,
|
|
40
|
-
"items": {
|
|
78
|
+
"items": {
|
|
79
|
+
"enum": [
|
|
80
|
+
"product",
|
|
81
|
+
"service",
|
|
82
|
+
"library",
|
|
83
|
+
"infra",
|
|
84
|
+
"tooling-meta",
|
|
85
|
+
"experiment",
|
|
86
|
+
"document"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
41
89
|
},
|
|
42
90
|
"modifiers": {
|
|
43
91
|
"type": "array",
|
|
44
92
|
"uniqueItems": true,
|
|
45
|
-
"items": {
|
|
93
|
+
"items": {
|
|
94
|
+
"enum": [
|
|
95
|
+
"data-bearing",
|
|
96
|
+
"public",
|
|
97
|
+
"regulated",
|
|
98
|
+
"user-facing"
|
|
99
|
+
]
|
|
100
|
+
}
|
|
46
101
|
}
|
|
47
102
|
}
|
|
48
103
|
}
|
|
@@ -50,90 +105,253 @@
|
|
|
50
105
|
},
|
|
51
106
|
"documents": {
|
|
52
107
|
"type": "array",
|
|
53
|
-
"items": {
|
|
108
|
+
"items": {
|
|
109
|
+
"$ref": "#/$defs/document"
|
|
110
|
+
},
|
|
54
111
|
"uniqueItems": true
|
|
55
112
|
},
|
|
56
|
-
"interfaces": {
|
|
113
|
+
"interfaces": {
|
|
114
|
+
"$ref": "#/$defs/repoRelativePath"
|
|
115
|
+
},
|
|
57
116
|
"legacy_layouts": {
|
|
58
117
|
"type": "array",
|
|
59
|
-
"items": {
|
|
118
|
+
"items": {
|
|
119
|
+
"$ref": "#/$defs/repoRelativePath"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"adoption": {
|
|
123
|
+
"$ref": "#/$defs/adoptionProfile"
|
|
60
124
|
},
|
|
61
|
-
"adoption": {"$ref": "#/$defs/adoptionProfile"},
|
|
62
125
|
"governed_set": {
|
|
63
126
|
"type": "array",
|
|
64
127
|
"uniqueItems": true,
|
|
65
|
-
"items": {
|
|
128
|
+
"items": {
|
|
129
|
+
"$ref": "#/$defs/governedSelector"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"gate_posture_overrides": {
|
|
133
|
+
"type": "object",
|
|
134
|
+
"description": "Retractable teeth: per-repo enforcement-posture overrides, {finding_code: posture}. May RAISE any finding class freely and LOWER only to (never below) its non-retractable min_posture floor in the gate_posture_registry; a downward move is surfaced by the non-retractable posture_retracted note. observe < warn < enforce.",
|
|
135
|
+
"additionalProperties": {
|
|
136
|
+
"enum": [
|
|
137
|
+
"observe",
|
|
138
|
+
"warn",
|
|
139
|
+
"enforce"
|
|
140
|
+
]
|
|
141
|
+
}
|
|
66
142
|
}
|
|
67
143
|
},
|
|
68
144
|
"$defs": {
|
|
69
145
|
"adoptionProfile": {
|
|
70
146
|
"type": "object",
|
|
71
|
-
"required": [
|
|
147
|
+
"required": [
|
|
148
|
+
"adopted",
|
|
149
|
+
"contract_version",
|
|
150
|
+
"archetype",
|
|
151
|
+
"adopted_scope"
|
|
152
|
+
],
|
|
72
153
|
"additionalProperties": false,
|
|
73
154
|
"properties": {
|
|
74
155
|
"adopted": {
|
|
75
156
|
"type": "boolean",
|
|
76
157
|
"description": "true = the repo consents to be governed for the facets in adopted_scope (which must be non-empty). false = an explicit, recorded declaration of non-adoption: the repo is UNGOVERNED for every facet even though a profile is present. A repo with no adoption profile at all is likewise ungoverned; adopted:false is the explicit, auditable form of that state."
|
|
77
158
|
},
|
|
78
|
-
"contract_version": {
|
|
79
|
-
|
|
159
|
+
"contract_version": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"pattern": "^0\\.\\d+\\.\\d+$"
|
|
162
|
+
},
|
|
163
|
+
"archetype": {
|
|
164
|
+
"enum": [
|
|
165
|
+
"product",
|
|
166
|
+
"service",
|
|
167
|
+
"library",
|
|
168
|
+
"infra",
|
|
169
|
+
"tooling-meta",
|
|
170
|
+
"experiment",
|
|
171
|
+
"document",
|
|
172
|
+
"baseline-only"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
80
175
|
"adopted_scope": {
|
|
81
176
|
"type": "array",
|
|
82
177
|
"uniqueItems": true,
|
|
83
|
-
"items": {
|
|
178
|
+
"items": {
|
|
179
|
+
"enum": [
|
|
180
|
+
"layout",
|
|
181
|
+
"gates",
|
|
182
|
+
"projections",
|
|
183
|
+
"cert"
|
|
184
|
+
]
|
|
185
|
+
}
|
|
84
186
|
}
|
|
85
187
|
},
|
|
86
188
|
"allOf": [
|
|
87
189
|
{
|
|
88
|
-
"if": {
|
|
89
|
-
|
|
190
|
+
"if": {
|
|
191
|
+
"properties": {
|
|
192
|
+
"adopted": {
|
|
193
|
+
"const": true
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"required": [
|
|
197
|
+
"adopted"
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
"then": {
|
|
201
|
+
"properties": {
|
|
202
|
+
"adopted_scope": {
|
|
203
|
+
"minItems": 1
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
90
207
|
}
|
|
91
208
|
]
|
|
92
209
|
},
|
|
93
210
|
"governedSelector": {
|
|
94
211
|
"type": "object",
|
|
95
|
-
"required": [
|
|
212
|
+
"required": [
|
|
213
|
+
"by",
|
|
214
|
+
"value"
|
|
215
|
+
],
|
|
96
216
|
"additionalProperties": false,
|
|
97
217
|
"properties": {
|
|
98
|
-
"by": {
|
|
218
|
+
"by": {
|
|
219
|
+
"enum": [
|
|
220
|
+
"path",
|
|
221
|
+
"glob",
|
|
222
|
+
"class"
|
|
223
|
+
]
|
|
224
|
+
},
|
|
99
225
|
"value": {
|
|
100
226
|
"type": "string",
|
|
101
227
|
"minLength": 1,
|
|
102
|
-
"not": {
|
|
228
|
+
"not": {
|
|
229
|
+
"anyOf": [
|
|
230
|
+
{
|
|
231
|
+
"pattern": "^/"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"pattern": "(^|/)\\.\\.(/|$)"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"pattern": "^[A-Za-z]:[\\\\/]"
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
}
|
|
103
241
|
}
|
|
104
242
|
}
|
|
105
243
|
},
|
|
106
244
|
"repoRelativePath": {
|
|
107
245
|
"type": "string",
|
|
108
246
|
"minLength": 1,
|
|
109
|
-
"not": {
|
|
247
|
+
"not": {
|
|
248
|
+
"anyOf": [
|
|
249
|
+
{
|
|
250
|
+
"pattern": "^/"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"pattern": "(^|/)\\.\\.(/|$)"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"pattern": "^[A-Za-z]:[\\\\/]"
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
}
|
|
110
260
|
},
|
|
111
261
|
"externalRef": {
|
|
112
262
|
"type": "object",
|
|
113
|
-
"required": [
|
|
263
|
+
"required": [
|
|
264
|
+
"kind",
|
|
265
|
+
"value"
|
|
266
|
+
],
|
|
114
267
|
"additionalProperties": false,
|
|
115
268
|
"properties": {
|
|
116
|
-
"kind": {
|
|
117
|
-
|
|
269
|
+
"kind": {
|
|
270
|
+
"enum": [
|
|
271
|
+
"org-ref",
|
|
272
|
+
"url",
|
|
273
|
+
"opaque-external-ref"
|
|
274
|
+
]
|
|
275
|
+
},
|
|
276
|
+
"value": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"minLength": 1
|
|
279
|
+
}
|
|
118
280
|
}
|
|
119
281
|
},
|
|
120
282
|
"document": {
|
|
121
283
|
"type": "object",
|
|
122
|
-
"required": [
|
|
284
|
+
"required": [
|
|
285
|
+
"id",
|
|
286
|
+
"class",
|
|
287
|
+
"maturity",
|
|
288
|
+
"target_level",
|
|
289
|
+
"required"
|
|
290
|
+
],
|
|
123
291
|
"oneOf": [
|
|
124
|
-
{
|
|
125
|
-
|
|
292
|
+
{
|
|
293
|
+
"required": [
|
|
294
|
+
"path"
|
|
295
|
+
],
|
|
296
|
+
"not": {
|
|
297
|
+
"required": [
|
|
298
|
+
"ref"
|
|
299
|
+
]
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"required": [
|
|
304
|
+
"ref"
|
|
305
|
+
],
|
|
306
|
+
"not": {
|
|
307
|
+
"required": [
|
|
308
|
+
"path"
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
}
|
|
126
312
|
],
|
|
127
313
|
"additionalProperties": false,
|
|
128
314
|
"properties": {
|
|
129
|
-
"id": {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
"
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
315
|
+
"id": {
|
|
316
|
+
"type": "string",
|
|
317
|
+
"pattern": "^[a-z0-9][a-z0-9_.-]*$"
|
|
318
|
+
},
|
|
319
|
+
"class": {
|
|
320
|
+
"enum": [
|
|
321
|
+
"intent-ground",
|
|
322
|
+
"intent-plan",
|
|
323
|
+
"proj-S",
|
|
324
|
+
"proj-code",
|
|
325
|
+
"ops-fact",
|
|
326
|
+
"static",
|
|
327
|
+
"index"
|
|
328
|
+
]
|
|
329
|
+
},
|
|
330
|
+
"path": {
|
|
331
|
+
"$ref": "#/$defs/repoRelativePath"
|
|
332
|
+
},
|
|
333
|
+
"ref": {
|
|
334
|
+
"$ref": "#/$defs/externalRef"
|
|
335
|
+
},
|
|
336
|
+
"maturity": {
|
|
337
|
+
"enum": [
|
|
338
|
+
"presence-only",
|
|
339
|
+
"hash-checked",
|
|
340
|
+
"realized-edge-observed"
|
|
341
|
+
]
|
|
342
|
+
},
|
|
343
|
+
"target_level": {
|
|
344
|
+
"enum": [
|
|
345
|
+
"L0",
|
|
346
|
+
"L1"
|
|
347
|
+
]
|
|
348
|
+
},
|
|
349
|
+
"required": {
|
|
350
|
+
"type": "boolean"
|
|
351
|
+
},
|
|
352
|
+
"last_attested_at": {
|
|
353
|
+
"type": "string"
|
|
354
|
+
}
|
|
137
355
|
}
|
|
138
356
|
}
|
|
139
357
|
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://spec.consiliency/spec-parity/result-state.schema.json",
|
|
4
|
+
"title": "Parity result state + per-dimension result + finding (Phase 3a)",
|
|
5
|
+
"description": "The result-state enum and the structures that carry it: per-dimension results and machine-readable findings. See SEMANTICS.md sec 6 (states) and sec 7 (dimensions). NO JSON FLOATS anywhere (canon v1 sec 6 forbids them): confidence/score fields are string-decimals.",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"result_state": {
|
|
8
|
+
"title": "result_state",
|
|
9
|
+
"description": "The verbatim v1 contract enum. pass: in-scope check applicable, fact observed, no violation. fail: in-scope violation OBSERVED. unknown: in-scope and applicable, but the required fact was NOT OBSERVABLE in this E(C) (data absent) -- the anti-silent-pass guard. unsupported: the CHECKER cannot ask the question (capability gap: unmapped kind, dimension not implemented for this entity class). not_applicable: no subject exists (vacuous; labeled so it is not counted as an evaluated pass).",
|
|
10
|
+
"enum": ["pass", "fail", "unknown", "unsupported", "not_applicable"]
|
|
11
|
+
},
|
|
12
|
+
"parity_dimension": {
|
|
13
|
+
"title": "parity_dimension",
|
|
14
|
+
"enum": ["completeness", "soundness", "closure", "prohibition", "revision_alignment"]
|
|
15
|
+
},
|
|
16
|
+
"string_decimal": {
|
|
17
|
+
"title": "string_decimal",
|
|
18
|
+
"description": "A decimal in [0,1] as a STRING (canon forbids JSON floats). Pattern allows 0, 1, and 0.xxx forms.",
|
|
19
|
+
"type": "string",
|
|
20
|
+
"pattern": "^(0|1|0\\.[0-9]+|1\\.0+)$"
|
|
21
|
+
},
|
|
22
|
+
"finding": {
|
|
23
|
+
"title": "finding",
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"required": ["finding_id", "dimension", "result_state", "code", "subject"],
|
|
27
|
+
"properties": {
|
|
28
|
+
"finding_id": { "type": "string", "description": "Stable id of this finding: canon semantic-content digest over the explicit content subset {dimension, result_state, code, subject} (NOT the whole record -- message/evidence_refs/confidence/waiver_ref are excluded so a re-worded message or an added waiver does not mint a new finding identity). Named-subset preimage, like waiver_id, to avoid relying on canon sec 8 for a nested id." },
|
|
29
|
+
"dimension": { "$ref": "#/$defs/parity_dimension" },
|
|
30
|
+
"result_state": { "$ref": "#/$defs/result_state" },
|
|
31
|
+
"code": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "A stable machine code for the finding class, e.g. missing_desired_element, structural_mismatch, prohibition_violated, prohibition_unobservable, unmapped_realized_kind, unmapped_desired_kind, ambiguous_kind_alignment, refinement_below_frontier, permitted_freedom, correspondence_ambiguous, capability_missing."
|
|
34
|
+
},
|
|
35
|
+
"subject": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"description": "What the finding is about.",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"properties": {
|
|
40
|
+
"desired_logical_id": { "type": "string", "description": "idmodel Tier-1 logical_id of the desired element, if any." },
|
|
41
|
+
"realized_occurrence_id": { "type": "string", "description": "idmodel Tier-2 occurrence_id of the realized fact, if any." },
|
|
42
|
+
"desired_kind": { "type": "string" },
|
|
43
|
+
"realized_kind": { "type": "string" },
|
|
44
|
+
"realized_source": { "type": "string" }
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"message": { "type": "string", "description": "Human-readable explanation (NOT hashed-meaning-bearing on its own; the code+subject are the load-bearing identity)." },
|
|
48
|
+
"evidence_refs": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"description": "Span-anchored / digest-anchored evidence pointers (SSRF-safe refs, not payloads).",
|
|
51
|
+
"items": { "type": "object" }
|
|
52
|
+
},
|
|
53
|
+
"confidence": { "$ref": "#/$defs/string_decimal", "description": "Optional. STRING decimal only; never a JSON float." },
|
|
54
|
+
"waiver_ref": { "type": "string", "description": "If this finding is currently suppressed by a waiver, the waiver_id. A waiver does NOT change result_state to pass; it only records suppression (SEMANTICS.md sec 8)." }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"dimension_result": {
|
|
58
|
+
"title": "dimension_result",
|
|
59
|
+
"type": "object",
|
|
60
|
+
"additionalProperties": false,
|
|
61
|
+
"required": ["dimension", "result_state"],
|
|
62
|
+
"properties": {
|
|
63
|
+
"dimension": { "$ref": "#/$defs/parity_dimension" },
|
|
64
|
+
"result_state": { "$ref": "#/$defs/result_state" },
|
|
65
|
+
"checks_evaluated": { "type": "integer", "minimum": 0, "description": "Count of in-scope checks evaluated for this dimension. A real JSON integer (canon sec 6 supports arbitrary-precision integers as JSON integers; the `$int`-tag is the test-vector encoding only, never the data model). Only FLOATS are forbidden, not integers." },
|
|
66
|
+
"finding_ids": { "type": "array", "items": { "type": "string" }, "description": "finding_ids contributing to this dimension's state." }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"type": "object",
|
|
71
|
+
"title": "finding_set",
|
|
72
|
+
"description": "The machine-readable finding set emitted by N(). Referenced by certificate.findings_ref.",
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"required": ["finding_set_id", "dimension_results", "findings", "overall_result_state"],
|
|
75
|
+
"properties": {
|
|
76
|
+
"finding_set_id": { "type": "string", "description": "canon semantic-content digest over {dimension_results, findings} (sorted/canonicalized)." },
|
|
77
|
+
"overall_result_state": {
|
|
78
|
+
"$ref": "#/$defs/result_state",
|
|
79
|
+
"description": "Aggregated per the severity rule in SEMANTICS.md sec 6.4: fail if any dimension fails; else unknown if any unknown; else unsupported if any unsupported; else pass. not_applicable is neutral (does not count)."
|
|
80
|
+
},
|
|
81
|
+
"dimension_results": {
|
|
82
|
+
"type": "array",
|
|
83
|
+
"items": { "$ref": "#/$defs/dimension_result" },
|
|
84
|
+
"minItems": 5,
|
|
85
|
+
"maxItems": 5,
|
|
86
|
+
"description": "Exactly one entry per parity_dimension (all five always present; a dimension with no subject reports not_applicable)."
|
|
87
|
+
},
|
|
88
|
+
"findings": {
|
|
89
|
+
"type": "array",
|
|
90
|
+
"items": { "$ref": "#/$defs/finding" }
|
|
91
|
+
},
|
|
92
|
+
"vacuity": {
|
|
93
|
+
"type": "object",
|
|
94
|
+
"description": "OPTIONAL. Present (and is_vacuous=true) ONLY when the certify VACUITY TRIPWIRE fired: E(C) had NO kind-aligned realized boundary, so there was no real code to certify and overall_result_state is not_applicable across every dimension. This block is the load-bearing DISTINCTION from an ordinary single-revision not_applicable; it makes a refusal-over-noise honest rather than a fake-green. Absent on every non-vacuous finding_set (so existing artifacts are byte-identical). NOT part of the finding_set_id preimage (which digests {dimension_results, findings} only); pinned instead by the certificate digest.",
|
|
95
|
+
"additionalProperties": false,
|
|
96
|
+
"required": ["is_vacuous", "reason", "realized_boundary_count", "kind_aligned_realized_count"],
|
|
97
|
+
"properties": {
|
|
98
|
+
"is_vacuous": { "const": true },
|
|
99
|
+
"reason": { "type": "string", "description": "Machine code for why the certify was vacuous, e.g. no_kind_aligned_realized_boundary." },
|
|
100
|
+
"realized_boundary_count": { "type": "integer", "minimum": 0, "description": "Total E(C) boundary count (may be >0 even when vacuous — e.g. config-file noise boundaries)." },
|
|
101
|
+
"kind_aligned_realized_count": { "type": "integer", "minimum": 0, "const": 0, "description": "Count of E(C) boundaries that map to a desired kind via kind-alignment; 0 is exactly the vacuity condition." }
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"properties": {
|
|
9
9
|
"schema": {"const": "consiliency.version_skew_protocol.v1"},
|
|
10
|
-
"contract_version": {"const": "0.6.
|
|
10
|
+
"contract_version": {"const": "0.6.4"},
|
|
11
11
|
"compatible_ranges": {
|
|
12
12
|
"type": "object",
|
|
13
13
|
"required": ["contract", "package"],
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "consiliency.spec_parity_provenance.v1",
|
|
3
|
+
"$comment": "The parity CERTIFICATE schema and its result-state $ref closure are DISTRIBUTED verbatim from the spec repo (spec is the source of truth for the parity semantics). These schemas are shipped byte-for-byte so external consumers (e.g. greenfield XG-6) validate against the real frozen parity-cert schema instead of a hand-rolled, repo-owned proof cert. The per-file sha256 below pins the exact spec source bytes; because the copy is verbatim, source sha == shipped sha, and the shipped-file digest is re-checked by the contract test suite.",
|
|
4
|
+
"normative_source": {
|
|
5
|
+
"repo": "spec",
|
|
6
|
+
"spec_commit": "7b6e356de3607b5f91fab00ecc803dee3c2cbfa0",
|
|
7
|
+
"path_prefix": "spec-parity/schemas",
|
|
8
|
+
"files": {
|
|
9
|
+
"certificate.schema.json": "39f5c3eaffb2a2de84a8f1fab0bf63e6a65298f303d651b8d85eb8d748be2cf4",
|
|
10
|
+
"result-state.schema.json": "6eed968da557bb4dd583209c4211db000580f4a2a4662bb2e758a8a3248e5151"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"distributed": {
|
|
14
|
+
"certificate": {
|
|
15
|
+
"path": "core/schemas/certificate.schema.json",
|
|
16
|
+
"sha256": "39f5c3eaffb2a2de84a8f1fab0bf63e6a65298f303d651b8d85eb8d748be2cf4",
|
|
17
|
+
"schema_id": "https://spec.consiliency/spec-parity/certificate.schema.json"
|
|
18
|
+
},
|
|
19
|
+
"result_state": {
|
|
20
|
+
"path": "core/schemas/result-state.schema.json",
|
|
21
|
+
"sha256": "6eed968da557bb4dd583209c4211db000580f4a2a4662bb2e758a8a3248e5151",
|
|
22
|
+
"schema_id": "https://spec.consiliency/spec-parity/result-state.schema.json"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"ref_closure": {
|
|
26
|
+
"$comment": "certificate.schema.json's only outward $refs target result-state.schema.json#/$defs/{result_state,dimension_result}; result-state.schema.json uses internal #/$defs refs only. The transitive $ref closure is therefore exactly these two files. portal-payload / kind-alignment / waiver / permitted-freedom-vocab are NOT in the closure and are deliberately not distributed here.",
|
|
27
|
+
"root": "certificate",
|
|
28
|
+
"members": ["certificate", "result_state"]
|
|
29
|
+
}
|
|
30
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@consiliency/contract",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Consiliency cross-repo contract package: shared JSON contract data, conformance vectors, thin npm/PyPI readers, and the canonical_html.v1 public contract surface.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const CONTRACT_PACKAGE: "@consiliency/contract";
|
|
2
|
-
export declare const CONTRACT_VERSION: "0.6.
|
|
2
|
+
export declare const CONTRACT_VERSION: "0.6.4";
|
|
3
3
|
export declare const CONTRACT: Record<string, unknown>;
|
|
4
4
|
export declare function loadContract(): Record<string, unknown>;
|
|
5
5
|
export declare function loadSchema(name: string): Record<string, unknown>;
|
package/src/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { dirname, join } from "node:path";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
|
|
5
5
|
export const CONTRACT_PACKAGE = "@consiliency/contract";
|
|
6
|
-
export const CONTRACT_VERSION = "0.6.
|
|
6
|
+
export const CONTRACT_VERSION = "0.6.4";
|
|
7
7
|
|
|
8
8
|
export {
|
|
9
9
|
AuthorityCanonicalError,
|