Commit 6933186
feat(toolchain): make opsm.toml [runtime] the single source of truth (#67)
## Problem
OPSM had **no single source of truth for its own toolchain versions —
five sources disagreed**:
| Source | Erlang | Elixir | Notes |
|---|---|---|---|
| `.tool-versions` (what actually builds it) | 28.3.1 | 1.19.5-otp-28 |
+ vestigial nodejs 25.6.1 |
| `opsm.toml [runtime]` (read by `opsm runtime install`) | 26.2.0 |
1.16.0 | stale |
| `.gitlab-ci.yml` | `elixir:latest` | `rust:latest` | non-reproducible
|
| `e2e.yml` + `nif-build.yml` | 27.0 | 1.17 | hardcoded |
| `trust-pipeline-e2e.yml` | 26.2 | 1.16.0 | hardcoded |
Plus: **Nickel** heavily used (`runtime/**/*.ncl`) but pinned nowhere,
**Idris2** (a real build dep — `src/abi/*.idr`) unpinned, **Rust**
floating on `stable`.
## Fix
`opsm.toml [runtime]` is now canonical (dogfooding — `opsm runtime
install` already consumes it). Everything else derives from it or is
drift-checked against it:
```
opsm.toml [runtime] ── just toolchain-sync ──► .tool-versions ──► asdf/mise + setup-beam (version-file)
└─ just toolchain-check (Mustfile-gated) ──► verifies .tool-versions + GitLab image pins
```
- **opsm.toml**: corrected stale pins (erlang → 28.3.1, elixir →
1.19.5-otp-28); completed the set (rust 1.97.0, nickel 1.16.0, idris2
0.8.0); dropped the vestigial nodejs pin (no package.json, nothing
invokes node — Deno is the sole JS runtime)
- **scripts/toolchain.sh** (new, POSIX sh): `sync` regenerates
`.tool-versions`; `check` fails loudly on any drift, incl. GitLab image
tags. Wired as `just toolchain-sync` / `just toolchain-check` + Mustfile
check
- **`.tool-versions`**: now generated, with idris2 (no asdf plugin —
pack/Chez route) and rust (asdf-global, cargo-audit conflict) excluded
via documented skip-list. zig/deno/nickel provision via the estate's
[`asdf-tool-plugins`](https://github.com/hyperpolymath/asdf-tool-plugins)
- **GitLab CI**: `elixir:1.19.5-otp-28` + `rust:1.97` (tags verified on
Docker Hub); also fixed the invalid `//` comment on line 2 that broke
YAML parsing. Scanner images (trivy/semgrep/trufflehog) deliberately
float — fresh detection DBs beat cosmetic pinning
- **GitHub workflows**: `setup-beam` now reads `.tool-versions`
(`version-file` + `version-type: strict`) in e2e, nif-build, and
trust-pipeline-e2e; rust steps pin `toolchain: 1.97.0` (nif-build,
echidna-validation)
- **`parse_runtime_section/1`** (`manager.ex`): hardened — comment lines
containing `=` were mis-parsed as pins and inline comments corrupted
versions; tests added
- **docs/TOOLCHAIN.adoc** (new): derivation chain, per-tool provisioner
table, the honest bootstrap story (OPSM is an Elixir escript — it cannot
provision the BEAM for itself; asdf/mise/Guix sit underneath), and the
Idris2 route (pack + Chez + GMP today; `guix.scm` is still a stub,
documented as TODO rather than overclaimed)
## Verified
- `sh scripts/toolchain.sh sync && sh scripts/toolchain.sh check` →
green
- Drift injections (`.tool-versions` version mutated; GitLab image
reverted to `:latest`) → both exit 1
- All 5 edited YAML files parse cleanly
- Elixir parser tests **not run locally** (no BEAM in this container) —
CI runs them; watching this PR for fallout, especially
`trust-pipeline-e2e` moving 26.2 → 28.3.1 (accepted risk per owner
decision)
## Known follow-ups (out of scope here)
- `guix.scm` is a stub (`source #f`) — growing it into a real manifest
is recorded in STATE.a2ml next-actions
- Handoff sections B/C (service deps wiring, solver stack) — separate
work
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Kq24sZCEohSrNFXSuEuz6C
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Kq24sZCEohSrNFXSuEuz6C)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent f91eb34 commit 6933186
20 files changed
Lines changed: 712 additions & 347 deletions
File tree
- .github/workflows
- .machine_readable/6a2
- docs
- opsm_ex
- lib/opsm
- package
- runtime
- trust
- test/opsm/runtime
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | | - | |
69 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | | - | |
37 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
35 | | - | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| |||
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
44 | | - | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
54 | | - | |
| 59 | + | |
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
| |||
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
69 | | - | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| |||
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
78 | | - | |
| 83 | + | |
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
| |||
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | | - | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
94 | 99 | | |
95 | 100 | | |
96 | | - | |
| 101 | + | |
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
| |||
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
110 | | - | |
| 115 | + | |
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
117 | 122 | | |
118 | | - | |
| 123 | + | |
119 | 124 | | |
120 | 125 | | |
121 | 126 | | |
| |||
128 | 133 | | |
129 | 134 | | |
130 | 135 | | |
131 | | - | |
| 136 | + | |
132 | 137 | | |
133 | 138 | | |
134 | 139 | | |
| |||
140 | 145 | | |
141 | 146 | | |
142 | 147 | | |
143 | | - | |
| 148 | + | |
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
172 | 184 | | |
173 | 185 | | |
| 186 | + | |
| 187 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
5 | 12 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
110 | 122 | | |
111 | 123 | | |
112 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
0 commit comments