Commit 2c36cae
ambientops #127: fix non-compiling backend_interface + honest SPARK boundary + sound contracts
Foundation-first verification (gnatprove + gnat) found backend_interface.ads
was SPARK theatre that NEVER COMPILED:
- Transaction_Item.Package used an Ada reserved word as a field name
(no compiler accepts it) -> renamed Pkg (zero references anywhere).
- Install/Remove/Upgrade/Upgrade_System/Autoremove are *functions* with
an in-out controlling parameter -> illegal SPARK (RM 4.5.2), yet the
unit was pragma SPARK_Mode (On). gnatprove could never analyse it.
Changes (genuine, no theatre, no fake green):
- backend_interface.ads: real bug fix (Package->Pkg, now compiles, gnat
exit 0); honest pragma SPARK_Mode (Off) with documented rationale;
added sound Ada 2022 Pre'Class/Post'Class on the SPARK-legal query ops
(Get_Name/Search/Get_Package_Info) + Pre on Register_Backend (runtime
-gnata enforced; also the spec for the OWED SPARK refactor).
- plugin_registry.ads: strengthened with non-empty-ID preconditions on
Unregister/Get_Plugin/Get_Plugin_Metadata/Enable/Disable/
Is_Plugin_Enabled (was: only Register_Plugin had a Pre).
OWED (tracked standards#127, must NOT be faked): state-mutating
function->procedure redesign across backend_interface + backend_guix +
backend_nix to make the modification path legal SPARK; only then can
backend_interface/plugin_registry be gnatprove-discharged.
Refs hyperpolymath/standards#124
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ffda4ff commit 2c36cae
2 files changed
Lines changed: 68 additions & 18 deletions
Lines changed: 52 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
8 | 25 | | |
9 | 26 | | |
10 | 27 | | |
| |||
107 | 124 | | |
108 | 125 | | |
109 | 126 | | |
110 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
111 | 130 | | |
112 | 131 | | |
113 | 132 | | |
| |||
129 | 148 | | |
130 | 149 | | |
131 | 150 | | |
132 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
133 | 154 | | |
134 | 155 | | |
135 | 156 | | |
| |||
142 | 163 | | |
143 | 164 | | |
144 | 165 | | |
145 | | - | |
146 | | - | |
147 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
148 | 191 | | |
149 | 192 | | |
150 | 193 | | |
| |||
198 | 241 | | |
199 | 242 | | |
200 | 243 | | |
201 | | - | |
202 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
203 | 247 | | |
204 | 248 | | |
205 | 249 | | |
| |||
Lines changed: 16 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| |||
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
154 | | - | |
155 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
163 | | - | |
164 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
165 | 168 | | |
166 | 169 | | |
167 | 170 | | |
| |||
172 | 175 | | |
173 | 176 | | |
174 | 177 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
179 | 185 | | |
180 | 186 | | |
181 | 187 | | |
| |||
0 commit comments