@xemahq/xema 0.47.1 → 0.48.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/edition/README.md
CHANGED
|
@@ -143,7 +143,7 @@ The edition library builds, validates and verifies evidence statements; it never
|
|
|
143
143
|
|
|
144
144
|
## Kernel protocol and pins
|
|
145
145
|
|
|
146
|
-
The CLI is coupled to the kernel's edition protocol, not to the kernel package. `@xemahq/contracts` exports the protocol identity as data (`dist/edition-protocol/edition-protocol.json`: `{contentDigest, provisional, version}`). This CLI supports protocols v28 and
|
|
146
|
+
The CLI is coupled to the kernel's edition protocol, not to the kernel package. `@xemahq/contracts` exports the protocol identity as data (`dist/edition-protocol/edition-protocol.json`: `{contentDigest, provisional, version}`). This CLI supports protocols v28, v30 and v31 (no published kernel declares v29; a CLI lists a protocol only while every kernel published under it exports what the CLI imports; v27 and older kernels lack `serviceImageSubjects`, so a data root whose pinned kernel speaks v27 or older stays on an earlier CLI), pinned to its digest and vendored, and REFUSES an identity with `provisional: true`; every loader that executes the kernel, `xema edition check` first, and the evidence verifier compare only that identity and refuse an unsupported one, naming the supported and the declared versions. A protocol change needs a CLI release first; only then does the data root repin its kernel authority.
|
|
147
147
|
|
|
148
148
|
A develop edition does not take the kernel's develop head blindly: `xema edition develop choose-kernel --kernel <package dir> [--kernel-pin <40-hex>] --out <file>` reads the declared protocol of each commit on the checkout's first-parent history (from source, unbuilt) and chooses the newest one this CLI supports. It writes `{chosenSha, headSha, held, reason}` (`reason`: `head-supported` | `head-ahead` | `explicit-pin`; `held` is `head-ahead`), and when held prints `kernel held at v<N> (<sha12>), head at v<M> (<sha12>): raise the CLI` (stdout only, never persisted). The head is the checkout's `refs/remotes/origin/develop` (a full-history checkout). An explicit pin wins but is still checked, and must be on that head's first-parent history (`not-on-develop` otherwise); when no commit is supported it refuses (`EditionProtocolMismatchError`, `no-supported-commit`; the walk ends at the first commit with no declaration file) and never falls back to the head; a declaration that exists but does not parse, at the head or any walked commit, is refused by name (`unparseable`), never skipped. `freeze-graph` applies the same check to `--kernel-sha`.
|
|
149
149
|
|
|
@@ -31,10 +31,11 @@ import { readBoundedNoFollowFile } from './no-follow-file.mjs';
|
|
|
31
31
|
/** The edition protocols this library interprets: version -> content digest. A protocol is listed only
|
|
32
32
|
* while every kernel published under it exports what this library imports (`kernel-export-coverage.test.mjs`):
|
|
33
33
|
* v27 and older kernels lack `serviceImageSubjects` (first exported by the v28 kernel), so they are not listed.
|
|
34
|
-
* No published kernel declares v29 (0.110.2 is v28, 0.110.3 is v30), so v29 is not listed either. */
|
|
34
|
+
* No published kernel declares v29 (0.110.2 is v28, 0.110.3 is v30, 0.111.0 is v31), so v29 is not listed either. */
|
|
35
35
|
export const SUPPORTED_EDITION_PROTOCOLS = Object.freeze([
|
|
36
36
|
Object.freeze({ version: 28, contentDigest: 'f7795478b1bfe9a41bcbea9efe496011fcd209a56c90294029a08801e84cf92c' }),
|
|
37
37
|
Object.freeze({ version: 30, contentDigest: '91e3cdff255778b5aa94b64ca9316d031be549ead2267a9a9311ff06d4f1db2c' }),
|
|
38
|
+
Object.freeze({ version: 31, contentDigest: 'b2026847fdd202e7b9e05815cdc2c9819b60be7007c789cc5b5f291c9c682fdd' }),
|
|
38
39
|
]);
|
|
39
40
|
|
|
40
41
|
/** Where a kernel package publishes its identity and its contract, package-relative. */
|
|
@@ -205,7 +205,7 @@ export function writeInvalidReferrerReport(skipped) {
|
|
|
205
205
|
* An artifact that is not valid evidence under `expectedAuthorityCommit`
|
|
206
206
|
* (a manifest that is not the exact subject's, RAW statements stating another authority commit, a
|
|
207
207
|
* failed strict parse, a statement whose contract authority is not exactly
|
|
208
|
-
* `expectedContractAuthority
|
|
208
|
+
* `expectedContractAuthority`, which is required) is refused with `InvalidEvidenceReferrerError`; a
|
|
209
209
|
* registry that cannot answer, or bytes that do not match their digests
|
|
210
210
|
* (`EvidenceIntegrityError`, a tampering signal), still throw.
|
|
211
211
|
*/
|
|
@@ -216,9 +216,12 @@ export async function readImageSourceEvidenceArtifact({
|
|
|
216
216
|
artifactDigest,
|
|
217
217
|
schemas,
|
|
218
218
|
expectedAuthorityCommit,
|
|
219
|
-
expectedContractAuthority
|
|
219
|
+
expectedContractAuthority,
|
|
220
220
|
}) {
|
|
221
221
|
assertExpectedAuthorityCommit(expectedAuthorityCommit);
|
|
222
|
+
if (!expectedContractAuthority) {
|
|
223
|
+
throw new Error('the expected kernel contract authority is required');
|
|
224
|
+
}
|
|
222
225
|
const fetched = await client.getManifestByDigest(repository, artifactDigest);
|
|
223
226
|
const invalid = (error) =>
|
|
224
227
|
new InvalidEvidenceReferrerError({
|
|
@@ -269,11 +272,9 @@ export async function readImageSourceEvidenceArtifact({
|
|
|
269
272
|
// The wire schema checks the shape of an authority's sourcePaths only
|
|
270
273
|
// (contracts 0.110.3), so a statement naming the expected commit with
|
|
271
274
|
// another path set or digest parses: it is not evidence under the pin.
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
throw new Error(`${record.key} statement's kernel contract authority is not exactly the expected one at ${expectedAuthorityCommit}`);
|
|
276
|
-
}
|
|
275
|
+
for (const record of evidence.records) {
|
|
276
|
+
if (canonicalJson(record.statement.predicate.contractAuthority) !== canonicalJson(expectedContractAuthority)) {
|
|
277
|
+
throw new Error(`${record.key} statement's kernel contract authority is not exactly the expected one at ${expectedAuthorityCommit}`);
|
|
277
278
|
}
|
|
278
279
|
}
|
|
279
280
|
return { ...evidence, artifactDigest, created };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/xema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/xema-dev/xema-cli.git",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@xemahq/distribution-source-hash": "^0.2.2",
|
|
55
55
|
"@xemahq/dsl": "^0.24.0",
|
|
56
56
|
"@xemahq/identity-client": "^0.16.0",
|
|
57
|
-
"@xemahq/contracts": "^0.
|
|
57
|
+
"@xemahq/contracts": "^0.111.0",
|
|
58
58
|
"@xemahq/kernel-state-runtime": "^0.8.0",
|
|
59
59
|
"@xemahq/license-verifier": "^0.2.0",
|
|
60
60
|
"@xemahq/service-registry-nest": "^0.12.2",
|
|
@@ -92,6 +92,6 @@
|
|
|
92
92
|
"typecheck": "tsc --noEmit"
|
|
93
93
|
},
|
|
94
94
|
"xemaRelease": {
|
|
95
|
-
"sourceDigest": "sha256:
|
|
95
|
+
"sourceDigest": "sha256:5f6bd75aa0d1bdc9a141a6f9f31be0957f7a8e5aa967695362db0ced936cac5a"
|
|
96
96
|
}
|
|
97
97
|
}
|