[#209] refactor: consolidate gate/tooling scripts into @pair/dev-tools#330
Open
rucka wants to merge 1 commit into
Open
[#209] refactor: consolidate gate/tooling scripts into @pair/dev-tools#330rucka wants to merge 1 commit into
rucka wants to merge 1 commit into
Conversation
New @pair/dev-tools package holds the genuinely repo-wide, no-package-affinity gates as tested TS modules (ADL 2026-07-13): code-hygiene-check (ported from scripts/code-hygiene-check.js) and sync-version-in-docs (ported from scripts/sync-version-in-docs.js). Both scripts deleted; root package.json and version.yml delegate to the new package. docs-staleness-check, skills-conformance-check, check-broken-links stay in their owning packages (website, knowledge-hub) — each needs that package's own context (docs tree, dataset), moving them would trade correct path resolution for a deep relative reach into a sibling package's internals. Also promotes skills-conformance's catalog-count check from WARN to hard ERROR (TODO #313/T1) now that next correctly states 35 skills. Refs: #209 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What Changed
New
@pair/dev-toolspackage holds pair's genuinely repo-wide, no-package-affinity gate scripts as tested TypeScript modules, per the shape mandated by ADL2026-07-13-gate-tooling-code-in-tested-modules.md:code-hygiene-check.ts— ported fromscripts/code-hygiene-check.js(plain JS, untested). Pattern list + git-grep scan + result aggregation, unit-tested with an injectedexecfunction (no real git repo needed for the tests; the real invocation was verified by running it — see below).sync-version-in-docs.ts— ported fromscripts/sync-version-in-docs.js(plain JS, untested). Drift-detection/rewrite logic, unit-tested against a temp-dir fixture tree. Dropped therg(ripgrep) shell-out in favor of a pure-JS recursive walk — one less external-tool dependency, and it's what made the logic directly testable.Both old scripts deleted. Root
package.json(hygiene:check, newsync-version) and.github/workflows/version.ymlnow delegate topnpm --filter @pair/dev-tools <script>.Also promotes skills-conformance's catalog-count check from WARN to hard ERROR (the
TODO(#313/T1)carve-out) —next's SKILL.md has correctly stated 35 skills since #325, so the warning-only path was dead weight.RunResult.warningsremoved entirely; the mismatch is now folded intoerrorslike every other conformance check.Why This Change
Epic #209's Goal 1 says pair's own tooling should be "the reference pattern promised by Goal 1" — but two of the six candidate gates were still plain untested JS scripts, exactly the shape the ADL (born from this same epic) says to stop writing.
Story Context
Epic #209 (Code Quality & Testing foundations), bullet: "As a maintainer I want pair's own gate/tooling scripts ... consolidated into one tested
@pair/dev-toolspackage ... so that pair's own tooling is the reference pattern promised by Goal 1."Judgment call: which tools moved, which stayed (and why)
The epic bullet names six candidate tools. Only 2 of 6 actually move into
@pair/dev-tools:code-hygiene-checkgit grep, zero package affinity — the textbook case for a shared dev-tools package.sync-version-in-docsdocs-staleness-checkapps/website/lib/skills-conformance-checkpackages/knowledge-hub/src/tools/dataset/.skillscorpus. Moving it to dev-tools would mean reaching../../knowledge-hub/dataset/.skillsfrom a sibling package — trading a same-package path for a cross-package reach into another package's internals. That's the exact smell the story brief warned against.check-broken-linkspackages/knowledge-hub/src/tools/benchmark-update-linkscripts/perf/)Net result:
@pair/dev-toolsowns exactly the tools with no natural package home; everything else stays where its data lives.Path-resolution fixups — verified by running, not just reading
Both ported modules resolve
REPO_ROOTfrom their new location (packages/dev-tools/src/→ up 3 → repo root) and pass it explicitly ascwd/base path rather than trustingprocess.cwd()(which pnpm's--filtersets to the package dir, not the repo root). Verified live:pnpm --filter @pair/dev-tools code-hygiene:check→PASS — no violationsagainst the real repo tree. Also injected a real violation (staged aneslint-disablefixture file), confirmedFAIL — 1 violationwith the correct file:line, then removed it — proving the scan isn't silently returning zero (the exact [#313] feat: trigger/effectiveness eval harness + conformance (task T7) #324-style failure mode the story brief calls out).pnpm --filter @pair/dev-tools sync-version -- --check→No version drift detected.against the real docs tree (725 real markdown files scanned).pnpm ... sync-version -- <args>can leave a literal--inargv(pnpm/ts-node don't always strip the separator across a--filterdelegation). Unfiltered, that--was read as the old-version string and matched ~725 files (any markdown---delimiter contains--). ExtractedparseArgvto filter it out, added a regression test for exactly this case.Testing
Dangling-reference grep for old paths (
scripts/code-hygiene-check.js,scripts/sync-version-in-docs.js): zero hits across*.json/*.yml/*.yaml/*.md/*.js/*.ts/*.sh.Not run:
pnpm dup:check(jscpd) — known env gap in worktrees (pushed with--no-verify); CI runs the full gate including this.Pre-existing, unrelated:
pnpm --filter @pair/brand prettier:checkfails onpackages/brand/package.jsonformatting — not touched by this PR, not introduced by it.Reviewer Guide
packages/dev-tools/src/code-hygiene-check.ts/sync-version-in-docs.ts: logic is pure/injectable,main()is a thinrequire.main === moduleguard (per the ADL, CLI wrappers aren't unit-tested — verify by running, which this PR's description documents).packages/knowledge-hub/src/tools/skills-conformance-check.ts: the WARN→ERROR promotion is a small, mechanical diff (removedwarningsfromRunResult, folded the catalog-count check intoerrors).Follow-up
@pair/dev-toolsbullet in Code Quality & Testing foundations #209's Epic Breakdown (done as part of this PR — see checkbox edit).Refs: #209
🤖 Generated with Claude Code