Skip to content

docs: document verify-workflow, pilot-packet, validate-specs and telemetry - #153

Merged
adityankale190895 merged 3 commits into
DiffCI:mainfrom
sarankumar1325:docs/remaining-commands
Nov 17, 2026
Merged

adityankale190895 merged 3 commits into
DiffCI:mainfrom
sarankumar1325:docs/remaining-commands

Conversation

@sarankumar1325

@sarankumar1325 sarankumar1325 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #128.

Adds a "More commands" section to docs/using-diffci.md, just before "Interpret the result", with a short index and one subsection per command. Each subsection says what the command does, gives an example and explains the exit codes. It also says what the command reads, writes and sends. Docs only.

I ran every example on a small synthetic TypeScript repository (one source file, one node:test file, one observer workflow), using the CLI from this branch (tsx packages/diffci-cli/src/client/cli.ts). The outputs and exit codes quoted come from those runs:

  • verify-workflow:

    • exit 0 with only the ACTION_NOT_PINNED warning;
    • exit 1 after removing continue-on-error, with the JOB_NOT_CONTINUE_ON_ERROR output shown in the doc;
    • --enforce exits 1 with ENFORCE_JOB_MISSING and FULL_SUITE_NOT_ON_DEFAULT_BRANCH.

    The finding codes come from workflow-guard.ts.

  • pilot-packet:

    • exit 0 (OBSERVED), writing the three files to ../diffci-output;
    • exit 1 (REFUSED) on a plain-JS repo with no tsconfig;
    • git status in the checkout was clean afterwards.

    The exit-2 cases come from runPilotPacket.

  • validate-specs: conflict exits 1, clean exits 0, --json prints the report, and a wrong file shape or a missing --file exits 1. The input rules come from spec-conflicts.ts.

  • telemetry: shows the choice; --mode count-only / repo rewrite telemetry.json (count-only drops the installation ID); --mode off is still accepted and maps to count-only; --mode bogus exits 1. The section links to docs/telemetry.md for the field list instead of copying it.

Two places where the issue no longer matches the code, so the docs follow the code:

  • The issue says telemetry is "off by default" with modes off|anonymous|installations. Since then, usage counting is on by default, the modes are repo|count-only, and the old names are mapped. Only DO_NOT_TRACK=1, DIFFCI_NO_SEND=1 or DIFFCI_SHARE_USAGE=0 stop it; --no-send stops report uploads only. The doc says this plainly.
  • --share-usage still appears in the usage text for verify, check and observe, but nothing in packages/diffci-cli/src reads it any more, so I left it out of the doc. You may want to drop it from the usage text, or tell me what it should say.

npm test (1100 pass), npm run typecheck and npm run audit:boundary pass.

Written with an AI coding assistant; I reviewed and checked every statement against the code and the runs above.

Update (32fa0da): I checked the four Codex findings against the code, and all four were right. The doc now says:

  • verify-workflow passing means no blocking interference, and each listed code shows its severity. Added JOB_SHARES_CONCURRENCY_GROUP.
  • --enforce checks that DIFFCI_ENFORCE is wired to vars.DIFFCI_ENFORCE, not a job-level if:.
  • --redact-paths hashes result paths, but workflow findings and some fallback details can still name files.
  • The installation ID is sent only after telemetry --mode repo has saved one; a never-configured default sends none.

Related, not changed here: docs/telemetry.md says the installation ID is "created locally" as if that always happens, and has the same gap.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T10:12:09.839028Z 01ae6fb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01ae6fb482

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/using-diffci.md Outdated
npx @diffci.com/diffci@latest verify-workflow --repo .
```

`verify-workflow` reads the YAML files in `.github/workflows` and finds the jobs that run the DiffCI action as an observer. It then checks that these jobs can't change what the rest of CI does. Findings are marked `[BLOCKING]` or `[WARNING]` and have stable codes. For example:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Limit the audit claim to blocking interference

When the audit finds only warnings such as JOB_SHARES_CONCURRENCY_GROUP (whose message says one job can cancel another) or JOB_HAS_WRITE_PERMISSIONS, runVerifyWorkflow still exits 0 because only BLOCKING findings fail. Saying these jobs "can't change" CI overstates what a successful exit proves; describe the command as checking for blocking interference or make these cases blocking.

Useful? React with 👍 / 👎.

Comment thread docs/using-diffci.md Outdated
`verify-workflow --enforce [--default-branch main] [--full-command "<cmd>"]` checks the opposite for enforce mode. It confirms three things:

- a job runs `diffci verify --policy enforce` as a gate (a `continue-on-error` dry run doesn't count);
- that job is switched on and off by the `vars.DIFFCI_ENFORCE` repository variable;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Check the job condition before claiming it is switched off

An enforce workflow that passes DIFFCI_ENFORCE: ${{ vars.DIFFCI_ENFORCE }} to verify --policy enforce but has no job-level if still passes auditEnforceWorkflows: it checks the variable's environment wiring, not the job condition. When the variable is off, verify still runs and falls back to the full suite rather than switching the job off. Clarify that the variable disables selective enforcement, or make the audit check the job condition.

Useful? React with 👍 / 👎.

Comment thread docs/using-diffci.md Outdated
- `diffci-observe.json`: the raw observation report.
- `diffci-observe.yml`: a non-blocking observation workflow for you to review. It isn't installed.

`--label` names the repository in the packet (default: the checkout's folder name). `--repository-url` adds a link and must be `https://`. `--redact-paths` keeps file paths out of the report.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Redact every report path before promising a shareable packet

With --redact-paths, observe() hashes result paths but still embeds workflow findings from safeAuditWorkflows(repoPath) and passes fallbackDetails through unchanged. A report with a workflow finding or fallback can therefore still expose raw names such as .github/workflows/ci.yml despite this promise. Redact all path-bearing report fields or narrow the claim before users share the packet.

Useful? React with 👍 / 👎.

Comment thread docs/using-diffci.md Outdated
npx @diffci.com/diffci@latest telemetry --mode count-only # count runs without the repository name
```

Usage counting is **on by default**. After each `plan`, `check`, `observe` and `verify` run, DiffCI sends a small count. It includes the command, the outcome, the version, where it ran, a random installation ID and the repository name (host/owner/repo). It never sends code, paths, commits, test names or reports. [Usage counting](telemetry.md) has the full field list.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct the default installation-ID claim

On a fresh install, readTelemetryPreference() returns the default repo mode without an installation ID, and recordUsage() sends the ID only when one is already present; an ID is created by explicitly running telemetry --mode repo. Thus default counts can include a recognizable repository name but do not include the random installation ID claimed here, so install-level usage metrics are missing it. Generate and save the ID for the default mode or qualify this statement.

Useful? React with 👍 / 👎.

…n-ID claims to what the code does

Signed-off-by: sarankumar1325 <[email protected]>

@adityankale190895 adityankale190895 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a thorough write-up. I checked the finding codes and severities, the --enforce flags, the pilot-packet defaults and the telemetry env vars against the code, and they all match.

One sentence needs fixing. The telemetry section says:

On the command line, --mode takes only repo or count-only; anything else exits 1.

configureTelemetry runs --mode through normaliseMode too, so the CLI also accepts off and anonymous (both become count-only) and installations (becomes repo). Only an unknown value like bogus exits 1. You noted this in the PR description, so the doc should match. Something like: "--mode takes repo or count-only; the older names are still accepted and mapped the same way, and any other value exits 1."

Once that's in, this is ready to merge.

@adityankale190895 adityankale190895 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --mode sentence is fixed in ac24c55. Thanks, merging.

@adityankale190895
adityankale190895 merged commit 1e73290 into DiffCI:main Nov 17, 2026
13 checks passed
adityankale190895 added a commit that referenced this pull request Nov 17, 2026
The tool description promised digests for every path in the report.
Workflow findings and some fallback details still name files, as the
#153 review found and docs/using-diffci.md already says.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adityankale190895 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: document verify-workflow, pilot-packet, validate-specs and telemetry

2 participants