Skip to main content

Module verify_artifacts

Module verify_artifacts 

Source
Expand description

Exhaustive daemon-artifact reconciliation for cleanup verify (#391). Exhaustive daemon-artifact reconciliation for cleanup verify (#391, part of #354).

Enumerates every artifact class the daemon can leave behind — IPC socket, pid file, .servicedef files, the SQLite registry database (plus WAL/SHM sidecars), log files, the ENOSPC emergency reserve, and shadow-dir contents — and reports each location as clean, active, present, stale, or orphaned. READ-ONLY by contract: nothing is created, deleted, or rewritten. The documented operator checklist lives in docs/v1-troubleshooting.md (“Cleanup Verification”).

Every check is a pure function over injected paths/probes so tests can exercise each class with temp dirs on all platforms; only the ArtifactPaths::from_environment constructor and the default probes in run touch the real environment.

Structs§

ArtifactCheck
One reconciled artifact location.
ArtifactPaths
Every expected daemon artifact location. Fully injectable for tests; Self::from_environment derives the real platform locations without creating any directory.
ArtifactReport
Aggregated artifact reconciliation report.

Enums§

ArtifactStatus
Reconciliation outcome for one artifact location.
SocketLocation
Where the daemon socket lives on this platform.

Constants§

EMERGENCY_RESERVE_BYTES
Expected size of a fully-armed emergency reserve. Mirrors daemon::emergency_reserve::EMERGENCY_RESERVE_BYTES.
EMERGENCY_RESERVE_FILE_NAME
Leaf name of the ENOSPC emergency reserve file (#390). Mirrors daemon::emergency_reserve::EMERGENCY_RESERVE_FILE_NAME, duplicated here because this module is client-only while the canonical constant is gated behind the daemon feature.

Functions§

check_database
Reconcile the SQLite registry database and its WAL/SHM sidecars.
check_emergency_reserve
Reconcile the 32 MiB ENOSPC emergency reserve (#390).
check_logs
Reconcile log files (*.log) in the daemon data directory. None are expected by default; any found are reported, never deleted.
check_pid_file
Reconcile the daemon pid file against process liveness.
check_service_definitions
Reconcile the service-definition directory: .servicedef files are expected persistent config; anything else in the directory is orphaned.
check_shadow_dir
Reconcile shadow-dir contents (relocated daemon binaries).
check_socket
Reconcile the daemon IPC endpoint.
run
Reconcile every artifact class against the live environment.
run_with_probes
run with injected liveness/connect probes (test seam).