method FileAuditStorage.prototype.isHealthy
Since 0.6.0
FileAuditStorage.prototype.isHealthy(): Promise<boolean>

Reports whether the audit file's sink is reachable.

Two signals, cheapest first. A most-recent append that FAILED is conclusive — the trail is demonstrably not being written, whatever the filesystem says now. Otherwise the target directory is stated, which is what catches the failure that has no write to observe yet: a volume unmounted, a path deleted, a network mount gone away.

It deliberately does NOT write a probe file. The M70k LocalStorageProvider precedent proves a root writable at connect(), but this backend has no connect phase, and probing by writing on a health interval would either append junk to the audit trail itself or litter its directory — for a capability whose whole value is that its file contains exactly what was logged. A root that is readable but not writable is therefore reported true until the first append proves otherwise, which is the one gap here and is the reason the append outcome is tracked at all.

Return Type

Promise<boolean>

true when the sink looks writable, false when the last append failed, or the parent cannot be reached, or it is not a directory

Usage

import { FileAuditStorage } from "audit-plugin/src/index.ts";