fix(evidence): harden canonical corpus contracts
This commit is contained in:
@@ -41,3 +41,33 @@ did not exist. After implementation, the focused suite passed.
|
||||
treat these value objects as immutable and construct replacements rather than mutate collections.
|
||||
- The adapter and normalization tasks should preserve the credential-free boundary by passing only
|
||||
these records beyond acquisition.
|
||||
|
||||
## Review hardening follow-up
|
||||
|
||||
All six binding review areas were addressed in a separate TDD pass:
|
||||
|
||||
- JSON metadata is recursively converted to immutable `FrozenDict`/tuple values while retaining
|
||||
stable object/array JSON serialization. Manifest document and chunk collections are tuples.
|
||||
- Secret-key matching now normalizes camelCase and punctuation. It rejects credential-specific
|
||||
names (passwords, API keys, access/refresh tokens, client/private keys, session cookies and
|
||||
authorization) recursively, while deliberate benign labels such as generic `token` and `secret`
|
||||
remain valid.
|
||||
- Canonical URIs require a scheme and reject userinfo or credential-bearing query parameters.
|
||||
- Namespaced IDs, SHA-256 content hashes, timezone-aware UTC timestamps, embedding/vector
|
||||
compatibility, unique IDs, chunk referential/provenance integrity, contiguous per-document
|
||||
ordinals and pipeline-version consistency are validated. Nested Pydantic instances are always
|
||||
revalidated so `model_copy(update=...)` cannot bypass a manifest boundary.
|
||||
- Acquired arbitrary bytes have explicit base64 JSON encoding and validation, covered by a JSON
|
||||
round-trip test.
|
||||
- `EvidenceSourceError` classifies transient/retryable versus permanent failures and exposes only
|
||||
recursively immutable, credential-screened JSON details.
|
||||
|
||||
Follow-up verification:
|
||||
|
||||
- Focused contract suite: 39 passed.
|
||||
- Focused Ruff: passed.
|
||||
- Harness excluding Docker-backed L0 and the network-dependent wheel packaging test: 470 passed,
|
||||
5 deselected.
|
||||
- Fresh unrestricted harness attempt: 479 passed, 5 deselected; the same environmental boundary
|
||||
remains (47 Docker socket setup errors, four Docker parity failures, one isolated `uv build`
|
||||
network failure).
|
||||
|
||||
Reference in New Issue
Block a user