Skip to content

Typecheck experiment in CI; drop the pre-push hook - #619

Merged
kcarnold merged 1 commit into
mainfrom
claude/experiment-ci-drop-husky
Aug 20, 2026
Merged

kcarnold merged 1 commit into
mainfrom
claude/experiment-ci-drop-husky

Conversation

@kcarnold

Copy link
Copy Markdown
Contributor

Moves the experiment/ typecheck from a local git hook into CI, where the work actually happens.

Why

Nothing typechecks experiment/ at PR time:

Workflow Covers
backend-tests.yml backend/
frontend-tests.yml frontend/
mindmap-tests.yml prototype-mindmap/
build-experiment-image.yml builds the image — push to main only

The only check experiment/ had was the Husky pre-push hook, and it gates on [ "$remote_ref" = "refs/heads/main" ] — a direct local push to main. Under PR flow that never happens: feature-branch pushes skip the gate, and merges run server-side where no local hook exists. So the hook guards a path the project doesn't use, which is why it hasn't fired in a long time.

build-experiment-image.yml would catch a type error via next build (there's no typescript.ignoreBuildErrors in next.config.ts), but only after the change is on main, and it fails the image push rather than the PR.

Net: a dead guard standing in front of a real gap.

What changed

Added .github/workflows/experiment-tests.yml, mirroring backend-tests.yml — same trigger shape, permissions: contents: read, same step sequence. Runs typecheck plus the Vitest suite on PRs touching experiment/**.

One deviation worth noting: npm test is watch mode in this package (unlike backend, where it's vitest run), so CI calls npm run test:run. Commented inline so it doesn't read as an inconsistency.

Removed .husky/pre-push and the root package.json entries that existed only to install it. grep -rn "husky\|prepare" across the repo found references in no file but the root manifest — the Dockerfile copies only per-app manifests, and the devcontainer's postCreateCommand runs uv sync and cd frontend && npm install, never a root install.

Beyond being inert, the hook had two latent problems if it ever did fire: cd experiment sits inside the while read loop without a subshell, so a multi-ref push would run the second iteration from the wrong directory; and it never installs dependencies, so a stale experiment/node_modules fails confusingly.

Testing

  • Ran the exact CI steps locally in experiment/: npm ci, then npm run typecheck (clean) and npm run test:run (20/20 passing in 1 file).
  • Parsed all seven workflow files with yaml.safe_load; all valid.
  • Compared the new workflow's trigger keys, permissions, working-directory, and step sequence against backend-tests.yml to confirm it matches the house pattern.
  • This PR touches .github/workflows/experiment-tests.yml, which is in its own paths filter, so the new workflow runs on this PR and validates itself.

Note for the reviewer

Root package.json and package-lock.json are now near-empty shells — the manifest keeps only name/version/description, and the lockfile has zero dependencies. Deleting both outright would be tidier, and nothing references them, but the sandbox blocked me from removing package.json. If you want them gone: git rm package.json package-lock.json.

Related

Follow-up to the docs cleanup in #618, which noted this gap. That PR adds a CLAUDE.md line documenting the pre-push hook; once both land, that line should come out. Happy to drop it from #618 pre-merge — say the word.


Generated by Claude Code

Nothing typechecked `experiment/` at PR time. backend-tests, frontend-tests,
and mindmap-tests each cover their own area; experiment had only the Husky
`pre-push` hook, which fires solely when the push target is `main`. Under
PR flow that never happens — feature-branch pushes skip the gate and merges
run server-side — so the hook was guarding a path we don't use. The
post-merge image build would catch a type error via `next build`, but only
once it's already on main.

Add experiment-tests.yml, mirroring backend-tests.yml: typecheck plus the
Vitest suite on PRs touching experiment/**. Note that `npm test` is watch
mode in this package, so CI runs test:run.

With the check where the work happens, remove .husky/pre-push and the root
package.json entries that existed only to install it. Nothing else in the
repo referenced husky or the root manifest.

Verified locally: `npm run typecheck` clean, `npm run test:run` 20/20.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EVaiHqHvxameg9j8JPRWBC
@kcarnold
kcarnold merged commit a853eb5 into main Aug 20, 2026
7 checks passed
@kcarnold
kcarnold deleted the claude/experiment-ci-drop-husky branch August 20, 2026 18:05
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.

2 participants