Skip to content

arkiv v0.1.2 (hardening)

Choose a tag to compare

@queelius queelius released this 09 Apr 15:07
· 23 commits to main since this release

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

  1. Metadata validation in insert_record and write_record. Non-dict metadata (list, string, number) is now rejected with a clear error. Previously these were silently stored, producing records that crashed discover_schema on re-import. The MCP write_record tool returns structured JSON errors instead of raising exceptions.

  2. Input validation for --since/--until. Malformed ISO 8601 prefixes like garbage, 2024-13, or 2024-02-30 are now rejected at the CLI boundary with clear error messages. Full timestamps (with T) bypass strict date validation since SQLite compares them lexicographically.

  3. Line-anchored sentinel matching. inject_schema_block now 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.

  4. New refresh_schema(collection) method. insert_record does not update _schema by 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.

  5. Cleaner render API. render_schema_summary and render_schema_detail now accept an optional heading parameter, replacing brittle index-arithmetic in the export path.

  6. Shared schema discovery core. discover_schema_from_metadata(iter) is the new shared implementation used by both discover_schema(path) (reads JSONL) and refresh_schema(collection) (reads from SQLite).

Documentation

  • SPEC.md: documented nested archive recursion on import, nested/since/until export parameters, get_manifest return 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-on export() description into readable bullets, added Public API section

Install

pip install --upgrade arkiv