Skip to main content

Module store

Module store 

Source
Expand description

The plan store: one directory per plan under the state root, holding the plan, the request that computed it, and every byte it names.

A stored plan is the thing that was reviewed, and an apply executes exactly its operations with exactly its bytes. Plans carry bytes from the target, some of which are not public, so the store is owner-only, the JSON view carries digests and bounded text rather than blobs, and a plan is ephemeral: never committed and never posted to a forge. Retention is bounded the way the run journal is: the newest PLANS_KEPT plans stay, pruned after every persist.

Structs§

Stored
A plan read back from the store.

Constants§

BLOBS_DIR
The blobs, one file per digest.
PLANS_KEPT
How many plans the store keeps; a persist past the cap prunes the oldest first.
PLAN_FILE
The plan document inside a plan’s directory.
REQUEST_FILE
The request that computed it, for the revalidation.

Functions§

list
Every stored plan, oldest first, as (created_at, id).
load
Read one plan back by id.
persist
Persist one computed plan with its request and its blobs, then prune the store to its cap. The directory is created owner-only.
plans_root
The store root: <state root>/plans.
prune_to
Remove the oldest plans past keep; the count removed.