Every record of one layer, via the composed key — no secondary index needed.
Records in a given sync state, across every layer.
Writes a pulled batch in ONE transaction, skipping every record that holds unsynchronised local work.
🛑 The rule lives here, and not in the caller, because get and put above open
SEPARATE transactions: reading the state in the orchestrator and writing after it
would leave a window in which the optimistic write of task 4.4 lands between the two
— and property 1 of the sync contract ("a capture never silently disappears") would
hold only by timing.
A record is skipped when it already exists with syncState !== "synced". Everything
else is inserted or refreshed.
Public API of the features store.