diff --git a/apps/manifest.json b/apps/manifest.json index 84bad09b0..39a18f1be 100644 --- a/apps/manifest.json +++ b/apps/manifest.json @@ -8,7 +8,7 @@ "ciCapable": true }, { - "id": "revenue", + "id": "revenue-analytics", "dir": "revenue", "label": "Revenue Analytics", "description": "Wire Stripe + PostHog for revenue tracking", diff --git a/services/wizard-benchmark/index.ts b/services/wizard-benchmark/index.ts index 26c41753d..b7c9a3aa7 100644 --- a/services/wizard-benchmark/index.ts +++ b/services/wizard-benchmark/index.ts @@ -215,10 +215,12 @@ function runBenchmark( }); } - // Subcommand (e.g. 'revenue') must come before flags + // Subcommand (e.g. 'revenue', or a family leaf like 'audit events') must come + // before flags. Split on whitespace so multi-token subcommands become + // separate argv entries. const subcommand = commandToSubcommand(command.id); const args: string[] = [wizardBin]; - if (subcommand) args.push(subcommand); + if (subcommand) args.push(...subcommand.split(' ')); args.push( "--local-mcp", "--benchmark", diff --git a/services/wizard-ci/utils.ts b/services/wizard-ci/utils.ts index 4cea297af..e5649f172 100644 --- a/services/wizard-ci/utils.ts +++ b/services/wizard-ci/utils.ts @@ -192,10 +192,12 @@ export function runWizard(appPath: string, options: WizardOptions = {}): Promise }); } - // Build wizard args — subcommand (e.g. 'revenue') must come before flags + // Build wizard args — subcommand (e.g. 'revenue', or a family leaf like + // 'audit events') must come before flags. Split on whitespace so multi-token + // subcommands become separate argv entries. const args = [wizardBin]; if (options.command) { - args.push(options.command); + args.push(...options.command.split(' ')); } if (options.skillId) { args.push(`--skill=${options.skillId}`); diff --git a/services/wizard-commands.ts b/services/wizard-commands.ts index c6b0d4946..345c3f2ad 100644 --- a/services/wizard-commands.ts +++ b/services/wizard-commands.ts @@ -51,13 +51,25 @@ function loadManifest(): WizardCommand[] { export const WIZARD_COMMANDS: WizardCommand[] = loadManifest(); +/** + * Family commands (e.g. `audit`) require a concrete leaf in non-interactive + * runs — after the CLI overhaul, bare `wizard audit` opens an interactive + * picker (or errors under `--ci`) instead of running an audit. Drive a + * sensible default leaf so CI keeps exercising the command. `all` runs the + * comprehensive audit so CI checks full integrations end-to-end. + */ +const FAMILY_DEFAULT_LEAF: Record = { audit: 'all' }; + /** * Convert a command id to the subcommand string the wizard binary expects. * 'default' → undefined (no subcommand), 'skill' → undefined (uses --skill flag), - * any other id → the id itself. + * a family id → " " (e.g. 'audit' → 'audit events'), + * any other id → the id itself. May be multi-token — callers must split on + * whitespace before pushing into an argv array. */ export function commandToSubcommand(id: string): string | undefined { if (id === 'default' || id === 'skill') return undefined; + if (FAMILY_DEFAULT_LEAF[id]) return `${id} ${FAMILY_DEFAULT_LEAF[id]}`; return id; }