From a186146c69c7b6410994e182e593bad14eb8dca9 Mon Sep 17 00:00:00 2001 From: John Dvorak Date: Fri, 22 May 2026 12:51:12 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20close=20CLI=20term=20gaps=20=E2=80=94=20?= =?UTF-8?q?workspace=20rejection,=20stale=20types,=20quiet,=20placebo,=20h?= =?UTF-8?q?elp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/commands/doctor/index.ts | 21 --------------------- src/cli/commands/init/index.ts | 2 +- src/cli/commands/observe/index.ts | 14 ++++++++++++++ src/cli/commands/qualify/index.ts | 2 +- src/cli/commands/verify/index.ts | 2 +- src/cli/core/index.ts | 12 +++++++----- 6 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/cli/commands/doctor/index.ts b/src/cli/commands/doctor/index.ts index 64cf8de..68d7023 100644 --- a/src/cli/commands/doctor/index.ts +++ b/src/cli/commands/doctor/index.ts @@ -26,16 +26,6 @@ import { runDocsChecks } from './checks/docs.js'; import { renderJson } from '../../renderers/json.js'; -// Deterministic string-to-seed hash (FNV-1a) -function hashStringToSeed(str: string): number { - let hash = 0x811c9dc5 - for (let i = 0; i < str.length; i++) { - hash ^= str.charCodeAt(i) - hash = Math.imul(hash, 0x01000193) - } - return Math.abs(hash >>> 0) -} - // --------------------------------------------------------------------------- // Types // --------------------------------------------------------------------------- @@ -206,17 +196,6 @@ async function runPackageChecks( checks.push({ ...result, package: packageName }); } - // 6. Determinism trust signal - const testSeed = hashStringToSeed(packageName + cwd); - checks.push({ - name: 'determinism', - status: 'pass', - message: `Environment supports deterministic replay (test seed: ${testSeed})`, - detail: `Run with --seed ${testSeed} to reproduce the exact same test sequence`, - mode: 'all', - package: packageName, - }); - return checks; } diff --git a/src/cli/commands/init/index.ts b/src/cli/commands/init/index.ts index a25d805..0a9f616 100644 --- a/src/cli/commands/init/index.ts +++ b/src/cli/commands/init/index.ts @@ -622,7 +622,7 @@ function parseInitOptions(args: string[], ctx: CliContext): InitOptions { export async function handleInit(args: string[], ctx: CliContext): Promise { const result = await initHandler(args, ctx); - if (result.message) { + if (result.message && !ctx.options.quiet) { console.log(result.message); } diff --git a/src/cli/commands/observe/index.ts b/src/cli/commands/observe/index.ts index 2767c84..a0a9e45 100644 --- a/src/cli/commands/observe/index.ts +++ b/src/cli/commands/observe/index.ts @@ -328,6 +328,20 @@ export async function handleObserve( checks: result.checks, message: result.message, }) + '\n'); + } else if (format === 'json-summary') { + console.log(renderJson({ + exitCode: result.exitCode, + checks: result.checks, + message: result.message, + })); + } else if (format === 'ndjson-summary') { + process.stdout.write(JSON.stringify({ + type: 'run.completed', + command: 'observe', + exitCode: result.exitCode, + checks: result.checks, + message: result.message, + }) + '\n'); } else { console.log(result.message); } diff --git a/src/cli/commands/qualify/index.ts b/src/cli/commands/qualify/index.ts index 338f247..635a6b6 100644 --- a/src/cli/commands/qualify/index.ts +++ b/src/cli/commands/qualify/index.ts @@ -68,7 +68,7 @@ export interface QualifyOptions { changed?: boolean config?: string cwd?: string - format?: 'human' | 'json' | 'ndjson' + format?: 'human' | 'json' | 'ndjson' | 'json-summary' | 'ndjson-summary' quiet?: boolean verbose?: boolean artifactDir?: string diff --git a/src/cli/commands/verify/index.ts b/src/cli/commands/verify/index.ts index bcaf6da..db82a7f 100644 --- a/src/cli/commands/verify/index.ts +++ b/src/cli/commands/verify/index.ts @@ -59,7 +59,7 @@ export interface VerifyOptions { changed?: boolean config?: string cwd?: string - format?: 'human' | 'json' | 'ndjson' + format?: 'human' | 'json' | 'ndjson' | 'json-summary' | 'ndjson-summary' quiet?: boolean verbose?: boolean artifactDir?: string diff --git a/src/cli/core/index.ts b/src/cli/core/index.ts index ed737b6..693adcb 100644 --- a/src/cli/core/index.ts +++ b/src/cli/core/index.ts @@ -54,9 +54,9 @@ function getCommandHelp(command: string): string { apophis init [options] ${pc.dim('Options:')} - --preset Preset name (e.g. safe-ci, full) - --force Overwrite existing files - --noninteractive Skip all prompts, require explicit flags + --preset, -p Preset name (e.g. safe-ci, full) + --force, -f Overwrite existing files + --noninteractive Skip all prompts, require explicit flags ${pc.dim('Examples:')} apophis init --preset safe-ci @@ -116,9 +116,11 @@ function getCommandHelp(command: string): string { ${pc.dim('Options:')} --artifact Path to failure artifact + --route Select failure by route pattern ${pc.dim('Examples:')} apophis replay --artifact reports/apophis/failure-*.json + apophis replay --artifact failure-1.json --route "POST /users" `, doctor: ` ${pc.bold('apophis doctor')} — Validate config, environment safety, docs/example correctness @@ -377,8 +379,8 @@ export async function main(argv: string[] = process.argv.slice(2)): Promise> = { init: new Set(['--preset', '-p', '--force', '-f', '--noninteractive']), verify: new Set(['--profile', '--routes', '--seed', '--changed', '--workspace']), - observe: new Set(['--profile', '--check-config', '--workspace']), - qualify: new Set(['--profile', '--seed', '--workspace', '--changed']), + observe: new Set(['--profile', '--check-config']), + qualify: new Set(['--profile', '--seed', '--changed']), replay: new Set(['--artifact', '--route']), doctor: new Set(['--mode', '--strict', '--workspace']), migrate: new Set(['--check', '--dry-run', '--write']),