Skip to content

fix: stop publishing from running the agent tooling tests - #207

Merged
scottlovegrove merged 2 commits into
mainfrom
scottl/split-agent-tests
Dec 3, 2026
Merged

scottlovegrove merged 2 commits into
mainfrom
scottl/split-agent-tests

Conversation

@scottlovegrove

@scottlovegrove scottlovegrove commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

The 3.2.0 release failed because publishing ran the agent tooling's tests: prepublishOnly runs npm test, which included .agents/scripts/**, and lib/patches.test.ts timed out on the release runner. Publishing should test what it is about to publish, not the tooling that checks our own work.

npm test (and so prepublishOnly and pre-push) now covers only src/. The agent tooling's tests run with npm run test:agents from a new vitest.agents.config.ts, as a separate "Run agent tooling tests" step in test.yml, which now also runs on every push to main and next, so both suites run on every pull request and every merge without being on the publish path.

npm run verify gains a tests:agents step that starts after the package tests and has onlyWhenChanged: it runs when a path the agent tests read changed since main (.agents/, vitest.agents.config.ts, package.json, package-lock.json, .github/workflows/, lefthook.yml, .claude/, .codex/, .cursor/, .pi/, the agent docs, src/_fixtures/, .oxfmtrc.json, tsconfig.json, .gitignore), when a file was deleted or renamed (the agent docs may name it), and when nothing changed. Otherwise it prints that it skipped them and that CI runs them on every pull request. A skipped step counts as passed, so steps after it still run. A test checks every path in the list exists, apart from .cursor/, which must stay free of a hooks file.

This releases 3.2.1, which ships the confirmation-flow change from #205.

The 3.2.0 release failed when a slow agent-tooling test timed out
inside npm publish's prepublishOnly. `npm test`, which publishing
runs, now covers only the package's tests in src/. The agent
tooling's tests run with `npm run test:agents`, from their own
vitest config, as a separate step in test.yml on every pull request.
`npm run verify` runs them only when something they read changed
since main, and says when it skips them.

This releases 3.2.1, which ships the confirmation-flow change from
#205.
@scottlovegrove scottlovegrove self-assigned this Dec 3, 2026

@doistbot doistbot 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.

This change cleanly splits the agent tooling's tests out of npm test so a release can't fail on prepublishOnly running them, moves them to a new vitest.agents.config.ts with a dedicated CI step, and gates them in npm run verify behind an onlyWhenChanged path list so local verification stays fast while every PR still runs them.

Few things worth tightening:

  • pre-push still runs only npm test, so a person pushing an agent-tooling change no longer exercises those tests locally — consider adding a test:agents job to the hook (or running both in one job), or noting in docs/agents.md that pre-push covers only src/.
  • Worth double-checking the onlyWhenChanged path list against what the agent tests actually read, since a gap would let verify report success locally for a change (like a doc deletion) that CI's tests would catch.

I also included a few optional follow-up notes in the details below.

Optional follow-up notes (2)
  • P3 .agents/scripts/lib/steps.ts:29: Deleting or renaming CHANGELOG.md now skips the agent tooling tests, though .agents/scripts/lib/tree.ts classifies a doc deletion as code precisely because instructions.test.ts checks every file the agent docs name (docs/agents.md names both CHANGELOG.md and CONTRIBUTING.md). In that scenario verify runs the other steps, records a pass, and the push check allows the push; only CI fails. Adding CHANGELOG.md here is exact: a changelog-only edit still returns earlier as docs-only, so only its deletion reaches this step. CONTRIBUTING.md would need adding too if its rename should be caught locally.
  • P3 .agents/scripts/lib/steps.test.ts:188: Nothing checks that every onlyWhenChanged entry still names a file or folder in the checkout. nothingItReadsChanged matches with path.startsWith(prefix), so a rename (docs/agents.md, CODEBASE.md, lefthook.yml) or a typo leaves an inert entry: verify silently stops running the agent tooling's tests for that path even though docs/agents.md says it does, and no test fails. A loop over the step's list with existsSync(join(REPO_ROOT, path)) in this test would pin it.

Share Feedback • Review Logs • Trace

Comment thread vitest.config.ts Resolved
…n unchanged tree

Verify now runs the agent tooling tests when a file was deleted or
renamed (the agent docs may name it) and when nothing changed since
the base, as it does every step then. They start after the package
tests, so two vitest runs don't slow each other into timeouts.

test.yml runs on every push to main and next as well, so both suites
run on each merge, apart from publishing. AGENT_DOCS and the test
helper folder move to tree.ts, shared by instructions.test.ts and the
step's path list, and a test checks every path in that list exists.
The docs say pre-push runs only the package's tests.
@scottlovegrove
scottlovegrove merged commit 4dbabf3 into main Dec 3, 2026
6 checks passed
@scottlovegrove
scottlovegrove deleted the scottl/split-agent-tests branch December 3, 2026 16:28
doist-release-bot Bot added a commit that referenced this pull request Dec 3, 2026
## [3.2.1](v3.2.0...v3.2.1) (2026-12-03)

### Bug Fixes

* stop publishing from running the agent tooling tests ([#207](#207)) ([4dbabf3](4dbabf3))
@doist-release-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants