Skip to content

chore(benchmarks): cover the paths that call-count tests guard - #357

Merged
LadyBluenotes merged 2 commits into
mainfrom
chore/benchmark-counted-paths
Nov 22, 2026
Merged

LadyBluenotes merged 2 commits into
mainfrom
chore/benchmark-counted-paths

Conversation

@LadyBluenotes

Copy link
Copy Markdown
Member

🎯 Changes

  • Several unit tests guard performance by counting file reads, scans, or git calls: tests/repeated-work.test.ts, the read-count assertions in tests/scanner.test.ts, and a few others. This adds a benchmark for each of those paths, so the same work is also measured. No test is removed and no source file changes.
  • The suite grows from 12 to 28 cases. review.bench.ts and install.bench.ts are new; list, load, stale, validate, and maintainer gain cases.
  • Adds createCliFixture to helpers.ts. It runs the CLI in process against one fixture per describe and checks the fixture at setup, so a case cannot pass on an empty result.
  • validate --fix rewrites its fixture, and bench() in vitest 4.1.11 passes no per-iteration hook to tinybench. The case restores the fixture in the suite beforeEach and falls back to a restore inside the function.
  • Locally the full suite takes about 3 min 55 s, up from about 1 min 32 s.
File New case
review.bench.ts reports every pending skill as json (distinct sources per skill)
review.bench.ts reuses source matches and hashes across skills (one shared source pattern)
install.bench.ts reviews unchanged permissions with one scan
list.bench.ts scans allowlisted scopes among dependencies without skills
list.bench.ts discovers symlinked nested packages without crawling loops or source trees
load.bench.ts loads one skill without reading its siblings
load.bench.ts loads a workspace package skill from a large workspace
stale.bench.ts reports drift for every package with shared artifacts
stale.bench.ts checks only the targeted package
stale.bench.ts matches artifact entries to skills by name
stale.bench.ts reports installed packages through the fallback scan
validate.bench.ts typechecks code blocks that import the package
validate.bench.ts typechecks code blocks for every workspace package
validate.bench.ts migrates pending frontmatter in every skill (--fix)
maintainer.bench.ts checks skills, typed examples, and reviews
maintainer.bench.ts plans an unchanged repository distribution

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr (run pnpm build:all first).

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

…-fix benchmarks

Add a shared CLI fixture helper that runs the built CLI in process, checks
each fixture once during setup, and works under both the tinybench runner
(bench options) and the CodSpeed runner (suite hooks).

New cases: intent review --json with 20 distinct source patterns and with
one shared pattern, intent validate with TypeScript code blocks for one
package and for a monorepo, and intent validate --fix with a pending
frontmatter migration.
Add cases for list (allowlisted scopes among plain dependencies, nested
symlinked node_modules), load (one skill from a 200-skill package, a
workspace package in a 120-member workspace), stale (large workspace,
targeted package, artifact entries matched by name, installed-dependency
fallback), install --review, and maintainer check and sync on a reviewed
repository.
@changeset-bot

changeset-bot Bot commented Nov 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 36cb002

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@nx-cloud

nx-cloud Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 36cb002

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 2s View ↗
nx run-many --targets=build ✅ Succeeded 1s View ↗

💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-11-22 19:39:57 UTC

@pkg-pr-new

pkg-pr-new Bot commented Nov 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@tanstack/intent@357

commit: 36cb002

@LadyBluenotes
LadyBluenotes merged commit 08bc500 into main Nov 22, 2026
8 of 9 checks passed
@LadyBluenotes
LadyBluenotes deleted the chore/benchmark-counted-paths branch November 22, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant