codex-plugin-doctor 1.12.1 → 1.13.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/README.md +2 -2
- package/dist/core/review-bundle.js +47 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -358,9 +358,9 @@ jobs:
|
|
|
358
358
|
runs-on: ubuntu-latest
|
|
359
359
|
steps:
|
|
360
360
|
- uses: actions/checkout@v5
|
|
361
|
-
- uses: Esquetta/CodexPluginDoctor@v1.
|
|
361
|
+
- uses: Esquetta/CodexPluginDoctor@v1.13.0
|
|
362
362
|
with:
|
|
363
|
-
version: "1.
|
|
363
|
+
version: "1.13.0"
|
|
364
364
|
path: .
|
|
365
365
|
runtime: "true"
|
|
366
366
|
policy: codex-publish
|
|
@@ -10,14 +10,60 @@ import { readJsonFile } from "./read-json-file.js";
|
|
|
10
10
|
function isPlainObject(value) {
|
|
11
11
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12
12
|
}
|
|
13
|
+
function hasExactKeys(value, keys) {
|
|
14
|
+
const actualKeys = Object.keys(value);
|
|
15
|
+
return actualKeys.length === keys.length && keys.every((key) => actualKeys.includes(key));
|
|
16
|
+
}
|
|
17
|
+
function isStatus(value) {
|
|
18
|
+
return value === "pass" || value === "warn" || value === "fail";
|
|
19
|
+
}
|
|
20
|
+
function isRuntimePolicyDecision(value) {
|
|
21
|
+
return value === "allow" ||
|
|
22
|
+
value === "review" ||
|
|
23
|
+
value === "sandbox_recommended" ||
|
|
24
|
+
value === "deny";
|
|
25
|
+
}
|
|
26
|
+
function isBundleFileMap(value) {
|
|
27
|
+
const expectedKeys = Object.keys(relativeBundleFiles());
|
|
28
|
+
return isPlainObject(value) &&
|
|
29
|
+
hasExactKeys(value, expectedKeys) &&
|
|
30
|
+
expectedKeys.every((key) => typeof value[key] === "string");
|
|
31
|
+
}
|
|
32
|
+
function isIntegrityEntry(value) {
|
|
33
|
+
if (!isPlainObject(value)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
const bytes = value.bytes;
|
|
37
|
+
return typeof value.path === "string" &&
|
|
38
|
+
typeof value.digest === "string" &&
|
|
39
|
+
/^sha256:[a-f0-9]{64}$/.test(value.digest) &&
|
|
40
|
+
typeof bytes === "number" &&
|
|
41
|
+
Number.isSafeInteger(bytes) &&
|
|
42
|
+
bytes >= 0;
|
|
43
|
+
}
|
|
44
|
+
function isManifestIntegrity(value) {
|
|
45
|
+
return isPlainObject(value) &&
|
|
46
|
+
value.algorithm === "sha256" &&
|
|
47
|
+
isPlainObject(value.files) &&
|
|
48
|
+
Object.values(value.files).every(isIntegrityEntry);
|
|
49
|
+
}
|
|
13
50
|
function isDoctorReviewBundleManifest(value) {
|
|
14
51
|
return isPlainObject(value) &&
|
|
15
52
|
value.schemaVersion === "1.0.0" &&
|
|
16
53
|
value.kind === "doctor.review.bundle" &&
|
|
54
|
+
typeof value.generatedAt === "string" &&
|
|
55
|
+
typeof value.version === "string" &&
|
|
17
56
|
typeof value.targetPath === "string" &&
|
|
18
57
|
typeof value.outputDirectory === "string" &&
|
|
58
|
+
isStatus(value.status) &&
|
|
59
|
+
(value.exitCode === 0 || value.exitCode === 1) &&
|
|
19
60
|
isPlainObject(value.summary) &&
|
|
20
|
-
|
|
61
|
+
isRuntimePolicyDecision(value.summary.runtimePolicy) &&
|
|
62
|
+
typeof value.summary.releaseReady === "boolean" &&
|
|
63
|
+
isStatus(value.summary.attestation) &&
|
|
64
|
+
(value.summary.releaseEvidence === "pass" || value.summary.releaseEvidence === "fail") &&
|
|
65
|
+
isBundleFileMap(value.files) &&
|
|
66
|
+
(value.integrity === undefined || isManifestIntegrity(value.integrity));
|
|
21
67
|
}
|
|
22
68
|
function statusRank(status) {
|
|
23
69
|
return status === "fail" ? 2 : status === "warn" ? 1 : 0;
|
package/package.json
CHANGED