Skip to main content

Module stage

Module stage 

Source
Expand description

The candidate stage: this binary’s projection for one target, materialized on disk beside the knowledge that explains it.

A stage is evidence, never an installation transaction. rk stage gathers the target’s evidence, computes the one pure Projection, and writes the complete proposed bytes of every candidate under artifacts/, the installed binary’s changelog, guidance, method, bindings, runbooks, forge notes, setup skill, and the shared resources that skill routes to under reference/, and one explanatory receipt, stage.json. It writes nothing inside the target. Production landing reads no byte of it, and only rk stage clean removes it.

The stage is built whole under a fresh sibling of its resolved path and renamed into place after the receipt, so a stage that is visible is complete. The default root below the private state directory and the receipt are created owner-only.

Modules§

clean
rk stage clean: remove one stage that names itself, and nothing else.

Structs§

CandidateEntry
One candidate under artifacts/.
CapabilityNote
One capability’s answer, as the receipt carries it.
Composed
A stage composed and ready to write: every file with its stage-relative path, and the receipt.
Note
One destination named with a reason.
Parameters
The resolved landing parameters, stated whole.
Prepared
An output path checked and made ready: its parent exists and is canonical, the resolved stage root is known, and nothing nonempty stands there.
Receipt
The explanatory receipt a stage carries, and the document rk stage --json reports. Metadata only: no later command reads it as input.

Enums§

OutputSource
Where the resolved output path came from.

Constants§

ARTIFACTS_DIR
The directory below the stage root holding the candidate tree.
INTERRUPT_VAR
The interruption proof’s seam: the stage-relative path after which a materialization stops on purpose, as if the write after it had failed.
OUTPUT_ROOT_VAR
The variable naming an alternative base for the default stage path.
PAUSE_AFTER_LAND_VAR
The proof’s seam after publication.
PAUSE_BEFORE_CLEANUP_VAR
The proof’s seam for the failure cleanup: a directory where a stopped write announces stopped before it quarantines its sibling and waits for proceed.
PAUSE_BEFORE_LAND_VAR
The proof’s seam before publication: a finished write announces finished under this directory before it claims its sibling and waits for proceed.
RECEIPT_NAME
The receipt’s name at the stage root.
REFERENCE_DIR
The directory below the stage root holding the installed knowledge.
REFERENCE_ROOTS
Every reference root a stage writes, in the order the receipt lists them.
SETUP_SKILL
The skill whose installed text and routed resources the reference tree carries.
STAGES_DIR
The directory below the state root that holds the default stages.
STAGE_SCHEMA
The shape version of the stage receipt and of the rk stage report.

Functions§

compose
Compose the stage for projection, rooted at stage_root, from the projection, the resolved parameters, the target’s record, and this binary’s embedded knowledge.
prepare
Resolve where the stage will stand, refuse a stage inside the target, refuse an existing nonempty output, create the parent, and name the canonical stage root.
recorded_schema_version
The schema_version the target’s landing record declares, read leniently: None where no record exists or it does not parse as a JSON object carrying an integer there. Explanatory, never a gate.
reference_files
Every file the reference tree carries, as (path, bytes) below reference/.
resolve_output
Resolve the output directory: --output first, then a target and version directory below RK_STAGE_ROOT, then the same below the private state root.
target_key
The filesystem-safe key naming one target below a stage base.
write
Write the composed stage whole, then rename it into place.
write_stopping_at
[write], stopped on purpose after the file at stop, as if the write after it had failed: the interruption proof’s seam.