# Generations And Rollback Den treats a system installation as a selected conda generation, not as a mutable collection of files. ## Generation Shape A generation lives at: ```text /den/generations//sw ``` It is a conda environment installed with its final runtime prefix. Metadata lives next to it: ```text /den/generations//metadata ``` The metadata records the workspace manifest, lockfile, generation provenance, and installed packages. `den generations validate ` checks that these files are present and that the generation has a runnable init path. ## Active Generation The selected generation is: ```text /den/current-system ``` At boot, the running system exposes: ```text /run/current-system ``` Root-level paths that should follow activation point through `/run/current-system/sw`. ## Activation Activation validates the target generation before changing the pointer. The prototype uses a same-directory symlink replacement so the active-generation switch is as small as possible. ## Rollback Rollback points the active-generation symlink back to an earlier generation. Older generations remain on disk under: ```text /den/generations ``` The `den rollback` command validates the target generation and updates `/den/current-system` through the same activation path as `den activate`. ## Why This Matters Traditional mutable package operations can leave a machine between states. Generation activation gives Den a cleaner model: - install a new generation, - validate it, - switch the active pointer, - keep the old generation available, - roll back if needed. This is one of the strongest ideas from NixOS and Guix System. Den explores whether conda lockfiles and workspace archives can support the same operational shape.