Typecheck experiment in CI; drop the pre-push hook - #619
Merged
Merged
Conversation
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
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.
Moves the
experiment/typecheck from a local git hook into CI, where the work actually happens.Why
Nothing typechecks
experiment/at PR time:backend-tests.ymlbackend/frontend-tests.ymlfrontend/mindmap-tests.ymlprototype-mindmap/build-experiment-image.ymlmainonlyThe only check
experiment/had was the Huskypre-pushhook, and it gates on[ "$remote_ref" = "refs/heads/main" ]— a direct local push tomain. 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.ymlwould catch a type error vianext build(there's notypescript.ignoreBuildErrorsinnext.config.ts), but only after the change is onmain, 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, mirroringbackend-tests.yml— same trigger shape,permissions: contents: read, same step sequence. Runs typecheck plus the Vitest suite on PRs touchingexperiment/**.One deviation worth noting:
npm testis watch mode in this package (unlikebackend, where it'svitest run), so CI callsnpm run test:run. Commented inline so it doesn't read as an inconsistency.Removed
.husky/pre-pushand the rootpackage.jsonentries 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'spostCreateCommandrunsuv syncandcd frontend && npm install, never a root install.Beyond being inert, the hook had two latent problems if it ever did fire:
cd experimentsits inside thewhile readloop without a subshell, so a multi-ref push would run the second iteration from the wrong directory; and it never installs dependencies, so a staleexperiment/node_modulesfails confusingly.Testing
experiment/:npm ci, thennpm run typecheck(clean) andnpm run test:run(20/20 passing in 1 file).yaml.safe_load; all valid.backend-tests.ymlto confirm it matches the house pattern..github/workflows/experiment-tests.yml, which is in its ownpathsfilter, so the new workflow runs on this PR and validates itself.Note for the reviewer
Root
package.jsonandpackage-lock.jsonare 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 removingpackage.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