Skip to main content

Module pull

Module pull 

Source
Expand description

The pull engine (Phase 22, DPLN-06): a live tree to a declared tree that renders back to the live effective view.

Pure: it takes an ObservedFiles the transport already read and returns a SourceTree; it touches no filesystem, network or clock. The action (actions::deploy::deploy_pull) reads the host through a TreeReader and writes the result.

§Layering (D-12)

Files of the core collection go to the base tree (resources/, tags/); files of the target’s mode collection go to the modes/<env>/ overlay, so render’s overlay reproduces the gateway’s own layering. A unit in both collections lands in both. Bytes are kept exactly as read, a bootstrapped resource keeps the gateway’s uuid (D-12).

§The render fixpoint (D-09)

A pulled tree is only worth writing if it is one the declared pipeline accepts and reproduces. pull therefore renders its own tree and repeats, dropping units, until a round drops nothing (at most PULL_MAX_ROUNDS rounds):

  • a unit holding a secret location (Embedded or plaintext) is dropped with reason REASON_EMBEDDED_SECRET;
  • a unit any other render finding names is dropped with render_refused: <finding message>; the messages name paths and key names, never values;
  • once render succeeds, a unit whose rendered files are not exactly its effective live files (mode copy when present, else core; same file set, same bytes) is dropped with REASON_NOT_ROUND_TRIPPABLE: a minted uuid, a dropped .gitkeep, a core file the mode copy lacks.

A render error whose findings map to no unit (for example one naming manifest.yaml) is returned as is: the manifest is the operator’s to fix. Because every kept unit renders byte-for-byte to its live copy, pull then render then plan is empty, and every dropped unit is unmanaged in the plan (the live copy exists, nothing renders it).

§Skip reasons (22-03 checkpoint, option-a)

embedded_secret, not_round_trippable, render_refused: <finding>, type_without_rule, denied_type. No reason ever carries a value.

Structs§

PullInput
What pull needs.
PullOutcome
What pull produced.
Skipped
One live unit (or type) pull did not write, and why.

Constants§

PULL_MAX_ROUNDS
The most render rounds pull runs before it gives up.
REASON_DENIED_TYPE
Skip reason: a live type on the deny list.
REASON_EMBEDDED_SECRET
Skip reason: the unit holds an Embedded or plaintext secret location.
REASON_NOT_ROUND_TRIPPABLE
Skip reason: render does not reproduce the unit’s live files.
REASON_RENDER_REFUSED
Skip reason prefix: render refused the unit; the finding follows.
REASON_TYPE_WITHOUT_RULE
Skip reason: a live type with no render rule.

Functions§

generate_manifest
The manifest.yaml text for a gateway that has none (D-10), and the live types it leaves out.
pull
Run the pull: assemble, render to a fixpoint, keep what round-trips.