read_doc
Retrieve a versioned continuity document from the EMET store, paginating long files by byte offset and verifying version and hash so agents never act on partial or mismatched content.
Instructions
Read a continuity document from the versioned document store. A document longer than one page (18,000 UTF-8 bytes by default) comes back in pages: the result then carries page with next_offset - call again with that offset (and expected_version set to the first page's version) until next_offset is null, and do not act on a document you have only part of. If the document changes between pages the read is refused: restart from offset 0. sha256 and size (characters; size_bytes in UTF-8 bytes) always describe the WHOLE document.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Optional: page size in bytes as the host receives it (default 18,000): a page ends before its JSON-escaped text plus 1,500 bytes kept for the result envelope would pass it, and never splits a character. 0 returns the whole document in one result. | |
| doc_id | Yes | Document id, e.g. 'STATE.md', 'HANDOFF.md', 'threads/pcb-laser-board.md', 'bootstrap/IDENTITY.md' | |
| offset | No | Optional: UTF-8 byte offset to start from (default 0). Use the previous page's `page.next_offset`. | |
| expected_sha256 | No | Optional: the `sha256` your first page returned - the same pin as expected_version, and the only pin for a shipped guide (guides have no version). | |
| expected_version | No | Optional: the `version` your first page returned. Pass it with every later page; if the document changed in between, the read is refused (restart from offset 0) so pages of two versions are never joined. |