GloriousFlywheel

RenovateBot Flywheel

This document describes how automated dependency updates form a self-improving loop when combined with the recursive dogfooding architecture.

Overview

RenovateBot continuously scans the repository for outdated dependencies and creates merge requests with version bumps. Those merge requests are tested and deployed by the same infrastructure that RenovateBot is updating. The result is a flywheel: each update cycle leaves the system in a better state for the next cycle.

What RenovateBot Scans

RenovateBot is configured to monitor three dependency manifests:

The Flywheel

graph LR
    RB[RenovateBot] -->|"version bump PRs"| PIPE[CI Pipeline]
    PIPE -->|"executed by"| R[Runners]
    R -->|"deploys updates from"| PIPE
    RB -->|"next scan"| RB

The cycle proceeds as follows:

  1. Scan. RenovateBot detects that a dependency has a newer version. It creates a merge request with the version bump and updated lockfile.
  2. Test. The merge request triggers a CI pipeline. Self-hosted runners execute the pipeline, which runs tofu validate, pnpm test, and bazel build against the proposed change.
  3. Merge. If the pipeline passes (and automerge is enabled for the dependency type), the merge request is merged to main.
  4. Deploy. The merge to main triggers the deployment pipeline. The runners execute tofu apply, which deploys the updated infrastructure. If the update affects the runners themselves (e.g., a new runner image tag), the runners redeploy themselves.
  5. Next scan. RenovateBot runs again on the now-updated codebase. Any transitive dependency changes introduced by the previous update are detected and the cycle repeats.

Self-Improvement Property

Each cycle can improve the infrastructure in concrete ways:

Because the infrastructure deploys itself, these improvements take effect without manual intervention. The system trends toward its best available state.

Interaction with the Attic Cache

When a dependency update changes Nix derivation outputs (e.g., a new nixpkgs pin), the first build after the update will miss the cache and rebuild affected derivations. Those new derivations are pushed to Attic. Subsequent builds (including the next RenovateBot cycle) benefit from the updated cache. Over time, the cache always contains derivations for the most recent dependency set.

Guardrails

Fully automated updates carry risk. The following guardrails are in place: