You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fixture: Vitest config change that only adds a reporter #53
Context: on a replay of one production app's history, DiffCI fell back to the full suite on 58% of commits, mostly because config, package.json, workflow or lockfile changes forced it to. Narrowing those safely is the main open problem.
vitest.config.* matches CONFIG_PATTERNS, so any edit runs everything. A common agent edit, adding a reporter or changing testTimeout, can't change which tests are affected. Add a synthetic-repo fixture in tests/repo/ that records today's behaviour (full fallback) and documents the case in docs/design/ as a candidate for narrowing. The fixture is the contribution; narrowing it is a follow-up.
New to DiffCI? See CONTRIBUTING.md: add a synthetic fixture, run npm test, and sign off commits with git commit -s. Comment here to claim the issue.
Test-backed contribution for issue #53 (not a PR; no repository write access). I created the requested synthetic git-repository fixture against main@2d5cc05d459b9c59e46ba22b5ecc07ba0ce946f0 and ran it locally.
Observed: A reporter-only edit and a testTimeout-only edit to vitest.config.ts each still trigger configChanged=true, CONFIG_GLOBAL, and fallbackRequired=true. Both tests pass (2/2); npm run typecheck also passes. These are assertions about DiffCI's current conservative behavior, not claims that skipping these edits is safe.
Reproduce from that commit: save the fixture below as tests/repo/vitest-config-fallback.test.ts, run npm ci, then node --import tsx --test tests/repo/vitest-config-fallback.test.ts and npm run typecheck.
// SPDX-License-Identifier: MIT// Regression fixture for issue #53: a non-selection Vitest config edit still falls back.import{strictasassert}from"node:assert";import{execFileSync}from"node:child_process";import{mkdirSync,mkdtempSync,rmSync,writeFileSync}from"node:fs";import{tmpdir}from"node:os";import{dirname,join}from"node:path";import{describe,it}from"node:test";import{analyzeGitDelta}from"../../src/git/git-diff.js";import{buildDependencyGraph}from"../../src/repo/graph.js";import{ImpactAnalyzer}from"../../src/repo/impact.js";import{repositoryFileReader}from"../../src/repo/file-references.js";functionwrite(root: string,path: string,content: string): void{constfull=join(root,path);mkdirSync(dirname(full),{recursive: true});writeFileSync(full,content);}functiongit(root: string, ...args: string[]): string{returnexecFileSync("git",args,{cwd: root,encoding: "utf8"}).trim();}constconfig=(reporter: string,timeout: number)=>"import { defineConfig } from 'vitest/config';\n"+"export default defineConfig({ test: { include: ['src/**/*.test.ts'], "+"reporters: ['"+reporter+"'], testTimeout: "+timeout+" } });\n";describe("Vitest config-only changes: conservative fallback (#53)",()=>{for(consttestCaseof[{name: "reporter-only",changed: config("verbose",5000)},{name: "timeout-only",changed: config("default",10000)},]){it(testCase.name+" edit still requests the full test suite",async()=>{constroot=mkdtempSync(join(tmpdir(),"diffci-vitest-config-"));try{git(root,"init","--quiet");git(root,"config","user.email","[email protected]");git(root,"config","user.name","DiffCI fixture");write(root,"package.json",JSON.stringify({name: "vitest-config-fixture",private: true,type: "module",scripts: {test: "vitest run"},devDependencies: {vitest: "^3.0.0"},}));write(root,"src/adder.ts","export const add = (a: number, b: number) => a + b;\n");write(root,"src/adder.test.ts","import { test, expect } from 'vitest';\n"+"import { add } from './adder';\n"+"test('adds', () => expect(add(1, 2)).toBe(3));\n");write(root,"vitest.config.ts",config("default",5000));git(root,"add","-A");git(root,"commit","--quiet","-m","baseline");constbaseSha=git(root,"rev-parse","HEAD");write(root,"vitest.config.ts",testCase.changed);git(root,"add","-A");git(root,"commit","--quiet","-m",testCase.name);constheadSha=git(root,"rev-parse","HEAD");constanalyzed=awaitanalyzeGitDelta({repoPath: root, baseSha, headSha });assert.equal(analyzed.success,true);if(!analyzed.success)return;constdelta=analyzed.delta;assert.deepEqual(delta.files.map((f)=>f.path),["vitest.config.ts"]);assert.equal(delta.analysis.configChanged,true);assert.deepEqual(delta.analysis.signalPaths?.config,["vitest.config.ts"]);constgraph=awaitbuildDependencyGraph({repoPath: root,excludeDirs: [".git","node_modules"]});constimpact=newImpactAnalyzer().analyze(delta,graph,graph.profile,{repositoryFiles: analyzed.inventory?.files,readRepositoryFile: repositoryFileReader(root),});assert.equal(impact.fallbackRequired,true);assert.ok(impact.riskSignals.some((s)=>s.reason==="CONFIG_GLOBAL"));assert.ok(impact.fallbackReasons.some((r)=>/Configurationfile\(s\)changed/.test(r)));}finally{rmSync(root,{recursive: true,force: true});}});}});
Narrowing design note: only consider a later optimization when old/new config shapes are statically recognizable, the sole changed field is known non-selection metadata, and test inclusion/projects/workspaces/CI invocation remain provably identical. Custom reporters can have side effects; changing timeouts can affect pass/fail. Dynamic configs or unsupported fields must keep the full fallback. The fixture does not execute Vitest or prove arbitrary config changes safe.
Attribution: prepared with AI assistance for a human BuddyLists / Linked AIs operator; not an autonomous-agent account or claim of independent identity. No changes were made to your repository.
Thanks, this is a useful fixture. I checked it against main@2d5cc05: both cases pass, npm run typecheck is clean, and both fail if vitest.config.* is removed from the config patterns in src/git/git-diff.ts, so it guards the behavior it describes.
You don't need write access to contribute. Fork DiffCI/core, add the file at tests/repo/vitest-config-fallback.test.ts, and open a PR from your fork that references #53 (CONTRIBUTING.md has the steps). A PR records that you're contributing it under the repository's MIT terms, and you get credit in the history. Before opening it, please run npm test, npm run build and npm run audit:boundary as well.
I agree with your design note. Any future narrowing should keep the full fallback unless the old and new configs are both statically recognizable and the only change is to non-selection fields. This fixture pins the conservative behavior until then.
If you'd prefer not to open a PR, let me know and I'll add it myself and credit this comment.
Thanks for checking the fixture and offering the maintainer integration path. I reran the exact fixture from my earlier comment on a clean checkout of 2d5cc05d459b9c59e46ba22b5ecc07ba0ce946f0 (Node 24.22.1, isolated sandbox, npm ci successful).
npm run audit:boundary: initially fails, Outside reviewed release manifest: tests/repo/vitest-config-fallback.test.ts.
Required companion change: Add "tests/repo/vitest-config-fallback.test.ts", to the files array in release-files.json, immediately before "tests/repo/workspaces.test.ts". With that one-line addition, I reran npm run audit:boundary: pass (225 reviewed files), and reran the fixture: 2/2 pass.
This is a test-backed, AI-assisted contribution through the authorized account, not a claim of independent human code review. I won't submit a fork PR or sign a DCO attestation on someone else's behalf. Please use your offered maintainer-addition path if you want to incorporate the fixture, with credit to the original issue comment. Both files remain uncommitted in my isolated test environment; no production files were changed.
Added in #65 (a1b95b3), crediting your comment with a Co-authored-by trailer. Your release-files.json note was right; the entry is in. I also wrote up the narrowing conditions from your design note in docs/design/config-narrowing.md, which completes the issue. Thanks for the fixture.
Activity
robertwmccarty-caelum commentedon Oct 30, 2026
Test-backed contribution for issue #53 (not a PR; no repository write access). I created the requested synthetic git-repository fixture against
main@2d5cc05d459b9c59e46ba22b5ecc07ba0ce946f0and ran it locally.Observed: A reporter-only edit and a
testTimeout-only edit tovitest.config.tseach still triggerconfigChanged=true,CONFIG_GLOBAL, andfallbackRequired=true. Both tests pass (2/2);npm run typecheckalso passes. These are assertions about DiffCI's current conservative behavior, not claims that skipping these edits is safe.Reproduce from that commit: save the fixture below as
tests/repo/vitest-config-fallback.test.ts, runnpm ci, thennode --import tsx --test tests/repo/vitest-config-fallback.test.tsandnpm run typecheck.Relevant implementation: config classification and fallback signal.
Copyable, tested regression fixture (TypeScript)
Narrowing design note: only consider a later optimization when old/new config shapes are statically recognizable, the sole changed field is known non-selection metadata, and test inclusion/projects/workspaces/CI invocation remain provably identical. Custom reporters can have side effects; changing timeouts can affect pass/fail. Dynamic configs or unsupported fields must keep the full fallback. The fixture does not execute Vitest or prove arbitrary config changes safe.
Attribution: prepared with AI assistance for a human BuddyLists / Linked AIs operator; not an autonomous-agent account or claim of independent identity. No changes were made to your repository.
adityankale190895 commentedon Oct 30, 2026
Thanks, this is a useful fixture. I checked it against
main@2d5cc05: both cases pass,npm run typecheckis clean, and both fail ifvitest.config.*is removed from the config patterns insrc/git/git-diff.ts, so it guards the behavior it describes.You don't need write access to contribute. Fork
DiffCI/core, add the file attests/repo/vitest-config-fallback.test.ts, and open a PR from your fork that references #53 (CONTRIBUTING.md has the steps). A PR records that you're contributing it under the repository's MIT terms, and you get credit in the history. Before opening it, please runnpm test,npm run buildandnpm run audit:boundaryas well.I agree with your design note. Any future narrowing should keep the full fallback unless the old and new configs are both statically recognizable and the only change is to non-selection fields. This fixture pins the conservative behavior until then.
If you'd prefer not to open a PR, let me know and I'll add it myself and credit this comment.
robertwmccarty-caelum commentedon Oct 30, 2026
Thanks for checking the fixture and offering the maintainer integration path. I reran the exact fixture from my earlier comment on a clean checkout of
2d5cc05d459b9c59e46ba22b5ecc07ba0ce946f0(Node 24.22.1, isolated sandbox,npm cisuccessful).Verified results
node --import tsx --test tests/repo/vitest-config-fallback.test.ts: 2/2 passnpm run typecheck: passnpm test: 594/594 pass, 88 suitesnpm run build: passnpm run audit:boundary: initially fails,Outside reviewed release manifest: tests/repo/vitest-config-fallback.test.ts.Required companion change: Add
"tests/repo/vitest-config-fallback.test.ts",to thefilesarray inrelease-files.json, immediately before"tests/repo/workspaces.test.ts". With that one-line addition, I rerannpm run audit:boundary: pass (225 reviewed files), and reran the fixture: 2/2 pass.This is a test-backed, AI-assisted contribution through the authorized account, not a claim of independent human code review. I won't submit a fork PR or sign a DCO attestation on someone else's behalf. Please use your offered maintainer-addition path if you want to incorporate the fixture, with credit to the original issue comment. Both files remain uncommitted in my isolated test environment; no production files were changed.
test: record full fallback for Vitest reporter/timeout config edits
test: record full fallback for Vitest reporter/timeout config edits (#65
adityankale190895 commentedon Oct 30, 2026
Added in #65 (a1b95b3), crediting your comment with a
Co-authored-bytrailer. Yourrelease-files.jsonnote was right; the entry is in. I also wrote up the narrowing conditions from your design note indocs/design/config-narrowing.md, which completes the issue. Thanks for the fixture.docs: credit robertwmccarty-caelum in the README contributors