Tablet 49: the bedikah grounds an output in what it was GIVEN, not in L1 alone
The first grounding check asked whether an output cited Torah verses —
Torah as content. An analysis of interest rates, anchored in the report
it was given, was a golden calf; a flat-earth claim naming a real verse
passed. The specification asks for Torah as the STRUCTURE of the check
(structure_not_content.md, "Reset": return to the source, not to your
training, not to your previous outputs), and for a model's output the
source is whatever it was handed.
Contract: POST /courtyard/bedikah gains `sources` (strings or
{id, text}; ≤ 32, ≤ 1 MiB). Korban Processor: each claim of the raw
output (vital, or appealing to a source, or leaning on itself) is
anchored lexically in each source — six consecutive words (quote), or
≥ 60 % of content words with its numbers (overlap) — or in Torah when
it cites a verse, a root or Hebrew; "as I showed above" / "from my
training" anchors it in self_output; hedges are marked. Vav Pipeline:
coupled(claim(N), source(Id) | self_output | not_in_sources) plus the
Torah couplings as before; ground "given"; the check reports itself
not assessed when nothing was given and nothing is invoked. Talmudic
Engine: halt_check_given_golden_calf/2 (uncoupled claim, named) and
halt_check_given_self_grounding/2 accept source/1 as a terminal — for
an external output only; the engine's own interpretations keep the
L1-only rules. L3: bedikot.sources (id, sha256, length — never text)
and bedikot.claims.
Specs: Tamid §1.1 (contract, anchoring, limits), Vayakhel §3.9,
Architecture §3.5, Broken Tablets tablet 49, KOHEN.md. Ingress body
2m. Doorpost a2ec3842… → 6c8933e7….
Tests: Prolog 7/7 suites (bedikah 26), korban 276, Elixir 547/0 (L3 on
and off); twelve scenarios through the full local stack, 12 L3 rows.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
9d5db797f7
commit
f69cc99a5f
22 files changed
+1051
-110
No files matched your search
@@ -459,6 +459,8 @@ defmodule VavPipeline.BigdeiKodesh.Router do
|
||||
# ============================================================
|
||||
|
||||
@bedikah_provenances ~w(claude gpt mistral llama gemma human)
|
||||
@bedikah_max_sources 32
|
||||
@bedikah_max_source_bytes 1_048_576
|
||||
@bedikah_max_bytes 65_536
|
||||
|
||||
defp process_bedikah(conn) do
|
||||
@@ -489,6 +491,17 @@ defmodule VavPipeline.BigdeiKodesh.Router do
|
||||
resubmit: true
|
||||
})
|
||||
|
||||
match?({:error, _}, parse_sources(params["sources"])) ->
|
||||
{:error, why} = parse_sources(params["sources"])
|
||||
|
||||
send_error(conn, 422, "KIYOR_VALIDATION_FAILED", %{
|
||||
issue: "'sources': #{why}",
|
||||
correction:
|
||||
"Give what the model was given as a list of strings or {\"id\", \"text\"} objects, " <>
|
||||
"at most #{@bedikah_max_sources} of them and #{@bedikah_max_source_bytes} bytes in all, or omit it",
|
||||
resubmit: true
|
||||
})
|
||||
|
||||
not is_binary(query) ->
|
||||
send_error(conn, 422, "KIYOR_VALIDATION_FAILED", %{
|
||||
issue: "'query' must be a string",
|
||||
@@ -514,11 +527,47 @@ defmodule VavPipeline.BigdeiKodesh.Router do
|
||||
})
|
||||
|
||||
:available ->
|
||||
respond_bedikah(conn, VavPipeline.Bedikah.examine(output, model, query))
|
||||
{:ok, sources} = parse_sources(params["sources"])
|
||||
respond_bedikah(conn, VavPipeline.Bedikah.examine(output, model, query, sources: sources))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# What the model was given: ["text", ...] or [{"id","text"}, ...].
|
||||
# Ids default to s1, s2, …; the Korban Processor sees the same shape.
|
||||
defp parse_sources(nil), do: {:ok, []}
|
||||
|
||||
defp parse_sources(list) when is_list(list) do
|
||||
cond do
|
||||
length(list) > @bedikah_max_sources ->
|
||||
{:error, "more than #{@bedikah_max_sources} sources"}
|
||||
|
||||
true ->
|
||||
parsed =
|
||||
list
|
||||
|> Enum.with_index(1)
|
||||
|> Enum.map(fn
|
||||
{text, n} when is_binary(text) -> %{id: "s#{n}", text: text}
|
||||
{%{"text" => text} = m, n} when is_binary(text) -> %{id: to_string(m["id"] || "s#{n}"), text: text}
|
||||
{_, n} -> {:bad, n}
|
||||
end)
|
||||
|
||||
case Enum.find(parsed, &match?({:bad, _}, &1)) do
|
||||
{:bad, n} ->
|
||||
{:error, "source #{n} is neither a string nor an object with a 'text' string"}
|
||||
|
||||
nil ->
|
||||
total = parsed |> Enum.map(&byte_size(&1.text)) |> Enum.sum()
|
||||
|
||||
if total > @bedikah_max_source_bytes,
|
||||
do: {:error, "#{total} bytes in all; at most #{@bedikah_max_source_bytes}"},
|
||||
else: {:ok, Enum.reject(parsed, &(String.trim(&1.text) == ""))}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
defp parse_sources(_), do: {:error, "must be a list"}
|
||||
|
||||
defp respond_bedikah(conn, {:ok, result}) do
|
||||
send_json(conn, 200, %{
|
||||
bedikah_ref: result.bedikah_ref,
|
||||
@@ -531,15 +580,24 @@ defmodule VavPipeline.BigdeiKodesh.Router do
|
||||
propositions: result.examination["propositions"],
|
||||
references: result.examination["references"],
|
||||
roots: result.examination["roots"],
|
||||
discarded: result.examination["discarded"]
|
||||
discarded: result.examination["discarded"],
|
||||
sources: result.examination["sources"] || [],
|
||||
claims: result.examination["claims"] || []
|
||||
},
|
||||
coupling_trace: result.coupling_trace,
|
||||
meaning:
|
||||
case result.verdict do
|
||||
:tov ->
|
||||
grounding_note =
|
||||
case result.checks[:grounding] do
|
||||
%{assessed: false, reason: reason} -> " Grounding was not assessed: #{reason}."
|
||||
_ -> ""
|
||||
end
|
||||
|
||||
"None of the three checks fired on what the examination could read. " <>
|
||||
"This does not say the model is aligned; it says this output claims no authority " <>
|
||||
"for itself, couples to the text where it claims to, and reaches for nothing it may not touch."
|
||||
"This does not say the model is aligned, and it does not say the output is true; it says this " <>
|
||||
"output claims no authority for itself, rests its claims on what it was given where it " <>
|
||||
"could be checked, and reaches for nothing it may not touch." <> grounding_note
|
||||
|
||||
:lo_tov ->
|
||||
"At least one check fired. The violations say which rule, and the checks say what it fired on."
|
||||
|
||||
Reference in new issue
Block a user