Repository navigation
feat: export packages.<system>.guardrails - #1799
Merged
Merged
Conversation
Surface the vendored guardrails gates derivation directly in the cross-platform packages set, for consumers that own their dev shell and pre-commit config and only want the hermetic gate binaries without migrating to mkProjectShell. Refs: #1572
Document the new packages.<system>.guardrails export in docs/NIX.md's capability-modules section as the supported API for a consumer that owns its dev shell and pre-commit config, and $out/share/guardrails/gates/test-gates.sh as the supported way to assert gate execution in a consumer flake. Add the CHANGELOG entry (mechanically synced to assets/workspace/.devcontainer/CHANGELOG.md by the sync-manifest pre-commit hook). Refs: #1572
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.
Description
Surfaces the vendored guardrails gates derivation directly as
packages.<system>.guardrails, for a consumer that already owns its own devshell and a committed pre-commit/prek config and only wants the hermetic
gate binaries — without migrating to
mkProjectShell.Type of Change
feat-- New featuredocs-- Documentation onlytest-- Adding or updating testsModifiers
!)Changes Made
tests/test_flake_checks.py: newtest_guardrails_package_is_exposed(builds
packages.<system>.guardrailsand assertsshare/guardrails/gates/test-gates.shis present in the output) — committedfailing first (TDD RED).
flake.nix: addedguardrails = guardrailsPkg;to the cross-platformpackagesset (the existingguardrailsPkgderivation used by theguardrailscapability module and theguardrails-canary/-shellcheckchecks), alongside the existing
servicespackage (TDD GREEN).docs/NIX.md: new subsection in Capability modules documentingpackages.<system>.guardrailsas the supported API for a consumer thatowns its dev shell/hook config, and
$out/share/guardrails/gates/test-gates.shas the supported way to assertgate execution in a consumer flake. Docs-only change, no new consumer-facing
check added (YAGNI, per the issue's "optional" ask Issue and PR templating #2).
CHANGELOG.md## Unreleased→Added(mechanically synced toassets/workspace/.devcontainer/CHANGELOG.mdby thesync-manifesthook).Changelog Entry
Added
packages.<system>.guardrails: the vendored gates without amkProjectShellmigration (#1572)mkProjectShell'smodules = [ "guardrails" ]) is now exposed directlyas
packages.<system>.guardrails, for a consumer that owns its own devshell and pre-commit/prek config and only wants the hermetic gate
binaries. Composes with Decision: which layer owns module-contributed pre-commit hooks? #1492: the consumer's hook config stays
consumer-owned
docs/NIX.md:$out/share/guardrails/gates/test-gates.shis the supported way for a consumer to assert gate execution in its own
flake
Testing
just test)Manual Testing Details
uv run pytest tests/test_flake_checks.py::test_guardrails_package_is_exposed— RED before the
flake.nixchange (attribute missing), GREEN after(builds and finds the gate script).
tests/test_flake_checks.py+tests/test_flake_services.py(minusthe services-boot integration test, excluded per repo convention) — 33
passed, including
test_flake_check_succeedsandtest_services_package_exposed_without_clobbering_linux_packages(regression guard that the Linux-only image packages weren't clobbered by
the
packagesrestructure — this PR follows the same cross-platform-setpattern
servicesalready established).just precommit(prek run --all-files) — green, no modified files.Checklist
CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
Scope note: the issue's ask #2 was optional ("either expose the canary as a
consumer-usable check, or document the execution-proof entry point"). Took
the docs-only path per the plan, to avoid adding a new consumer-facing check
that nobody has asked for yet (YAGNI) —
checks.guardrails-canarystaysdevkit-internal.
Refs: #1572