Define processing-adapter contract and add UTF-8 plain-text ingestion #57
No reviewers
Labels
No labels
area/deployment
area/governance
area/metadata
area/pipeline
area/search
type/data
type/design
type/implementation
type/testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Arkive/arkive!57
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/issue-12-plaintext-ingestion"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements Issue #12 by defining Arkive's minimal processing-adapter contract and adding deterministic UTF-8 plain-text ingestion for approved originals.
The implementation builds directly on the approved-file integrity boundary introduced by Issue #11. Format processing receives the exact bytes from the same read that successfully passed integrity verification rather than reopening or independently resolving arbitrary filesystem paths.
Closes #12
Changes
load_approved_document()while preserving the existingverify_approved_document()API and behaviorarkive.plain_textadapter at version0.1.0text/plainoriginalsProcessing boundary
The implemented flow is:
document_id→ approved-file lookup and integrity verification
→ exact verified bytes
→ format-specific processing adapter
→ immutable processing result
Adapters do not accept arbitrary caller-supplied file paths and do not duplicate Issue #11 path-safety or integrity-verification logic.
The contract is intentionally small so a future born-digital PDF adapter can use the same boundary without introducing dynamic plugin discovery.
UTF-8 policy
Plain-text ingestion:
text/plainoriginalsRuntime transformation metadata describes the decoding step and does not alter the persisted document transformation schema used for derived artifacts.
Scope
This PR deliberately does not implement:
No metadata schemas, source policies, or committed pilot originals are changed.
Validation
Complete pre-staging validation passed:
git diff --checkpython -m ruff check src pipeline testspython -m ruff format --check src pipeline testspython -m pip check— no broken requirementsThe tests include both approved UTF-8 plain-text pilot originals plus focused coverage for exact character/byte preservation, CRLF and whitespace preservation, UTF-8 BOM handling, unsupported BOM-marked encodings, malformed UTF-8, unsupported PDF media type, deterministic serialization, immutable results, lineage metadata, repeated ingestion, and Issue #11 verification-error propagation.