sugya, step 2: the exemptions are read from the facts, not kept as constants

specs/sugya.md §IV "drives the code", §V step 2. Behaviour unchanged;
the reason is now where the behaviour is read from:

- @single_witness_forms is gone. Which forms stand on one witness is
  Sugya.single_witness_forms/0 — every exception(lo_taaseh_lekha,
  single_witness(F), _) — and the fact's verse is the reason (Vayikra
  22:20: a mark on the offering, not a deed of recurrence).
- The hedged claim is omitted from the coupling trace only because
  exception(golden_calf, hedged, Devarim 18:22) says so; with the fact
  removed, "perhaps" would be counted.
- "No sources given and the output invokes none" reports assessed:
  false only because exception(golden_calf, no_ground_given, Shemot
  32:4) says so (tablet 49); with the fact removed, those claims would
  be calves.

Sugya.exceptions_of/2, exception?/3, single_witness_forms/1 read the
Doorpost file once into :persistent_term (the file is the image's
identity); a synthetic root reads fresh. Tests: the forms excepted are
exactly [forged_fringe]; the two golden_calf exemptions are facts; with
the fact removed from a mirror, the exemption is gone. Elixir 659/0;
the existing bedikah and gate tests prove the behaviour did not move.
Doorpost pin unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Scott KarpandClaude Fable 5.1 committed 2026-10-25 01:18:04 +00:00
1 parent dba056bd80
commit 1ad2c3ec40
3 files changed
+88 -6

No files matched your search

+27
View File
@@ -48,6 +48,33 @@ defmodule VavPipeline.SugyaTest do
assert Sugya.for_rule("no_such_rule") == nil
end
describe "the code reads its exemptions from the facts (step 2)" do
test "the single-witness forms are those the sugya excepts, and only those" do
assert Sugya.single_witness_forms() == ["forged_fringe"]
end
test "the hedged and no-ground exemptions of golden_calf are facts, not constants" do
assert Sugya.exception?("golden_calf", "hedged")
assert Sugya.exception?("golden_calf", "no_ground_given")
refute Sugya.exception?("golden_calf", "anything_at_all")
refute Sugya.exception?("chelbenah", "hedged")
end
test "with the fact removed, the exemption is gone: behaviour is read from the reason" do
temp = Path.join(System.tmp_dir!(), "sugya_step2_#{System.unique_integer([:positive])}")
rel = "talmudic_engine/src/halt/sugya.pl"
File.mkdir_p!(Path.dirname(Path.join(temp, rel)))
File.cp!(Path.join(Doorpost.repo_root(), rel), Path.join(temp, rel))
on_exit(fn -> File.rm_rf!(temp) end)
assert Sugya.single_witness_forms(temp) == ["forged_fringe"]
path = Path.join(temp, rel)
File.write!(path, String.replace(File.read!(path), "exception(lo_taaseh_lekha, single_witness(forged_fringe), verse(vayikra, 22, 20)).", ""))
assert Sugya.single_witness_forms(temp) == []
File.write!(path, String.replace(File.read!(path), "exception(golden_calf, hedged, verse(devarim, 18, 22)).", ""))
refute Sugya.exception?("golden_calf", "hedged", temp)
end
end
describe "drift (synthetic spec root)" do
setup do
temp = Path.join(System.tmp_dir!(), "sugya_test_#{System.unique_integer([:positive])}")