@diffci.com/diffci 0.1.11 → 0.2.0

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.
Files changed (76) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +295 -229
  3. package/action.yml +154 -154
  4. package/dist-client/src/client/cli.js +213 -95
  5. package/dist-client/src/client/economics.js +31 -0
  6. package/dist-client/src/client/full-command.js +46 -0
  7. package/dist-client/src/client/mcp.js +196 -0
  8. package/dist-client/src/client/observe.js +40 -9
  9. package/dist-client/src/client/verify-savings.js +8 -2
  10. package/docs/agent-adoption-kit.md +96 -0
  11. package/docs/agent-adoption-targets.md +52 -0
  12. package/docs/ai-agents.md +27 -3
  13. package/docs/claude-code.md +3 -2
  14. package/docs/codex.md +3 -2
  15. package/docs/copilot.md +4 -4
  16. package/docs/cursor.md +4 -4
  17. package/docs/grok.md +3 -2
  18. package/docs/language-support.md +118 -70
  19. package/docs/mcp.md +21 -0
  20. package/docs/npm-adoption.md +6 -0
  21. package/llms.txt +3 -0
  22. package/node_modules/@babel/parser/bin/babel-parser.js +0 -0
  23. package/node_modules/@diffci.com/core/README.md +9 -1
  24. package/node_modules/@diffci.com/core/dist/cache/economics-context.d.ts +2 -0
  25. package/node_modules/@diffci.com/core/dist/cache/economics-context.js +21 -0
  26. package/node_modules/@diffci.com/core/dist/cache/economics-context.js.map +1 -0
  27. package/node_modules/@diffci.com/core/dist/cache/vue-analysis-cache.d.ts +5 -0
  28. package/node_modules/@diffci.com/core/dist/cache/vue-analysis-cache.js +100 -0
  29. package/node_modules/@diffci.com/core/dist/cache/vue-analysis-cache.js.map +1 -0
  30. package/node_modules/@diffci.com/core/dist/planner/test-command.js +32 -0
  31. package/node_modules/@diffci.com/core/dist/planner/test-command.js.map +1 -1
  32. package/node_modules/@diffci.com/core/dist/repo/adapters/go.d.ts +3 -0
  33. package/node_modules/@diffci.com/core/dist/repo/adapters/go.js +24 -6
  34. package/node_modules/@diffci.com/core/dist/repo/adapters/go.js.map +1 -1
  35. package/node_modules/@diffci.com/core/dist/repo/adapters/index.js +2 -1
  36. package/node_modules/@diffci.com/core/dist/repo/adapters/index.js.map +1 -1
  37. package/node_modules/@diffci.com/core/dist/repo/adapters/maven.d.ts +3 -0
  38. package/node_modules/@diffci.com/core/dist/repo/adapters/maven.js +65 -0
  39. package/node_modules/@diffci.com/core/dist/repo/adapters/maven.js.map +1 -0
  40. package/node_modules/@diffci.com/core/dist/repo/adapters/types.d.ts +11 -0
  41. package/node_modules/@diffci.com/core/dist/repo/adapters/types.js.map +1 -1
  42. package/node_modules/@diffci.com/core/dist/repo/adapters/vue.js +142 -14
  43. package/node_modules/@diffci.com/core/dist/repo/adapters/vue.js.map +1 -1
  44. package/node_modules/@diffci.com/core/dist/repo/graph.d.ts +4 -0
  45. package/node_modules/@diffci.com/core/dist/repo/graph.js +169 -19
  46. package/node_modules/@diffci.com/core/dist/repo/graph.js.map +1 -1
  47. package/node_modules/@diffci.com/core/dist/repo/impact.js +22 -5
  48. package/node_modules/@diffci.com/core/dist/repo/impact.js.map +1 -1
  49. package/node_modules/@diffci.com/core/dist/repo/repo-config.d.ts +15 -0
  50. package/node_modules/@diffci.com/core/dist/repo/repo-config.js +13 -2
  51. package/node_modules/@diffci.com/core/dist/repo/repo-config.js.map +1 -1
  52. package/node_modules/@diffci.com/core/dist/repo/test-discovery.js +2 -0
  53. package/node_modules/@diffci.com/core/dist/repo/test-discovery.js.map +1 -1
  54. package/node_modules/@diffci.com/core/dist/repo/types.d.ts +17 -0
  55. package/node_modules/@diffci.com/core/dist/repo/vue-scope.d.ts +4 -0
  56. package/node_modules/@diffci.com/core/dist/repo/vue-scope.js +157 -0
  57. package/node_modules/@diffci.com/core/dist/repo/vue-scope.js.map +1 -0
  58. package/node_modules/@diffci.com/core/src/cache/economics-context.ts +19 -0
  59. package/node_modules/@diffci.com/core/src/cache/vue-analysis-cache.ts +80 -0
  60. package/node_modules/@diffci.com/core/src/planner/test-command.ts +28 -0
  61. package/node_modules/@diffci.com/core/src/repo/adapters/go.ts +24 -5
  62. package/node_modules/@diffci.com/core/src/repo/adapters/index.ts +2 -1
  63. package/node_modules/@diffci.com/core/src/repo/adapters/maven.ts +38 -0
  64. package/node_modules/@diffci.com/core/src/repo/adapters/types.ts +5 -0
  65. package/node_modules/@diffci.com/core/src/repo/adapters/vue.ts +120 -15
  66. package/node_modules/@diffci.com/core/src/repo/graph.ts +146 -20
  67. package/node_modules/@diffci.com/core/src/repo/impact.ts +20 -4
  68. package/node_modules/@diffci.com/core/src/repo/repo-config.ts +20 -2
  69. package/node_modules/@diffci.com/core/src/repo/test-discovery.ts +2 -0
  70. package/node_modules/@diffci.com/core/src/repo/types.ts +11 -0
  71. package/node_modules/@diffci.com/core/src/repo/vue-scope.ts +122 -0
  72. package/node_modules/nanoid/bin/nanoid.cjs +0 -0
  73. package/node_modules/typescript/bin/tsc +0 -0
  74. package/node_modules/typescript/bin/tsserver +0 -0
  75. package/node_modules/yaml/bin.mjs +0 -0
  76. package/package.json +155 -138
package/action.yml CHANGED
@@ -1,155 +1,155 @@
1
- # DiffCI observer - the GitHub Action a third-party repository installs (Phase 02, 2026-08-26).
2
- #
3
- # WHAT THIS DOES: analyses one commit range against the checkout the job already has, writes a JSON
4
- # report to the runner's temp directory, prints a summary to the job log and the job summary, optionally
5
- # uploads the report as an artifact, and - only when `api-url` and `api-token` are both set - sends that
6
- # same report to DiffCI. With no token configured nothing leaves the runner at all.
7
- #
8
- # WHAT THIS DOES NOT DO, and cannot: run tests, skip tests, cancel a job, re-order steps, write to the
9
- # repository, comment on a pull request, or set a check status. There is no input below that turns any
10
- # of that on, because the claim being tested for seven days is that installing DiffCI leaves CI
11
- # byte-identical, and a flag that could change what CI runs would eventually be set by accident.
12
- #
13
- # INSTALL IT AS ITS OWN JOB. A job of its own is what makes the claim structural rather than careful:
14
- #
15
- # jobs:
16
- # diffci:
17
- # runs-on: ubuntu-latest
18
- # continue-on-error: true # a DiffCI failure must not become the workflow's conclusion
19
- # permissions:
20
- # contents: read
21
- # steps:
22
- # - uses: actions/checkout@v4
23
- # with:
24
- # fetch-depth: 0 # the base commit must exist locally, or DiffCI refuses
1
+ # DiffCI observer - the GitHub Action a third-party repository installs (Phase 02, 2026-08-26).
2
+ #
3
+ # WHAT THIS DOES: analyses one commit range against the checkout the job already has, writes a JSON
4
+ # report to the runner's temp directory, prints a summary to the job log and the job summary, optionally
5
+ # uploads the report as an artifact, and - only when `api-url` and `api-token` are both set - sends that
6
+ # same report to DiffCI. With no token configured nothing leaves the runner at all.
7
+ #
8
+ # WHAT THIS DOES NOT DO, and cannot: run tests, skip tests, cancel a job, re-order steps, write to the
9
+ # repository, comment on a pull request, or set a check status. There is no input below that turns any
10
+ # of that on, because the claim being tested for seven days is that installing DiffCI leaves CI
11
+ # byte-identical, and a flag that could change what CI runs would eventually be set by accident.
12
+ #
13
+ # INSTALL IT AS ITS OWN JOB. A job of its own is what makes the claim structural rather than careful:
14
+ #
15
+ # jobs:
16
+ # diffci:
17
+ # runs-on: ubuntu-latest
18
+ # continue-on-error: true # a DiffCI failure must not become the workflow's conclusion
19
+ # permissions:
20
+ # contents: read
21
+ # steps:
22
+ # - uses: actions/checkout@v4
23
+ # with:
24
+ # fetch-depth: 0 # the base commit must exist locally, or DiffCI refuses
25
25
  # - uses: DiffCI/DiffCI.com@<40-character commit sha>
26
- #
27
- # `diffci verify-workflow` checks those properties against your own workflow files and exits non-zero
28
- # if any of them does not hold. Run it before the observation window starts.
29
- name: DiffCI observer
30
- description: Observation-only change-aware CI analysis. Runs nothing, changes nothing, skips nothing.
31
- branding:
32
- icon: eye
33
- color: gray-dark
34
-
35
- inputs:
36
- repository-path:
37
- description: The checkout to observe. Defaults to the workspace.
38
- required: false
39
- default: ${{ github.workspace }}
40
- base-sha:
41
- description: Base commit. Leave empty to derive it from the event (pull request base, push before).
42
- required: false
43
- default: ""
44
- head-sha:
45
- description: Head commit. Must be given together with base-sha.
46
- required: false
47
- default: ""
48
- node-version:
49
- description: Node version used to run the observer. Only affects this job.
50
- required: false
51
- default: "22"
52
- report-path:
53
- description: Where to write the report. Must be outside the checkout. Defaults to RUNNER_TEMP.
54
- required: false
55
- default: ""
56
- redact-paths:
57
- description: Replace every file path in the report with a stable 12-character digest.
58
- required: false
59
- default: "false"
60
- upload-artifact:
61
- description: Upload the report as a workflow artifact.
62
- required: false
63
- default: "true"
64
- artifact-name:
65
- description: Name of the uploaded artifact.
66
- required: false
67
- default: diffci-observation
68
- artifact-retention-days:
69
- description: Retention for the uploaded artifact.
70
- required: false
71
- default: "7"
72
- api-url:
73
- description: >-
74
- DiffCI ingest endpoint. Leave empty and nothing is sent anywhere - the report stays on the runner
75
- as an artifact. Must be https.
76
- required: false
77
- default: ""
78
- api-token:
79
- description: >-
80
- Ingest token for THIS repository, from a repository secret. Pass it as the workflow expression
81
- for secrets.DIFFCI_TOKEN, never as a literal. Nothing is sent without it. (This text deliberately
82
- does not spell out the expression: GitHub evaluates expressions inside action metadata, and
83
- "secrets" is not a context an action file may use - a literal expression here made the whole
84
- action fail to load on every run until 2026-09-06.)
85
- required: false
86
- default: ""
87
- fail-on-error:
88
- description: >-
89
- Fail this step when the observation refuses or errors. Default false, so a DiffCI problem never
90
- shows up as a red step in your CI. Turn it on only while debugging an installation.
91
- required: false
92
- default: "false"
93
-
94
- outputs:
95
- report-path:
96
- description: Absolute path of the written report.
97
- value: ${{ steps.observe.outputs.report-path }}
98
- status:
99
- description: OBSERVED, REFUSED, or ERROR.
100
- value: ${{ steps.observe.outputs.status }}
101
-
102
- runs:
103
- using: composite
104
- steps:
105
- - name: Set up Node for the observer
106
- uses: actions/setup-node@v4
107
- with:
108
- node-version: ${{ inputs.node-version }}
109
-
110
- # Installed into the action's own directory, never into the observed repository: nothing here
111
- # touches the workspace, its node_modules, or its lockfile. --omit=dev keeps this to TypeScript and
112
- # a YAML parser; --ignore-scripts means no dependency of DiffCI's runs code on your runner.
113
- - name: Install observer dependencies
114
- shell: bash
115
- working-directory: ${{ github.action_path }}
116
- run: npm ci --omit=dev --no-audit --fund=false --ignore-scripts
117
-
118
- - name: Build observer
119
- shell: bash
120
- working-directory: ${{ github.action_path }}
121
- run: node_modules/.bin/tsc -p tsconfig.client.json
122
-
123
- - name: Observe
124
- id: observe
125
- shell: bash
126
- env:
127
- DIFFCI_REPO: ${{ inputs.repository-path }}
128
- DIFFCI_BASE: ${{ inputs.base-sha }}
129
- DIFFCI_HEAD: ${{ inputs.head-sha }}
130
- DIFFCI_OUT: ${{ inputs.report-path }}
131
- DIFFCI_REDACT: ${{ inputs.redact-paths }}
132
- DIFFCI_FAIL_ON_ERROR: ${{ inputs.fail-on-error }}
133
- # Passed through the environment, never on the command line: an argv is visible to every other
134
- # process on the runner and shows up in traces. The observer reads these directly and never
135
- # prints them.
136
- DIFFCI_API_URL: ${{ inputs.api-url }}
137
- DIFFCI_TOKEN: ${{ inputs.api-token }}
138
- run: |
139
- set -euo pipefail
140
- args=(observe --repo "$DIFFCI_REPO")
141
- if [ -n "$DIFFCI_BASE" ]; then args+=(--base "$DIFFCI_BASE"); fi
142
- if [ -n "$DIFFCI_HEAD" ]; then args+=(--head "$DIFFCI_HEAD"); fi
143
- if [ -n "$DIFFCI_OUT" ]; then args+=(--out "$DIFFCI_OUT"); fi
144
- if [ "$DIFFCI_REDACT" = "true" ]; then args+=(--redact-paths); fi
145
- if [ "$DIFFCI_FAIL_ON_ERROR" = "true" ]; then args+=(--fail-on-error); fi
146
- node "$GITHUB_ACTION_PATH/dist-client/src/client/cli.js" "${args[@]}"
147
-
148
- - name: Upload observation report
149
- if: ${{ inputs.upload-artifact == 'true' && steps.observe.outputs.report-path != '' }}
150
- uses: actions/upload-artifact@v4
151
- with:
152
- name: ${{ inputs.artifact-name }}
153
- path: ${{ steps.observe.outputs.report-path }}
154
- retention-days: ${{ inputs.artifact-retention-days }}
155
- if-no-files-found: warn
26
+ #
27
+ # `diffci verify-workflow` checks those properties against your own workflow files and exits non-zero
28
+ # if any of them does not hold. Run it before the observation window starts.
29
+ name: DiffCI observer
30
+ description: Observation-only change-aware CI analysis. Runs nothing, changes nothing, skips nothing.
31
+ branding:
32
+ icon: eye
33
+ color: gray-dark
34
+
35
+ inputs:
36
+ repository-path:
37
+ description: The checkout to observe. Defaults to the workspace.
38
+ required: false
39
+ default: ${{ github.workspace }}
40
+ base-sha:
41
+ description: Base commit. Leave empty to derive it from the event (pull request base, push before).
42
+ required: false
43
+ default: ""
44
+ head-sha:
45
+ description: Head commit. Must be given together with base-sha.
46
+ required: false
47
+ default: ""
48
+ node-version:
49
+ description: Node version used to run the observer. Only affects this job.
50
+ required: false
51
+ default: "22"
52
+ report-path:
53
+ description: Where to write the report. Must be outside the checkout. Defaults to RUNNER_TEMP.
54
+ required: false
55
+ default: ""
56
+ redact-paths:
57
+ description: Replace every file path in the report with a stable 12-character digest.
58
+ required: false
59
+ default: "false"
60
+ upload-artifact:
61
+ description: Upload the report as a workflow artifact.
62
+ required: false
63
+ default: "true"
64
+ artifact-name:
65
+ description: Name of the uploaded artifact.
66
+ required: false
67
+ default: diffci-observation
68
+ artifact-retention-days:
69
+ description: Retention for the uploaded artifact.
70
+ required: false
71
+ default: "7"
72
+ api-url:
73
+ description: >-
74
+ DiffCI ingest endpoint. Leave empty and nothing is sent anywhere - the report stays on the runner
75
+ as an artifact. Must be https.
76
+ required: false
77
+ default: ""
78
+ api-token:
79
+ description: >-
80
+ Ingest token for THIS repository, from a repository secret. Pass it as the workflow expression
81
+ for secrets.DIFFCI_TOKEN, never as a literal. Nothing is sent without it. (This text deliberately
82
+ does not spell out the expression: GitHub evaluates expressions inside action metadata, and
83
+ "secrets" is not a context an action file may use - a literal expression here made the whole
84
+ action fail to load on every run until 2026-09-06.)
85
+ required: false
86
+ default: ""
87
+ fail-on-error:
88
+ description: >-
89
+ Fail this step when the observation refuses or errors. Default false, so a DiffCI problem never
90
+ shows up as a red step in your CI. Turn it on only while debugging an installation.
91
+ required: false
92
+ default: "false"
93
+
94
+ outputs:
95
+ report-path:
96
+ description: Absolute path of the written report.
97
+ value: ${{ steps.observe.outputs.report-path }}
98
+ status:
99
+ description: OBSERVED, REFUSED, or ERROR.
100
+ value: ${{ steps.observe.outputs.status }}
101
+
102
+ runs:
103
+ using: composite
104
+ steps:
105
+ - name: Set up Node for the observer
106
+ uses: actions/setup-node@v4
107
+ with:
108
+ node-version: ${{ inputs.node-version }}
109
+
110
+ # Installed into the action's own directory, never into the observed repository: nothing here
111
+ # touches the workspace, its node_modules, or its lockfile. --omit=dev keeps this to TypeScript and
112
+ # a YAML parser; --ignore-scripts means no dependency of DiffCI's runs code on your runner.
113
+ - name: Install observer dependencies
114
+ shell: bash
115
+ working-directory: ${{ github.action_path }}
116
+ run: npm ci --omit=dev --no-audit --fund=false --ignore-scripts
117
+
118
+ - name: Build observer
119
+ shell: bash
120
+ working-directory: ${{ github.action_path }}
121
+ run: node_modules/.bin/tsc -p tsconfig.client.json
122
+
123
+ - name: Observe
124
+ id: observe
125
+ shell: bash
126
+ env:
127
+ DIFFCI_REPO: ${{ inputs.repository-path }}
128
+ DIFFCI_BASE: ${{ inputs.base-sha }}
129
+ DIFFCI_HEAD: ${{ inputs.head-sha }}
130
+ DIFFCI_OUT: ${{ inputs.report-path }}
131
+ DIFFCI_REDACT: ${{ inputs.redact-paths }}
132
+ DIFFCI_FAIL_ON_ERROR: ${{ inputs.fail-on-error }}
133
+ # Passed through the environment, never on the command line: an argv is visible to every other
134
+ # process on the runner and shows up in traces. The observer reads these directly and never
135
+ # prints them.
136
+ DIFFCI_API_URL: ${{ inputs.api-url }}
137
+ DIFFCI_TOKEN: ${{ inputs.api-token }}
138
+ run: |
139
+ set -euo pipefail
140
+ args=(observe --repo "$DIFFCI_REPO")
141
+ if [ -n "$DIFFCI_BASE" ]; then args+=(--base "$DIFFCI_BASE"); fi
142
+ if [ -n "$DIFFCI_HEAD" ]; then args+=(--head "$DIFFCI_HEAD"); fi
143
+ if [ -n "$DIFFCI_OUT" ]; then args+=(--out "$DIFFCI_OUT"); fi
144
+ if [ "$DIFFCI_REDACT" = "true" ]; then args+=(--redact-paths); fi
145
+ if [ "$DIFFCI_FAIL_ON_ERROR" = "true" ]; then args+=(--fail-on-error); fi
146
+ node "$GITHUB_ACTION_PATH/dist-client/src/client/cli.js" "${args[@]}"
147
+
148
+ - name: Upload observation report
149
+ if: ${{ inputs.upload-artifact == 'true' && steps.observe.outputs.report-path != '' }}
150
+ uses: actions/upload-artifact@v4
151
+ with:
152
+ name: ${{ inputs.artifact-name }}
153
+ path: ${{ steps.observe.outputs.report-path }}
154
+ retention-days: ${{ inputs.artifact-retention-days }}
155
+ if-no-files-found: warn