#!/bin/sh set -eu cd "$(dirname "$0")/.." tmp_bundle=$(mktemp) tmp_auth=$(mktemp) tmp_auth_config=$(mktemp -d) trap 'rm -f "$tmp_bundle" "$tmp_auth"; rm -rf "$tmp_auth_config"' EXIT HUP INT TERM printf '%s\n' 'THT_MODEL_API_KEY=test-model' >"$tmp_bundle" chmod 0600 "$tmp_bundle" printf '%s\n' '{}' >"$tmp_auth" chmod 0600 "$tmp_auth" chmod 0700 "$tmp_auth_config" printf '%s\n' 'mode: local' >"$tmp_auth_config/auth.yaml" chmod 0600 "$tmp_auth_config/auth.yaml" export THT_SECRETS_FILE="$tmp_bundle" export PI_AUTH_FILE="$tmp_auth" export THT_AUTH_CONFIG_ROOT="$tmp_auth_config" export THT_WORKSPACE_GIT_REMOTE=https://git.example.invalid/platform/thoth-workspaces.git config_json=$(docker compose -f compose.yaml -f deploy/compose.preprocess.yaml --profile preprocess config --format json) printf '%s' "$config_json" | python3 -c ' import json, sys config = json.load(sys.stdin) services = config["services"] assert "qdrant" in services assert "embedding" in services assert "embedding-model-init" in services assert "preprocess-evidence" in services assert "preprocess-dwh" in services for name in ("preprocess-evidence", "preprocess-dwh", "core"): service = services[name] assert any(item.get("target") == "thothii.secrets" for item in service.get("secrets", []) if isinstance(item, dict)), (name, service.get("secrets")) assert "THT_OLLAMA_URL" not in str(service) assert "THT_VECTOR_" not in str(service) assert services["preprocess-evidence"]["depends_on"]["qdrant"]["condition"] == "service_healthy" assert services["preprocess-evidence"]["depends_on"]["embedding-model-init"]["condition"] == "service_completed_successfully" assert "depends_on" not in services["preprocess-dwh"] or "vector-migrate" not in str(services["preprocess-dwh"]["depends_on"]) ' python3 - <<'PY' from pathlib import Path evidence = Path("deploy/workspaces/preprocess-evidence.yaml").read_text() dwh = Path("deploy/workspaces/preprocess-dwh.yaml").read_text() assert "type: qdrant" in evidence assert "base_url: http://qdrant:6333" in evidence assert "provider: ollama_internal" in evidence assert "base_url: http://embedding:11434" in evidence assert "qwen3-embedding:0.6b" in evidence assert "THT_VECTOR_" not in evidence assert "THT_OLLAMA_URL" not in evidence assert "pgvector" not in evidence assert "type: postgres_direct" in dwh assert "THT_PREPROCESS_DWH_HOST" in dwh print("preprocess workspace contract: ok") PY echo "preprocess compose config: ok"