Commit e3f1727
lane 4A follow-up: classify non-dict input as unsupported, not legacy
Caught during a second adversarial sweep of the kernel adapter: the
``verify_commitment`` wrapper was coercing non-dict input to an empty dict
before handing it to the kernel. The kernel's empty-dict branch treats
``{}`` as a legacy envelope (missing ``spec_version``), so non-dict input
(``None``, lists, strings, scalars) was producing a result with
``spec_version_status="legacy"`` and ``legacy_envelope=True`` — labels that
read as "valid pre-spec_version envelope that failed signature" when the
truth is "this isn't a valid envelope shape at all."
``overall=False`` was correct in every case (the safety-relevant
guarantee), so this was a cosmetic, not a correctness, issue. But the
labels appear in CLI panels, logs, and audit-export JSON, so consistency
matters.
Two changes:
- Pass the envelope through to the kernel unchanged — the kernel handles
non-dict directly (returns ``legacy_envelope=False`` with errors
``["envelope is not a JSON object"]``), so the coercion was the bug.
- Fix the ``spec_version_status`` synth: non-dict input is ``unsupported``,
with ``reason="envelope_not_a_json_object"`` for diagnostics. The
trichotomy stays (``supported`` / ``legacy`` / ``unsupported``); only
malformed input gets the precise diagnostic ``reason``.
Parametrized regression test covers five non-dict shapes (None / [] /
"hello" / 42 / True). The pre-kernel in-tree code crashed with
``AttributeError`` on the same inputs, so this also locks in the soft-fail
improvement from the kernel migration.
Suite: 229 passed, 21 skipped. Cross-product green
(``TestCrossProductVerify`` + ``cross-product-verified-model`` E2E).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 2d858ea commit e3f1727
2 files changed
Lines changed: 41 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
220 | 225 | | |
221 | | - | |
| 226 | + | |
222 | 227 | | |
223 | 228 | | |
224 | 229 | | |
225 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
226 | 234 | | |
227 | 235 | | |
228 | 236 | | |
229 | | - | |
230 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
231 | 243 | | |
232 | 244 | | |
233 | 245 | | |
| |||
240 | 252 | | |
241 | 253 | | |
242 | 254 | | |
243 | | - | |
| 255 | + | |
244 | 256 | | |
245 | 257 | | |
246 | 258 | | |
247 | 259 | | |
248 | 260 | | |
249 | | - | |
| 261 | + | |
250 | 262 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
272 | 295 | | |
273 | 296 | | |
274 | 297 | | |
| |||
0 commit comments