Skip to content

feat: expose read-only reading history queries - #11

Open
jadehawk wants to merge 1 commit into
Free-Ink:masterfrom
jadehawk:feat/read-only-reading-history
Open

jadehawk wants to merge 1 commit into
Free-Ink:masterfrom
jadehawk:feat/read-only-reading-history

Conversation

@jadehawk

@jadehawk jadehawk commented Nov 27, 2026 •

Copy link
Copy Markdown

Why this matters to users

Reading calendars, yearly summaries and library dashboards should be able to use the history the reader already records. A small application should not need to parse the entire history file and keep a large book index in its own memory just to answer questions such as how much someone read this month or which books they recently finished.

A native query prototype has already been exercised on physical readers. In serial logs from an X3 processed 11 sessions across 3 books (2,292 bytes) in 165 ms, and an X4 processed 99 sessions across 6 books (13,684 bytes) in 172 ms. These are small real-world examples, not comparative benchmarks or guarantees for large libraries. They demonstrate that an application can request bounded results from an existing native history provider.

The benefit of this interface is sharing that work across applications rather than requiring each guest to implement its own parser and aggregation logic. The host retains control over the data and access permissions. The guest can release the temporary result when it needs memory for something else.

The isolated SDK proposal is read-only and format-independent. The firmware's native history provider is a separate integration; no account service or upload behavior is required by this API.

Summary

Add an optional, versioned, read-only reading-history service for applications such as reading calendars, library summaries and progress displays. A host can aggregate its existing local history efficiently without requiring each guest to parse large records or allocate a full library index.

  • Start an asynchronous query for device totals and optionally a selected book.
  • Read bounded, little-endian summary, daily, book-ID and book-metadata records.
  • Probe availability and release temporary snapshots explicitly.
  • Validate selector forms, record sizes, page limits and guest buffers before dispatch.
  • The host owns the history representation, authorization, aggregation and snapshot lifetime. This contract does not change reading records, identify physical devices, upload data or implement an external protocol.
  • Generate C, Rust and Zig wrappers from the ABI definition; proposed call numbers 110 and 111 avoid the other open capability proposals.

Validation

Full upstream make test passed with the pinned FreeInk SDK. A mock host drives a real guest through capability detection, malformed arguments, asynchronous query completion, each record kind, snapshot release and absent history. No firmware-specific history provider or firmware build is included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant