version: "1.0"

project:
  id: "urban-birdwatch-2026"
  name: "Urban Birdwatch Survey"
  description: "Citizen-science survey of bird abundance and distribution in urban habitats."
  organization: "Community Avian Research Network"
  season:
    start_date: "2026-04-15"
    end_date: "2026-10-31"
  timezone: "America/Toronto"
  contact:
    email: "survey@example.org"
    emergency_phone: "+1-555-010-2026"

survey:
  protocol: "stationary-point-count"
  duration_minutes: 10
  observation_radius_meters: 100
  minimum_observers: 1
  maximum_observers: 4
  repeat_visits_per_site: 3
  preferred_start:
    relative_to_sunrise_minutes: -30
  preferred_end:
    relative_to_sunrise_minutes: 180
  allowed_weather:
    precipitation:
      - "none"
      - "light"
    maximum_wind_beaufort: 3
    minimum_visibility_meters: 500
  required_fields:
    - "site_id"
    - "observer_id"
    - "started_at"
    - "duration_minutes"
    - "species_code"
    - "count"
    - "detection_type"
    - "effort_complete"
  optional_fields:
    - "age"
    - "sex"
    - "behavior"
    - "distance_band"
    - "breeding_evidence"
    - "notes"
    - "media"

sites:
  source: "data/sites.geojson"
  coordinate_reference_system: "EPSG:4326"
  location_precision_meters: 10
  restricted_site_precision_meters: 1000
  habitat_categories:
    - "residential"
    - "urban-park"
    - "wetland"
    - "woodland"
    - "agricultural-edge"
    - "industrial"
  accessibility:
    require_public_access: true
    allow_remote_sites: false

observations:
  taxonomy:
    authority: "eBird/Clements"
    version: "2025"
    species_reference: "data/taxonomy.csv"
    allow_unknown_species: true
    unknown_species_code: "BIRD-SP"
  counts:
    minimum: 0
    maximum_without_review: 500
    allow_estimates: true
  detection_types:
    - "seen"
    - "heard"
    - "seen-and-heard"
    - "flyover"
  distance_bands_meters:
    - label: "near"
      minimum: 0
      maximum: 25
    - label: "middle"
      minimum: 26
      maximum: 50
    - label: "far"
      minimum: 51
      maximum: 100
    - label: "outside-radius"
      minimum: 101
      maximum: null
  breeding_evidence_codes:
    - "possible"
    - "probable"
    - "confirmed"

participants:
  minimum_age: 13
  guardian_consent_required_under_age: 18
  training:
    required: true
    course_url: "https://example.org/training/urban-birdwatch"
    passing_score_percent: 80
    expires_after_days: 365
  privacy:
    public_display_name: "anonymous"
    store_exact_home_address: false
    consent_form_version: "2026.1"

quality_control:
  validate_on_submission: true
  flag_rules:
    - id: "high-count"
      condition: "count > 500"
      severity: "warning"
      action: "expert-review"
    - id: "rare-species"
      condition: "regional_frequency < 0.001"
      severity: "warning"
      action: "request-media"
    - id: "outside-season"
      condition: "observed_at < season.start_date || observed_at > season.end_date"
      severity: "error"
      action: "reject"
    - id: "invalid-duration"
      condition: "duration_minutes < 5 || duration_minutes > 30"
      severity: "warning"
      action: "coordinator-review"
    - id: "duplicate-checklist"
      condition: "same_observer_site_start_within_minutes <= 5"
      severity: "error"
      action: "hold"
  expert_review:
    required_approvals: 1
    escalation_after_hours: 72
    notify:
      - "reviewers@example.org"

media:
  accepted_types:
    - "image/jpeg"
    - "image/png"
    - "audio/wav"
    - "audio/mpeg"
  maximum_file_size_mb: 25
  strip_location_metadata_on_public_export: true
  license:
    default: "CC-BY-4.0"
    participant_may_override: true

storage:
  database:
    driver: "postgresql"
    host_env: "BIRD_SURVEY_DB_HOST"
    port: 5432
    database: "bird_survey"
    username_env: "BIRD_SURVEY_DB_USER"
    password_env: "BIRD_SURVEY_DB_PASSWORD"
    ssl_mode: "require"
  media_bucket:
    provider: "s3-compatible"
    bucket_env: "BIRD_SURVEY_MEDIA_BUCKET"
    region_env: "BIRD_SURVEY_MEDIA_REGION"
    encryption: "AES256"
  retention:
    raw_observations_years: 10
    audit_logs_years: 7
    rejected_uploads_days: 30

exports:
  schedule: "0 3 * * *"
  formats:
    - "csv"
    - "darwin-core"
    - "geojson"
  destinations:
    - id: "public-dataset"
      visibility: "public"
      include_personal_data: false
      coordinate_precision_meters: 100
    - id: "research-archive"
      visibility: "restricted"
      include_personal_data: false
      coordinate_precision_meters: 10
  embargo:
    sensitive_species_days: 365
    breeding_sites_days: 180

notifications:
  submission_receipt:
    enabled: true
    channels:
      - "email"
  severe_weather:
    enabled: true
    channels:
      - "email"
      - "push"
  digest:
    enabled: true
    schedule: "0 9 * * 1"
    timezone: "America/Toronto"

monitoring:
  healthcheck_path: "/health"
  metrics_path: "/metrics"
  alert_thresholds:
    failed_submissions_per_hour: 20
    review_backlog: 250
    export_age_hours: 30
  alert_recipients:
    - "operations@example.org"

audit:
  enabled: true
  record_ip_addresses: false
  record_changes:
    - "observations"
    - "site_metadata"
    - "review_decisions"
    - "consent_status"