Commit 9082980
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 a7f3433 commit 9082980
2 files changed
Lines changed: 75 additions & 20 deletions
Lines changed: 59 additions & 10 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 | | |
| |||
67 | 84 | | |
68 | 85 | | |
69 | 86 | | |
70 | | - | |
71 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
72 | 94 | | |
73 | 95 | | |
74 | 96 | | |
| |||
101 | 123 | | |
102 | 124 | | |
103 | 125 | | |
104 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
105 | 129 | | |
106 | 130 | | |
107 | 131 | | |
| |||
123 | 147 | | |
124 | 148 | | |
125 | 149 | | |
126 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
127 | 153 | | |
128 | 154 | | |
129 | 155 | | |
| |||
136 | 162 | | |
137 | 163 | | |
138 | 164 | | |
139 | | - | |
140 | | - | |
141 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
142 | 190 | | |
143 | 191 | | |
144 | 192 | | |
| |||
192 | 240 | | |
193 | 241 | | |
194 | 242 | | |
195 | | - | |
196 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
197 | 246 | | |
198 | 247 | | |
199 | 248 | | |
| |||
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