{
  "$schema": "dss-doc-sync-v1",
  "version": "1.0.0",
  "last_updated": "2025-12-07",
  "description": "Documentation synchronization manifest - maps code to documentation targets",

  "sources": {
    "code_mappings": [
      {
        "pattern": "tools/api/server.py",
        "extracts_to": ".knowledge/dss-architecture.json",
        "generator": "api_extractor",
        "mcp_entities": ["DSS_FastAPI_Server", "DSS_API_Endpoints"],
        "triggers": ["post-commit", "manual"],
        "description": "FastAPI server REST endpoints"
      },
      {
        "pattern": "dss-claude-plugin/servers/dss-mcp-server.py",
        "extracts_to": ".knowledge/mcp-tools.json",
        "generator": "mcp_extractor",
        "mcp_entities": ["DSS_MCP_Server", "DSS_MCP_Tools"],
        "triggers": ["post-commit", "manual"],
        "description": "MCP server tool definitions"
      },
      {
        "pattern": "admin-ui/js/**/*.js",
        "extracts_to": ".knowledge/dss-architecture.json",
        "generator": "component_extractor",
        "mcp_entities": ["DSS_Admin_UI", "DSS_Browser_Logger"],
        "triggers": ["post-commit"],
        "description": "Admin UI JavaScript components"
      },
      {
        "pattern": "dss-claude-plugin/core/**/*.py",
        "extracts_to": ".knowledge/dss-architecture.json",
        "generator": "architecture_analyzer",
        "mcp_entities": ["DSS_Context_Compiler", "DSS_Core_Workflows"],
        "triggers": ["post-commit"],
        "description": "Core workflow modules"
      }
    ]
  },

  "generators": {
    "api_extractor": {
      "module": ".dss.doc-sync.generators.api_extractor",
      "class": "APIExtractor",
      "enabled": true,
      "description": "Extract FastAPI routes and endpoints"
    },
    "mcp_extractor": {
      "module": ".dss.doc-sync.generators.mcp_extractor",
      "class": "MCPExtractor",
      "enabled": true,
      "description": "Extract MCP tool definitions"
    },
    "component_extractor": {
      "module": ".dss.doc-sync.generators.component_extractor",
      "class": "ComponentExtractor",
      "enabled": true,
      "description": "Extract UI component metadata"
    },
    "architecture_analyzer": {
      "module": ".dss.doc-sync.generators.architecture_analyzer",
      "class": "ArchitectureAnalyzer",
      "enabled": true,
      "description": "Analyze module architecture"
    }
  },

  "mcp_sync": {
    "enabled": true,
    "sync_on": ["post-commit"],
    "batch_size": 50,
    "provenance_tracking": true,
    "incremental": true,
    "description": "Synchronize .knowledge/ JSON to MCP memory graph"
  },

  "cleanup_policy": {
    ".dss/": {
      "archive_after_days": 30,
      "archive_to": ".dss/sessions/{YYYY-MM}/",
      "exclude_patterns": [
        "runtime-config.json",
        "doc-sync/**",
        "dss.db"
      ],
      "compress": true,
      "description": "Archive old session work artifacts"
    },
    ".knowledge/": {
      "backup_on_update": true,
      "backup_to": ".dss/backups/knowledge/",
      "keep_backups": 10,
      "description": "Backup knowledge base before updates"
    }
  },

  "validation": {
    "pre_commit": {
      "check_manifest_syntax": true,
      "warn_on_doc_changes": true,
      "block_on_validation_errors": false
    },
    "post_commit": {
      "validate_generated_json": true,
      "check_mcp_sync": true,
      "report_failures": true
    }
  },

  "git_hooks": {
    "pre-commit": {
      "enabled": true,
      "actions": [
        "validate_manifest",
        "check_doc_consistency"
      ]
    },
    "post-commit": {
      "enabled": true,
      "actions": [
        "run_generators",
        "update_knowledge_base",
        "sync_mcp_memory"
      ]
    },
    "post-merge": {
      "enabled": true,
      "actions": [
        "reconcile_conflicts",
        "regenerate_all_docs"
      ]
    }
  }
}
