arkiv v0.1.2 (hardening)
arkiv v0.1.2: hardening release
Addresses the important-priority findings from the post-v0.1.1 code and doc review. 261 tests passing (20 new regression tests).
Code hardening
-
Metadata validation in
insert_recordandwrite_record. Non-dict metadata (list, string, number) is now rejected with a clear error. Previously these were silently stored, producing records that crasheddiscover_schemaon re-import. The MCPwrite_recordtool returns structured JSON errors instead of raising exceptions. -
Input validation for
--since/--until. Malformed ISO 8601 prefixes likegarbage,2024-13, or2024-02-30are now rejected at the CLI boundary with clear error messages. Full timestamps (withT) bypass strict date validation since SQLite compares them lexicographically. -
Line-anchored sentinel matching.
inject_schema_blocknow requires schema sentinels to be on their own line. A sentinel-looking string embedded in prose (e.g., a code fence discussing arkiv) is no longer matched as a real sentinel, so documentation READMEs don't get corrupted on export. -
New
refresh_schema(collection)method.insert_recorddoes not update_schemaby design (per-insert recomputation would be O(n) on the hot path).refresh_schema()brings the pre-computed schema back in sync after batches of writes, preserving curated descriptions. -
Cleaner render API.
render_schema_summaryandrender_schema_detailnow accept an optionalheadingparameter, replacing brittle index-arithmetic in the export path. -
Shared schema discovery core.
discover_schema_from_metadata(iter)is the new shared implementation used by bothdiscover_schema(path)(reads JSONL) andrefresh_schema(collection)(reads from SQLite).
Documentation
- SPEC.md: documented nested archive recursion on import,
nested/since/untilexport parameters,get_manifestreturn shape, updated design principle naming - README.md: added temporal slicing example, stack diagram now shows export arrow
- CLAUDE.md: documented
insert_record,refresh_schema, new CLI flags, split run-onexport()description into readable bullets, added Public API section
Install
pip install --upgrade arkiv