Make the purpose a bit more concise

This commit is contained in:
Arnaud 2025-08-13 19:17:05 +02:00
parent 0b9bfc2d0f
commit 6942ac3a1d
No known key found for this signature in database
GPG Key ID: 20E40A5D3110766F

View File

@ -2,12 +2,7 @@
## 1. Purpose and Scope
The Purchase module manages the lifecycle of a storage agreement between a client and a host in Codex. Its main responsibilities are to:
* Create new purchases from a `StorageRequest`.
* Initialize them in the correct starting state `pending` for new purchases, `unknown` for recovered ones.
* Keep accurate tracking so the current state of a purchase is always known and can be queried at any time.
* Determine the terminal state based on the request state returned by the `marketplace`.
The Purchase module manages the lifecycle of a storage agreement between a client and a host in Codex. It ensures that each purchase is correctly initialized, tracked, and completed according to the state of its corresponding `StorageRequest` in the marketplace.
Purchases are implemented as a state machine that progresses through defined states until reaching a deterministic terminal state (`finished`, `cancelled`, `failed`, or `errored`).