Files
bikoret/vav_pipeline/priv/repo/migrations/20261007000002_bedikot_rebukes.exs
Scott KarpandClaude Fable 5.1 5c63273dba gate: Shorashim between a caller and a model, with the fringe and rebuke once (bishe'arecha step 4)
Devarim 6:9 / 11:20 — on your gates. POST /gate/anthropic/v1/messages and
POST /gate/openai/v1/chat/completions take the model's own request shape
under the caller's own upstream key (x-api-key, or Authorization with the
courtyard key in X-Shorashim-Key), forward it unchanged (OTP inets/ssl,
verify_peer; the Korban socket is serial, so the upstream call is made
in the Vav Pipeline and the reply enters as korban like every bedikah),
examine the reply with the request in hand — sources = the system prompt
and the user turns, query = the last user turn; the model's prior turns
are not sources — and deliver it with its fringe (Bamidbar 15:39): a
trailer on the last text block naming ref, verdict, the rules with their
verses and sentences; X-Shorashim-Bedikah / X-Shorashim-Verdict; a
`shorashim` object. A non-200 passes through as it came; a reply with
no text is not delivered; stream is refused.

Rebuke once (Vayikra 19:17; X-Shorashim-Rebuke: once): a lo_tov reply is
answered once more with the finding; the second reply is examined like
the first, its record carries rebukes: <first ref> (migration
20261007000002), and it is delivered marked with both. Never a third.

Manna: one api_calls_external per upstream call, gathered before any
call. Stateless: no conversation, no key kept; the log is the path class.
Gate.bearer accepts X-Shorashim-Key. Construction §3.10, Tamid §1.1,
KOHEN "Standing at the gate", bishearecha §I/§III/§VII marked built.
Elixir 592/0 (+14 gate tests incl. a real httpc round trip to a local
model double), L3 9/0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 11:38:32 +00:00

20 lines
538 B
Elixir

defmodule VavPipeline.Repo.Migrations.BedikotRebukes do
use Ecto.Migration
@moduledoc """
Hocheach tochiach (bishe'arecha §VII): at the gate a lo_tov reply may
be rebuked once and answered again. The second examination's record
points at the first — `rebukes` holds the first bedikah_ref. Both
rows stand; the correction does not persist in the model, the record
does. Append-only.
"""
def change do
alter table(:bedikot) do
add :rebukes, :string
end
create index(:bedikot, [:rebukes])
end
end