@diffci.com/diffci 0.2.7 → 0.2.8

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.
@@ -1,118 +1,118 @@
1
- # Language and framework support
2
-
3
- DiffCI now has an extensible repository-adapter boundary and initial Vue, Go, and Maven support.
4
- These additions propose selections in the existing observer; they do not enable production CI skipping.
5
-
6
- | Surface | Implemented scope | Boundaries |
7
- | --- | --- | --- |
8
- | JavaScript / TypeScript | Existing dependency analysis and ten existing test-runner command mappings | Runner recognition is not a guarantee of complete framework semantics |
9
- | Vue | SFC parsing with `@vue/compiler-sfc`; script imports, literal Options API component registrations, empty script fixtures, compiled template asset imports; propagation into importing JS/TS tests; protected runtime-dependent tests in verified isolated scopes | Runtime uncertainty requires full validation unless protected by the isolated-suite policy below; preprocessors, external/custom SFC blocks, style URLs/imports, Nuxt conventions and glob imports require full validation |
10
- | Go | One root module; optional explicit root-module scope in a repository containing nested modules; native metadata, package-level transitive selection, embeds and Go test commands | Workspaces, changes inside excluded modules, inactive Go files, cgo/native objects, plugins, generation/linkname and incomplete metadata require full validation; root scoping rejects local replacements |
11
- | Maven / Java / Kotlin | Conventional multi-module reactors with `src/main/{java,kotlin}` and `src/test/{java,kotlin}`; module dependency propagation; Surefire-style test names; proposed reactor commands | Nonstandard layouts, generated sources, integration-test conventions, and POM changes may require full validation. Maven commands are observations and must match the repository's CI lifecycle and profiles. |
12
- | Mixed Go and JS/TS | Detected | Full validation until cross-language relationships are declared and modeled |
13
- | Python, Svelte, Astro, C#, Rust | No new semantic support in this release | Require additional adapters and qualification |
14
-
15
- ## Using the observer
16
-
17
- Use the existing `observe` command and commit range options. The observer now admits a root
18
- `go.mod`, Vue SFCs, or a conventional Maven reactor as well as a TypeScript project. Vue projects without a tsconfig have their
19
- JS/TS files parsed alongside their components. Existing TS-only corpus eligibility remains separate:
20
- this release does not silently enroll Go repositories in historical JS/TS research cohorts.
21
-
22
- For Maven, DiffCI proposes module-level commands but does not run them or change CI. The default
23
- goal is `test`. If the repository's CI runs `verify` with profiles, declare that command shape in
24
- `diffci.json` (or the `diffci` key in `package.json`):
25
-
26
- ```json
27
- { "maven": { "goal": "verify", "profiles": ["run-its"] } }
28
- ```
29
-
30
- This produces a command such as `mvn -pl tools -am verify -P run-its`. The `-am` option can also run
31
- tests in upstream modules. Check the proposed command against the actual CI workflow before using
32
- it for execution. A single Cloudflare Resolver run showed a candidate saving of 8.6% with a
33
- CI-aligned `verify -P run-its` command; it does not establish repeatable savings across repositories.
34
-
35
- For Go, install a compatible Go toolchain on the **same host and build environment** used for analysis
36
- and testing, and prepare the repository's dependencies first using its normal setup procedure.
37
- DiffCI invokes `go list -mod=readonly -deps -test -json ./...` with `GOTOOLCHAIN=local`, `GOPROXY=off`,
38
- `GOSUMDB=off`, and `GOWORK=off`. Missing toolchains or dependencies produce refusal/full fallback.
39
- Go may populate its own build cache but must not modify the checkout. It does not run `go generate`.
40
- Custom `GOFLAGS` currently require full validation. Discovered GOOS, GOARCH and CGO_ENABLED settings
41
- are carried into the structured test command.
42
-
43
- For CI that runs only the root module's `go test ./...`, a repository containing nested
44
- modules can explicitly declare that scope in a committed root `diffci.json`:
45
-
46
- ```json
47
- { "go": { "scope": "root-module" } }
48
- ```
49
-
50
- This does not cover nested-module CI jobs. Keep their validation unchanged. Without the
51
- declaration, nested modules still block selection. With it, nested module trees are
52
- excluded from the root test universe, but any change there (including a rename out of
53
- the tree) forces full validation. Scope/configuration changes also force full validation.
54
- Go workspaces and local replacements still block scoped selection. Reports identify the
55
- declared `goScope`; the structured commands continue to run root-relative packages.
56
-
57
- Empty-graph refusals now include the adapter's reason. Vue recognizes only direct imported
58
- component identifiers in literal `components` registrations. Unresolved runtime dependencies
59
- retain full execution unless the isolated-suite protection described below applies.
60
-
61
- The Reka selection candidate also resolves imported Vue macro types through TypeScript aliases,
62
- extended configurations and directory index files, and recognizes leading `./` in test globs.
63
- For an explicitly scoped Vue suite, a component-specific blocker can be excluded only when every
64
- test/setup/configuration root has been parsed and none can reach that component. This is not a
65
- directory-name exclusion: imported story fixtures retain their blockers. Unresolved dependencies
66
- and global configuration blockers still force full validation. Compiler-assisted components that
67
- probe JSON configuration are rebuilt instead of persistently cached until every compiler input can
68
- be tracked. See the [Reka experiment](research/2026-09-13-reka-selection.md) for qualification evidence.
69
-
70
- The runtime-protection candidate can always run every test file reaching an unresolved runtime
71
- component or directive, while selecting other tests normally. This requires a verified scoped
72
- Vitest suite and isolated execution. Shared setup reaching a runtime blocker, disabled or ambiguous
73
- isolation, custom runners/environments and unmodeled configuration keep full-suite fallback.
74
- This policy protects tests despite unknown runtime edges; it does not resolve those edges or claim
75
- support for non-isolated or order-dependent jobs. See the [runtime protection experiment](research/2026-09-13-vue-runtime-partition.md).
76
-
77
- A selection such as `lib/value_test.go` becomes:
78
-
79
- ```sh
80
- go test -mod=readonly -json -count=1 ./lib
81
- ```
82
-
83
- It runs the entire package. Consumers must honor the emitted `CommandSpec.env`, preserve the build
84
- context, and check fallback/command-synthesis status before execution. Commands are not portable
85
- between different GOOS/GOARCH/GOFLAGS contexts. The controlled runner command policies accept `go`;
86
- hosted images still need a Go installation before Go workloads can run. No deployment is performed
87
- by these code changes.
88
-
89
- Go result parsing counts failing **packages**, records failing test names, and rejects incomplete
90
- JSON streams. It does not invent test-file counts from package counts, so file-based economics
91
- qualification may still report an unsupported denominator for Go.
92
-
93
- ## Extension points
94
-
95
- - `src/repo/adapters/types.ts`: adapter context and graph contribution contract.
96
- - `src/repo/adapters/index.ts`: framework/language adapter registry and bounded file inventory.
97
- - `src/repo/adapters/vue.ts`: Vue compiler integration.
98
- - `src/repo/adapters/go.ts`: native Go package metadata and conservative dependency model.
99
- - `src/repo/adapters/go-test.ts`: structured Go outcome parsing.
100
- - `src/planner/test-command.ts`: runner command routing, including verified Go package targets.
101
-
102
- Adapters contribute source and asset nodes, dependency edges, virtual JS/TS source, runnable test
103
- identities and explicit blockers. Effective suite blockers persist into the profile and graph result
104
- and cannot be removed by delta-specific reachability refinement. Go graphs bypass the disk cache until every cache
105
- caller provides a complete toolchain/build-context identity. The cache schema was bumped to prevent
106
- reuse of graphs created before adapter support.
107
-
108
- ## Validation and qualification
109
-
110
- `tests/repo/language-adapters.test.ts` covers transitive Vue selection, unsupported-feature fallbacks,
111
- Go package imports and embeds, metadata failures, command routing, and incomplete output.
112
- When Go is on PATH, its native integration test runs the observer against a real Git fixture,
113
- compares successful full/subset test runs, and verifies the subset catches an introduced fault.
114
- Without Go, that native test is explicitly skipped.
115
-
116
- These are implementation checks, not prospective customer safety or savings evidence. Each new
117
- ecosystem still needs real repository shadow observations and economic qualification before broader
118
- support or savings claims are made.
1
+ # Language and framework support
2
+
3
+ DiffCI now has an extensible repository-adapter boundary and initial Vue, Go, and Maven support.
4
+ These additions propose selections in the existing observer; they do not enable production CI skipping.
5
+
6
+ | Surface | Implemented scope | Boundaries |
7
+ | --- | --- | --- |
8
+ | JavaScript / TypeScript | Existing dependency analysis and ten existing test-runner command mappings | Runner recognition is not a guarantee of complete framework semantics |
9
+ | Vue | SFC parsing with `@vue/compiler-sfc`; script imports, literal Options API component registrations, empty script fixtures, compiled template asset imports; propagation into importing JS/TS tests; protected runtime-dependent tests in verified isolated scopes | Runtime uncertainty requires full validation unless protected by the isolated-suite policy below; preprocessors, external/custom SFC blocks, style URLs/imports, Nuxt conventions and glob imports require full validation |
10
+ | Go | One root module; optional explicit root-module scope in a repository containing nested modules; native metadata, package-level transitive selection, embeds and Go test commands | Workspaces, changes inside excluded modules, inactive Go files, cgo/native objects, plugins, generation/linkname and incomplete metadata require full validation; root scoping rejects local replacements |
11
+ | Maven / Java / Kotlin | Conventional multi-module reactors with `src/main/{java,kotlin}` and `src/test/{java,kotlin}`; module dependency propagation; Surefire-style test names; proposed reactor commands | Nonstandard layouts, generated sources, integration-test conventions, and POM changes may require full validation. Maven commands are observations and must match the repository's CI lifecycle and profiles. |
12
+ | Mixed Go and JS/TS | Detected | Full validation until cross-language relationships are declared and modeled |
13
+ | Python, Svelte, Astro, C#, Rust | No new semantic support in this release | Require additional adapters and qualification |
14
+
15
+ ## Using the observer
16
+
17
+ Use the existing `observe` command and commit range options. The observer now admits a root
18
+ `go.mod`, Vue SFCs, or a conventional Maven reactor as well as a TypeScript project. Vue projects without a tsconfig have their
19
+ JS/TS files parsed alongside their components. Existing TS-only corpus eligibility remains separate:
20
+ this release does not silently enroll Go repositories in historical JS/TS research cohorts.
21
+
22
+ For Maven, DiffCI proposes module-level commands but does not run them or change CI. The default
23
+ goal is `test`. If the repository's CI runs `verify` with profiles, declare that command shape in
24
+ `diffci.json` (or the `diffci` key in `package.json`):
25
+
26
+ ```json
27
+ { "maven": { "goal": "verify", "profiles": ["run-its"] } }
28
+ ```
29
+
30
+ This produces a command such as `mvn -pl tools -am verify -P run-its`. The `-am` option can also run
31
+ tests in upstream modules. Check the proposed command against the actual CI workflow before using
32
+ it for execution. A single Cloudflare Resolver run showed a candidate saving of 8.6% with a
33
+ CI-aligned `verify -P run-its` command; it does not establish repeatable savings across repositories.
34
+
35
+ For Go, install a compatible Go toolchain on the **same host and build environment** used for analysis
36
+ and testing, and prepare the repository's dependencies first using its normal setup procedure.
37
+ DiffCI invokes `go list -mod=readonly -deps -test -json ./...` with `GOTOOLCHAIN=local`, `GOPROXY=off`,
38
+ `GOSUMDB=off`, and `GOWORK=off`. Missing toolchains or dependencies produce refusal/full fallback.
39
+ Go may populate its own build cache but must not modify the checkout. It does not run `go generate`.
40
+ Custom `GOFLAGS` currently require full validation. Discovered GOOS, GOARCH and CGO_ENABLED settings
41
+ are carried into the structured test command.
42
+
43
+ For CI that runs only the root module's `go test ./...`, a repository containing nested
44
+ modules can explicitly declare that scope in a committed root `diffci.json`:
45
+
46
+ ```json
47
+ { "go": { "scope": "root-module" } }
48
+ ```
49
+
50
+ This does not cover nested-module CI jobs. Keep their validation unchanged. Without the
51
+ declaration, nested modules still block selection. With it, nested module trees are
52
+ excluded from the root test universe, but any change there (including a rename out of
53
+ the tree) forces full validation. Scope/configuration changes also force full validation.
54
+ Go workspaces and local replacements still block scoped selection. Reports identify the
55
+ declared `goScope`; the structured commands continue to run root-relative packages.
56
+
57
+ Empty-graph refusals now include the adapter's reason. Vue recognizes only direct imported
58
+ component identifiers in literal `components` registrations. Unresolved runtime dependencies
59
+ retain full execution unless the isolated-suite protection described below applies.
60
+
61
+ The Reka selection candidate also resolves imported Vue macro types through TypeScript aliases,
62
+ extended configurations and directory index files, and recognizes leading `./` in test globs.
63
+ For an explicitly scoped Vue suite, a component-specific blocker can be excluded only when every
64
+ test/setup/configuration root has been parsed and none can reach that component. This is not a
65
+ directory-name exclusion: imported story fixtures retain their blockers. Unresolved dependencies
66
+ and global configuration blockers still force full validation. Compiler-assisted components that
67
+ probe JSON configuration are rebuilt instead of persistently cached until every compiler input can
68
+ be tracked. See the [Reka experiment](research/2026-09-13-reka-selection.md) for qualification evidence.
69
+
70
+ The runtime-protection candidate can always run every test file reaching an unresolved runtime
71
+ component or directive, while selecting other tests normally. This requires a verified scoped
72
+ Vitest suite and isolated execution. Shared setup reaching a runtime blocker, disabled or ambiguous
73
+ isolation, custom runners/environments and unmodeled configuration keep full-suite fallback.
74
+ This policy protects tests despite unknown runtime edges; it does not resolve those edges or claim
75
+ support for non-isolated or order-dependent jobs. See the [runtime protection experiment](research/2026-09-13-vue-runtime-partition.md).
76
+
77
+ A selection such as `lib/value_test.go` becomes:
78
+
79
+ ```sh
80
+ go test -mod=readonly -json -count=1 ./lib
81
+ ```
82
+
83
+ It runs the entire package. Consumers must honor the emitted `CommandSpec.env`, preserve the build
84
+ context, and check fallback/command-synthesis status before execution. Commands are not portable
85
+ between different GOOS/GOARCH/GOFLAGS contexts. The controlled runner command policies accept `go`;
86
+ hosted images still need a Go installation before Go workloads can run. No deployment is performed
87
+ by these code changes.
88
+
89
+ Go result parsing counts failing **packages**, records failing test names, and rejects incomplete
90
+ JSON streams. It does not invent test-file counts from package counts, so file-based economics
91
+ qualification may still report an unsupported denominator for Go.
92
+
93
+ ## Extension points
94
+
95
+ - `src/repo/adapters/types.ts`: adapter context and graph contribution contract.
96
+ - `src/repo/adapters/index.ts`: framework/language adapter registry and bounded file inventory.
97
+ - `src/repo/adapters/vue.ts`: Vue compiler integration.
98
+ - `src/repo/adapters/go.ts`: native Go package metadata and conservative dependency model.
99
+ - `src/repo/adapters/go-test.ts`: structured Go outcome parsing.
100
+ - `src/planner/test-command.ts`: runner command routing, including verified Go package targets.
101
+
102
+ Adapters contribute source and asset nodes, dependency edges, virtual JS/TS source, runnable test
103
+ identities and explicit blockers. Effective suite blockers persist into the profile and graph result
104
+ and cannot be removed by delta-specific reachability refinement. Go graphs bypass the disk cache until every cache
105
+ caller provides a complete toolchain/build-context identity. The cache schema was bumped to prevent
106
+ reuse of graphs created before adapter support.
107
+
108
+ ## Validation and qualification
109
+
110
+ `tests/repo/language-adapters.test.ts` covers transitive Vue selection, unsupported-feature fallbacks,
111
+ Go package imports and embeds, metadata failures, command routing, and incomplete output.
112
+ When Go is on PATH, its native integration test runs the observer against a real Git fixture,
113
+ compares successful full/subset test runs, and verifies the subset catches an introduced fault.
114
+ Without Go, that native test is explicitly skipped.
115
+
116
+ These are implementation checks, not prospective customer safety or savings evidence. Each new
117
+ ecosystem still needs real repository shadow observations and economic qualification before broader
118
+ support or savings claims are made.
package/docs/mcp.md CHANGED
@@ -1,70 +1,70 @@
1
- # DiffCI MCP Server
2
-
3
- DiffCI ships a small stdio MCP server for coding agents that prefer native tools over shell commands.
4
-
5
- Run it with:
6
-
7
- ```bash
8
- npx -p @diffci.com/diffci@latest diffci-mcp
9
- ```
10
-
11
- ## MCP Client Config
12
-
13
- Use this stdio configuration in clients that accept MCP JSON. Set `cwd` to the repository where the
14
- agent should run DiffCI.
15
-
16
- ```json
17
- {
18
- "mcpServers": {
19
- "diffci": {
20
- "command": "npx",
21
- "args": ["-p", "@diffci.com/diffci@latest", "diffci-mcp"],
22
- "cwd": "/path/to/repository"
23
- }
24
- }
25
- }
26
- ```
27
-
28
- On Windows, keep the same command shape and use a Windows path:
29
-
30
- ```json
31
- {
32
- "mcpServers": {
33
- "diffci": {
34
- "command": "npx",
35
- "args": ["-p", "@diffci.com/diffci@latest", "diffci-mcp"],
36
- "cwd": "C:\\Users\\you\\path\\to\\repository"
37
- }
38
- }
39
- }
40
- ```
41
-
42
- For Claude Desktop, Claude Code, Cursor, Codex-style MCP clients, and other stdio-compatible agents,
43
- name the server `diffci` and call `diffci_check` before PR-ready answers.
44
-
45
- Available tools:
46
-
47
- - `diffci_check` - runs `diffci check`, including inferred full and selected test commands.
48
- - `diffci_init` - runs `diffci init` to seed agent instruction files.
49
- - `diffci_verify_workflow` - runs `diffci verify-workflow` to check non-interference.
50
-
51
- The MCP server delegates to the same open-source CLI. `diffci_check` sends nothing to DiffCI Cloud,
52
- but it runs test commands when it can infer them. Use the CLI's `observe --no-send` for analysis only.
53
-
54
- Keep required project CI authoritative. DiffCI output is a validation lens, not permission to skip
55
- required checks.
56
-
57
- ## Directory Metadata
58
-
59
- Discovery links:
60
-
61
- - npm package: https://www.npmjs.com/package/@diffci.com/diffci
62
- - GitHub repository: https://github.com/DiffCI/DiffCI.com
63
- - Agent docs: https://diffci.com/docs/ai-agents.html
64
- - LLM discovery file: https://diffci.com/llms.txt
65
- - MCP command: `npx -p @diffci.com/diffci@latest diffci-mcp`
66
-
67
- Short description:
68
-
69
- > Observation-only CI/CD validation for AI coding agents. DiffCI helps agents inspect the current
70
- > checkout, explain affected tests, and keep required CI authoritative.
1
+ # DiffCI MCP Server
2
+
3
+ DiffCI ships a small stdio MCP server for coding agents that prefer native tools over shell commands.
4
+
5
+ Run it with:
6
+
7
+ ```bash
8
+ npx -p "@diffci.com/diffci@latest" diffci-mcp
9
+ ```
10
+
11
+ ## MCP Client Config
12
+
13
+ Use this stdio configuration in clients that accept MCP JSON. Set `cwd` to the repository where the
14
+ agent should run DiffCI.
15
+
16
+ ```json
17
+ {
18
+ "mcpServers": {
19
+ "diffci": {
20
+ "command": "npx",
21
+ "args": ["-p", "@diffci.com/diffci@latest", "diffci-mcp"],
22
+ "cwd": "/path/to/repository"
23
+ }
24
+ }
25
+ }
26
+ ```
27
+
28
+ On Windows, keep the same command shape and use a Windows path:
29
+
30
+ ```json
31
+ {
32
+ "mcpServers": {
33
+ "diffci": {
34
+ "command": "npx",
35
+ "args": ["-p", "@diffci.com/diffci@latest", "diffci-mcp"],
36
+ "cwd": "C:\\Users\\you\\path\\to\\repository"
37
+ }
38
+ }
39
+ }
40
+ ```
41
+
42
+ For Claude Desktop, Claude Code, Cursor, Codex-style MCP clients, and other stdio-compatible agents,
43
+ name the server `diffci` and call `diffci_check` before PR-ready answers.
44
+
45
+ Available tools:
46
+
47
+ - `diffci_check` - runs `diffci check`, including inferred full and selected test commands.
48
+ - `diffci_init` - runs `diffci init` to seed agent instruction files.
49
+ - `diffci_verify_workflow` - runs `diffci verify-workflow` to check non-interference.
50
+
51
+ The MCP server delegates to the same open-source CLI. `diffci_check` sends nothing to DiffCI Cloud,
52
+ but it runs test commands when it can infer them. Use the CLI's `observe --no-send` for analysis only.
53
+
54
+ Keep required project CI authoritative. DiffCI output is a validation lens, not permission to skip
55
+ required checks.
56
+
57
+ ## Directory Metadata
58
+
59
+ Discovery links:
60
+
61
+ - npm package: https://www.npmjs.com/package/@diffci.com/diffci
62
+ - GitHub repository: https://github.com/DiffCI/DiffCI.com
63
+ - Agent docs: https://diffci.com/docs/ai-agents
64
+ - LLM discovery file: https://diffci.com/llms.txt
65
+ - MCP command: `npx -p "@diffci.com/diffci@latest" diffci-mcp`
66
+
67
+ Short description:
68
+
69
+ > Change-aware CI/CD validation for AI coding agents. DiffCI analyzes the checkout, can run paired
70
+ > full and selected test commands, and keeps required CI authoritative.