Mercurial
diff mrjunejune/test/inference_stack_config_test.sh @ 265:056790c4fb0d
add role-aware Epi assistant prompts
Add verified June knowledge, guest/member/admin Copilot profiles, profile-isolated session recovery, animated Epi greetings, and a single authoritative runtime config workflow for inference.
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Fri, 07 Aug 2026 10:50:30 -0700 |
| parents | |
| children | 13d61401c57d |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mrjunejune/test/inference_stack_config_test.sh Fri Aug 07 10:50:30 2026 -0700 @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +set -euo pipefail + +source_script="$(realpath "$1")" +root="$(mktemp -d)" +trap 'rm -rf "$root"' EXIT +mkdir -p "$root/mrjunejune" +for file in server launcher sidecar copilot litellm config python mock; do + touch "$root/$file" +done + +cat > "$root/mrjunejune/.config" <<EOF +AUTH_COOKIE_SECRET=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef +AUTH_BOOTSTRAP_USERNAME=admin +AUTH_BOOTSTRAP_PASSWORD_HASH=zenbu-scrypt\$v=1\$N=32768\$r=8\$p=1\$salt\$hash +LITELLM_MASTER_KEY=sk-test-only-value +GITHUB_COPILOT_TOKEN_DIR=$root/token-dir +MRJUNEJUNE_ALLOW_GUEST_INFERENCE=true +SERVER_HOST=127.0.0.1 +EOF + +output="$( + MRJUNEJUNE_ALLOW_GUEST_INFERENCE=false \ + BUILD_WORKSPACE_DIRECTORY="$root" \ + "$source_script" \ + "$root/server" \ + "$root/launcher" \ + "$root/sidecar" \ + "$root/copilot" \ + "$root/litellm" \ + "$root/config" \ + "$root/python" \ + "$root/mock" \ + --check-config +)" +grep -q "config=$root/mrjunejune/.config" <<<"$output" +grep -q '^litellm_master_key=set$' <<<"$output" +grep -q "copilot_token_dir=$root/token-dir" <<<"$output" +grep -q '^guest_inference=true$' <<<"$output" +if grep -q 'sk-test-only-value' <<<"$output"; then + echo "Config check leaked the LiteLLM master key" >&2 + exit 1 +fi + +echo 'UNSUPPORTED_SETTING=value' >> "$root/mrjunejune/.config" +if BUILD_WORKSPACE_DIRECTORY="$root" \ + "$source_script" \ + "$root/server" \ + "$root/launcher" \ + "$root/sidecar" \ + "$root/copilot" \ + "$root/litellm" \ + "$root/config" \ + "$root/python" \ + "$root/mock" \ + --check-config >/dev/null 2>&1; then + echo "Unsupported config key was accepted" >&2 + exit 1 +fi + +if grep -Eq '(^|[[:space:]])(source|eval)[[:space:]]' "$source_script"; then + echo "Inference config parser must not source or eval config files" >&2 + exit 1 +fi