Don't just diff configurations. Understand their consequences.
cargo install confsequence # or a binary from Releases (Linux, macOS, Windows)
confsequence scan path/to/projectTry the online demo: the Studio on the bundled synthetic project, read-only, nothing to install.
The 24-second demo is one real synthetic run: counterexample, the Git change behind it, the source chain, the repair patch, and a Docker replay that reproduces the failure and confirms the fix. Terminal recording
- Problem. One setting such as
API_PORTcan come from a shell, a.envfile, Compose, a Dockerfile and a Pydantic default. Each layer has its own precedence. A text diff shows which lines changed, not which effective values changed or whether they will break at runtime. - What it does. Confsequence models every layer and then:
- traces where each value really comes from;
- explains what a Git change does to effective values;
- finds the smallest combination of settings that breaks a rule;
- proposes a fix and verifies it before showing it.
- The hard parts.
- Each reader follows one pinned release (Compose 2.40.3, Pydantic Settings 2.10.1, CPython 3.12.10), and anything outside the modelled subset stays Unknown instead of being guessed.
- A finite-domain solver finds cost-minimal counterexamples, cross-checked with Z3.
- Repairs are applied to a copy and re-analysed before they are shown.
- How it was checked.
- 289 reference tests against the pinned tools.
- Frozen synthetic sets for every rule.
- 15 real public projects, where the first run exposed false positives and coverage gaps that were then fixed (below).
- Built with Rust, TypeScript and React. Everything runs offline, with no AI model or API key.
A single value such as API_PORT can be set in a host shell, a .env file, a Compose environment block, an env_file, a Dockerfile ENV and a Pydantic default. Each layer has its own precedence and interpolation rules, and an empty string is not the same as an unset variable. A text diff shows which lines changed, not which effective values changed, and it cannot say whether a combination of settings will fail at runtime.
Confsequence models those layers explicitly so it can answer five questions:
- Where does this value come from, and what did it override?
- What does this Git change actually do to effective values and their consumers?
- Which combination of settings violates a rule, with the fewest changes from today's configuration?
- What is the smallest edit that fixes it without breaking a protected rule?
- Does the failure, and the fix, reproduce in a real container?
Install with cargo install confsequence, or download the archive for your platform from Releases and extract it; it includes the bundled synthetic project used below. On Windows PowerShell use .\confsequence.exe.
./confsequence scan fixtures/workspace
./confsequence explain PORT --root fixtures/workspace --scope service:api
./confsequence studio --root fixtures/workspacescan lists findings with their keys and source lines, explain prints the full source chain, and studio opens a local browser UI. More commands are in the usage guide. 繁體中文說明見快速入門。
flowchart LR
A[Compose, dotenv,<br/>Dockerfile, Python,<br/>Pydantic sources] --> B[Version-pinned<br/>adapters]
B --> C[Configuration IR<br/>typed, scoped values<br/>with provenance and Unknown]
C --> D[Resolver and<br/>dependency graph]
D --> E[Rules CW001–CW010<br/>and semantic Git diff]
E --> F[Finite-domain search<br/>cost-minimal witness]
F --> G[Repair search<br/>protected rules]
G --> H[Independent check<br/>and Docker replay]
E --> I[CLI · Studio · VS Code<br/>MCP · SARIF]
- Typed configuration IR. Every value carries its scope, type and source span.
Known(""), missing, null and Unknown are different states. A host variable and a container variable with the same name are different keys. - Version-pinned semantics. Each adapter follows one pinned reference release (Compose 2.40.3, Pydantic Settings 2.10.1, CPython 3.12.10), and its behaviour is checked against that release. Anything outside the modelled subset stays Unknown instead of being guessed.
- Counterexamples, not warnings. For a rule such as "cache enabled requires a fallback", the solver searches the declared finite domain for the violating assignment closest to the current configuration. A separate evaluator re-checks every witness against the full model.
- Verified repairs. Candidate edits are limited to files the user allows. Each candidate is applied to a temporary copy and re-analysed. A candidate that breaks a protected rule is rejected, and if no safe edit exists the tool says so.
The design notes cover each of these in more detail.
Confsequence was run on 15 public projects that ship Compose and env files: sentry self-hosted, supabase, dify, immich, mastodon, appwrite and others. Every finding was checked by hand. The method and every finding are in the real-project report.
| First run (0.1.0) | After the fixes (0.1.1) | |
|---|---|---|
| Real configuration defects found | 0 | 0 |
| False positives | 75 | 0 |
| Values / dependencies modelled | 234 / 132 | 684 / 498 |
What the first run exposed.
- Coverage gaps: 6 main Compose files were rejected as a whole because of YAML anchors, a plain decimal or dotted names.
- Over-reporting: the "unused setting" rule reported variables whose consumers had not been modelled.
Both were fixed and checked against pinned Compose. These are popular, maintained projects, and none had a defect the scanner could prove. The second run uses the same corpus, so it is not held out.
Each evaluation set was written for this project and frozen in Git before its first run, and the first result is kept even when it was a failure.
| What was measured | Result |
|---|---|
| Detection on prospective sets for every rule family, CW001–CW010 | 32/32 set and reference runs match on one release build |
| CW005–CW007 contracts, values passed through six Compose routes | Precision 1.0, recall 1.0. Regex baseline F1 0.25 |
| CW008 drift between two scenarios | Precision 1.0, recall 1.0. Regex baseline precision 0.71 |
| CW001 guarded Python reads, first blind run of set 1 | Recall 0.5. Two missing features were found and fixed. Set 2 then passed 12/12 on its first run |
| Unsupported Python shapes (dynamic keys, decorators, …) | 12/12 reported as Unknown, none silently cleared |
| Semantics against pinned Compose, Pydantic, CPython and dotenv | 289 reference tests pass |
| Solver against independent enumeration and Z3 | 144 of 144 results match. Z3 confirms the optimal cost on 24 satisfiable inputs |
| Scan time, 10,000 keys with dense dependencies | 178 ms median on Windows, 171 ms on Linux |
| Parser robustness | 800,000 deterministic mutations across eight parsers |
The full evidence, including failed first runs, is in evidence.
- CLI for scan, explain, graph, diff, counterexamples, repair, coverage and report. Output formats are text, JSON, SARIF, HTML and Markdown.
- Studio, a local browser UI with ten views. It is keyboard accessible and listens only on loopback with a session token.
- VS Code extension with Problems, hover, go-to-source, Git diff and witness and repair previews.
- MCP server (stdio, read-only) for coding agents, a Python SDK, and a GitHub Actions SARIF example.
- Python support is a static subset: direct
os.environandos.getenvreads, simple guards and common Pydantic Settings fields. Dynamic keys, decorators and other unsupported shapes are reported as Unknown. - Compose support covers a verified subset.
include,extendsand some profile cases stay Unknown. - The real-project evaluation covers 15 projects and one reviewer. Its second run is not held out.
extends, includes and some flow-style YAML still stop a Compose file from being modelled. - Docker runtime replay is verified on Linux only. Usability was checked with a keyboard and accessibility-tree walkthrough, not with human participants or a screen reader.
- This is a 0.1 preview built as a personal project. See status for open items.
token-autopsy is a local-first profiler for AI coding agents: it finds where Claude Code and Codex spend their tokens, with evidence.
MIT. Release archives include notices for bundled dependencies.
