Skip to content

Environment variable operation policy (EvoSpikeNet)

[!NOTE] For the latest implementation status, please refer to Functional Implementation Status (Remaining Functionality).

This document defines the meaning of operationally important environment variables used in the EvoSpikeNet repository and recommends settings for each environment (CI/development/staging/production).

Purpose: - Prevent misuse of mocks/stubs - Clarify data sources (mock vs real) and prevent deceptive data from being mixed into production - Provide consistent operational procedures between CI and production


Target environment variable

EVOSPIKENET_ALLOW_STUBS

  • Description: Flag to explicitly allow in-process stub/mock implementations (e.g. in-memory Zenoh stubs, CARLA mocks, etc.).
  • Received values: 0|1, false|true, no|yes, off|on (case does not matter)
  • Default: 0 (disabled)
  • Behavior: If 1, the code is allowed to "start successfully with mocks" when dependent libraries are not present. If 0, mocks are not allowed and many integration points will fail on connection failure.
  • CI (unit tests): 1 (for using stubs in unit tests)
  • Development local: 1 (permitted for development efficiency)
  • Staging: 0 (disallowing is recommended to perform verification close to actual production)
  • Production: 0 (must be disabled)

Operation caution

  • Please check the pre-deployment checklist that EVOSPIKENET_ALLOW_STUBS is 0 before the production image/production deployment.
  • Enabling 1 incorrectly in production hides the absence of dependent services and poses a significant operational risk.

EVOSPIKENET_DATA_STRICT_REAL

  • Description: Flag to enforce strictness of data provenance. If 1, a component that receives data with source_type of mock will throw an exception/handle it as an error.
  • Received values: 0|1, false|true, no|yes, off|on
  • Default: 0 (disabled)
  • CI (unit test): 0 (unit test uses mock data)
  • Development local: 0 (Local development uses mocks a lot)
  • Staging: 1 (recommended for verifying production approximation)
  • Production: 1 (required. Prevents mock inclusion)

Operation caution

  • Enabling EVOSPIKENET_DATA_STRICT_REAL=1 may cause test jobs to fail, so it is recommended to run "mock permission job" and "strict real data verification job" separately in the CI test matrix.

EVOSPIKENET_FAIL_ON_COMM_FALLBACK

  • Description: Controls behavior when real Zenoh backend is not available in the communication layer.
  • Received values: 0|1, false|true, no|yes, off|on
  • Default: 0 (disabled)
  • Operation:
  • 1: Disables communication fallback (SDK relay / in-memory stub) and stops exception with fail-closed.
  • 0: Allow fallback under the condition of EVOSPIKENET_ALLOW_STUBS.
  • CI (Unit Test): 0
  • Development local: 0
  • Staging: 1
  • Production: 1

EVOSPIKENET_ALLOW_COMPAT_FALLBACKS

  • Description: Allow synthetic fallback responses for the compatibility API (/datasets, /images, /audio, /state, /training).
  • Received values: 0|1, false|true, no|yes, off|on
  • Default: 1 in development environment, 0 when determining production/staging.
  • Behavior: If 0, return 503 and compat_fallback_disabled.
  • CI (Unit Test): 1
  • Development local: 1
  • Staging: 0
  • Production: 0

EVOSPIKENET_ALLOW_MEDIA_PLACEHOLDERS

  • Description: Allow placeholder response when video analysis cannot generate a transcript/narrative.
  • Received values: 0|1, false|true, no|yes, off|on
  • Default: 1 in development environment, 0 when determining production/staging.
  • Operation:
  • 1: Returns a transcript/narrative synthetic response.
  • 0: The job is terminated as failed (fail-closed).
  • CI (Unit Test): 1
  • Development local: 1
  • Staging: 0
  • Production: 0

EVOSPIKENET_ALLOW_DUMMY_SERVICES

  • Description: Allows an alternative dummy service implementation to be activated on import failure.
  • Received values: 0|1, false|true, no|yes, off|on
  • Default: 1 in development environment, 0 when determining production/staging.
  • Behavior: If 0, the dummy implementation does not return a synthetic response and raises an exception.
  • CI (Unit Test): 1
  • Development local: 1
  • Staging: 0
  • Production: 0

Configuration example (.env)```bash

Example: For production

EVOSPIKENET_ALLOW_STUBS=0 EVOSPIKENET_DATA_STRICT_REAL=1 EVOSPIKENET_FAIL_ON_COMM_FALLBACK=1 EVOSPIKENET_ALLOW_COMPAT_FALLBACKS=0 EVOSPIKENET_ALLOW_MEDIA_PLACEHOLDERS=0 EVOSPIKENET_ALLOW_DUMMY_SERVICES=0

Example: CI/Development

EVOSPIKENET_ALLOW_STUBS=1 EVOSPIKENET_DATA_STRICT_REAL=0 EVOSPIKENET_FAIL_ON_COMM_FALLBACK=0 EVOSPIKENET_ALLOW_COMPAT_FALLBACKS=1 EVOSPIKENET_ALLOW_MEDIA_PLACEHOLDERS=1 EVOSPIKENET_ALLOW_DUMMY_SERVICES=1

## Configuration example with Docker Compose```yaml
services:
  api:
    environment:
      - EVOSPIKENET_ALLOW_STUBS=0
      - EVOSPIKENET_DATA_STRICT_REAL=1
      - EVOSPIKENET_FAIL_ON_COMM_FALLBACK=1
      - EVOSPIKENET_ALLOW_COMPAT_FALLBACKS=0
      - EVOSPIKENET_ALLOW_MEDIA_PLACEHOLDERS=0
      - EVOSPIKENET_ALLOW_DUMMY_SERVICES=0

  • Before production deployment:
  • Check that EVOSPIKENET_ALLOW_STUBS is 0
  • Check that EVOSPIKENET_DATA_STRICT_REAL is 1
  • Check that EVOSPIKENET_FAIL_ON_COMM_FALLBACK is 1
  • Check that EVOSPIKENET_ALLOW_COMPAT_FALLBACKS is 0
  • Check that EVOSPIKENET_ALLOW_MEDIA_PLACEHOLDERS is 0
  • Check that EVOSPIKENET_ALLOW_DUMMY_SERVICES is 0
  • Run smoke tests to ensure successful connections to external dependencies (DB, API, CARLA, etc.)
  • future_apps/smart_city_infrastructure/src/urban_data_api.py — Uses EVOSPIKENET_DATA_STRICT_REAL
  • future_apps/climate_change_prediction/src/climate_data_api.py — Uses EVOSPIKENET_DATA_STRICT_REAL
  • future_apps/brain_machine_interface/src/services/distributed_connector.py — Uses EVOSPIKENET_ALLOW_STUBS (allow in-memory stub)
  • EvoSpikeNet-Core/evospikenet/communication.py — Uses EVOSPIKENET_FAIL_ON_COMM_FALLBACK
  • EvoSpikeNet-Core/evospikenet/api_modules/future_apps_compat_api.py — Uses EVOSPIKENET_ALLOW_COMPAT_FALLBACKS
  • EvoSpikeNet-Core/evospikenet/video_scene_service.py — Uses EVOSPIKENET_ALLOW_MEDIA_PLACEHOLDERS
  • EvoSpikeNet-Core/evospikenet/services/__init__.py — Uses EVOSPIKENET_ALLOW_DUMMY_SERVICES

Audit method

  • See how settings are used across repositories:
grep -R "EVOSPIKENET_ALLOW_STUBS\|EVOSPIKENET_DATA_STRICT_REAL\|EVOSPIKENET_FAIL_ON_COMM_FALLBACK\|EVOSPIKENET_ALLOW_COMPAT_FALLBACKS\|EVOSPIKENET_ALLOW_MEDIA_PLACEHOLDERS\|EVOSPIKENET_ALLOW_DUMMY_SERVICES" -n || true

In closing: This policy is a minimum guideline to improve security and operational health. Tailor it to your organization's operational rules and CI/CD policies.