generated from john/python-template
5.2 KiB
5.2 KiB
Source Acceptance Criteria
Purpose: Define implementation-ready acceptance criteria for Source Create, Read, Update, and Delete workflows.
Companion documents:
- docs/ui/entities/source/user-journey.md
- docs/ui/entities/source/schema-mapping.md
Scope
This checklist covers:
- Create flow
- Read flow
- Update flow
- Delete flow
This checklist does not cover:
- advanced multi-version revision history design
- job orchestration state-machine behavior
- provider-level transcription internals
Create Acceptance Criteria
CR-1 Source creation entry
- Given the user is in job creation or job configuration flow
- When the user selects Add sources
- Then the user can upload one or more source files or a folder
- Then source creation is not offered as a standalone first-release document-only flow
CR-2 Required create values
- document_id is derived from selected Document context
- JobSource.job_id is derived from the active Job context
- Each created Source is linked to the active Job through JobSource at create time
- page_number is assigned to preserve ordering
- upload_name, filename, and file_path are persisted for each created source
CR-3 Ordering and filename strategy
- Given a multi-file or folder upload
- When source records are created
- Then page ordering follows alphabetical order of original filenames
- Then upload_name stores the original filename
- Then filename is stored using UUID plus original extension in the form UUID.extension
CR-4 Successful create outcome
- Given valid uploads
- When source creation completes
- Then Source records are created and linked to the Document
- Then Source records are linked to the active Job through JobSource
- Then source list reflects new pages in sequence
- Then the user can open preview or revision workflow
CR-5 Create failure outcome
- Given upload or persistence failure
- Then clear error feedback is shown
- Then no false success feedback is shown
- Then retry path remains available
- Then creation fails when required Document or Job linkage cannot be established
Read Acceptance Criteria
RD-1 Source detail retrieval
- Given a valid Source id in source context, typically via a document-scoped source list in first release
- When the user opens source detail or equivalent panel
- Then source metadata and preview are displayed for that source only if the detail UI exists in a later revision
RD-2 Transcription and revision visibility
- Original transcription context is visible read-only when the revision UI exists
- Revision state is visible when the revision UI exists
- If revised_text is absent, no revision yet messaging is shown when the revision UI exists
RD-3 Missing source state
- Given a missing source
- Then UI shows clear no source available or not found messaging without crashing
Update Acceptance Criteria
UP-1 Revision editing entry
- Given a source context
- When the user enters revision edit flow
- Then revised_text input is available in a later revision of the UI
UP-2 Revision validation
- revised_text cannot be saved as empty after trimming when the revision UI exists
- Warning feedback is shown for invalid empty input when the revision UI exists
UP-3 Successful revision save
- Given valid revision text
- When the user saves in a later revision of the UI
- Then revised_text persists
- Then date_revised is updated
- Then success feedback is shown
- Then refreshed revision content is visible
UP-4 Revision save failure
- Given backend failure during save in a later revision of the UI
- Then clear error feedback is shown
- Then the user-entered text remains available for retry where possible
Delete Acceptance Criteria
DL-1 Delete entry and confirmation
- Given a source in source context, typically via a later source detail view
- When the user selects delete source
- Then a permanent-action confirmation dialog appears
DL-2 Dependency guardrails
- If policy requires cleanup of related JobSource records first, delete is blocked
- If policy allows dependent cleanup path, delete can proceed
DL-3 Blocked delete behavior
- When blocked
- Then UI explains dependency constraints
- Then UI provides guidance for dependency cleanup
DL-4 Successful delete
- Given no blocking dependencies
- When the user confirms deletion
- Then source is removed
- Then success feedback is shown
- Then the user returns to source list context
DL-5 Delete failure
- Given backend failure during delete
- Then clear error feedback is shown
- Then the user remains in source context with retry path
Cross-Criteria Quality Gates
QG-1 Separation of intent and implementation
- UX intent remains in user-journey.md
- Current versus target implementation mapping remains in schema-mapping.md
QG-2 Traceability
- Each accepted behavior maps to at least one future UI action or service path
- No acceptance criterion contradicts first-release deferred items
QG-3 First-release constraints
- Source interaction may remain job-detail-centric initially
- revised_text is the primary editable source field in first release
- source creation requires both Document linkage and Job linkage at create time
- richer source management surfaces are phased in later