
























@@ -289,6 +289,29 @@ function openclawCommand(repoRoot, args) {
289289};
290290}
291291292+function builtEntryPath(repoRoot) {
293+return path.join(repoRoot, "dist", "entry.js");
294+}
295+296+function selectSlashHelpAliases(plugin, includePluginOwnedCliAliases) {
297+return includePluginOwnedCliAliases
298+ ? plugin.cliCommandAliases
299+ : plugin.cliCommandAliases.filter((entry) => !isPluginOwnedCliAlias(entry));
300+}
301+302+function requiresBuiltEntry(options, selectedPlugins) {
303+if (selectedPlugins.length === 0) {
304+return false;
305+}
306+if (!options.skipLifecycle) {
307+return true;
308+}
309+if (options.skipSlashHelp) {
310+return false;
311+}
312+return selectedPlugins.some((plugin) => selectSlashHelpAliases(plugin, true).length > 0);
313+}
314+292315function sourceOpenclawCommand(repoRoot, args) {
293316return {
294317command: process.execPath,
@@ -773,9 +796,7 @@ async function runPluginLifecycle(params) {
773796774797async function runSlashHelpProbes(params) {
775798for (const plugin of params.plugins) {
776-const aliases = params.includePluginOwnedCliAliases
777- ? plugin.cliCommandAliases
778- : plugin.cliCommandAliases.filter((entry) => !isPluginOwnedCliAlias(entry));
799+const aliases = selectSlashHelpAliases(plugin, params.includePluginOwnedCliAliases);
779800for (const alias of aliases) {
780801process.stderr.write(`[plugin-gauntlet] ${plugin.id} slash-help /${alias.name}\n`);
781802params.rows.push(
@@ -898,7 +919,13 @@ async function main() {
898919const prebuildFailed = rows.some(
899920(row) => row.phase === "prebuild" && (row.status !== 0 || row.timedOut),
900921);
901-if (!prebuildFailed && !options.skipLifecycle) {
922+const entryPath = builtEntryPath(repoRoot);
923+const missingSkippedPrebuildEntry =
924+selectedPlugins.length > 0 &&
925+options.skipPrebuild &&
926+requiresBuiltEntry(options, selectedPlugins) &&
927+!fs.existsSync(entryPath);
928+if (!prebuildFailed && !missingSkippedPrebuildEntry && !options.skipLifecycle) {
902929await runPluginLifecycle({
903930 repoRoot,
904931outputDir: options.outputDir,
@@ -910,7 +937,7 @@ async function main() {
910937skipSlashHelp: options.skipSlashHelp,
911938});
912939}
913-if (!prebuildFailed && !options.skipSlashHelp) {
940+if (!prebuildFailed && !missingSkippedPrebuildEntry && !options.skipSlashHelp) {
914941await runSlashHelpProbes({
915942 repoRoot,
916943outputDir: options.outputDir,
@@ -959,16 +986,22 @@ async function main() {
959986(row) => row.status !== 0 || row.timedOut || row.diagnosticFailure,
960987);
961988const observations = [...metricObservations, ...qaBaselineObservations, ...gatewayObservations];
962-const guardFailures =
963-!hasGauntletWorkRows(rows) && !options.allowEmpty
964- ? [
965-{
966-kind: "empty-run",
967-message:
968-"No lifecycle, slash-help, or QA gauntlet commands ran; remove a skip flag or pass --allow-empty for intentional dry runs.",
969-},
970-]
971- : [];
989+const guardFailures = [];
990+if (missingSkippedPrebuildEntry) {
991+guardFailures.push({
992+kind: "missing-built-entry",
993+message:
994+`${path.relative(repoRoot, entryPath)} is missing; ` +
995+"run without --skip-prebuild or build the gauntlet runtime first.",
996+});
997+}
998+if (!hasGauntletWorkRows(rows) && !options.allowEmpty && guardFailures.length === 0) {
999+guardFailures.push({
1000+kind: "empty-run",
1001+message:
1002+"No lifecycle, slash-help, or QA gauntlet commands ran; remove a skip flag or pass --allow-empty for intentional dry runs.",
1003+});
1004+}
9721005guardFailures.push(...buildObservationGuardFailures(observations, options.failOnObservation));
9731006const hasFailures = failures.length > 0 || guardFailures.length > 0;
9741007preserveRunRoot = preserveRunRoot || hasFailures;
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。