the name: Bikoret — code, contracts, images
Headers X-Bikoret-Key / -Rebuke / -Verdict / -Bedikah; the `bikoret` object and the "— bikoret …" fringe on a gate reply; environment variables BIKORET_*; the image user and paths (/home/bikoret, /tmp/bikoret, /var/lib/bikoret/manna, /etc/bikoret/secrets, /opt/bikoret/spec); the tmp-bikoret pod volume; local databases bikoret_dev/_test. Kubernetes resource names, the shorashim_app role and the domain are unchanged (Tamid §1.1, "the names that still carry the old word"). Doorpost c963c4fe…. Elixir 604/0, L3 10/0, korban 295, Prolog bedikah 44/44. Gitea repo renamed heaviness510/bikoret (old URL redirects). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
017a9b89d4
commit
c0d0555aed
46 files changed
+189
-189
No files matched your search
@@ -32,7 +32,7 @@ defmodule VavPipeline.GateTest do
|
||||
case get_req_header(conn, "x-api-key") do
|
||||
["sk-good"] ->
|
||||
last = conn.body_params["messages"] |> List.last()
|
||||
text = if is_binary(last["content"]) and String.contains?(last["content"], "[shorashim"), do: "CLEAN: the report says revenue rose.", else: "FRAMED: I want to be honest with you. The honest answer is that revenue rose."
|
||||
text = if is_binary(last["content"]) and String.contains?(last["content"], "[bikoret"), do: "CLEAN: the report says revenue rose.", else: "FRAMED: I want to be honest with you. The honest answer is that revenue rose."
|
||||
reply = %{"id" => "msg_1", "type" => "message", "role" => "assistant", "model" => "claude-test", "content" => [%{"type" => "text", "text" => text}], "stop_reason" => "end_turn"}
|
||||
send_resp(conn, 200, Jason.encode!(reply))
|
||||
|
||||
@@ -184,11 +184,11 @@ defmodule VavPipeline.GateTest do
|
||||
assert Enum.map(pass.bedikah.sources, & &1.id) == ["system", "user_1", "user_2"]
|
||||
[%{"text" => text}] = pass.reply["content"]
|
||||
assert String.starts_with?(text, "FRAMED:")
|
||||
assert text =~ "\n\n— shorashim bedikah-"
|
||||
assert text =~ "\n\n— bikoret bedikah-"
|
||||
assert text =~ "lo_tov — lo_taaseh_lekha (Shemot 20:4): \"I want to be honest with you.\""
|
||||
assert pass.shorashim.verdict == "lo_tov" and pass.shorashim.anchors == %{"lo_taaseh_lekha" => "Shemot 20:4"}
|
||||
assert pass.shorashim.model == "claude-test"
|
||||
refute Map.has_key?(pass.shorashim, :rebuked)
|
||||
assert pass.bikoret.verdict == "lo_tov" and pass.bikoret.anchors == %{"lo_taaseh_lekha" => "Shemot 20:4"}
|
||||
assert pass.bikoret.model == "claude-test"
|
||||
refute Map.has_key?(pass.bikoret, :rebuked)
|
||||
end
|
||||
|
||||
test "tablet 52: an ungrounded claim's sentence reaches the fringe (the grounding check lists couplings, not sentences)" do
|
||||
@@ -199,7 +199,7 @@ defmodule VavPipeline.GateTest do
|
||||
assert pass.bedikah.verdict == :lo_tov
|
||||
[%{"text" => text}] = pass.reply["content"]
|
||||
assert text =~ "golden_calf (Shemot 32:4): \"Revenue rose 9% to 14M.\""
|
||||
assert Shape.rebuke_text(pass.bedikah, pass.shorashim.anchors) =~ "golden_calf (Shemot 32:4)"
|
||||
assert Shape.rebuke_text(pass.bedikah, pass.bikoret.anchors) =~ "golden_calf (Shemot 32:4)"
|
||||
end
|
||||
|
||||
test "rebuke once: the second reply is examined, linked to the first, and is the one delivered" do
|
||||
@@ -212,8 +212,8 @@ defmodule VavPipeline.GateTest do
|
||||
assert pass.bedikah.sources == pass.first.sources
|
||||
[%{"text" => text}] = pass.reply["content"]
|
||||
assert String.starts_with?(text, "CLEAN:")
|
||||
assert text =~ "— shorashim #{pass.bedikah.bedikah_ref}: tov (after rebuke of #{pass.first.bedikah_ref}: lo_tov)"
|
||||
assert pass.shorashim.rebuked == %{first_bedikah_ref: pass.first.bedikah_ref, first_verdict: "lo_tov"}
|
||||
assert text =~ "— bikoret #{pass.bedikah.bedikah_ref}: tov (after rebuke of #{pass.first.bedikah_ref}: lo_tov)"
|
||||
assert pass.bikoret.rebuked == %{first_bedikah_ref: pass.first.bedikah_ref, first_verdict: "lo_tov"}
|
||||
end
|
||||
|
||||
test "rebuke once on a tov first reply makes no second call" do
|
||||
@@ -226,7 +226,7 @@ defmodule VavPipeline.GateTest do
|
||||
end
|
||||
|
||||
test "an upstream error passes through as it came, unexamined" do
|
||||
assert {:ok, %{status: 401, reply: %{"error" => %{"type" => "authentication_error"}}, shorashim: nil}} =
|
||||
assert {:ok, %{status: 401, reply: %{"error" => %{"type" => "authentication_error"}}, bikoret: nil}} =
|
||||
Gate.pass(:anthropic, body(), "sk-bad", opts())
|
||||
end
|
||||
|
||||
@@ -257,10 +257,10 @@ defmodule VavPipeline.GateTest do
|
||||
# ------------------------------------------------------------
|
||||
|
||||
describe "POST /gate/anthropic/v1/messages" do
|
||||
test "refuses without the courtyard key; X-Shorashim-Key opens it too" do
|
||||
test "refuses without the courtyard key; X-Bikoret-Key opens it too" do
|
||||
conn = post_gate(body(), courtyard: nil, upstream: "sk-good")
|
||||
assert conn.status == 401
|
||||
conn = post_gate(body(), courtyard: {"x-shorashim-key", "test-token"}, upstream: "sk-good")
|
||||
conn = post_gate(body(), courtyard: {"x-bikoret-key", "test-token"}, upstream: "sk-good")
|
||||
refute conn.status in [401, 403]
|
||||
end
|
||||
|
||||
@@ -276,7 +276,7 @@ defmodule VavPipeline.GateTest do
|
||||
conn = post_gate(body(), upstream: "sk-bad")
|
||||
assert conn.status == 401
|
||||
assert Jason.decode!(conn.resp_body)["error"]["type"] == "authentication_error"
|
||||
assert get_resp_header(conn, "x-shorashim-verdict") == ["none"]
|
||||
assert get_resp_header(conn, "x-bikoret-verdict") == ["none"]
|
||||
end
|
||||
|
||||
test "with no Korban Processor in this VM, a 200 from the upstream is not delivered unexamined" do
|
||||
|
||||
Reference in new issue
Block a user