pub enum CachePolicy {
RetainRunnerPackage,
DiscardRunnerPackage,
}Expand description
What survives an attempt’s cleanup.
04-subsystem-contracts.md, precedence rule 6: “Runtime cache retention is
optional; job workspace retention is always disabled in v1.”
The first half is the choice this enum offers. The second half is enforced by
having no representation at all: CachePolicy::retains_job_workspace is a
const fn returning false, and there is no variant, field, or constructor
that could make it return anything else. A future version that wants
workspace retention has to add one deliberately, which is the point — a
retained workspace is the two-job contamination path that e3 and
07-security.md test against.
Variants§
RetainRunnerPackage
Keep the verified runner package cache between attempts (the default; re-downloading it on every cold start would be the main avoidable cost).
DiscardRunnerPackage
Discard the runner package cache after each attempt.
Implementations§
Source§impl CachePolicy
impl CachePolicy
pub const fn retains_runner_package(self) -> bool
Sourcepub const fn retains_job_workspace(self) -> bool
pub const fn retains_job_workspace(self) -> bool
Always false, by construction rather than by policy.
D4 is the deliberate addition the type comment anticipated, and it was
made on another type: job-workspace retention is
crate::workspace::WorkspacePolicy, repository-scoped, opt-in, and
carrying its own root. Nothing was added here, so a caller reading a
CachePolicy still cannot conclude anything about the job workspace —
which is the point of keeping them apart
(02-target-architecture.md, “Repository policy”).
Trait Implementations§
Source§impl Clone for CachePolicy
impl Clone for CachePolicy
Source§fn clone(&self) -> CachePolicy
fn clone(&self) -> CachePolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more