Skip to content

ci: extend the skill-harness workflow; fix pnpm 11 frozen installs - #36

Merged
oschaaf merged 3 commits into
mainfrom
ci/skill-harness-workflow
Oct 23, 2026
Merged

oschaaf merged 3 commits into
mainfrom
ci/skill-harness-workflow

Conversation

@oschaaf

@oschaaf oschaaf commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Rebase of this PR after #50, which added .github/workflows/test.yml. The standalone skill-harness.yml workflow from the original version is dropped; its remaining value now extends the #50 workflow in place.

What this PR still adds on top of main:

  • pnpm 11 frozen installs (pnpm install --frozen-lockfile and pnpm test are broken on pnpm 11 (overrides moved) #30). pnpm install --frozen-lockfile fails on main under pnpm 11 with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH, because pnpm 11 ignores the pnpm.overrides key in package.json. The esbuild override moves to skill-harness/pnpm-workspace.yaml, with allowBuilds: esbuild: false. The lockfile is unchanged. CI only passes today because it pins pnpm 10.
  • Toolchain from package.json. packageManager: pnpm@11.18.0 and engines.node: 24 are the single source for both local runs and the workflow (package_json_file, node-version-file).
  • Typecheck. New pnpm typecheck script (tsc --noEmit), run in CI.
  • Digest-first step. node scripts/generate-schema-digest.mjs --check runs first, as a named step, on the runner's default Node, so a stale digest is reported even if install fails.
  • Lockfile guard. git diff --exit-code on the lockfile and pnpm-workspace.yaml, run even if the install failed (a backstop: pnpm 11 rewrites pnpm-workspace.yaml on some failed installs, and this shows what it wanted to change). Test, biome and typecheck are gated on the install step so one run reports every failure.
  • Hardening. persist-credentials: false, concurrency (PR runs share a group per ref so a newer push cancels the older run; every other run, i.e. push to main or manual dispatch, gets its own group so nothing is cancelled or queued), 10 minute timeout.
  • Dependabot. Weekly grouped updates for the action pins and the harness npm dependencies.
  • Docs. CLAUDE.md and both READMEs describe the extended checks. No plugin.json bump: nothing distributed changes.

The live bench is still not run in CI (needs API credentials).

Follow-up, unchanged from the original description: scripts/generate-schema-digest.mjs is not covered by biome.

Verification

From a clean clone of the branch, in workflow order, under pnpm 11.18.0 / Node 24.18.1 with CI=true:

  • node scripts/generate-schema-digest.mjs --check: in sync
  • pnpm install --frozen-lockfile: clean
  • git diff --exit-code -- skill-harness/pnpm-lock.yaml skill-harness/pnpm-workspace.yaml: no diff
  • pnpm test: 181/181
  • pnpm biome:check: clean
  • pnpm typecheck: clean
  • actionlint .github/workflows/test.yml: clean
  • git status --porcelain empty afterwards

Mutation probes (fresh node_modules): removing allowBuilds fails with ERR_PNPM_IGNORED_BUILDS; deleting pnpm-workspace.yaml fails with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH.

Closes #30. Closes #33.

The first dependabot PR will show whether dependabot handles pnpm 11's pnpm-workspace.yaml overrides; nothing to do until then.

@oschaaf
oschaaf requested a review from pareilly August 21, 2026 15:54
@oschaaf

oschaaf commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

Drift the workflow now enforces on every PR/push (these guards existed but only ran if someone ran pnpm test locally):

  • SKILL.md ↔ schema-reference.json — generate-schema-digest.mjs --check fails if the generated digest section is stale (runs first, even if install breaks).
  • Vendored validator bundle — suite asserts the byte sha256 of config-validator.bundle.mjs and its 2.0.0 version pin; schema artifact likewise pinned by sha256 + 1.1.0.
  • Hand-written safe defaults ↔ artifact's gatewayDefault — the mismatched/shadowed/unresolved buckets throw at build.
  • Digest coverage gates — every target/constraint/reserved key/default flavor must render; a dangling schemaPath is fatal.
  • Type drift — tsc --noEmit now runs for the first time in any gate.

Drift the PR adds new guards for:

  • Lockfile/config drift — the Lockfile is stable step fails if a frozen install wants to rewrite pnpm-lock.yaml or pnpm-workspace.yaml (the pnpm install --frozen-lockfile and pnpm test are broken on pnpm 11 (overrides moved) #30 bug class, which previously silently
    re-resolved esbuild back to a vulnerable version).
  • Toolchain drift — pnpm and Node are pinned in package.json; CI and local read the same values.
  • Action drift — SHA-pinned actions plus dependabot so the pins are bumped deliberately rather than floating.

What it does not guard:

  • Upstream drift — whether the vendored bundle/schema still match the product repo's current artifact. The harness pins what's committed; detecting that the source moved needs a
    producer-side check (tracked as a follow-up on the product side).
  • Behavioral drift of the skill itself — that's the live bench, which stays out of CI.

@nicobatalla

nicobatalla commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

the skill harness is now run on every merge to main and PRs after #50

pnpm 11 no longer reads the `pnpm` key in package.json, so the esbuild
override that lived there was silently ignored and `pnpm install
--frozen-lockfile` refused the committed lockfile. Move the override to
skill-harness/pnpm-workspace.yaml, which is where pnpm 11 looks for it.

While there, declare `allowBuilds: esbuild: false`. esbuild's postinstall
is only a fallback for platforms without a prebuilt optional dependency;
on every platform we run on the binary comes from the optional package,
so the build script is not needed and the install stays free of
arbitrary postinstall execution.

Pin the toolchain in package.json so CI and local runs agree:
`packageManager: pnpm@11.18.0` (read by pnpm/action-setup) and
`engines.node: 24` (read by actions/setup-node). Add a `typecheck`
script (`tsc --noEmit`) so CI can run it by name.

The lockfile is unchanged: a frozen install accepts it byte-for-byte
once the override is read from the right place.

Closes #30

Signed-off-by: Otto van der Schaaf <otto@dtwo.ai>
Extend the `skill-harness` job that #50 added to .github/workflows/test.yml
rather than adding a second workflow. Changes relative to that version:

- The pnpm and Node versions are read from skill-harness/package.json
  (`packageManager`, `engines.node`) instead of being hard-coded in the
  workflow, so a local run and CI use the same toolchain.
- The schema digest `--check` runs first, as its own named step. The
  generator imports only node: builtins, so it runs on the runner's
  default Node and reports a stale digest even if the install fails.
- A lockfile-stability guard (`git diff --exit-code` on the lockfile and
  workspace file) runs after the install, even if the install failed: a
  frozen install must not want to rewrite either file, and pnpm 11
  rewrites pnpm-workspace.yaml on some failed installs.
- `pnpm typecheck` (`tsc --noEmit`) runs alongside the tests and biome.
  The checks after install are gated on the install step rather than on
  the previous step, so one run reports every failure.
- Hardening: checkout does not persist credentials, a newer push to a PR
  cancels that PR's older run (every other run gets its own concurrency
  group, so nothing is cancelled or queued), and the job has a 10 minute
  timeout.
- .github/dependabot.yml keeps the action SHA pins current and bumps the
  harness npm dependencies in one weekly PR.

The live bench (`pnpm bench`) is still not run: it calls a model API and
needs credentials.

Closes #33

Signed-off-by: Otto van der Schaaf <otto@dtwo.ai>
The `skill-harness` workflow now also runs the schema-digest `--check`
as its first step, a lockfile-stability guard, and `pnpm typecheck`, and
reads its pnpm and Node versions from skill-harness/package.json. Update
CLAUDE.md and both READMEs to say so, list `pnpm typecheck` with the
other offline commands, and note that the live bench is not run in CI.

Signed-off-by: Otto van der Schaaf <otto@dtwo.ai>
@oschaaf oschaaf changed the title Run the skill-harness suite in CI; fix pnpm 11 installs ci: extend the skill-harness workflow; fix pnpm 11 frozen installs Oct 22, 2026
@oschaaf
oschaaf force-pushed the ci/skill-harness-workflow branch from e2d68c2 to 839a6c3 Compare October 22, 2026 15:23
@oschaaf

oschaaf commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

Thanks, rebased on top of #50. The standalone workflow is dropped; this now extends test.yml in place with the parts #50 did not cover: the pnpm 11 frozen-install fix (#30), pnpm typecheck, the digest --check as a first named step, toolchain versions read from package.json, a lockfile backstop, and dependabot. Description updated to match.

@oschaaf
oschaaf requested a review from nicobatalla October 22, 2026 15:23
@oschaaf
oschaaf merged commit b4c430f into main Oct 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants