V4.5 Complete - Enhanced trancription context, added option to restranscribe source under different models.

This commit is contained in:
Jim Lancaster
2026-08-16 09:06:56 -05:00
parent bdb1b31b0a
commit 7054cd8af9
28 changed files with 2883 additions and 1485 deletions
+10 -4
View File
@@ -137,11 +137,12 @@ Responsibilities:
1. User uploads one or more images for a `Document`.
2. System stores files, hashes them, creates ordered `Source` rows, and creates a `Job`.
3. Worker claims the job, marks it `processing`, and executes page calls concurrently.
3. Worker claims the job, marks it `processing`, resolves metadata-directed orientation, and sends either the
immutable original or an exact normalized derivative to the provider.
4. Each provider call appends an `ExecutionAttempt` with its request manifest, transport evidence, SDK snapshot,
normalized metadata, timing, and outcome.
5. The linked `JobSource` is updated as a compatibility projection, and a successful attempt updates the
`Source.raw_transcription` latest-success projection.
5. The linked `JobSource` is updated as a compatibility projection. The first successful attempt establishes
`Source.preferred_execution_attempt_id` and `Source.raw_transcription`; later successes remain candidates.
6. Aggregate status becomes `completed`, `partial_success`, or `failed`.
### 2. Document-Person Relationship Management
@@ -170,13 +171,18 @@ Responsibilities:
## V4 Domain Rules
- `JobSource.raw_transcription` preserves page output for its Job execution.
- `Source.raw_transcription` is the latest-success machine-output projection for a page.
- `Source.raw_transcription` is the selected preferred-machine-output projection for a page.
- `Source.preferred_execution_attempt_id` identifies its exact immutable provenance; candidate promotion updates
both fields atomically.
- Human corrections occur only in `Source.revised_text`.
- Prompt and parameter provenance is frozen on `Job` at submission time.
- The SDK-serialized OpenRouter response snapshot is stored on `JobSource` for each successful page execution.
- Every V4.2 provider call appends a distinct `ExecutionAttempt`; retries never rewrite earlier attempts.
- Exact response bytes identify the OpenRouter HTTP boundary and are not labeled as native upstream-provider JSON.
- Generic `ProcessingArtifact` records use versioned schemas, digests, and one inline or external content location.
- Orientation-normalized model inputs and deterministic quality warnings are versioned `ProcessingArtifact` evidence
attached to the consuming `ExecutionAttempt`.
- A `retranscription` Job contains one locked existing Source and freezes one configured allowlisted model.
- `DocumentPerson` links are unique for `(document_id, person_id)` and require one `role_id`.
- Relationship mutations are deterministic, set-based, and atomic with Document writes.
- `DocumentType.id` and `PersonRole.id` are canonical relationship identities; unique labels may evolve.