ATMOSYNTH Groove: a desktop DAW whose instruments and effects are ATMOSYNTH patches, on ATproto.

A commit that changes a lockfile or names a new path is refused before it lands red #27

Closed opened by center.for.cybernetic.beauty

Part of #26

.githooks/pre-commit checks formatting only. frontend/test/notices.test.js holds src-tauri/THIRD-PARTY-NOTICES.txt to what the lockfiles name, so a backend-only commit that adds a crate reddens the frontend suite: 3a2fffc went in red that way, because the worker ran cargo and named-paths only, and 9b26a0a fixed it a commit later. frontend/test/named-paths.test.js refuses a document file name until it is in PLACEHOLDERS, and two commits went in red on it, chained after a Vitest run with ; instead of gated on its exit.

Done when the hook, on a staged Cargo.lock, Cargo.toml or frontend/package-lock.json, runs npx vitest run notices in frontend/, and on any staged .rs, .js, .mjs or .md runs npx vitest run named-paths, refusing on red; both take seconds. CLAUDE.md's Commands line about the hook says what it refuses now. Left out: the whole Vitest suite on commit, which takes every core on this machine and belongs to the suite wrapper, another child of #26.

Done in ec3dd2a. The pre-commit hook now runs vitest run notices in frontend/ when Cargo.lock, any Cargo.toml, frontend/package-lock.json or what the notices are made from is staged. It runs vitest run named-paths when a staged file is one that test reads. Each red refuses the commit with a line naming it. A frontend without Vitest refuses rather than skips. The two runs take about four seconds. CLAUDE.md's Commands line says what the hook refuses now.

Where this goes further than the ticket asked:

  • Named paths. The hook takes everything that test reads, so .sh, .toml, .html, .githooks/ and NOTICE as well as .rs, .js, .mjs and .md. Deleted and renamed files count too, since a doc may name them.
  • How Vitest is called. It's called from frontend/node_modules, as Prettier is, not through npx.

One gap is left. Both tests read the working tree, as the suite does, not the index, so a file left out of a commit can pass here and fail on main.

frontend/test/pre-commit.test.js runs the hook in a scratch repository. It was red before the hook changed.

Sign up or Sign in to add to the discussion.