V4.2 Updated what ai_raw_response data is being captured. The changes were more extensive than I expected.

This commit is contained in:
Jim Lancaster
2026-08-14 07:21:15 -05:00
parent 28811d79ce
commit 6bd4cbb0a7
29 changed files with 2091 additions and 130 deletions
+17
View File
@@ -210,6 +210,23 @@ Enforce exactly one content location: inline payload or external reference. An e
These decisions must be settled before their corresponding implementation phase; they do not weaken the invariant or expand V4.2 into live OCR integration.
## Resolved Implementation Decisions
1. `JobSource` remains queue linkage and a compatibility projection; immutable retries use a one-to-many
`ExecutionAttempt` model with a unique `(job_id, source_id, attempt_number)` constraint.
2. Exact OpenRouter response bytes remain database values for V4.2. Generic artifacts use inline canonical JSON up
to 1 MiB by default and constrained, atomically written external files above that threshold.
3. Request manifests use `transcription-canonical-json-v1`: UTF-8 JSON with sorted keys, compact separators,
preserved Unicode, and non-finite numbers rejected.
4. Safe response headers are explicitly allowlisted in the evidence contract; all others are discarded before
persistence.
5. Software identity records the package version, optional `TRANSCRIPTION_COMMIT`, adapter contract version,
OpenRouter SDK version, and Python version.
6. The artifact root defaults to `data/artifacts` and stores source-scoped relative references.
7. Evidence exports include source identity and digest by reference, not original source binaries.
8. The benchmark manifest is private and digest-referenced. Corpus size remains archive-dependent, but every run
uses preserved execution-attempt identity and the fixed literal scoring contract.
## Done When
- Every V4.2 acceptance criterion is satisfied by focused tests or an explicit demonstration.