Repository navigation
Description
Two findings from building a full Rust layer on top of devkit 1.6.0 in
gerchowl/filesender (private). Design doc:
docs/designs/0001-rust-language-pack.md in that repo — it records the
verification status of every claim, including which remain unverified.
The second finding is the more urgent one, so it goes first.
A. devkit and gerchowl/guardrails overlap, and today they collide
gerchowl/guardrails is "shareable code-quality / observability / perf
governance for repos — gates + toolbelt + conventions, packaged as a Nix flake…
built to counter agent drift". It is mature and shipping.
The collision: both projects want to own .pre-commit-config.yaml, both
install git hooks, and devkit additionally owns .githooks/ and drives
core.hooksPath. A repo adopting both naively gets two hook managers fighting
over the same path — and the loser's hooks stop running silently, which is the
worst possible failure mode for a gate. Both also ship a deny.toml and both
ship templates.
The overlap is otherwise complementary, not redundant:
| devkit | guardrails | |
|---|---|---|
Scaffold, delivery modes, .vig-os upgrades |
✅ | — |
| Release train, CI, commit standard | ✅ | — |
| Content gates (fake-impl, hardcoded, commented-code, conflict markers) | — | ✅ |
Observability spine (crates/trace) + no-raw-trace-fields |
— | ✅ |
Tunables registry (const_tunable!/config! → generated TUNABLES.md) |
— | ✅ |
| Perf budgets/ratchets, ADR-matrix, derived-docs freshness | — | ✅ |
| Capability modules, home-manager, image | ✅ | — |
So the question is not which wins — it is who owns the hook surface. Options:
- devkit owns hooks; guardrails ships its gates as entries devkit's
.pre-commit-config.yaml(or the flake-generatedhooksargument) includes.
The gates are already PATH-exposed asguardrails-<name>, so this looks
cheap. - guardrails owns hooks; devkit's
prekstack becomes a guardrails gate set. - Documented mutual exclusion — worst option, but honest if 1 and 2 are hard.
Recommendation: option 1. devkit's flake already supports fully custom hooks
via mkProjectShell's hooks argument, which is exactly the seam, and
guardrails' gates are already individually invocable.
B. Rust language pack
devkit is language-neutral by contract, and for Rust that currently means the
stock justfile.project guards every recipe on [ -f pyproject.toml ] — so on
a Rust repo just lint and just test silently no-op and CI goes green
without compiling anything. nix/modules/default.nix names rust as an
ask-gated candidate; this is the ask, with a working consumer behind it.
Asks, in priority order
-
Capability-module v1 cannot contribute
checks. The contract is
pkgs -> options -> { packages, env, shellHook }, and most of a Rust pack's
value is checks (clippy / fmt / nextest / doctests / deny). Either extend
the contract, or blessvigos.lib.mkRustProjectalongsidemkProjectShell.
This decides the pack's shape — a module-only adopter would get a
toolchain and no checks, i.e. exactly the silent-green-CI failure above.
Working within v1 for now: module for the toolchain, lib for the checks. -
The language axis is hardcoded. Node support lives in a bash function
(seed_node_justfile_project). Rust is the second language to need the same
treatment; the fix is alang.d/<lang>/pack the installer iterates, not a
second special case. -
Nix detection false-negative. Detection requires
*.nixbeyond
flake.nix, so a single-flake repo is never nix-detected and never receives
the nix.gitignorefragment —result/result-*go unignored. Every
direnv-mode Rust consumer hits this. -
worktreeopt-out leaves residue. With the group disabled,
.claude/worktrees.jsonsurvives and.claude/skills/is left as an empty
directory. -
contents: readceiling blocks the documented release-asset use case.
release.ymlis managed, so raising it locally is reverted on the next
--force. Options: raise it upstream, add an attach step torelease.yml,
or document OCI /secrets: inheritas the intended pattern.
Known limits the pack has to state honestly
flake.nixis aPRESERVE_FILE, so the Rust flake can never be
scaffolded into an existing repo — template for new repos, documented snippet
otherwise.- Cargo manifest policy cannot be scaffolded at all; there is no
manifest-merge.[workspace.lints], profiles and resolver are template +
documentation only. (Cargo also rejects mixinglints.workspace = truewith
crate-local overrides, so per-crate deviation must live in source as
#![allow(…)]— which is actually the desirable shape: opt-out beats forget,
and the opt-out is greppable.) - Policy files should be preserved (scaffold-once) + drift-reported. A
survey of uv / ruff / reth / rust-analyzer found ~70% overlap and ~30%
deliberate divergence in[workspace.lints]. Enforcing a shared file
would be wrong; reporting divergence is right.
Evidence worth reusing
- Cross-repo
[workspace.lints]sharing does not exist in Cargo (no
manifest-fragment merge, no runtime to do it at — which is why npm's
eslint-config-*pattern cannot be translated). Copy-paste is the state of
the art. - Orgs do not cross-consume reusable GitHub workflows —
uses: <org>/<repo>/…searches across astral-sh, paradigmxyz and matter-labs
return zero. They compose within-repo and pin actions by SHA. - Nix-flake-as-input is the only mechanism with real cross-repo distribution
evidence (crane, fenix — and guardrails). That validates both projects'
approach. - Ship templates first, primitives second. crane has ~30 lib primitives and
14nix flake init -ttemplates; the templates are what people adopt. - devkit already implements copier's update model —
.vig-osis
.copier-answers.ymlandinstall.sh --forceiscopier update. The gap
versus copier is migration hooks: a version bump can re-render but cannot
transform consumer files.
Activity
gerchowl commentedon Aug 10, 2026
Reconciliation: three layers, one hook surface
Following up on section A. The two systems were built independently — the
overlap is convergent rather than derivative, and the gaps are complementary.
Proposed division:
core.hooksPath, commit-msg + prepare-commit-msg,.vig-os, CI, release trainguardrails-<name>gates,crates/trace, tunables registrydevkit keeps the hook surface. guardrails' gates enter as entries in the
.pre-commit-config.yamldevkit's flake generates —mkProjectShell'shooksargument is exactly that seam, and the gates are already individually invocable
as
guardrails-<name>. The Rust pack adds further entries plus flakechecks.One surface, three contributors, nothing fighting over
core.hooksPath.Stage assignment
Refs:rustfmt --check, no-conflict-markers, no-fake-impl, no-debug-leftovers, no-commented-code, no-hardcoded, no-raw-trace-fields, protect-trunkclippy -D warnings, nextest +cargo test --doc,cargo-deny, xtask gatesnix flake check, mutants, perf budgets, numerical ratchet, coverage report, derived-docs, attribution freshness, scaffold driftguardrails staleOrdering rule: earliest stage where it is fast enough. A slow gate trains
--no-verify, and a bypassed gate is worse than no gate.What the Rust pack will NOT duplicate
guardrails does these better, so the pack consumes rather than reinvents:
the escape-hatch→generated-registry pattern (supersedes "every
#[allow]carriesa reason"),
derived-docsmarker regions (supersedes per-artifact freshnessrecipes),
no-raw-trace-fields(supersedes a per-structDebugtest), plusno-fake-implandprotect-trunk, which are agent failure modes the pack'sdesign had missed entirely.
One principle adopted from guardrails that changes the pack
Baseline ratchets — snapshot per-file counts, growth hard-fails, burn-down
nudges a re-record, at-baseline stays silent, re-recording refuses to loosen.
Every count-based gate in the pack needs that shape; without it a gate gets
deleted rather than satisfied.
One gate that should go UPSTREAM to guardrails, not just into the pack
Root tool configs must appear in the crane fileset. A config absent from the
fileset is dropped inside the build sandbox, and the tool then runs against its
own defaults — reporting success while enforcing nothing. This bit the
consumer repo twice in one day (
deny.toml, thenclippy.toml, the lattercaught by the new gate on its first run, inside the very commit meant to fix
that class).
guardrails' own gates are vulnerable to this the moment they run inside a
crane sandbox with an explicit fileset. The failure is invisible by construction,
which is exactly what makes it worth a gate rather than a convention.
gerchowl commentedon Aug 11, 2026
Scope correction: the Rust pack ships STANDALONE, no guardrails dependency
Sharpening section A, because the two proposals should not be fused.
The pack does not depend on guardrails, and shouldn't. guardrails' gates are
language-agnostic —
no-fake-impl,no-commented-code,no-hardcoded,derived-docs,gitleaks,protect-trunkserve a Python or Node consumerexactly as much as a Rust one. Scoping them inside a rust module would deny
them to everyone else. They belong at devkit's level or nowhere.
The pack also doesn't need them: its content is fenix, crane, the check suite,
profiles,
[workspace.lints], layering, fileset. The consumer repo demonstratesthe two compose — not that one requires the other.
So: two proposals, sequenced. The pack first (small, self-contained, has a
working consumer). The guardrails reconciliation second, org-wide.
Ownership, because the separation leaks in practice
Clean in principle, leaky in practice, and the leak is nameable: Rust tooling
and its config have three claimants.
deny.tomlis shipped by guardrails'templates/default/, hand-written in the consumer, and would be shipped by thepack.
cargo-deny/rustfmt/clippycome from guardrails' toolbelt, are invokedby hook entries, and are also wanted as flake
checks.prek/python3arrivefrom guardrails while
uv/vig-utilsarrive from devkit, with no declared ownerof the intersection.
core.hooksPath, hook scripts), scaffold, release train,vig-utilsdeny.toml,clippy.toml,rustfmt.toml) and the flakechecksCorollary that needs stating in both projects, or every Rust consumer
resolves it differently: guardrails' Rust-specific pieces — its
deny.toml, itsrustfmt/clippy hook entries — are for repos without the pack. Where the pack is
present, they defer.
Elevation criterion: language-agnosticism, not maturity
When something graduates out of the rust module, the test is whether it is
Rust-specific:
profile shape.
vig-utils(alongsidevalidate-commit-msg), so Python andNode consumers get it too: the derived-artifact manifest, policy drift, the
exception registry.
The derived-artifact manifest is the clearest candidate — nothing about "a
generated file must not silently disagree with its source" is Rust-specific.
Two caveats a reviewer will raise
Governance.
gerchowl/guardrailsis a personal repo;vig-os/devkitis theorg's. An org tool taking a hard dependency on a personal one is a bus-factor and
transfer question — it probably wants guardrails under
vig-osfirst, or anexplicit policy. Not a blocker for a personal consumer; definitely one here.
Flake inputs are fetched at EVALUATION, since they are arguments to
outputs. A governance input in the main flake is therefore fetched by anyonewho merely runs
nix run <repo>— dev-only tooling in the consumer's path. Theconsumer repo currently has exactly this problem with two governance inputs. The
pack should recommend a separate
dev/flake.nixrather than reproducing itacross every Rust repo in the org.
fix(nix): mkRustProject package builds compile only when nextest is on
feat(doctor): report whether core.hooksPath wires the tracked git hoo…
feat(nix): rust performance tooling — @Perf groups and a deterministi…
test(nix): cover the mkRustProject consumer guards
feat(nix): guard the mkRustProject consumer path and close two gaps
feat(nix): guard the mkRustProject consumer path and close two gaps (#…
fix(nix): pin the overlay sentinel both ways, and rename buildEnv to …
chore(nix): merge dev into the rust language pack branch
fix(nix): satisfy statix on the fenix input
feat(nix): Rust language pack — capability module + lib.mkRustProject (…
feat(nix): guardrails capability module — the org's semantic gates (#…
c-vigo commentedon Aug 13, 2026
Both halves have landed: the Rust language pack in #1429 (+ #1452 hardening) and the guardrails reconciliation in #1495. The collision this issue opened on is resolved by keeping hook entries a scaffold concern (#1492) and shipping the gates as a PATH-contributing capability module. Ships in 1.9.0.
chore: release 1.9.0 (#1498)
fix(workspace): survive a mid-scaffold abort without wiping .vig-os (#…
feat: seed the Rust pack on cold adoption (cargo recipes, tool config…