Overview
Document model
Layer reserves the _hevlayer_* attribute prefix for its own bookkeeping. These attributes are read-only. The gateway stamps and maintains them; your writes and UDF completion patches must not set or change them. The gateway rejects or overwrites any _hevlayer_* value you send, and editing one directly breaks Layer’s guarantees.
The reserved set depends on the engine backing the namespace.
| Attribute | Type | Purpose |
|---|---|---|
_hevlayer_upserted_at | integer (epoch ms) | Server-stamped on every write. The watermark Layer’s stable reads are taken against. |
_hevlayer_shard | integer | Hash bucket assigned at write time (xxh64(id) % shard_count), present only on sharded namespaces. Lets the gateway scatter/gather a query across the shards of one namespace. |
_hevlayer_udf_<id>_v | string | Function completion marker. The gateway stamps the Function’s spec.version here when a worker completes a row. Hyphens in the Function id are normalized to underscores. |
_hevlayer_udf_<id>_stale_after | integer or null | Function invalidation marker. Discovery reclaims rows once this epoch-ms timestamp expires; completion clears the marker. |
The _hevlayer_ prefix also namespaces internal cache sets (snapshot field-values and search-history clickstream), but those are cache keys, not part of your document schema.