045-store-receipts-and-work-claims

Receipts and work claims: an inbound item is recorded once per content revision, processed once per processor revision, and never silently dropped

Lifecycle approvedImplementation completeVerification unknownQualification unknown

Every product that ingests from an outside source rebuilds the same table: a key, a body digest, the first outcome, and a rule for a repeat (statecraft-platform's `sc_idempotency`; aicortex's work-claim rows over the Lease and the Outbox). This spec puts one primitive in rahi-store. A receipt names an inbound item by tenant, source namespace, and external key (or a synthetic key when the source has none) and records a digest of its content; classification distinguishes first seen, exact redelivery, changed content under the same key (recorded as a new revision or a collision, never dropped), and erased. Receipt rows stage into the caller's TxnBuilder beside the domain writes and Outbox::stage. Processing is identified separately (receipt revision plus processor and its policy revision) so a correction or a new policy reprocesses. Work is reserved under the existing Lease into a fenced claim row with attempt history, bounded retry, a visible dead-letter state, and reclaim after expiry; queue counts reach /metrics redacted. Retention compacts to a tombstone, erasure keeps only the key digest and is never undone, and a crash-point table states recovery at every boundary. Owner decisions of 2026-09-24 are recorded.

Read the full pinned specification ↗

Relationships

Claimed units

  • establishes
    {
      "kind": "file",
      "path": "crates/rahi-store/src/receipt.rs"
    }
  • establishes
    {
      "kind": "file",
      "path": "crates/rahi-store/src/work.rs"
    }
  • establishes
    {
      "kind": "file",
      "path": "crates/rahi-store/tests/receipt.rs"
    }
  • establishes
    {
      "kind": "file",
      "path": "crates/rahi-store/tests/work.rs"
    }
  • establishes
    {
      "kind": "file",
      "path": "crates/rahi-store/tests/receipt_recovery.rs"
    }
  • extends
    {
      "nature": "additive",
      "spec": "011-store-hiqlite",
      "unit": {
        "kind": "file",
        "path": "crates/rahi-store/src/lib.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "011-store-hiqlite",
      "unit": {
        "kind": "file",
        "path": "crates/rahi-store/src/error.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "012-store-coordination",
      "unit": {
        "kind": "file",
        "path": "crates/rahi-store/src/lock.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "023-observability",
      "unit": {
        "kind": "file",
        "path": "crates/rahi-edge/src/obs/metrics.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "023-observability",
      "unit": {
        "kind": "file",
        "path": "crates/rahi-edge/tests/obs.rs"
      }
    }
  • refines
    {
      "aspect": "a work claim that outlives the lease TTL is a chassis row created and renewed under a short-held lease and fenced by its own token (012 D-10)",
      "unit": {
        "id": "rahi_store::lock::Lease",
        "kind": "symbol"
      }
    }

Source headings

  1. 045: Receipts and work claims
  2. 1. Purpose
  3. 2. Territory
  4. 2.1 What is new
  5. 2.2 What is reused unchanged
  6. 2.3 What is extended
  7. 3. Behavior
  8. 3.1 Receipt identity
  9. 3.2 Classification outcomes
  10. 3.3 Atomic participation
  11. 3.4 Processing identity
  12. 3.5 Work reservation
  13. 3.6 Retention and erasure
  14. 3.7 Crash-point recovery
  15. 4. Functional requirements
  16. 5. Acceptance criteria
  17. 6. Out of scope
  18. 7. Resolved decisions
  19. Follow-up: statecraft-platform's `sc_idempotency`
  20. Verification

Frozen anchors

No frozen anchors declared.