From 1fee6cc248da8506434b2a22f5a5e13986ff4881 Mon Sep 17 00:00:00 2001 From: "/\\n!KeT KuMaR" Date: Sat, 14 Nov 2026 00:01:26 +0530 Subject: [PATCH 1/2] fix(cli): synchronize help commands and usage Signed-off-by: /\n!KeT KuMaR --- packages/diffci-cli/src/client/cli.ts | 9 ++- .../diffci-cli/tests/client/cli-help.test.ts | 67 +++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 packages/diffci-cli/tests/client/cli-help.test.ts diff --git a/packages/diffci-cli/src/client/cli.ts b/packages/diffci-cli/src/client/cli.ts index cf7cef76..47decc9e 100644 --- a/packages/diffci-cli/src/client/cli.ts +++ b/packages/diffci-cli/src/client/cli.ts @@ -9,6 +9,13 @@ * the observer is exactly what Phase 02 shipped: a local analysis whose output never leaves the runner. * * Commands: + * watch verify changes after each save + * agent-stop verify changes when an AI agent finishes a turn + * telemetry configure anonymous usage reporting + * pilot run observation and verification savings + * pilot-packet generate a shareable compatibility packet + * coverage build a test coverage map + * outcomes summarize previous verification outcomes * init seed a repository with AI-agent instructions for using DiffCI * mcp run the stdio MCP server * verify fail-closed verification of a working-tree snapshot or commit range @@ -1387,7 +1394,7 @@ Usage: [--redact-paths] [--json] [--quiet] [--fail-on-error] [--timeout-ms ] [--share-usage] diffci plan --base [--head ] [--repo ] diffci check-plan --plan --results - diffci red-builds [--runs ] [--workflow ] [--json ] + diffci red-builds [--runs ] [--workflow ] [--json ] [--check-jobs ] [--ci-only-jobs ] diffci pilot --full [--selected ] [--repo ] [--out-dir ] [--label ] diffci pilot-packet [--repo ] [--out-dir ] [--base --head ] [--label ] [--repository-url ] [--redact-paths] diff --git a/packages/diffci-cli/tests/client/cli-help.test.ts b/packages/diffci-cli/tests/client/cli-help.test.ts new file mode 100644 index 00000000..70441268 --- /dev/null +++ b/packages/diffci-cli/tests/client/cli-help.test.ts @@ -0,0 +1,67 @@ + +import { strict as assert } from "node:assert"; +import { spawnSync } from "node:child_process"; +import { describe, it } from "node:test"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; + +const ROOT = join(dirname(fileURLToPath(import.meta.url)), "../.."); +const CLI = join(ROOT, "dist-client", "src", "client", "cli.js"); + +// TODO: Update this list whenever a CLI command is added. +const COMMANDS = [ + "check-plan", + "plan", + "red-builds", + "telemetry", + "init", + "mcp", + "verify", + "watch", + "agent-stop", + "check", + "pilot", + "pilot-packet", + "observe", + "verify-savings", + "validate-specs", + "verify-workflow", + "gate", + "enforce-misses", + "coverage", + "outcomes", + "version", +]; + +describe("CLI help", () => { + it("lists every CLI command", () => { + const build = spawnSync( + process.execPath, + [ + join(ROOT, "..", "..", "node_modules", "typescript", "bin", "tsc"), + "-p", + "tsconfig.client.json", + ], + { cwd: ROOT, encoding: "utf8" }, + ); + + assert.ifError(build.error); + assert.equal(build.status, 0, build.stdout + build.stderr); + + const result = spawnSync(process.execPath, [CLI, "help"], { + cwd: ROOT, + encoding: "utf8", + timeout: 60_000, + }); + + assert.ifError(result.error); + assert.equal(result.status, 0, result.stdout + result.stderr); + + for (const command of COMMANDS) { + assert.ok( + result.stdout.includes(`diffci ${command}`), + `Help output is missing command: diffci ${command}`, + ); + } + }); +}); From c437e4e78ce3430afffccad6651e1360fb5dd7d7 Mon Sep 17 00:00:00 2001 From: adityankale190895 Date: Sat, 14 Nov 2026 09:56:53 +0530 Subject: [PATCH 2/2] fix(cli): list the help test in the release manifest Add cli-help.test.ts to release-files.json so audit:boundary passes, build with the CLI package's own TypeScript as plan-cli.test.ts does, and place the new header entries next to related commands. Co-Authored-By: Claude Opus 5.5 Signed-off-by: adityankale190895 Signed-off-by: /\n!KeT KuMaR --- packages/diffci-cli/src/client/cli.ts | 14 +++++++------- packages/diffci-cli/tests/client/cli-help.test.ts | 3 +-- release-files.json | 1 + 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/diffci-cli/src/client/cli.ts b/packages/diffci-cli/src/client/cli.ts index 47decc9e..c70825a0 100644 --- a/packages/diffci-cli/src/client/cli.ts +++ b/packages/diffci-cli/src/client/cli.ts @@ -9,16 +9,12 @@ * the observer is exactly what Phase 02 shipped: a local analysis whose output never leaves the runner. * * Commands: - * watch verify changes after each save - * agent-stop verify changes when an AI agent finishes a turn - * telemetry configure anonymous usage reporting - * pilot run observation and verification savings - * pilot-packet generate a shareable compatibility packet - * coverage build a test coverage map - * outcomes summarize previous verification outcomes * init seed a repository with AI-agent instructions for using DiffCI * mcp run the stdio MCP server * verify fail-closed verification of a working-tree snapshot or commit range + * watch verify changes after each save + * agent-stop verify changes when an AI agent finishes a turn + * telemetry configure anonymous usage reporting * gate run a build's whole gate and record what DiffCI would have skipped (observe) * check analysis plus automatic paired runtime measurement * plan print Core's advisory JSON plan for a commit range (the input check-plan reads) @@ -26,9 +22,13 @@ * red-builds count a repository's red PR builds a check before the push could have prevented * observe analyse the checkout and write an observation report * verify-savings run a paired full-versus-selected timing check + * pilot run observation and verification savings + * pilot-packet generate a shareable compatibility packet * validate-specs block conflicting same-turn change specifications * verify-workflow check that a DiffCI job in this repository's workflows cannot affect other jobs * enforce-misses after a full run on main, find failures enforce mode would have skipped + * coverage build a test coverage map + * outcomes summarize previous verification outcomes * version print the observer version * * Exit codes: `observe` exits 0 even when it refuses or errors, because a broken observer must not diff --git a/packages/diffci-cli/tests/client/cli-help.test.ts b/packages/diffci-cli/tests/client/cli-help.test.ts index 70441268..2254ce63 100644 --- a/packages/diffci-cli/tests/client/cli-help.test.ts +++ b/packages/diffci-cli/tests/client/cli-help.test.ts @@ -1,4 +1,3 @@ - import { strict as assert } from "node:assert"; import { spawnSync } from "node:child_process"; import { describe, it } from "node:test"; @@ -38,7 +37,7 @@ describe("CLI help", () => { const build = spawnSync( process.execPath, [ - join(ROOT, "..", "..", "node_modules", "typescript", "bin", "tsc"), + join(ROOT, "node_modules", "typescript", "bin", "tsc"), "-p", "tsconfig.client.json", ], diff --git a/release-files.json b/release-files.json index b723f91a..33e2c373 100644 --- a/release-files.json +++ b/release-files.json @@ -352,6 +352,7 @@ "packages/diffci-cli/src/client/red-builds.ts", "packages/diffci-cli/tests/client/check-plan-cli.test.ts", "packages/diffci-cli/tests/client/plan-cli.test.ts", + "packages/diffci-cli/tests/client/cli-help.test.ts", "packages/diffci-cli/tests/client/check-plan-review.test.ts", "packages/diffci-cli/tests/client/check-plan.test.ts", "packages/diffci-cli/tests/client/red-builds.test.ts",