V4.1 revisions in preparation for v4.2. AI data capture now better defined.

This commit is contained in:
Jim Lancaster
2026-08-12 18:51:48 -05:00
parent 89cf69f8a2
commit 171132919d
15 changed files with 944 additions and 11 deletions
+4
View File
@@ -86,6 +86,8 @@ async def seed_job(app_client: tuple[FastAPI, TestClient]) -> Callable[..., Awai
error_detail: str | None = None,
revision_text: str | None = None,
source_file: Path | None = None,
ai_metadata: dict | None = None,
raw_api_response: dict | None = None,
) -> UUID:
async with session_scope() as session:
stored_path = app.state.settings.upload_dir / filename
@@ -130,6 +132,8 @@ async def seed_job(app_client: tuple[FastAPI, TestClient]) -> Callable[..., Awai
),
raw_transcription=transcription_text,
error_detail=error_detail,
ai_metadata=ai_metadata,
raw_api_response=raw_api_response,
)
)
-1
View File
@@ -118,7 +118,6 @@ class TestDocumentsPageRendering:
assert "Letter from Hig" in response.text
assert "ZC-1924-001" in response.text
assert "Zenna Cochran" in response.text
assert f"/ui/people/{seed_person_and_document[1]}" in response.text
assert "PIPELINE JOBS" in response.text.upper()
assert "Edit Document" in response.text
+4 -2
View File
@@ -48,8 +48,10 @@ class TestPeoplePageRendering:
assert response.status_code == 200
assert "Create Person Record" in response.text
assert "Full name is required." in response.text
assert "Birth date (YYYY-MM-DD)" in response.text
assert "Death date (YYYY-MM-DD)" in response.text
assert "Birth date" in response.text
assert "Death date" in response.text
assert "Birth date (YYYY-MM-DD)" not in response.text
assert "Death date (YYYY-MM-DD)" not in response.text
assert "FamilySearch ID" in response.text
assert "Biography" in response.text
assert "Save person" in response.text
+6
View File
@@ -192,6 +192,8 @@ class TestSourcesPageRendering:
transcription_text="original transcription text",
revision_text="human revision text",
source_file=fixture_path,
ai_metadata={"finish_reason": "stop", "confidence": 0.98},
raw_api_response={"id": "response-123", "model": "test-model"},
)
async with session_scope() as session:
@@ -216,6 +218,10 @@ class TestSourcesPageRendering:
assert "Save revision" in response.text
assert "Previous Page" in response.text
assert "Next Page" in response.text
assert "AI Metadata" in response.text
assert "Raw API Response" in response.text
assert "finish_reason" in response.text
assert "response-123" in response.text
@pytest.mark.asyncio
async def test_source_delete_page_blocks_when_source_is_job_linked(