auditor-lambda 0.6.0 → 0.6.3
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/dist/cli/dispatch.js +9 -5
- package/package.json +1 -1
package/dist/cli/dispatch.js
CHANGED
|
@@ -187,9 +187,12 @@ export async function prepareDispatchArtifacts(params) {
|
|
|
187
187
|
}
|
|
188
188
|
const bundle = await loadArtifactBundle(artifactsDir);
|
|
189
189
|
const tasksPath = join(runDir, "pending-audit-tasks.json");
|
|
190
|
-
const tasks = await readJsonFile(tasksPath).catch((error) => {
|
|
191
|
-
if (isFileMissingError(error))
|
|
192
|
-
|
|
190
|
+
const tasks = await readJsonFile(tasksPath).catch(async (error) => {
|
|
191
|
+
if (isFileMissingError(error)) {
|
|
192
|
+
const generated = buildPendingAuditTasks(bundle);
|
|
193
|
+
await writeJsonFile(tasksPath, generated);
|
|
194
|
+
return generated;
|
|
195
|
+
}
|
|
193
196
|
throw error;
|
|
194
197
|
});
|
|
195
198
|
const sessionConfig = params.sessionConfig ?? (await loadSessionConfig(artifactsDir).catch(() => ({})));
|
|
@@ -353,7 +356,7 @@ export async function prepareDispatchArtifacts(params) {
|
|
|
353
356
|
"",
|
|
354
357
|
];
|
|
355
358
|
});
|
|
356
|
-
const submitCommand = `
|
|
359
|
+
const submitCommand = `node packages/audit-code/audit-code.mjs submit-packet ` +
|
|
357
360
|
`--run-id-b64 ${toBase64Url(runId)} ` +
|
|
358
361
|
`--packet-id-b64 ${toBase64Url(packet.packet_id)} ` +
|
|
359
362
|
`--artifacts-dir-b64 ${toBase64Url(artifactsDir)}`;
|
|
@@ -395,7 +398,7 @@ export async function prepareDispatchArtifacts(params) {
|
|
|
395
398
|
" unit_id copy from the task metadata",
|
|
396
399
|
" pass_id copy from the task metadata",
|
|
397
400
|
" lens copy from the task metadata",
|
|
398
|
-
" file_coverage [{path, total_lines}] - copy the exact template from each task section above",
|
|
401
|
+
" file_coverage [{path, total_lines}] - copy the exact template from each task section above. You MUST include total_lines. Do not omit or zero it out, as this will cause fatal validation errors.",
|
|
399
402
|
" findings [] or array of finding objects",
|
|
400
403
|
"",
|
|
401
404
|
"Lens verification tasks:",
|
|
@@ -425,6 +428,7 @@ export async function prepareDispatchArtifacts(params) {
|
|
|
425
428
|
"## Submit",
|
|
426
429
|
"Pipe the JSON array on stdin to this command:",
|
|
427
430
|
` ${submitCommand}`,
|
|
431
|
+
" (If using Windows PowerShell, you MUST use `Get-Content <file> | & <command>` instead of the `<` operator.)",
|
|
428
432
|
"",
|
|
429
433
|
"The command validates and writes the packet-owned result files. Exit 0 means accepted.",
|
|
430
434
|
"Non-zero: read the errors, fix the JSON, and run the same submit command again. Retry up to 3 times.",
|