The store key of a materialized agent-secret FILE — the same projection the builders above apply,
for callers that hold a RECORDED path (a resume inventory, a manifest ledger) rather than the
(name, uid) coordinates: under mixed generations the recorded path is the truth, and its key must
be derived from the SAME filename, never re-derived from the name alone (which would silently
address a different generation's row).
IT TAKES THE SPACE, AND CHECKS IT AGAINST THE PATH — the one signature change in this commit that
is not bookkeeping. The segment could be read out of the recorded path instead, and nothing would
have to change at a single call site; that is precisely why it must not be. A recorded path is
caller-supplied data, and once the segment carries a tenant's identity, deriving it from that data
means a record written for tenant A can name tenant B's segment and this function will hand back a
key into it — which the manager then reads, overwrites, or DELETES. The space a caller is entitled
to comes from its own authority (the manager's space, the ledger's), so it is passed in and the
path is checked against it. A path outside the space's segment is refused rather than resolved,
the same posture as the filename check that was already here.
The store key of a materialized agent-secret FILE — the same projection the builders above apply, for callers that hold a RECORDED path (a resume inventory, a manifest ledger) rather than the (name, uid) coordinates: under mixed generations the recorded path is the truth, and its key must be derived from the SAME filename, never re-derived from the name alone (which would silently address a different generation's row).
IT TAKES THE SPACE, AND CHECKS IT AGAINST THE PATH — the one signature change in this commit that is not bookkeeping. The segment could be read out of the recorded path instead, and nothing would have to change at a single call site; that is precisely why it must not be. A recorded path is caller-supplied data, and once the segment carries a tenant's identity, deriving it from that data means a record written for tenant A can name tenant B's segment and this function will hand back a key into it — which the manager then reads, overwrites, or DELETES. The space a caller is entitled to comes from its own authority (the manager's
space, the ledger's), so it is passed in and the path is checked against it. A path outside the space's segment is refused rather than resolved, the same posture as the filename check that was already here.