Add v0.1 metadata schemas, validator, and worked example (Issue #3) #5
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!5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/issue-3-metadata-schemas-v0.1"
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?
Introduce the three metadata contracts the proof loop needs — source,
document, and chunk — under meta/schemas/, with fields derived directly
from the committed source acceptance and license policies. License is an
embedded $defs object in the source schema, able to graduate to its own
schema later without field changes.
Add pipeline/validate/validate_records.py: a reference validator that runs
JSON Schema (draft 2020-12) checks plus two things schema alone can't
express — the cross-field rule that a source is only bundleable under a
redistributable license status, and referential integrity across the three
record types.
Add a worked example record set under data/sources/core/army-survival/
(a public-domain US Army field manual) that validates cleanly, so the
proof-loop spine has real data to exercise.
Defers trust_score, index_manifest, bundle_manifest, and embeddings until
real documents have been run through the loop.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Thanks — this is a strong and well-scoped implementation, and it satisfies the literal acceptance criteria from Issue #3.
I am requesting a few changes before merge because the metadata contracts are foundational and need to enforce Arkive’s project policies consistently:
license.bundleable: true must also require review_status: accepted. The current example is pending_review while marked bundleable, but the license policy says pending-review sources must not be included in redistributable releases.
Referential integrity must verify source consistency, not only ID existence:
a chunk’s source_id must match the source of its referenced document;
a derived document must have the same source_id as its parent document.
Duplicate chunk_id values should be rejected, just as duplicate source and document IDs are.
The worked FM 21-76 example currently uses a placeholder URL, checksums, file paths, offsets, and an unverified safety-critical passage/page citation. Please replace it with a small project-created sample file with a real checksum and exact offsets, or provide a fully verified source artifact and citation.
Once those points are addressed, the PR should be ready to merge into develop.