{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "file-operations/pre-edit-backup/v1.0.0",
  "title": "Pre-Edit Backup Schema",
  "description": "Schema for pre-edit backup metadata (Integration Point 2.1)",
  "type": "object",
  "required": ["file_path", "backup_path", "agent_id", "timestamp", "file_hash", "file_size"],
  "properties": {
    "file_path": {
      "type": "string",
      "description": "Absolute path to original file",
      "pattern": "^/.*"
    },
    "backup_path": {
      "type": "string",
      "description": "Absolute path to backup file",
      "pattern": "^/.*"
    },
    "agent_id": {
      "type": "string",
      "description": "Agent that created the backup",
      "pattern": "^[a-z0-9-]+$"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "When backup was created"
    },
    "file_hash": {
      "type": "string",
      "description": "File content hash (sha256:...)",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "file_size": {
      "type": "integer",
      "description": "File size in bytes",
      "minimum": 0
    },
    "retention_hours": {
      "type": "integer",
      "description": "How long to retain backup (hours)",
      "minimum": 1,
      "maximum": 720,
      "default": 24
    }
  },
  "additionalProperties": false
}
