tablet 58: the tool's answer is given — tool results are sources; markers on word boundaries
The sugya reply came back lo_tov — golden_calf on two sentences the builder had just read from tool output (the Mishnah's reasons, from the second scroll; the commit and pod, from its own tools). The gate's sources were only the user turns' text and document blocks; a tool_result block and a tool turn — what the model was GIVEN (tablet 49) — were not counted. And "shorashim-675b…" was vital because the insight markers matched "Rashi" inside it. - Shape.sources: Anthropic tool_result blocks (string or blocks) inside a user turn, and OpenAI role "tool" turns, are sources; the query is still the last user turn. gate_test: both shapes. - zerikah._INSIGHT_MARKERS: \b…\b. test_zerikah: the pod name is not Rashi; "Rashi reads" and "The Mishnah records" are; "Rambanovich" and "talmudic_engine" are not. - Tablet 58 in the Broken Tablets. Elixir 643/0, korban 294/0. Doorpost pin unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
dc93805877
commit
ad27d3c037
5 files changed
+97
-3
No files matched your search
@@ -52,9 +52,10 @@ defmodule VavPipeline.Gate.Shape do
|
||||
# sources pass the cap — a coding agent's conversation runs to megabytes.
|
||||
@max_source_bytes 1_048_576
|
||||
|
||||
# A "tool" turn (OpenAI) is what a tool returned to the model: given, a source (tablet 58).
|
||||
defp user_sources(messages, text_fun) do
|
||||
messages
|
||||
|> Enum.filter(&(&1["role"] == "user"))
|
||||
|> Enum.filter(&(&1["role"] in ["user", "tool"]))
|
||||
|> Enum.with_index(1)
|
||||
|> Enum.flat_map(fn {m, i} -> text_fun.(m) |> wrap("user_#{i}") end)
|
||||
|> Enum.reverse()
|
||||
@@ -93,6 +94,11 @@ defmodule VavPipeline.Gate.Shape do
|
||||
%{"type" => "text", "text" => t} when is_binary(t) -> [t]
|
||||
%{"type" => "document", "source" => %{"type" => "text", "data" => t}} when is_binary(t) -> [t]
|
||||
%{"type" => "document", "source" => %{"type" => "content", "content" => inner}} when is_list(inner) -> [text_of_blocks(inner)]
|
||||
# Tablet 58: what a tool returned to the model was GIVEN to it
|
||||
# (tablet 49) — a file it read, a reply from a service, the scroll
|
||||
# it consulted. A claim that rests on it rests on a source.
|
||||
%{"type" => "tool_result", "content" => c} when is_binary(c) -> [c]
|
||||
%{"type" => "tool_result", "content" => inner} when is_list(inner) -> [text_of_blocks(inner)]
|
||||
_ -> []
|
||||
end)
|
||||
|> Enum.join("\n")
|
||||
|
||||
Reference in new issue
Block a user