# Test Platform Configuration
#
# Runtime configuration for test environment
# Optimized for fast, isolated, deterministic tests

let contracts = import "../../schemas/kb/contracts.ncl" in
let defaults = import "../../schemas/kb/defaults.ncl" in
let helpers = import "../../schemas/kb/helpers.ncl" in
let test_mode = import "../../schemas/kb/modes/test.ncl" in

# Test-specific overrides
let test_platform = {
  graph = {
    name = "knowledge-base-test",
    description = "Test instance of KB (ephemeral)",
  },

  storage = {
    primary = 'memory,  # Ephemeral, fast, isolated
    secondary = {
      enabled = false,  # No external dependencies in tests
    },
  },

  embeddings = {
    enabled = false,  # Disable for test speed
    provider = 'fastembed,  # Fallback if needed by specific tests
    model = "BAAI/bge-small-en-v1.5",
    dimensions = 384,
  },

  query = {
    similarity_threshold = 0.3,  # Permissive for test coverage
    max_results = 50,  # More results for verification
    recency_weight = 1.0,  # No recency bias in tests
    cross_graph = false,  # Isolated tests
  },

  sync = {
    auto_index = false,  # Manual control in tests
    debounce_ms = 0,  # No debounce for deterministic behavior
    watch_paths = [],  # No file watching in tests
  },

  mcp = {
    server = {
      name = "kb-mcp-test",
      version = "1.0.0-test",
      transport = 'stdio,
    },
    tools = {
      search = true,
      add_note = true,
      add_decision = true,
      link = true,
      get_guidelines = true,
      export = true,
    },
    resources = {
      expose_project = false,  # Isolated tests
      expose_shared = false,
    },
  },
} in

helpers.compose_config defaults.base test_mode test_platform
  | contracts.KbConfig
