001-corpora-mvp · Status: Draft
User stories
1. Upload new corpus dataset (P1)
A researcher has a corpus file (PDF, plain text, or structured XML/TEI) they want to ingest. They open the Corpora admin app, trigger the upload workflow, provide metadata (title, language, source, corpus type), and submit the file. The system ingests the file, converts it to the internal storage format, and makes it available in the corpus library. Why P1: Without upload, no data exists in the system. All other operations depend on having corpora available. Acceptance scenarios:- Uploading a PDF with title, language, and source metadata makes the corpus appear in the library with all metadata, and its content viewable.
- Submitting an unsupported file format shows a clear error listing accepted formats without corrupting existing data.
- Submitting without required metadata highlights missing fields and prevents saving until they are populated.
2. Browse and view corpus library (P2)
A researcher opens the app and sees a list of all available corpora. They can browse, filter by language or corpus type, and select an entry to view its full content and metadata. Acceptance scenarios:- With 50+ entries, the library displays title, language, and corpus type for each, and remains responsive.
- Filtering by “Hebrew” shows only Hebrew corpora with an updated count.
- Selecting an entry opens a detail view with full metadata and scrollable content.
3. Edit corpus metadata and content (P3)
A researcher corrects an error in an entry’s metadata or text content: select the entry, enter edit mode, make corrections, and save. The system preserves the previous state so the change can be tracked. Acceptance scenarios:- Updating title and language in edit mode saves and reflects immediately in the library list.
- Closing the app without saving leaves the original entry unchanged, with a prompt about unsaved changes before closing.
4. Delete or archive corpus entry (P4)
A researcher removes a duplicate or deprecated entry: select it, choose delete or archive, confirm, and the entry is removed from the active library. Acceptance scenarios:- Confirming deletion removes the entry from the library and shows a confirmation.
- Cancelling the confirmation dialog leaves the entry unchanged.
Edge cases
- A corpus file exceeds available local storage space
- The local database becomes corrupted
- A duplicate corpus is uploaded (same title and source)
- Very large files (100MB+ PDFs) during upload and display
- The app is force-quit during an active upload
Functional requirements
Key entities
- Corpus Dataset — a single ingested corpus: title, language, source, corpus type (manuscript, biblical text, lexicon, commentary), content, created date, last modified date.
- Metadata Record — descriptive information attached to a Corpus Dataset: title, author/source, language, corpus type, notes/annotations.
- Upload Job — tracks a file ingestion in progress: file name, file type, status (pending, processing, complete, failed), error message.
Success criteria
Assumptions
- Single researcher/administrator operating locally on macOS; multi-user access is out of scope for MVP.
- Authentication is not required for local-only MVP use; access control comes in a future phase.
- Corpus files come from the local file system; remote URL ingestion is out of scope.
- Accepted file size limit is 200 MB per upload.
- “Archive” is a soft-delete (hidden but retained); permanent deletion destroys the record.
- Corpus type taxonomy for MVP: biblical text, manuscript, lexicon, commentary, historical text.
- Corpora are stored in the internal
.exgenvelope format; raw source files are not exposed in the UI. - Version history beyond “last saved” is a Phase 2 feature.
- Seed data (30+ pre-loaded corpora) is present in development for testing Story 2 independently.