@diffci.com/diffci 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -49,6 +49,17 @@ content-addressed snapshot passed and remained unchanged while tests ran. The JS
49
49
  For paired full-versus-selected runtime measurement, use `check`. For analysis without test execution,
50
50
  use `npx "@diffci.com/diffci@latest" observe --no-send`.
51
51
 
52
+ To prepare a maintainer-reviewable pilot without changing the target repository or running its tests:
53
+
54
+ ```bash
55
+ npx "@diffci.com/diffci@latest" pilot-packet --repo /path/to/checkout \
56
+ --label owner/repository --repository-url https://github.com/owner/repository
57
+ ```
58
+
59
+ The command writes `pilot-packet.md`, the raw observation, and a pinned non-blocking GitHub Actions
60
+ workflow to `../diffci-output` by default. The packet describes compatibility and planned selection;
61
+ it does not present planned reduction as measured runtime savings.
62
+
52
63
  To add instructions for coding agents, run:
53
64
 
54
65
  ```bash
@@ -181,19 +192,19 @@ permissions:
181
192
  contents: read
182
193
  jobs:
183
194
  diffci:
184
- runs-on: ubuntu-latest
195
+ runs-on: ubuntu-24.04
185
196
  continue-on-error: true
186
197
  steps:
187
- - uses: actions/checkout@v4
198
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # immutable checkout pin
188
199
  with:
189
200
  fetch-depth: 0
190
- - uses: DiffCI/DiffCI.com@db73353e680c3713a8426817e13b045a1f2dcb15
201
+ - uses: DiffCI/DiffCI.com@12e910f5938fe57cb5e5dc2aa3dce3dc7405d00c
191
202
  ```
192
203
 
193
204
  Then check the workflow locally with `npx "@diffci.com/diffci@latest" verify-workflow`. Keep the observer
194
205
  out of required checks and other jobs' `needs` lists. The Action adds a job summary and a
195
206
  `diffci-observation` artifact to the run; it does not alter which tests your other jobs execute.
196
- The example pins release `v0.3.3` to its qualified feature commit SHA for reproducibility.
207
+ The example pins release `v0.3.5` to its qualified feature commit SHA for reproducibility.
197
208
 
198
209
  The CLI sends no report with `--no-send`. The Action uploads a GitHub artifact by default; sending to
199
210
  DiffCI's hosted service requires an explicitly configured endpoint and token.
@@ -396,7 +407,7 @@ npm run research:sandbox:deploy
396
407
  DiffCI is intended to be installable as infrastructure, not only as a hosted shadow experiment:
397
408
 
398
409
  ```yaml
399
- - uses: DiffCI/DiffCI.com@db73353e680c3713a8426817e13b045a1f2dcb15
410
+ - uses: DiffCI/DiffCI.com@12e910f5938fe57cb5e5dc2aa3dce3dc7405d00c
400
411
  ```
401
412
 
402
413
  ```bash
package/action.yml CHANGED
@@ -14,12 +14,12 @@
14
14
  #
15
15
  # jobs:
16
16
  # diffci:
17
- # runs-on: ubuntu-latest
17
+ # runs-on: ubuntu-24.04
18
18
  # continue-on-error: true # a DiffCI failure must not become the workflow's conclusion
19
19
  # permissions:
20
20
  # contents: read
21
21
  # steps:
22
- # - uses: actions/checkout@v4
22
+ # - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23
23
  # with:
24
24
  # fetch-depth: 0 # the base commit must exist locally, or DiffCI refuses
25
25
  # - uses: DiffCI/DiffCI.com@<40-character commit sha>
@@ -103,7 +103,7 @@ runs:
103
103
  using: composite
104
104
  steps:
105
105
  - name: Set up Node for the observer
106
- uses: actions/setup-node@v4
106
+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
107
107
  with:
108
108
  node-version: ${{ inputs.node-version }}
109
109
 
@@ -40,6 +40,7 @@ import { detectSpecificationConflicts, readSpecificationFile } from "./spec-conf
40
40
  import { formatVerificationSummary, verificationExitCode, verifyChanged, verifyRange } from "./verify.js";
41
41
  import { formatGrowthPrompt, formatVerifySavingsSummary, measureCommand, runVerifySavings, writeVerifySavingsReport } from "./verify-savings.js";
42
42
  import { auditWorkflows, isNonInterfering } from "./workflow-guard.js";
43
+ import { buildPilotWorkflow, renderPilotPacket } from "./pilot-packet.js";
43
44
  function parseArgs(argv) {
44
45
  const args = argv.slice(2);
45
46
  const flags = {};
@@ -193,13 +194,13 @@ permissions:
193
194
  contents: read
194
195
  jobs:
195
196
  diffci:
196
- runs-on: ubuntu-latest
197
+ runs-on: ubuntu-24.04
197
198
  continue-on-error: true
198
199
  steps:
199
- - uses: actions/checkout@v4
200
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # immutable checkout pin
200
201
  with:
201
202
  fetch-depth: 0
202
- - uses: actions/setup-node@v4
203
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # immutable setup-node pin
203
204
  with:
204
205
  node-version: 22
205
206
  - run: npx "@diffci.com/diffci@${version}" observe --no-send
@@ -213,13 +214,13 @@ permissions:
213
214
  jobs:
214
215
  diffci-verify:
215
216
  name: DiffCI verification
216
- runs-on: ubuntu-latest
217
+ runs-on: ubuntu-24.04
217
218
  steps:
218
- - uses: actions/checkout@v4
219
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # immutable checkout pin
219
220
  with:
220
221
  fetch-depth: 0
221
222
  ref: \${{ github.event.pull_request.head.sha || github.sha }}
222
- - uses: actions/setup-node@v4
223
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # immutable setup-node pin
223
224
  with:
224
225
  node-version: 22
225
226
  - name: Verify changed code
@@ -774,6 +775,43 @@ function runVerifySavingsCommand(flags, env) {
774
775
  function defaultPilotOutputDir(repoPath) {
775
776
  return join(dirname(repoPath), "diffci-output");
776
777
  }
778
+ async function runPilotPacket(flags, env) {
779
+ const repoPath = resolve(stringFlag(flags, "repo") ?? env.GITHUB_WORKSPACE ?? process.cwd());
780
+ const outDir = resolve(stringFlag(flags, "out-dir") ?? defaultPilotOutputDir(repoPath));
781
+ if (isInsideRepository(repoPath, outDir) || outDir === repoPath) {
782
+ console.error(`Refusing to write pilot packet inside the repository: ${outDir}. Pass --out-dir with a path outside the checkout.`);
783
+ return 2;
784
+ }
785
+ const label = stringFlag(flags, "label") ?? basename(repoPath);
786
+ const repositoryUrl = stringFlag(flags, "repository-url");
787
+ if (repositoryUrl && !/^https:\/\//i.test(repositoryUrl)) {
788
+ console.error("--repository-url must be an https URL");
789
+ return 2;
790
+ }
791
+ const observationPath = join(outDir, "diffci-observe.json");
792
+ const packetPath = join(outDir, "pilot-packet.md");
793
+ const workflowPath = join(outDir, "diffci-observe.yml");
794
+ const identity = observerIdentity();
795
+ const observation = await observe({
796
+ repoPath,
797
+ env: env,
798
+ version: identity.version,
799
+ engineSha: identity.sha,
800
+ baseOverride: stringFlag(flags, "base"),
801
+ headOverride: stringFlag(flags, "head"),
802
+ redactPaths: flags["redact-paths"] === true,
803
+ reportPath: observationPath,
804
+ });
805
+ mkdirSync(outDir, { recursive: true });
806
+ writeFileSync(observationPath, `${JSON.stringify(observation, null, 2)}\n`, "utf8");
807
+ writeFileSync(packetPath, renderPilotPacket(observation, { label, repositoryUrl }), "utf8");
808
+ writeFileSync(workflowPath, buildPilotWorkflow(identity.version), "utf8");
809
+ console.log(summarise(observation));
810
+ console.log(` packet: ${packetPath}`);
811
+ console.log(` observation report: ${observationPath}`);
812
+ console.log(` reviewable workflow: ${workflowPath}`);
813
+ return observation.status === "OBSERVED" ? 0 : 1;
814
+ }
777
815
  async function runPilot(flags, env) {
778
816
  const full = stringFlag(flags, "full");
779
817
  if (!full) {
@@ -869,6 +907,8 @@ Usage:
869
907
  diffci check [--repo <path>] [--out <file>] [--base <sha> --head <sha>]
870
908
  [--redact-paths] [--json] [--quiet] [--fail-on-error] [--timeout-ms <ms>] [--share-usage]
871
909
  diffci pilot --full <command> [--repo <path>] [--out-dir <dir>] [--label <name>]
910
+ diffci pilot-packet [--repo <path>] [--out-dir <dir>] [--base <sha> --head <sha>]
911
+ [--label <name>] [--repository-url <https-url>] [--redact-paths]
872
912
  diffci observe [--repo <path>] [--out <file>] [--base <sha> --head <sha>]
873
913
  [--redact-paths] [--json] [--quiet] [--fail-on-error]
874
914
  [--api-url <url> --api-token <token>] [--no-send] [--share-usage]
@@ -893,6 +933,8 @@ verify without --changed resolves the CI event range (or HEAD^..HEAD locally), r
893
933
  and exits zero only when the analyzed head is the commit that actually passed verification.
894
934
  check analyzes the change, runs inferred full and selected commands, and shows measured savings.
895
935
  pilot runs observe and verify-savings together, writing reports to ../diffci-output by default.
936
+ pilot-packet writes a shareable compatibility summary, raw observation, and non-blocking workflow
937
+ outside the checkout. It runs no tests, modifies no target-repository files, and sends nothing.
896
938
  observe analyses the checkout and writes one JSON report. It runs nothing and changes nothing.
897
939
  verify-savings runs both commands and reports measured paired runtime; it is an opt-in pilot command.
898
940
  validate-specs checks an explicit list of specification IDs and logical targets and blocks duplicates.
@@ -928,6 +970,9 @@ async function main() {
928
970
  case "pilot":
929
971
  process.exitCode = await runPilot(flags, env);
930
972
  return;
973
+ case "pilot-packet":
974
+ process.exitCode = await runPilotPacket(flags, env);
975
+ return;
931
976
  case "observe":
932
977
  process.exitCode = await runObserve(flags, env);
933
978
  return;
@@ -0,0 +1,110 @@
1
+ const CHECKOUT_SHA = "3d3c42e5aac5ba805825da76410c181273ba90b1";
2
+ const SETUP_NODE_SHA = "820762786026740c76f36085b0efc47a31fe5020";
3
+ const UPLOAD_ARTIFACT_SHA = "043fb46d1a93c77aae656e7c1c64a875d1fc6a0a";
4
+ function text(value) {
5
+ return value?.trim() || "not reported";
6
+ }
7
+ function bullets(values, empty) {
8
+ return values.length > 0 ? values.map((value) => `- ${value}`).join("\n") : `- ${empty}`;
9
+ }
10
+ export function buildPilotWorkflow(version) {
11
+ return `name: DiffCI pilot observation
12
+ on: [pull_request]
13
+ permissions:
14
+ contents: read
15
+ jobs:
16
+ diffci-pilot:
17
+ name: DiffCI pilot (non-blocking)
18
+ runs-on: ubuntu-24.04
19
+ continue-on-error: true
20
+ steps:
21
+ - uses: actions/checkout@${CHECKOUT_SHA} # immutable checkout pin
22
+ with:
23
+ fetch-depth: 0
24
+ - uses: actions/setup-node@${SETUP_NODE_SHA} # immutable setup-node pin
25
+ with:
26
+ node-version: 22
27
+ - name: Observe only
28
+ run: npx "@diffci.com/diffci@${version}" observe --no-send --out "$RUNNER_TEMP/diffci-observe.json"
29
+ - name: Upload local observation
30
+ if: always()
31
+ uses: actions/upload-artifact@${UPLOAD_ARTIFACT_SHA} # immutable upload-artifact v7 pin
32
+ with:
33
+ name: diffci-observation-\${{ github.run_id }}-\${{ github.run_attempt }}
34
+ path: \${{ runner.temp }}/diffci-observe.json
35
+ if-no-files-found: warn
36
+ `;
37
+ }
38
+ export function renderPilotPacket(report, options) {
39
+ const result = report.result;
40
+ const range = report.commitRange;
41
+ const repository = options.repositoryUrl
42
+ ? `[${options.label}](${options.repositoryUrl})`
43
+ : options.label;
44
+ const selection = result?.mode === "FULL"
45
+ ? `full validation required across ${result.totalTestCount} discovered test files`
46
+ : result
47
+ ? `${result.selectedTests.length} of ${result.totalTestCount} discovered test files`
48
+ : "not available";
49
+ const reduction = result?.mode === "FULL"
50
+ ? "0.0% planned test-file reduction (full validation required)"
51
+ : result && result.totalTestCount > 0
52
+ ? `${Math.max(0, (1 - result.selectedTests.length / result.totalTestCount) * 100).toFixed(1)}% planned test-file reduction`
53
+ : "not available";
54
+ const nextStep = report.status !== "OBSERVED"
55
+ ? "Resolve the reported observation limit before evaluating a pilot."
56
+ : result?.mode === "FULL"
57
+ ? "This change requires full validation; observe more representative changes before judging fit."
58
+ : "Review the proposed command, then use `diffci pilot --full <command>` to measure paired runtime.";
59
+ return `# DiffCI compatibility packet: ${options.label}
60
+
61
+ Generated ${report.producedAt} by DiffCI ${report.observer.version}. This is a read-only compatibility assessment, not a measured savings claim.
62
+
63
+ ## Repository and revision
64
+
65
+ - Repository: ${repository}
66
+ - Base: ${text(range?.baseSha)}
67
+ - Head: ${text(range?.headSha)}
68
+ - Range source: ${text(range?.source)}
69
+
70
+ ## Result
71
+
72
+ - Observation status: **${report.status}**
73
+ - Stage: ${report.stage}
74
+ - Decision: ${result?.mode ?? "not available"}
75
+ - Selection: ${selection}
76
+ - Planning result: ${reduction}
77
+ - Analysis status: ${result?.analysisStatus ?? "not available"}
78
+ - Reason: ${report.reason ?? result?.commandRefusalReason ?? "none"}
79
+
80
+ ### Proposed commands
81
+
82
+ ${bullets(result?.proposedCommands ?? [], "none")}
83
+
84
+ ### Conservative fallbacks and risk signals
85
+
86
+ ${bullets([
87
+ ...(result?.fallbackReasons ?? []),
88
+ ...(result?.riskSignals ?? []).map((signal) => `${signal.level}: ${signal.reason}`),
89
+ ], "none")}
90
+
91
+ ## Safety evidence
92
+
93
+ - Working tree unchanged: ${report.nonInterference.worktreeUnchanged ? "yes" : "no"}
94
+ - Report written outside the repository: ${report.nonInterference.reportWrittenOutsideRepository ? "yes" : "no"}
95
+ - File contents included: ${report.payload.includesFileContents ? "yes" : "no"}
96
+ - Environment included: ${report.payload.includesEnvironment ? "yes" : "no"}
97
+ - Credentials included: ${report.payload.includesCredentials ? "yes" : "no"}
98
+ - Workflow findings: ${report.nonInterference.workflowFindings.length}
99
+
100
+ ### Workflow findings
101
+
102
+ ${bullets(report.nonInterference.workflowFindings.map((finding) => `${finding.severity} ${finding.code}: ${finding.message}`), "none")}
103
+
104
+ ## Recommended next step
105
+
106
+ ${nextStep}
107
+
108
+ The accompanying \`diffci-observe.yml\` is a reviewable, non-blocking GitHub Actions workflow. It has read-only permissions, sends nothing, and uploads the observation only to the repository's own workflow run.
109
+ `;
110
+ }
@@ -122,7 +122,7 @@ They are supporting signals only.
122
122
 
123
123
  | Signal | Value | Interpretation |
124
124
  | --- | ---: | --- |
125
- | npm latest version | `0.3.3` | Current CLI and MCP binaries are publicly available. |
125
+ | npm latest version | `0.3.5` | Current CLI and MCP binaries are publicly available. |
126
126
  | npm downloads, last complete registry week (`2026-09-15`–`2026-09-21`) | 1,929 | Distribution activity; not unique users or repositories. |
127
127
  | GitHub stars / forks / watchers | 0 / 0 / 0 | No repository-level community conversion yet. |
128
128
  | GitHub views, available 14-day window | 18 views / 4 unique visitors | Early discovery signal. |
@@ -38,13 +38,13 @@ permissions:
38
38
  contents: read
39
39
  jobs:
40
40
  diffci:
41
- runs-on: ubuntu-latest
41
+ runs-on: ubuntu-24.04
42
42
  continue-on-error: true
43
43
  steps:
44
- - uses: actions/checkout@v4
44
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # immutable checkout pin
45
45
  with:
46
46
  fetch-depth: 0
47
- - uses: DiffCI/DiffCI.com@db73353e680c3713a8426817e13b045a1f2dcb15 # v0.3.3
47
+ - uses: DiffCI/DiffCI.com@12e910f5938fe57cb5e5dc2aa3dce3dc7405d00c # v0.3.5
48
48
  ```
49
49
 
50
50
  Run `npx "@diffci.com/diffci@latest" verify-workflow` before starting a pilot. The Action uploads a
@@ -63,18 +63,18 @@ continue-on-error job:
63
63
  ```yaml
64
64
  jobs:
65
65
  diffci:
66
- runs-on: ubuntu-latest
66
+ runs-on: ubuntu-24.04
67
67
  continue-on-error: true
68
68
  permissions:
69
69
  contents: read
70
70
  steps:
71
- - uses: actions/checkout@v4
71
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # immutable checkout pin
72
72
  with:
73
73
  fetch-depth: 0
74
- - uses: DiffCI/DiffCI.com@db73353e680c3713a8426817e13b045a1f2dcb15
74
+ - uses: DiffCI/DiffCI.com@12e910f5938fe57cb5e5dc2aa3dce3dc7405d00c
75
75
  ```
76
76
 
77
- The example pins release `v0.3.3` to its qualified feature commit SHA. `npx "@diffci.com/diffci@latest" verify-workflow`
77
+ The example pins release `v0.3.5` to its qualified feature commit SHA. `npx "@diffci.com/diffci@latest" verify-workflow`
78
78
  checks that the job is dedicated, read-only, not required by other jobs, and unable to alter the rest
79
79
  of CI.
80
80
 
@@ -30,15 +30,15 @@ Use the GitHub Action when someone wants the normal non-blocking CI installation
30
30
  ```yaml
31
31
  jobs:
32
32
  diffci:
33
- runs-on: ubuntu-latest
33
+ runs-on: ubuntu-24.04
34
34
  continue-on-error: true
35
35
  permissions:
36
36
  contents: read
37
37
  steps:
38
- - uses: actions/checkout@v4
38
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # immutable checkout pin
39
39
  with:
40
40
  fetch-depth: 0
41
- - uses: DiffCI/DiffCI.com@db73353e680c3713a8426817e13b045a1f2dcb15
41
+ - uses: DiffCI/DiffCI.com@12e910f5938fe57cb5e5dc2aa3dce3dc7405d00c
42
42
  ```
43
43
 
44
44
  ## Outreach Copy
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diffci.com/diffci",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Fail-closed, change-aware verification for AI coding agents with conservative affected-test selection",
5
5
  "keywords": [
6
6
  "ci",
@@ -5,7 +5,7 @@
5
5
  "args": [
6
6
  "--yes",
7
7
  "--package",
8
- "@diffci.com/diffci@0.3.3",
8
+ "@diffci.com/diffci@0.3.5",
9
9
  "diffci-mcp"
10
10
  ]
11
11
  }
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "io.github.DiffCI/diffci",
4
4
  "title": "DiffCI",
5
5
  "description": "Fail-closed, change-aware verification for AI coding agents with affected-test guidance.",
6
- "version": "0.3.3",
6
+ "version": "0.3.5",
7
7
  "websiteUrl": "https://diffci.com/mcp-server",
8
8
  "repository": {
9
9
  "url": "https://github.com/DiffCI/DiffCI.com",
@@ -22,7 +22,7 @@
22
22
  {
23
23
  "registryType": "npm",
24
24
  "identifier": "@diffci.com/diffci",
25
- "version": "0.3.3",
25
+ "version": "0.3.5",
26
26
  "transport": {
27
27
  "type": "stdio"
28
28
  },