Align metadata schemas and validation with the intake workflow #33
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!33
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/issue-9-metadata-intake-alignment"
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
source.reviewobject for reviewer identity and review date, andlicense.jurisdictionpluslicense.legal_basisfor public-domain and government-work claims.no_derivativesinheritance blocking bundle eligibility while derived documents or chunks exist.docs/source-intake.md: removes the file checksum from document identity, preserves the artifact key when truncating a long document key, and records that identifier determinism applies to first assignment rather than to re-derivation.no_derivativessource with an OCR derivative and chunks marked bundleable previously validated clean; it now fails with specific errors.Verification
git diff --checkpython pipeline/validate/validate_records.pypython -m unittest discover -s tests -v— 21 tests, all passing (was 8)python -m ruff check src pipeline testspython -m ruff format --check src pipeline testsAdditional behavioural checks performed:
reviewobject.conditions: ["attribution", "no_derivatives"],bundleable: true, anocr_textdocument derived from the original, and a chunk cut from that OCR text now fails validation. The same fixture passed before this change.no_derivativessource with only an unchanged original and no chunks still validates, confirming the rule does not over-block what section 9.1 permits.no_derivativessource with derived documents butbundleable: falsestill validates, confirming derivatives may exist for lawful local review.Scope confirmation
document.schema.jsonandchunk.schema.jsonare untouchedMetadata v0.1 compatibility decision
reviewis optional in the schema but required by the validator once a decision exists. Section 3.2 permits a committedpending_reviewrecord, and such a record legitimately has no completed reviewer or review date. Makingreviewschema-required would forbid a state the workflow explicitly allows. It is therefore enforced as a cross-field rule forreview_statusofacceptedorrejectedonly, with a positive regression test asserting that apending_reviewrecord may omit it.The committed worked example was migrated, not grandfathered.
data/sources/core/reference-library-sample/source.jsongains areviewblock. Its reviewer is recorded as the contributor who authored the fixture, with the review date matching the commit that introduced it. No other field changed and its checksums, offsets, and exact text are unaffected.Existing behaviour is preserved. All eight prior validations continue to work. One existing test fixture (
test_valid_derived_chain_passes) was migrated because its source record predated these rules and was bundleable with neither evidence nor a review block. The sharedsource_recordtest helper now produces a valid record by default, with explicit switches for the negative cases, so each new rule has both a positive and a negative test.Backward compatibility. Any source record written before this change that is
acceptedorrejected, or that isbundleablewithout evidence, will now fail validation. The only such record in the repository is the worked example, which is migrated here. No migration tooling is provided because no other records exist.Two points for reviewer attention
The
no_derivativesrule also blocks chunks, not only derived documents. Section 9.1 states thatno_derivatives"permits consideration of the unchanged original only", and a chunk is not the unchanged original. The strict reading is implemented. If chunks cut directly from an unchanged original were intended to remain permissible, this rule needs narrowing to derived documents alone.Three documentation corrections extend slightly beyond the schema and validator changes. The document-identity, key-truncation, and determinism clarifications in
docs/source-intake.mdwere raised in the review comment on this issue and all concern the identifier contract this issue aligns, so they were judged in scope. They are documentation-only and change no committed record. Happy to split them into a follow-up if preferred.Remaining follow-up
Per-document and per-asset bundle eligibility, visual document roles with page and caption linkage, and release rules for
share_alikeandnon_commercialare not addressed here. The first two are structural changes to the document contract and are tracked in #32. Section 13 and the schema README both record the remaining gaps.Linked issue
Closes #9