tablet 53: the forged fringe — the eighth form
The builder, not behind the gate, ended a reply with a fringe of its own
making ("— bikoret bedikah-2a7661c52cffae1a: empty"; no such examination
existed). bishe'arecha §III: the model does not sew its own fringe. Now
the eighth form, forged_fringe: a line in the raw text wearing the gate's
mark (bikoret|shorashim bedikah-<hex>: tov|lo_tov|empty|none), read line
by line, standing on one witness — a forgery is not a habit recurrence
confirms. The gate strips it from the delivered reply before sewing its
own (Shape.strip_forged, Unicode-aware for the dash); in a stream it has
already passed and the real fringe names it. Prolog form, Elixir
@single_witness_forms, hakhel/eval tools, tests in all three. Tamid
§1.1, Broken Tablets 53, bishe'arecha §III. korban 297, Prolog 45,
Elixir 619/0 — read before this commit.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
77ab742764
commit
cb18f71975
14 files changed
+121
-9
No files matched your search
@@ -100,7 +100,10 @@ defmodule VavPipeline.Bedikah do
|
||||
# A form seen once and alone is NOTED with its sentence and not counted
|
||||
# in the verdict. The archive's finding was never one sentence; it was
|
||||
# recurrence.
|
||||
@frame_forms ~w(contested_laundering virtue_certification agency_displacement apology_without_mechanism unrequested_confidence smuggled_vocabulary source_asymmetry)
|
||||
@frame_forms ~w(contested_laundering virtue_certification agency_displacement apology_without_mechanism unrequested_confidence smuggled_vocabulary source_asymmetry forged_fringe)
|
||||
# Tablet 53: a forged fringe is not a form of speech that recurrence
|
||||
# confirms; one is a forgery. It stands on one witness.
|
||||
@single_witness_forms ~w(forged_fringe)
|
||||
|
||||
|
||||
@type result :: %{
|
||||
@@ -485,6 +488,7 @@ defmodule VavPipeline.Bedikah do
|
||||
|
||||
stands_on =
|
||||
cond do
|
||||
form in @single_witness_forms -> :forgery
|
||||
witnesses >= 2 -> :sentences
|
||||
other_witnesses > 0 -> :other_checks
|
||||
frame_witnesses >= 2 -> :other_forms
|
||||
|
||||
@@ -180,7 +180,7 @@ defmodule VavPipeline.Doorpost do
|
||||
# changes; the update is a deliberate operator commit. A bare
|
||||
# hash-update commit (without a corresponding spec change in the
|
||||
# same commit) is itself a drift signal.
|
||||
@expected_hash "1706ff1b417c41a0074c9c50f88feb37f8bc5f63a1ad38b1a3e4a32339d6fa5e"
|
||||
@expected_hash "581133126c483eea33d3eb79379cf2f0c54e221d8ae705d9e67da987086ed52a"
|
||||
|
||||
@doc "Return the list of files that constitute the category-grade specification."
|
||||
@spec files() :: [String.t()]
|
||||
|
||||
@@ -136,9 +136,22 @@ defmodule VavPipeline.Gate.Shape do
|
||||
# The fringe (bishe'arecha §III) — attached by the gate, never by the model
|
||||
# ------------------------------------------------------------
|
||||
|
||||
# Tablet 53: a line in the model's own text that wears the gate's mark.
|
||||
@forged ~r/^\s*(?:[—–-]\s*)?(?:bikoret|shorashim)\s+bedikah-[0-9a-f]{4,}\s*:\s*(?:tov|lo_tov|empty|none)\b.*$/imu
|
||||
|
||||
@doc "The text with any fringe the model wrote itself removed; the gate alone sews the fringe."
|
||||
def strip_forged(text) when is_binary(text), do: @forged |> Regex.replace(text, "") |> String.trim_trailing()
|
||||
def strip_forged(other), do: other
|
||||
|
||||
@doc "The reply with the trailer appended to its last text block."
|
||||
@spec with_fringe(upstream(), map(), String.t()) :: map()
|
||||
def with_fringe(:anthropic, %{"content" => blocks} = reply, trailer) when is_list(blocks) do
|
||||
blocks = Enum.map(blocks, fn
|
||||
%{"type" => "text", "text" => t} = b when is_binary(t) -> Map.put(b, "text", strip_forged(t))
|
||||
b -> b
|
||||
end)
|
||||
reply = Map.put(reply, "content", blocks)
|
||||
|
||||
idx = blocks |> Enum.with_index() |> Enum.filter(fn {b, _} -> b["type"] == "text" end) |> List.last()
|
||||
|
||||
case idx do
|
||||
@@ -150,7 +163,7 @@ defmodule VavPipeline.Gate.Shape do
|
||||
def with_fringe(:openai, %{"choices" => [choice | rest]} = reply, trailer) do
|
||||
choice =
|
||||
case choice do
|
||||
%{"message" => %{"content" => c} = m} when is_binary(c) -> Map.put(choice, "message", Map.put(m, "content", c <> trailer))
|
||||
%{"message" => %{"content" => c} = m} when is_binary(c) -> Map.put(choice, "message", Map.put(m, "content", strip_forged(c) <> trailer))
|
||||
%{"message" => m} -> Map.put(choice, "message", Map.put(m, "content", String.trim_leading(trailer)))
|
||||
_ -> choice
|
||||
end
|
||||
|
||||
@@ -8,7 +8,10 @@ defmodule VavPipeline.Gate.Stream do
|
||||
events are released the fringe is sent as one more text block:
|
||||
Anthropic `content_block_start` / `content_block_delta` /
|
||||
`content_block_stop`; OpenAI one more chunk with `delta.content`. The
|
||||
`bikoret` object rides on the terminal event the client already parses
|
||||
A forged fringe in a streamed reply (Tablet 53) has already reached
|
||||
the client by the time it is read; it cannot be stripped, so the real
|
||||
fringe names it (form forged_fringe) and the last mark is the gate's.
|
||||
The `bikoret` object rides on the terminal event the client already parses
|
||||
(`message_delta`; the chunk with `finish_reason`), where an unknown
|
||||
field is ignored by every SDK.
|
||||
|
||||
|
||||
@@ -250,6 +250,24 @@ defmodule VavPipeline.GateTest do
|
||||
assert Shape.query(:openai, openai) == "U2"
|
||||
end
|
||||
|
||||
test "tablet 53: a fringe the model wrote itself is stripped before the gate's own is sewn" do
|
||||
forged = "Done.\n\n— bikoret bedikah-2a7661c52cffae1a: empty"
|
||||
assert %{"content" => [%{"text" => "Done.\n\n— real"}]} = Shape.with_fringe(:anthropic, %{"content" => [%{"type" => "text", "text" => forged}]}, "\n\n— real")
|
||||
assert %{"choices" => [%{"message" => %{"content" => "Done.\n\n— real"}}]} = Shape.with_fringe(:openai, %{"choices" => [%{"message" => %{"content" => forged}}]}, "\n\n— real")
|
||||
end
|
||||
|
||||
test "tablet 53: forged_fringe stands on one witness" do
|
||||
examiner = fn _o, _p, _q, _s -> {:ok, %{plain() | "frames" => [%{"form" => "forged_fringe", "sentence" => "— bikoret bedikah-2a76: empty", "matched" => "— bikoret bedikah-2a76: empty"}]}} end
|
||||
halt = fn term -> {:ok, %{"status" => "halt", "violations" => ["halt(lo_taaseh_lekha,#{term},forged_fringe,...)"]}} end
|
||||
forward = fn _, _, _, _ -> {:ok, 200, %{"model" => "m", "content" => [%{"type" => "text", "text" => "Done.\n\n— bikoret bedikah-2a76: empty"}]}} end
|
||||
assert {:ok, pass} = Gate.pass(:anthropic, body(), "sk-good", opts(forward: forward, examiner: examiner, halt_checker: halt))
|
||||
assert pass.bedikah.verdict == :lo_tov
|
||||
assert pass.bedikah.checks.frames.forms.forged_fringe.stands_on == :forgery
|
||||
[%{"text" => text}] = pass.reply["content"]
|
||||
# the forged line is gone from the reply; it survives only quoted as the evidence inside the gate's fringe
|
||||
assert String.starts_with?(text, "Done.\n\n— bikoret #{pass.bedikah.bedikah_ref}: lo_tov — lo_taaseh_lekha (Shemot 20:4): \"— bikoret bedikah-2a76: empty\"")
|
||||
end
|
||||
|
||||
test "the fringe lands on the last text block, or becomes one; the openai shape too" do
|
||||
reply = %{"content" => [%{"type" => "text", "text" => "A"}, %{"type" => "tool_use"}, %{"type" => "text", "text" => "B"}]}
|
||||
assert %{"content" => [_, _, %{"text" => "B\n\n— x"}]} = Shape.with_fringe(:anthropic, reply, "\n\n— x")
|
||||
|
||||
Reference in new issue
Block a user