Files
Joe Haddad 3b6cbeb8a9 ci: add manifest-drift gate + correct stale generated artifacts (#103)
* ci: add manifest-drift gate and correct stale generated artifacts

The committed skill-manifest.json had drifted from its source: the
`workflow` skill carried 11 path patterns (**/chain-engine*, **/orchestrat*,
**/escalation*, etc.) that were deliberately removed from skills/workflow/
SKILL.md in 498c263 ("fixing strict workflow skill detection"). They were
silently reintroduced into the manifest in 5641bff (#94), which regenerated
the manifest on a branch predating that removal. The skill-catalog.md had
the same workflow drift plus a stale vercel-connect entry.

Root cause: CI runs `bun run build` (which regenerates the manifest into the
working tree) and then tests against that fresh copy — it never verifies the
*committed* manifest matches source, so a stale committed manifest passes.

Fix:
- Add `--check` to scripts/build-manifest.ts: rebuilds in-memory and compares
  to the committed file (normalizing the volatile generatedAt timestamp),
  exiting non-zero on drift. Exposed as `bun run build:manifest:check`.
- Wire build:manifest:check (and the existing build:from-skills:check) into
  CI *before* the build step, so they validate the committed artifacts on the
  pristine tree rather than after build clobbers them.
- Regenerate skill-manifest.json and skill-catalog.md to heal the drift.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix: sort skill directory scan for deterministic manifest across platforms

scanSkillsDir() iterated readdirSync() output directly, whose order is
filesystem-dependent — roughly alphabetical on macOS/APFS but arbitrary on
Linux/ext4. The committed manifest was therefore generated in macOS order,
and build:manifest:check failed on the Linux CI runner because a fresh build
produced the same skills in a different key order (CI run on #103).

Sort the entries so manifest/catalog generation is byte-identical on every
platform. Regenerates skill-manifest.json and skill-catalog.md into sorted
order (one-time reordering churn; no semantic change).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 12:32:02 -07:00

42 lines
890 B
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
# Verify committed generated artifacts match their sources BEFORE the
# build step regenerates (and thus clobbers) them in the working tree.
- name: Check committed manifest is up-to-date
run: bun run build:manifest:check
- name: Check generated files are up-to-date
run: bun run build:from-skills:check
- name: Build
run: bun run build
- name: Typecheck
run: bun run typecheck
- name: Validate skills
run: bun run validate
- name: Test
run: bun test