Devenv integration#3
Merged
Merged
Conversation
- Pin Ruby 4.0.5 and PostgreSQL 18 tooling (pg_config, pg_regress, pgformatter) through Nix so the toolchain is reproducible rather than relying on system installs. - Move MUTANT_SINCE and PG_REGRESS into devenv and drop the .envrc/direnv setup. - Expose the Rakefile dev tasks as devenv tasks (app:format, :test, :mutate, :pg-regress, :check). - Manage the pre-commit hook via git-hooks.nix (runs the full bin/rake). - Drive the Claude stree-on-save hook from devenv; attribution moves to settings.local.json since devenv now owns settings.json. - Run CI through devenv (Nix + cachix) instead of ruby/setup-ruby and cache devenv's bundle directory. - Ignore devenv-generated files (settings.json, .mcp.json, .githooks, .pre-commit-config.yaml). - Gemfile.lock now records bundler 2.7.2, the version shipped by the Nix Ruby.
- `devenv test` only checks that the shell and services come up healthy; with no service daemon to wait on, it has nothing to verify. - The full bin/rake run already lives in the app:check task, the pre-commit hook, and CI (devenv shell -- bin/rake), so enterTest was redundant.
- Consolidate the pg_regress run in one place: devenv.nix's scripts.pg-regress, dropping the Rakefile task, the pg-ephemeral gem dependency, and the PG_REGRESS/PG_BINDIR env-var plumbing. - The script spins up an ephemeral PostgreSQL from the Nix server binaries on a private unix socket (no TCP listener), seeds db/schema/0.1.0.sql, runs the schedule_existing suite, and tears it down via a trap. - Inline the pg_regress and bindir paths from Nix instead of probing PATH/Homebrew and passing them through env vars.
- Replace pgformatter (pg_format) with sqlfluff: swap the devenv package, point the rake format task at `sqlfluff format db`, and add .sqlfluff pinning the postgres dialect.
- Apply the new formatter to the schema and seed files. Layout and whitespace only; no semantic change (pg-regress still passes).
- Replace the per-tool format invocations with treefmt (devenv's treefmt-nix integration): Ruby via syntax_tree, SQL via sqlfluff, configured in devenv.nix. - Exclude sqlfluff's LT05 (line too long) so `sqlfluff format` exits 0 as a formatter; the long lines it can't wrap no longer fail it. - Point app:format and the Claude on-save hook at treefmt (SQL now formats on save too), drop the Rakefile format task, and update AGENTS.md.
- Drop .sqlfluff; pass the dialect and excluded rules to sqlfluff through the treefmt formatter options in devenv.nix. - Exclude LT05 (unfixable long lines) so `sqlfluff format` exits 0.
- Move `bundle install` out of enterShell into an app:setup task gated on devenv:enterShell, so it still runs on shell entry. - Drop bin/setup; it only ran bundle install and is now redundant.
- Replace the app:test/app:mutate/app:check devenv tasks with test:unit (bin/m test), test:mutate (mutant --since) and test:pg (the pg-regress script). - Drive the pre-commit hook and CI via `devenv tasks run test:unit test:mutate`, keeping the test commands defined in one place. - Slim the Rakefile to gem tasks only; its Minitest/mutate/default tasks now duplicate the devenv tasks.
- Move setup and format out of the app: namespace into dev:setup and dev:format, leaving test:* as the only other group.
- Replace the explicit test:unit/test:mutate(/test:pg) lists with `devenv tasks run test`, so both CI and the pre-commit hook run every task in the test: namespace (now including test:pg).
- treefmt formats Ruby with the bundled syntax_tree (stree), so dev:format now depends on dev:setup to ensure the gems are installed before formatting.
- On push to master, base MUTANT_SINCE on github.event.before instead of HEAD^ so mutant covers every commit the push introduced, not just the last one. PR runs still mutate against the PR base.
- Replace the git pre-commit hook (git-hooks.hooks.test) with a Claude Stop hook that runs `devenv tasks run test` at the end of each agent loop. - On failure it sends the output back so the agent fixes it; a stop_hook_active guard avoids looping on the slow suite. - Commits no longer run the suite (the Stop hook is the gate now).
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.
No description provided.