Provider malformed-response corpus + era-jump migration; fix usage accounting on dirty payloads (#105) - #107
Merged
Merged
Conversation
…counting on non-dict payloads (#105) Corpus: 11 protocol-agnostic dirty bodies (truncated JSON, empty, HTML error pages, null/array top level, wrong inner shapes, non-string text, empty output) parametrized over BOTH adapters, each row asserting ProviderError (fail closed), no crash, and no credential material in the error text; plus parse_intent never returns garbage, and the ideal shapes keep passing (no overfit). The corpus caught a real regression from #77 on its first run: the usage accounting block ran payload.get("usage") before any dict check, so a null or array body raised a bare AttributeError instead of ProviderError. Both adapters now degrade accounting on non-dict payloads (isinstance guard); the content parse below owns the ProviderError. Migration: a database created at the v0.1-era schema (no digest/stale/ flaky columns; permissions without content_hash or capabilities) opens under current TaskStore + PermissionCenter with every newer dimension off, round-trips an update, and the additive migrations are idempotent on reopen. 745 tests pass (+27); demo 8/8.
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #105. 27 new offline tests: an 11-row dirty-body corpus (truncated JSON, empty bodies, HTML error pages, null/array top level, wrong inner shapes, non-string text blocks, empty output) parametrized over both adapters — each row asserts ProviderError, no crash, and no credential in the error text — plus parse_intent garbage rejection, an anti-overfit row proving ideal shapes still pass, and a v0.1-era database jumping to the current schema with every newer dimension off and idempotent migrations.
The corpus caught a real defect on its first run (exactly what the strict-acceptance discipline is for): #77's usage accounting executed
payload.get("usage")before any dict check, so a null or array body raised a bareAttributeError— violating the every-failure-is-ProviderError contract in both adapters. Fixed with an isinstance guard: accounting degrades silently on non-dict payloads, the content parse below raises the proper ProviderError.745 tests pass (+27), demo 8/8.