These cases exercise the backend through callers that now use the interface, so they land after them. The legacy tests/hermes_state copies of the same cases go with them.
On a read-only store, room_change_rows ran the rooms table's setup before reading, which a reader may not do: a profile's state.db without the hosted-room tables raised that the database is read-only, and a shared placement with no shared-state.db raised that the file cannot be opened. Main reads the rows on a read-only connection and answers no rows for a file without the rooms table, and the change watcher reads every profile's store through a reader, so every profile that never hosted a room failed its signature. A reader now answers no rows for a shared file that does not exist and for a file without the rooms table, and a rooms table that exists is still checked current. This is BearHuddleston's patch, with his two cases.
Reported-by: BearHuddleston <bear@bearhuddleston.dev>
A repository taken from a handle and kept after the backend's last handle closed refused on placement='profile', through the store holder, as the persistence handle documents. On placement='shared' it still opened shared-state.db and wrote and read rooms, and probe_hosted_room still opened the profile's state.db directly. Every hosted-room verb names its file through HostedFiles.path, which now checks first that the store's backend is open and raises the same RuntimeError a closed backend raises elsewhere, without opening any file. Main's hosted-room functions take a path and have no handle to close, so no caller of main's code relies on a write after close. A placement case keeps a room repository past the backend's close and checks that a write, a read and a probe refuse on both placements and that neither file is created.
A writable handle's first attachment verb on a file runs the reconciliation, which clears the expiry of every committed attachment its durable event names: rows published before retains became atomic still carry the expiry their upload hold set. A read-only handle skips that setup, so an open_persistence_reader handle answered "attachment has expired" for such a row on all four read verbs and both placements, while a fresh writable handle served it. On a read-only handle the expiry check now applies the reconciliation's rule for the one row: an expired commitment whose owning event's payload names it reads as unexpired, and a missing event table, a missing event or a malformed payload leave the expiry in force, as the reconciliation leaves them. A writable handle checks expiry exactly as before.
Reported-by: BearHuddleston <bear@bearhuddleston.dev>
The change watcher reads each store's live rooms through a read-only handle. room_change_rows opened the file with the driver's schema step, which a reader never runs: a file whose driver tables were never set up (rooms created, no task admitted yet) was refused, so the watcher signed none of its rooms, where main's read of the same file answers each room with no tasks. The read already handles a missing task table, so it now opens the file with the rooms step only. A backend case pins it on both placements, through open_persistence_reader, and checks that the reader creates no driver table.
read, describe, read_range and read_viewer ran the file's first-touch setup before reading, and that setup refuses a read-only handle, so an open_persistence_reader handle could not read a committed attachment on either placement. On a read-only handle the read verbs now skip the setup: no directory is created or chmodded, nothing is pruned, reconciled or migrated. A file without the attachment tables answers as a missing attachment does on a writable handle, a missing blob gives the same integrity error, and attachment tables older than this version are refused with PermanentStoreError instead of being migrated. A writable handle runs exactly the path it ran before.
The cases live in tests/persistence_sqlite/hosted/ because the reference backend has no reader door.
The SQLite backend's settle_task takes allow_expired_lease, as main's driver does: with it on, the lease check after the settlement replay drops only its expiry term, so the room authority, the lease generation and an unreleased lease are still required; the lease-first checks are unchanged.
The backend's own tests carry main's two driver cases for it, with main's assertions: the live settle commits after plain expiry of the attempt's own lease and is refused without the flag, and a reclaimed lease still fences it. The contract cases for the flag now pass on SQLite too.