Mercurial
comparison mrjunejune/test/production_inference_bundle_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 | b401627fc49e |
| children | a78f5986011f |
comparison
equal
deleted
inserted
replaced
| 264:04fee26ecce0 | 265:056790c4fb0d |
|---|---|
| 39 fi | 39 fi |
| 40 | 40 |
| 41 entrypoint="$(find -L "$bundle" -type f -name production_entrypoint.sh -print -quit)" | 41 entrypoint="$(find -L "$bundle" -type f -name production_entrypoint.sh -print -quit)" |
| 42 bash -n "$entrypoint" | 42 bash -n "$entrypoint" |
| 43 grep -q 'mrjunejune_server_binary' "$entrypoint" | 43 grep -q 'mrjunejune_server_binary' "$entrypoint" |
| 44 if grep -q 'MRJUNEJUNE_ALLOW_.*INFERENCE' "$entrypoint"; then | |
| 45 echo "Production entrypoint must not override guest policy from .config" >&2 | |
| 46 exit 1 | |
| 47 fi | |
| 44 | 48 |
| 45 sidecar="$(find -L "$bundle" -type f -path '*/mrjunejune/inference/copilot_sidecar.zip' -print -quit)" | 49 sidecar="$(find -L "$bundle" -type f -path '*/mrjunejune/inference/copilot_sidecar.zip' -print -quit)" |
| 46 litellm="$(find -L "$bundle" -type f -path '*/mrjunejune/inference/litellm_proxy.zip' -print -quit)" | 50 litellm="$(find -L "$bundle" -type f -path '*/mrjunejune/inference/litellm_proxy.zip' -print -quit)" |
| 47 copilot_cli="$(find -L "$bundle" -type f -path '*/+http_archive+copilot_cli_linux_x86_64/copilot' -print -quit)" | 51 copilot_cli="$(find -L "$bundle" -type f -path '*/+http_archive+copilot_cli_linux_x86_64/copilot' -print -quit)" |
| 48 python="$(find -L "$bundle" -type f -path '*/rules_python++python+python_3_11_*/bin/python3' -print -quit)" | 52 python="$(find -L "$bundle" -type f -path '*/rules_python++python+python_3_11_*/bin/python3' -print -quit)" |
| 49 state="$(mktemp -d)" | 53 state="$(mktemp -d)" |
| 50 trap 'rm -rf "$state"' EXIT | 54 trap 'rm -rf "$state"' EXIT |
| 55 | |
| 56 sidecar_files="$(unzip -Z1 "$sidecar")" | |
| 57 for required in \ | |
| 58 'mrjunejune/inference/public_knowledge.py' \ | |
| 59 'mrjunejune/assistant/common.md' \ | |
| 60 'mrjunejune/assistant/public_visitor.md' \ | |
| 61 'mrjunejune/assistant/invited_friend.md' \ | |
| 62 'mrjunejune/assistant/june_admin.md' \ | |
| 63 'mrjunejune/assistant/knowledge/public_facts.json'; do | |
| 64 if ! grep -q "$required" <<<"$sidecar_files"; then | |
| 65 echo "Copilot sidecar is missing assistant prompt data: $required" >&2 | |
| 66 exit 1 | |
| 67 fi | |
| 68 done | |
| 69 | |
| 70 facts_path="$( | |
| 71 grep 'mrjunejune/assistant/knowledge/public_facts.json$' \ | |
| 72 <<<"$sidecar_files" | |
| 73 )" | |
| 74 facts="$(unzip -p "$sidecar" "$facts_path")" | |
| 75 grep -q '"visibility": "public"' <<<"$facts" | |
| 76 grep -q '"status": "verified"' <<<"$facts" | |
| 77 if grep -Eqi \ | |
| 78 '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}|650-531-1728|437-580-8026' \ | |
| 79 <<<"$facts"; then | |
| 80 echo "Copilot sidecar public knowledge contains contact data" >&2 | |
| 81 exit 1 | |
| 82 fi | |
| 51 | 83 |
| 52 output="$( | 84 output="$( |
| 53 printf '%s\n' '{"command":"shutdown","request_id":"bundle-test","conversation_id":null}' | | 85 printf '%s\n' '{"command":"shutdown","request_id":"bundle-test","conversation_id":null}' | |
| 54 COPILOT_SIDECAR_HOME="$state/copilot" \ | 86 COPILOT_SIDECAR_HOME="$state/copilot" \ |
| 55 LITELLM_BASE_URL='http://127.0.0.1:1/v1' \ | 87 LITELLM_BASE_URL='http://127.0.0.1:1/v1' \ |
| 56 LITELLM_MODEL='jrpg-copilot' \ | 88 LITELLM_MODEL='jrpg-copilot' \ |
| 57 LITELLM_WIRE_API='completions' \ | 89 LITELLM_WIRE_API='completions' \ |
| 58 "$python" "$sidecar" "$copilot_cli" | 90 "$python" "$sidecar" "$copilot_cli" |
| 59 )" | 91 )" |
| 60 grep -q '"type":"ready"' <<<"$output" | 92 grep -q '"type":"ready"' <<<"$output" |
| 93 grep -q '"public_visitor"' <<<"$output" | |
| 94 grep -q '"invited_friend"' <<<"$output" | |
| 95 grep -q '"june_admin"' <<<"$output" | |
| 61 "$python" "$litellm" --help >/dev/null | 96 "$python" "$litellm" --help >/dev/null |