title: Module Retraction weight: 50
Module Retraction
Module retraction automatically generates .retract files --- the reverse of each module --- so you always have a clean undo ready. When enabled, vigocli config publish generates a retract module for every new or changed module, and shows affected envoys when a module is removed.
Requirements
Both settings must be enabled in server.yaml:
ai:
enabled: true
provider: claude # or openai, ollama
publish:
retraction:
enabled: true
How It Works
On new or changed modules
- Run
vigocli config publishafter adding or modifying a module instockpile/modules/ - The publish pipeline detects new/changed modules and reads their content
- The server generates a deterministic retract module (flipping each resource to its absent state)
- The AI reviews and improves the draft, especially for
execresources where reversal requires reasoning - A
.retractfile is written alongside the module instockpile/modules/
On removed modules
- Run
vigocli config publishafter removing a module fromstockpile/modules/ - The publish pipeline detects the removal and reads the module content from the previous config
- The server generates the retract module and looks up which envoys previously ran it
- A
.retractfile is written tostockpile/modules/with a detailed summary of affected envoys and per-resource confidence levels
Generated Output
The generated .retract file is inert --- it won't be loaded by the config system until renamed to .vgo. For removed modules, the CLI also prints:
- Which envoys previously ran the module
- Per-resource confidence levels (high for package/file/service, low for exec)
- Step-by-step instructions for applying the retraction
Resource Reversal Rules
| Resource Type | Reversal | Confidence |
|---|---|---|
file, directory, symlink |
state: absent |
High |
package |
state: absent |
High |
service |
state: stopped, enabled: false |
High |
user |
state: absent |
Medium (home dir may have data) |
cron |
state: absent |
High |
repository |
state: absent |
High |
sysctl |
state: absent (resets to system default) |
High |
firewall |
state: absent |
High |
source_package |
Delete target file | Medium (extracted contents not removed) |
nonrepo_package |
state: absent (remove via dpkg/rpm) |
High |
exec |
AI-generated reversal with onlyif guard |
Low (always review) |
Applying a Retraction
- Review the generated file:
stockpile/modules/<name>.retract - Rename to
<name>-retract.vgo - Add module
<name>-retractto the relevant node entries or roles - Run
vigocli config publish - After all affected envoys converge, remove the retract module and its node entry
The retract module is idempotent --- it's safe to leave in the config for multiple convergence cycles while all envoys catch up. Remove it once cleanup is confirmed.
API
POST /api/v1/config/retract
Called automatically by vigocli config publish. Can also be called directly:
{
"modules": [
{"name": "nginx", "content": "name: nginx\nresources:\n ..."}
]
}
Returns generated retract YAML, warnings, and affected envoy list for each module.
Example Retractions
Every example module in example-configs/stockpile/modules/ has a pre-built retraction counterpart in example-configs/retractions/modules/. These follow the same reversal rules documented above and serve as reference implementations.
To use an example retraction:
- Copy the retraction to your stockpile:
cp example-configs/retractions/modules/web/nginx-retract.vgo.example \ /srv/vigo/stockpile/modules/nginx-retract.vgo - Review the file, especially any
# REVIEW:or# WARNING:comments - Add
nginx-retractto the relevant node entries or roles - Publish:
vigocli config publish - After all affected envoys converge, remove the retract module and its node entry