Skip to content

feat: Add change watcher for real-time documentation drift monitoring #74

@tosin2013

Description

@tosin2013

Overview

Implement a change watching system that monitors code changes and proactively triggers documentation drift detection. This enables real-time awareness of when documentation may become stale.

Background

This enhancement supports ADR-009: Documentation Synchronization Agent from the DocuMCP Orchestrator project. The change watcher enables proactive drift detection rather than relying solely on manual checks.

Requirements

Core Functionality

  • Monitor git hooks for code changes
  • Support webhook integration for CI/CD pipelines
  • File system watching for development environments
  • Debounced change detection to avoid excessive processing

Trigger Events

  • Post-commit hooks
  • Pull request events
  • Branch merge events
  • Manual trigger API

Change Analysis

  • Identify which functions/classes changed
  • Map changes to affected documentation sections
  • Calculate change impact scores
  • Queue drift detection jobs

Configuration Options

interface ChangeWatcherConfig {
  watchPaths: string[];
  excludePatterns: string[];
  debounceMs: number;
  triggerOnCommit: boolean;
  triggerOnPR: boolean;
  webhookEndpoint?: string;
}

Acceptance Criteria

  • Git hook integration works with standard git workflows
  • Webhook endpoint accepts GitHub/GitLab events
  • Changes are correctly mapped to documentation sections
  • Debouncing prevents duplicate processing
  • Configuration is flexible for different project setups

Dependencies

Implementation Notes

  • Consider using chokidar for file system watching
  • Git hooks should be installable via CLI command
  • Webhook should validate request signatures

Related

  • ADR-009: Documentation Synchronization Agent
  • src/utils/drift-detector.ts - existing drift detection

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions