Expand description
Small, I/O-free helpers shared across the workspace.
These were independently re-implemented in the monitors, fs, cli, napi and
checks crates (RFC3339 time formatting, epoch-millis parsing, path.basename,
the unix “group/other-accessible” permission test). Centralizing them here
keeps one source of truth so the behaviors cannot drift apart.
Functions§
- basename
- Final path component - port of Node’s
path.basename. Trailing slashes are trimmed first ("a/b/" -> "b"); a path with no separator returns itself. - is_
group_ or_ other_ accessible - True if a unix permission
modegrants any group or other access (mode & 0o077 != 0) - the credential-permission red flag used by the checks, hardening and credential monitor.modeis the permission bits, already masked to0o777by the caller. - now_iso
- Current UTC time as an RFC3339 string - the Rust equivalent of TS
new Date().toISOString()(PRODUCT.md A.5 wire format). On the (impossible) formatting error, falls back to the epoch so an audit never aborts over a clock. - now_ms
- Current UTC time as epoch milliseconds.
- parse_
ms - Parse an RFC3339 timestamp to epoch milliseconds. Returns
Nonefor unparseable input (callers exclude such entries, matching the TS tool).