tablet 55, third: roots the engine can read; abstentions count; an empty trace is no ground
Live after the second commit (vav :046010f0): a monetary case naming bereishit 1:1 convened three judges and came back "accepted" — the interpret seat said "resolved (5 roots, 0 verses)" with reading(mitzvot_count(0),verse_count(0),grounded_in([],[])), the other two seats said teiku, and one accept beat two abstentions (the reply showed majority 1, minority 2). Three defects the tests could not see: - The engine names roots by letter (bet_resh_aleph; json_bridge reads "bet-resh-aleph") and the pipeline sent it the Hebrew, which its verse facts never match. BereishitCycle.engine_root_name/1 builds the engine's name from the Shoresh Engine's letter names or, for the L1 fallback, from the Hebrew with finals folded; the router sends that. (The cycle's own Talmudic routing still sends the Hebrew — recorded, not changed here: it alters /peah/ask and needs its own verification.) - judge.erl: "resolved" with no verse and no mitzvah is a reading coupled to nothing (avodah_zarah.pl Form 2); the judge abstains and says "resolved on an empty trace; nothing to stand on". - panel.erl: the majority is the verdict with the most votes, abstentions included; an abstaining plurality or an accept/reject tie is teiku. EUnit 57/0 (plurality, tie, empty trace). Elixir 632/0 (engine_root_name from names, from Hebrew, nil on nothing; the no-engine case is an abstaining majority of one, teiku). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
046010f0ed
commit
4bffa01e0e
7 files changed
+120
-7
No files matched your search
@@ -157,7 +157,16 @@ vote_from_consultation(Step, {ok, Map}, RootCount) ->
|
||||
Status = maps:get(status, Map, <<"teiku">>),
|
||||
Text = maps:get(text, Map, <<>>),
|
||||
Verses = maps:get(verses, Map, []),
|
||||
Grounding = maps:get(grounding, Map, []),
|
||||
case Status of
|
||||
<<"resolved">> when Verses =:= [], Grounding =:= [] ->
|
||||
%% The engine says "resolved" over an empty trace — no verse,
|
||||
%% no mitzvah. That is a reading that stands on nothing, and
|
||||
%% a vote to accept it would be the calf (avodah_zarah.pl
|
||||
%% Form 2: the uncoupled output). Abstain, and say why.
|
||||
{<<"Teiku — the reading is coupled to no verse and no mitzvah">>,
|
||||
reasoning(Step, <<"resolved on an empty trace; nothing to stand on">>, RootCount, Verses),
|
||||
[], abstain};
|
||||
<<"resolved">> ->
|
||||
{Text,
|
||||
reasoning(Step, <<"resolved">>, RootCount, Verses),
|
||||
|
||||
+10
-4
@@ -207,15 +207,21 @@ compute_majority_minority([]) ->
|
||||
torah_refs => [],
|
||||
vote_count => 0}};
|
||||
compute_majority_minority(Votes) ->
|
||||
%% Count accepts vs rejects
|
||||
Accepts = [V || V <- Votes, V#vote.verdict == accept],
|
||||
Rejects = [V || V <- Votes, V#vote.verdict == reject],
|
||||
Abstains = [V || V <- Votes, V#vote.verdict == abstain],
|
||||
NA = length(Accepts), NR = length(Rejects), NB = length(Abstains),
|
||||
|
||||
%% The majority is the verdict with the most votes — abstentions
|
||||
%% count (tablet 55: live, one accept "won" against two
|
||||
%% abstentions, and the reply showed majority 1, minority 2). An
|
||||
%% abstaining plurality, or an accept/reject tie, is teiku
|
||||
%% (determine_outcome reads the majority's verdict).
|
||||
{MajVotes, MinVotes} =
|
||||
case length(Accepts) >= length(Rejects) of
|
||||
true -> {Accepts, Rejects ++ Abstains};
|
||||
false -> {Rejects, Accepts ++ Abstains}
|
||||
if
|
||||
NA > NR, NA >= NB -> {Accepts, Rejects ++ Abstains};
|
||||
NR > NA, NR >= NB -> {Rejects, Accepts ++ Abstains};
|
||||
true -> {Abstains, Accepts ++ Rejects}
|
||||
end,
|
||||
|
||||
MajSample = case MajVotes of
|
||||
|
||||
@@ -506,6 +506,37 @@ majority_verdict_reject_test() ->
|
||||
{Maj, _Min} = panel:compute_majority_minority(Votes),
|
||||
?assertEqual(reject, maps:get(verdict, Maj)).
|
||||
|
||||
%% Tablet 55: abstentions count. One accept against two abstentions is
|
||||
%% not an accepting majority — it is teiku.
|
||||
majority_abstaining_plurality_is_teiku_test() ->
|
||||
Votes = [make_vote(accept), make_vote(abstain), make_vote(abstain)],
|
||||
{Maj, Min} = panel:compute_majority_minority(Votes),
|
||||
?assertEqual(abstain, maps:get(verdict, Maj)),
|
||||
?assertEqual(2, maps:get(vote_count, Maj)),
|
||||
?assertEqual(1, maps:get(vote_count, Min)),
|
||||
?assertEqual(teiku, panel:determine_outcome(Maj, Min, passed)).
|
||||
|
||||
majority_accept_reject_tie_is_teiku_test() ->
|
||||
Votes = [make_vote(accept), make_vote(reject)],
|
||||
{Maj, _Min} = panel:compute_majority_minority(Votes),
|
||||
?assertEqual(abstain, maps:get(verdict, Maj)),
|
||||
?assertEqual(0, maps:get(vote_count, Maj)).
|
||||
|
||||
%% Tablet 55: "resolved" over an empty trace — no verse, no mitzvah —
|
||||
%% is nothing to stand on; the judge abstains rather than accept.
|
||||
judge_resolved_on_empty_trace_abstains_test() ->
|
||||
{Pos, Reason, Refs, Verdict} =
|
||||
judge:vote_from_consultation(interpret,
|
||||
{ok, #{status => <<"resolved">>, text => <<"reading(0,0)">>, verses => [], grounding => []}}, 5),
|
||||
?assertEqual(abstain, Verdict),
|
||||
?assertEqual([], Refs),
|
||||
?assertMatch({_, _}, binary:match(Pos, <<"Teiku">>)),
|
||||
?assertMatch({_, _}, binary:match(Reason, <<"empty trace">>)),
|
||||
%% a mitzvah without a verse is still ground
|
||||
{_, _, _, V2} = judge:vote_from_consultation(interpret,
|
||||
{ok, #{status => <<"resolved">>, text => <<"r">>, verses => [], grounding => [<<"mitzvah(5)">>]}}, 1),
|
||||
?assertEqual(accept, V2).
|
||||
|
||||
%% ============================================================
|
||||
%% determine_outcome tests — accepted, rejected, teiku reachable
|
||||
%% ============================================================
|
||||
|
||||
Reference in new issue
Block a user