Skip to main content

config_monitoring

Version: v1.3.0 | Status: Active | Last Updated: March 2026

Overview​

Configuration change detection, drift analysis, compliance auditing, and hot-reload watching. Tracks configuration file mutations via SHA-256 hashing, maintains point-in-time snapshots for infrastructure drift detection, scans for security anti-patterns (plaintext secrets, overly permissive file permissions), and provides a thread-safe filesystem watcher for hot-reload workflows.

Key Components​

ComponentFileDescription
ConfigurationMonitorconfig_monitor.pyCentral monitoring engine: change detection, snapshots, drift, auditing
ConfigWatcherwatcher.pyThread-safe daemon poller for single-file hot-reload
ConfigChangeconfig_monitor.pyDataclass: single file mutation record
ConfigSnapshotconfig_monitor.pyDataclass: point-in-time directory hash capture
ConfigAuditconfig_monitor.pyDataclass: compliance audit result
monitor_config_changesconfig_monitor.pyConvenience function: one-shot change detection

Quick Start​

from codomyrmex.config_monitoring import ConfigurationMonitor, ConfigWatcher

# Detect changes
monitor = ConfigurationMonitor(workspace_dir="/tmp/project")
changes = monitor.detect_config_changes(["config.yaml", "settings.json"])

# Take a snapshot for drift detection
snapshot = monitor.create_snapshot("production", "/etc/myapp/")

# Watch a file for hot-reload
watcher = ConfigWatcher("config.yaml", lambda: print("changed!"))
watcher.start()

MCP Tools​

ToolDescription
config_monitoring_detect_changesDetect config file changes by hashing
config_monitoring_summaryGet monitoring state summary
config_monitoring_hash_fileCompute SHA-256 hash of a file

Directory Contents​

FilePurpose
API_SPECIFICATION.mdPublic Python and MCP interface contract
MCP_TOOL_SPECIFICATION.mdMCP tool contract
config_monitor.pyCore monitoring engine (560 lines)
watcher.pyHot-reload file watcher (94 lines)
mcp_tools.pyMCP tool definitions (3 tools)
__init__.pyPublic exports