Skip to main content

Module claim_grant

Module claim_grant 

Source
Expand description

RFC-024 PR-D — ff_claim_grant table accessors + the two new RFC-024 methods (issue_reclaim_grant, reclaim_execution).

Replaces the pre-RFC JSON stash at ff_exec_core.raw_fields.claim_grant (see scheduler.rs:252 pre- PR-D). The scheduler’s write path now calls write_claim_grant below; the scheduler’s verify/read path (scheduler::verify_grant) reads from the same table.

§Isolation

Both RFC-024 methods run under SERIALIZABLE + a 3-attempt retry loop (mirrors operator::cancel_execution_impl).

§Grant identity

grant_id (BYTEA PK) is the sha256 of the Valkey/HMAC-signed grant_key string. Deterministic, stable across retries, and decoupled from the HMAC encoding (no need to re-sign on backfill).

Constants§

DEFAULT_MAX_RECLAIM_COUNT
Default per-Rust-surface ceiling per RFC-024 §4.6.

Functions§

grant_id_from_key
sha256(grant_key) → 32-byte grant_id.
issue_reclaim_grant_impl
read_claim_grant_identity
Read a claim-grant row (kind=‘claim’) for verification / diagnostics. Returns Ok(None) when absent.
reclaim_execution_impl
write_claim_grant
Insert a fresh claim grant row. Called by the scheduler’s Stage 5.