@consiliency/contract 0.6.4 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +50 -2
  2. package/conformance/registries/authority-key-registry.test.json +48 -0
  3. package/conformance/vectors/authority-algorithm-confusion.json +1 -1
  4. package/conformance/vectors/authority-bad-signature.json +1 -1
  5. package/conformance/vectors/authority-cert-digest-mismatch.json +1 -1
  6. package/conformance/vectors/authority-chain-appended-still-verifies.json +1 -1
  7. package/conformance/vectors/authority-core-validity-expired.json +1 -1
  8. package/conformance/vectors/authority-forged-self-minted.json +1 -1
  9. package/conformance/vectors/authority-key-expired.json +1 -1
  10. package/conformance/vectors/authority-key-revoked.json +1 -1
  11. package/conformance/vectors/authority-missing-signature.json +1 -1
  12. package/conformance/vectors/authority-signer-approver-mismatch.json +1 -1
  13. package/conformance/vectors/authority-unknown-key-id.json +1 -1
  14. package/conformance/vectors/authority-valid.json +1 -1
  15. package/conformance/vectors/authority-wrong-key-valid-id.json +1 -1
  16. package/core/authority-canon/provenance.json +1 -1
  17. package/core/contract.json +24 -4
  18. package/core/registries/authority-key-registry.json +3 -3
  19. package/core/registries/protected-source-categories.json +86 -0
  20. package/core/schemas/git-discipline-protocol.schema.json +1 -1
  21. package/core/schemas/protected-source-category.schema.json +29 -0
  22. package/core/schemas/version-skew-protocol.schema.json +3 -3
  23. package/core/supervised-run/admitted-launch-envelope.schema.json +226 -0
  24. package/core/supervised-run/admitted-launch-envelope.v2.schema.json +880 -0
  25. package/core/supervised-run/conformance/README.md +55 -0
  26. package/core/supervised-run/conformance/README.v2.md +297 -0
  27. package/core/supervised-run/conformance/SHA256SUMS +10 -0
  28. package/core/supervised-run/conformance/envelope.v2.apply.vectors.json +1938 -0
  29. package/core/supervised-run/conformance/envelope.v2.canonical.vectors.json +2088 -0
  30. package/core/supervised-run/conformance/envelope.v2.vectors.json +16359 -0
  31. package/core/supervised-run/conformance/envelope.vectors.json +557 -0
  32. package/core/supervised-run/conformance/run-status.vectors.json +2150 -0
  33. package/core/supervised-run/provenance.json +116 -0
  34. package/core/supervised-run/run-status.schema.json +768 -0
  35. package/package.json +1 -1
  36. package/src/index.d.ts +3 -1
  37. package/src/index.js +8 -1
@@ -0,0 +1,226 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:contract:admitted_launch_envelope.v1",
4
+ "title": "admitted_launch_envelope.v1 (provisional)",
5
+ "description": "What a harness receives after admission. Harness-neutral and language-neutral. Every digest is lowercase hex SHA-256. The harness treats assignment_digest, snapshot_ref, crosswalk_ref, obligation digests and caller_context as opaque. Field types, required fields and closed enums are defined here; the semantic rules a schema cannot establish are listed under x-semantic-rules. Status: provisional until the owning contract revision completes; a change needs reconciliation with every consumer.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema",
10
+ "envelope_digest",
11
+ "assignment_digest",
12
+ "units",
13
+ "workspace",
14
+ "enforcement",
15
+ "obligations",
16
+ "executable_dependencies",
17
+ "caller_context",
18
+ "redaction_posture"
19
+ ],
20
+ "properties": {
21
+ "schema": {
22
+ "const": "admitted_launch_envelope.v1"
23
+ },
24
+ "envelope_digest": {
25
+ "$ref": "#/$defs/sha256",
26
+ "description": "SHA-256 of the RFC 8785 (JCS) serialization of this object with envelope_digest removed."
27
+ },
28
+ "assignment_digest": {
29
+ "$ref": "#/$defs/sha256"
30
+ },
31
+ "units": {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "required": [
35
+ "target_unit_ids",
36
+ "readonly_neighbor_unit_ids",
37
+ "snapshot_ref",
38
+ "crosswalk_ref"
39
+ ],
40
+ "properties": {
41
+ "target_unit_ids": {
42
+ "type": "array",
43
+ "minItems": 1,
44
+ "items": {
45
+ "$ref": "#/$defs/unit_id"
46
+ }
47
+ },
48
+ "readonly_neighbor_unit_ids": {
49
+ "type": "array",
50
+ "items": {
51
+ "$ref": "#/$defs/unit_id"
52
+ }
53
+ },
54
+ "snapshot_ref": {
55
+ "$ref": "#/$defs/sha256"
56
+ },
57
+ "crosswalk_ref": {
58
+ "$ref": "#/$defs/sha256",
59
+ "description": "Opaque reference to the reviewed correspondence of the subject project at the snapshot; identifies the project."
60
+ }
61
+ }
62
+ },
63
+ "workspace": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": [
67
+ "kind",
68
+ "repo_relative_locators"
69
+ ],
70
+ "properties": {
71
+ "kind": {
72
+ "enum": [
73
+ "separate_clone",
74
+ "separate_copy",
75
+ "git_worktree_of_protected",
76
+ "in_place"
77
+ ]
78
+ },
79
+ "repo_relative_locators": {
80
+ "type": "array",
81
+ "items": {
82
+ "type": "string"
83
+ }
84
+ }
85
+ }
86
+ },
87
+ "enforcement": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": [
91
+ "tier",
92
+ "required_constraints"
93
+ ],
94
+ "properties": {
95
+ "tier": {
96
+ "enum": [
97
+ "provider_readonly_patch_return_audit",
98
+ "post_write_audit_only",
99
+ "os_enforced"
100
+ ]
101
+ },
102
+ "required_constraints": {
103
+ "type": "array",
104
+ "uniqueItems": true,
105
+ "items": {
106
+ "enum": [
107
+ "write_scope",
108
+ "command_denial",
109
+ "network_denial"
110
+ ]
111
+ }
112
+ }
113
+ }
114
+ },
115
+ "obligations": {
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": [
119
+ "definition_digests"
120
+ ],
121
+ "properties": {
122
+ "definition_digests": {
123
+ "type": "array",
124
+ "items": {
125
+ "$ref": "#/$defs/sha256"
126
+ }
127
+ }
128
+ }
129
+ },
130
+ "executable_dependencies": {
131
+ "type": "object",
132
+ "additionalProperties": false,
133
+ "required": [
134
+ "declared",
135
+ "admitted_dependency_digest"
136
+ ],
137
+ "properties": {
138
+ "declared": {
139
+ "type": "boolean"
140
+ },
141
+ "admitted_dependency_digest": {
142
+ "anyOf": [
143
+ {
144
+ "$ref": "#/$defs/sha256"
145
+ },
146
+ {
147
+ "type": "null"
148
+ }
149
+ ]
150
+ }
151
+ }
152
+ },
153
+ "caller_context": {
154
+ "type": "object",
155
+ "description": "Opaque. Echoed back byte-for-byte (JCS) in every record that carries it; never interpreted by the harness or the workbench reader."
156
+ },
157
+ "redaction_posture": {
158
+ "const": "digests_and_repo_relative_locators_only"
159
+ }
160
+ },
161
+ "$defs": {
162
+ "sha256": {
163
+ "type": "string",
164
+ "pattern": "^[0-9a-f]{64}$"
165
+ },
166
+ "unit_id": {
167
+ "type": "string",
168
+ "minLength": 1,
169
+ "maxLength": 200
170
+ }
171
+ },
172
+ "x-canonicalization": "RFC 8785 (JCS). Vectors use ASCII object keys and integers only, so code-point and UTF-16 key orders coincide.",
173
+ "x-enforcement-tiers": {
174
+ "provider_readonly_patch_return_audit": {
175
+ "qualified": true,
176
+ "workspace_kinds": [
177
+ "separate_clone",
178
+ "separate_copy"
179
+ ],
180
+ "constraints": {
181
+ "write_scope": "checked_before_apply",
182
+ "command_denial": "not_enforced",
183
+ "network_denial": "not_enforced"
184
+ },
185
+ "limits": "The provider is asked to run read-only; that is the provider's own enforcement, not operating-system confinement. Changes return as proposal bytes that are checked before apply, followed by a post-run audit. A tool-action refusal is detection, not prevention. Network cannot be denied. A same-login process is not contained."
186
+ },
187
+ "post_write_audit_only": {
188
+ "qualified": true,
189
+ "workspace_kinds": [
190
+ "separate_clone",
191
+ "separate_copy",
192
+ "git_worktree_of_protected",
193
+ "in_place"
194
+ ],
195
+ "constraints": {
196
+ "write_scope": "not_enforced",
197
+ "command_denial": "not_enforced",
198
+ "network_denial": "not_enforced"
199
+ },
200
+ "limits": "Detects after the write only. Applies when the workspace is not a separate clone or copy, for example a git worktree of the protected repository, which shares its object store and refs."
201
+ },
202
+ "os_enforced": {
203
+ "qualified": false,
204
+ "workspace_kinds": [],
205
+ "constraints": {
206
+ "write_scope": "not_enforced",
207
+ "command_denial": "not_enforced",
208
+ "network_denial": "not_enforced"
209
+ },
210
+ "limits": "Reserved and unqualified. An envelope that requires it is refused."
211
+ }
212
+ },
213
+ "x-semantic-rules": {
214
+ "envelope_digest_mismatch": "envelope_digest does not equal the JCS SHA-256 of the envelope without envelope_digest.",
215
+ "authority_foreign": "assignment_digest or units.crosswalk_ref differs from the injected validator's independently expected values (another assignment, repository or project), even when the envelope self-verifies.",
216
+ "authority_baseline_stale": "units.snapshot_ref differs from the independently expected snapshot while assignment and crosswalk match, even when the envelope self-verifies.",
217
+ "tier_unqualified": "the tier is reserved or unqualified.",
218
+ "constraint_unsupported": "a required constraint maps to not_enforced under the declared tier; refused with {constraint, tier}, never silently weakened.",
219
+ "workspace_not_separate_copy": "the workspace kind is not permitted for the declared tier.",
220
+ "locator_not_repo_relative": "a locator is empty, absolute, contains a '..' segment or a backslash.",
221
+ "dependency_digest_required": "executable dependencies are declared without an admitted dependency digest.",
222
+ "raw_output_in_record": "a string outside caller_context contains a line break or control character, or exceeds 512 characters.",
223
+ "caller_context_interpreted": "an echoed caller_context differs from the envelope's caller_context.",
224
+ "refusal_zero_invocations": "every refusal above is recorded before any process starts, as state refused with worker_invocations 0."
225
+ }
226
+ }