← Back to Pull requests

Feat/nix integration #6104

Open
unknown opened this pull request with 335 lines diff across 4 files
View on GitHub
unknown unknown commented on Dec 03, 2026 20:03 UTC
Author

Problem

Sure ships as a container image and expects Postgres, Redis and a worker next to
it. On a NixOS host that means hand-managed compose files, a mutable gem
directory inside the image, and no way to pin the toolchain a developer actually
uses. Reproducing a bug or cutting a release then depends on whichever Ruby and
Node happened to be on the machine.

What this does

  • nix develop provides the exact toolchain (ruby, node, postgres, valkey,

  • libvips, poppler, sqlcipher) instead of a manual setup, pinned by the flake
    lock.
  • packages.default builds the application with precompiled assets from a

  • single derivation; packages.image and packages.image-worker produce
    the OCI images from that same derivation, so the packaged app and the shipped
    images cannot drift apart.
  • nixosModules.default runs web, worker and migration units natively with

  • systemd hardening, secrets via LoadCredential, and an optional boot-time
    migration. The container path stays available; nothing forces the switch.
  • A gemset is pinned, not resolved at build time. One gemset serves all

  • architectures, with an allow-list install and VERSION stamping, and
    .sure-version carries a Gem::Version-parseable, dot-separated release
    identity.
  • nix flake check is the CI gate: lint (rubocop, brakeman, biome), build

  • smoke tests, gemset drift, a source-entries classifier that accounts for every
    top-level entry, install-shape and closure-size targets, and a KVM boot test.
  • nix/tag-release.sh derives the release tag from nix/VERSION plus the

  • commit, resolves the tag to the commit it names, and asserts that before
    pushing.

    Validation

  • nix flake check is the branch's own gate: the checks listed above, including

  • the KVM boot test.
  • nix build .#packages.default produces the app; the packaged binary is

  • asserted to run with BUNDLE_GEMFILE pointing at share/bundle.
  • Install-shape and closure-size checks encode the targets this packaging aims

  • at; nix/README.md documents deployment, README.md states that aarch64 is
    explicitly not a goal of this branch.
  • The history cleanup that produced this branch only replayed these commits onto

  • current main; no Nix code was changed in it, so the flake checks were not
    re-run here.

    Notes for review

  • The branch is rebased onto current main (7e86933) in 17 linear commits and

  • contains only Nix glue, packaging scripts and docs — no application or test
    code — so it can be reviewed on its own.
  • nix/ is kept out of the application source tree, so the app itself stays

  • project-generic and the flake consumes it as a package.

    Diff: 335 lines (+251 / -84) across 4 files Reviewer: jjmata Review duration: 2556m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.42) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 335 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.348
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #6104"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.2% (MEDIUM) · Higher = larger blast radius
    42.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.5% · Safe to merge
    22.5%