Documentation
¶
Overview ¶
Package health monitors context health by detecting stale architecture maps and pruning expired state files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var UUIDPattern = regexp.MustCompile(
`[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`,
)
UUIDPattern matches a UUID (v4) anywhere in a filename.
Functions ¶
func AutoPrune ¶
AutoPrune silently removes session-scoped state files older than the given number of days. Called from context-load-gate on session start. Returns the number of files removed. Errors are swallowed - auto-prune is best-effort and must never block session startup.
Parameters:
- days: Prune files older than this many days
Returns:
- int: Number of files pruned
func CountModuleCommits ¶
CountModuleCommits counts git commits touching internal/ since the given date.
Parameters:
- since: date string in YYYY-MM-DD format
Returns:
- int: number of commits, or 0 on error or if git is unavailable
func EmitMapStalenessWarning ¶
EmitMapStalenessWarning builds the architecture map staleness warning box.
Parameters:
- sessionID: session identifier for notifications
- dateStr: last refresh date (YYYY-MM-DD)
- moduleCommits: number of commits touching modules since last refresh
Returns:
- string: formatted nudge box, or empty string if silenced
Types ¶
type MapTrackingInfo ¶
MapTrackingInfo holds the minimal fields needed from map-tracking.json.
func ReadMapTracking ¶
func ReadMapTracking() *MapTrackingInfo
ReadMapTracking reads and parses the map-tracking.json file from the context directory.
Returns:
- *MapTrackingInfo: parsed tracking info, or nil if not found or invalid