Skip to content

0.1.0: restore Grain State during action recovery #112

Description

@suraciii

Goal

Keep Confirmed State and the Application Receipt consistent when the Single Silo recovers a Pending Action.

Problem

ReportAction saves a Pending Action before it writes Grain State. Recovery must not create the Application Receipt or remove the Pending Action while Confirmed State is stale.

Contract

  • ReportAction and recovery use the same State confirmation rule.
  • The requested State contains the reported properties and Online set to true.
  • A required State write uses a new ReportedAt value from the injected Clock.
  • Recovery completes the Pending Action only after the State step succeeds.
  • A failed or unknown State write keeps the Pending Action.
  • An unknown write is safe to repeat. Recovery does not write State again when the requested State is already confirmed.
  • Recovery applies Pending Actions in save order.
  • A repeat of a completed ActionID does not roll State back.
  • A Pending Action or Application Receipt for another DeviceKey is rejected.
  • The process proof checks Confirmed State, the Application Receipt, and Pending Action removal.

Acceptance

  • Recovery restores both Confirmed State and the Application Receipt.
  • A State failure does not create the Application Receipt.
  • An unknown State result is safe after process restart.
  • A completed ActionID is idempotent and does not change newer State.
  • Multiple Pending Actions produce State in save order.
  • make ci and make external pass.

References

  • examples/shadow/domain
  • design/conformance-example.md
  • design/persistence.md
  • docs/release-0.1.0.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions