Skip to main content

Module exec_core

Module exec_core 

Source
Expand description

exec_core trait-method family — Postgres impls.

RFC-v0.7 Wave 4 (Agent A). Implements the five exec-core write

  • read methods for the Postgres backend:
  1. [create_execution_impl] — inherent entry on super::PostgresBackend. Replaces the Valkey ff_create_execution FCALL with a single INSERT ... ON CONFLICT DO NOTHING for idempotency (idempotency-key replay mirrors the FCALL’s Duplicate outcome). Also seeds the global [ff_lane_registry] row on first sight of a lane (Q6 adjudication — dynamic lanes get a registry entry here as well as at server-boot seeding).
  2. [describe_execution_impl] — single-row SELECT against ff_exec_core, decoded into ExecutionSnapshot via the shared ff_core::contracts::decode::build_execution_snapshot helper so the snapshot shape matches the Valkey backend bit-for-bit.
  3. [list_executions_impl] — cursor-paginated forward scan over one partition_key, ORDER BY execution_id ASC. Uses the N+1 trick (fetch limit+1 rows) to decide next_cursor.
  4. [cancel_impl] — transactional SELECT ... FOR UPDATE + UPDATE to transition the exec row to public_state='cancelled', lifecycle_phase='terminal', setting terminal_at_ms + cancellation_reason. Per Q11 the default READ COMMITTED isolation suffices; the row lock narrows the RMW to one writer.
  5. [resolve_execution_flow_id_impl] — one-column lookup by execution_id (the unique index lets pg skip partition pruning for this admin-tooling path).

Spec authority: rfcs/drafts/v0.7-migration-master.md Q5 (partition math), Q11 (isolation), Q14 (dual-backend — no cross-backend fields).