codex-plugin-doctor 1.10.0 → 1.11.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 +35 -2
- 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.11.0
|
|
362
362
|
with:
|
|
363
|
-
version: "1.
|
|
363
|
+
version: "1.11.0"
|
|
364
364
|
path: .
|
|
365
365
|
runtime: "true"
|
|
366
366
|
policy: codex-publish
|
|
@@ -46,6 +46,10 @@ function relativeBundleFiles() {
|
|
|
46
46
|
releaseEvidenceJson: "release-evidence.json"
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
+
function isPathInsideDirectory(candidatePath, directoryPath) {
|
|
50
|
+
const relativePath = path.relative(directoryPath, candidatePath);
|
|
51
|
+
return relativePath === "" || (!relativePath.startsWith("..") && !path.isAbsolute(relativePath));
|
|
52
|
+
}
|
|
49
53
|
function bundleStatus(runtimePolicy, releaseEvidence) {
|
|
50
54
|
if (runtimePolicy.status === "fail" || releaseEvidence.status === "fail") {
|
|
51
55
|
return "fail";
|
|
@@ -344,7 +348,16 @@ export async function verifyDoctorReviewBundle(bundleDirectory, options) {
|
|
|
344
348
|
const files = manifest?.files ?? relativeBundleFiles();
|
|
345
349
|
for (const [fileKey, relativePath] of Object.entries(files)) {
|
|
346
350
|
try {
|
|
347
|
-
const
|
|
351
|
+
const artifactPath = path.resolve(resolvedBundleDirectory, relativePath);
|
|
352
|
+
if (!isPathInsideDirectory(artifactPath, resolvedBundleDirectory)) {
|
|
353
|
+
checks.push({
|
|
354
|
+
id: `review_bundle.file.${fileKey}`,
|
|
355
|
+
status: "fail",
|
|
356
|
+
message: `${relativePath} resolves outside the review bundle directory.`
|
|
357
|
+
});
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
const fileStat = await stat(artifactPath);
|
|
348
361
|
checks.push({
|
|
349
362
|
id: `review_bundle.file.${fileKey}`,
|
|
350
363
|
status: fileStat.isFile() ? "pass" : "fail",
|
|
@@ -404,7 +417,27 @@ export async function verifyDoctorReviewBundle(bundleDirectory, options) {
|
|
|
404
417
|
continue;
|
|
405
418
|
}
|
|
406
419
|
try {
|
|
407
|
-
const
|
|
420
|
+
const declaredPath = files[fileKey];
|
|
421
|
+
if (expected.path !== declaredPath) {
|
|
422
|
+
integrityStatus = "fail";
|
|
423
|
+
checks.push({
|
|
424
|
+
id: `review_bundle.integrity.${fileKey}.path`,
|
|
425
|
+
status: "fail",
|
|
426
|
+
message: `${expected.path} does not match the declared bundle file path.`
|
|
427
|
+
});
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
const integrityPath = path.resolve(resolvedBundleDirectory, expected.path);
|
|
431
|
+
if (!isPathInsideDirectory(integrityPath, resolvedBundleDirectory)) {
|
|
432
|
+
integrityStatus = "fail";
|
|
433
|
+
checks.push({
|
|
434
|
+
id: `review_bundle.integrity.${fileKey}.path`,
|
|
435
|
+
status: "fail",
|
|
436
|
+
message: `${expected.path} resolves outside the review bundle directory.`
|
|
437
|
+
});
|
|
438
|
+
continue;
|
|
439
|
+
}
|
|
440
|
+
const content = await readFile(integrityPath);
|
|
408
441
|
const digest = sha256(content);
|
|
409
442
|
const matches = digest === expected.digest && content.byteLength === expected.bytes;
|
|
410
443
|
if (!matches) {
|
package/package.json
CHANGED