operations tier

operations-mem-reaper

Stops explicitly allowlisted systemd --user units when available memory drops below a threshold, so a heavy job (mutation testing, a push hook) doesn't have to compete with restartable background services for RAM. Allowlist-only, never a heuristic 'kill the top memory consumer' -- an unlisted process is never touched. Dry-run unless --apply is passed.

Stops explicitly allowlisted systemd --user units when available memory drops below a threshold, so a heavy job (mutation testing, a push hook) doesn't have to compete with restartable background services for RAM. Allowlist-only, never a heuristic 'kill the top memory consumer' -- an unlisted process is never touched. Dry-run unless --apply is passed.

Tieroperations
Roleunclassified (baselined)
Pathcrates/operations/mem-reaper
Edition2021
Targetsoperations-mem-reaper, operations_mem_reaper
Public items5 across 0 modules
Tests7

What it is for

Pure decision logic for operations-mem-reaper: given an explicit allowlist and the current available-memory reading, decide which systemd --user units to stop. No process spawning here (Gate 2.1) -- main.rs is the only part that calls systemctl.

Safety model: allowlist-only. There is no "kill the top memory consumer" heuristic anywhere in this crate -- a unit not named in the config is never a candidate, full stop. The allowlist ships empty; the operator opts each unit in explicitly with a stated reason, because only the operator knows which of their own services are actually restartable without losing state.

Capabilities

crate root

Pure decision logic for operations-mem-reaper: given an explicit allowlist and the

Item
fn parse_mem_available_kb(meminfo_text : & str) -> Option <u64>
fn units_to_stop(allowlist : & Allowlist, available_kb : u64, threshold_kb : u64,) -> Vec <AllowlistEntry>

Allowlist

Pure decision logic for operations-mem-reaper: given an explicit allowlist and the

Item
pub struct Allowlist
fn parse_allowlist(toml_text : & str) -> Result <Allowlist, String>

AllowlistEntry

Pure decision logic for operations-mem-reaper: given an explicit allowlist and the

Item
pub struct AllowlistEntry

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

`crate root`

ItemWhat it is
pub struct AllowlistEntry
pub struct Allowlist
fn parse_allowlist(toml_text : & str) -> Result <Allowlist, String>
fn parse_mem_available_kb(meminfo_text : & str) -> Option <u64>Parses the MemAvailable: line out of /proc/meminfo text (the kernel's own estimate of memory available for new allocations without swapping, which is what matters here -- not raw MemFree).
fn units_to_stop(allowlist : & Allowlist, available_kb : u64, threshold_kb : u64,) -> Vec <AllowlistEntry>Decides which allowlisted units to stop

No pub use re-exports: every item above is declared in this crate.

Boundary

Depends on no other workspace tier.

Shares tier operations with 40 other crates: operations-approval-workflow, operations-assessments, operations-block-imaging, operations-boot-media, operations-browser-agent-worker, operations-camera-discovery, operations-camera-liveview, operations-camera-registry, … (40 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)operations
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/operations/mem-reaper
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
anyhow^1noalways
serde^1derivenoalways
toml^0.8noalways

Development. None.

Build. None.

Depended on by. Nothing in this workspace.

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
binoperations-mem-reaper`src/main.rs`
liboperations_mem_reaper`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

No workspace crate depends on this one.

Verification

KindCount
Unit tests7
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root500

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc25
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 2
    "No rustdoc detected" : 3

Metrics

MetricValue
Rust source files2
Source lines224
Code lines176
Public API items5
Public modules0
Tests7
Examples0
Cargo features0
Direct runtime dependencies3
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "function" : 3
    "struct" : 2
pie showData
    title Rust source composition
    "Code" : 176
    "Blank or comment" : 48

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

All operations · Manual