Tutorial: Your First Encoding¶
This tutorial walks you through encoding your first seif into Mistaber using the complete mistaber-skills workflow. You will encode YD 89:1 (waiting between meat and dairy) from start to commit, learning the five-phase process with checkpoint approvals at each stage.
Duration: 2-3 hours Difficulty: Beginner Target Seif: Yoreh Deah 89:1
What You Will Encode¶
Shulchan Aruch Yoreh Deah 89:1 addresses the waiting period required after eating meat before one may eat dairy:
"One who ate meat should not eat cheese afterward until the time between one meal and another has passed, which is approximately six hours."
This is an excellent first encoding because:
- Simple structure: One clear ruling without complex branching
- Universal agreement: Mechaber and Rema agree on the basic rule (though minhagim vary on timing)
- Clear madrega: D'rabanan prohibition with clear Talmudic source
- Minimal machloket: The main text is uncontested
Prerequisites Verification¶
Before starting, verify your environment is correctly configured.
Step 1: Verify Plugin Installation¶
Check that the mistaber-skills plugin is installed:
Expected output:
Step 2: Verify Sefaria MCP¶
Test that the Sefaria MCP server is configured:
You should see the Hebrew and English text of the seif.
Step 3: Verify Mistaber Repository¶
Ensure you're in the Mistaber repository:
You should be on a clean working directory (or a feature branch for this encoding).
Phase 1: Corpus Preparation¶
The first phase fetches and organizes all source texts needed to encode the seif.
Step 1.1: Invoke the Corpus-Prep Skill¶
Start the encoding session:
The corpus-prep skill will:
- Validate the reference "Shulchan Arukh, Yoreh De'ah 89:1"
- Fetch the primary text from Sefaria (Hebrew and English)
- Fetch relevant commentaries (Shach, Taz, Rema gloss)
- Build the derivation chain to Talmudic sources
- Identify any machloket between authorities
- Generate a corpus report for your review
Step 1.2: Review the Corpus Report¶
The skill generates corpus-report-YD-89-1.md. Review it carefully:
Sample Corpus Report (Expand)
# Corpus Report: YD 89:1
## Primary Source
**Shulchan Aruch Yoreh Deah 89:1**
### Hebrew Text
אכל בשר לא יאכל גבינה אחריו עד שישהה שיעור סעודה אחרת שהוא
כשש שעות
### English Translation
One who ate meat should not eat cheese afterward until the time
between one meal and another has passed, which is approximately
six hours.
## Rema Gloss
No explicit gloss on this seif. Rema's silence indicates agreement
with the Mechaber's basic ruling.
**Note**: Rema adds customs regarding waiting period in later seifim
and in Darkei Moshe.
## Commentary Classification
| Commentary | Status | Notes |
|------------|--------|-------|
| Shach | TIER 1 | Clarifies "approximately six hours" |
| Taz | TIER 1 | Discusses source and variations |
| Pri Megadim | TIER 2 | Extends to all meat types |
## Derivation Chain
```mermaid
graph TD
Torah["Torah<br/>Not explicit for meat→dairy wait"] --> Gemara
Gemara["Chullin 105a<br/>Mar Ukva's statement"] --> Rambam
Rambam["Rambam Hilchot Ma'achalot Assurot 9:28"] --> Tur
Tur["Tur YD 89"] --> SA
SA["SA YD 89:1<br/>Primary encoding target"]
Source: Chullin 105a¶
Mar Ukva said: "My father, when he would eat meat, would not eat cheese until the next meal. But I, in the same meal..."
This establishes the concept of waiting "between meals."
Machloket Identification¶
No machloket identified for this specific seif.
The main text (six-hour wait) is universally accepted. Variations in community practice (1/3/6 hours) are minhag-based additions in later worlds, not disputes with this seif.
Complexity Score: 3/10¶
- Single ruling without branches
- Clear derivation chain
- No machloket with Rema
- Standard predicate usage
Questions for Human Review¶
- Should the encoding include the "approximately" (כשש) qualifier, or treat six hours as the fixed standard?
-
[Default: Fixed standard of 6 hours]
-
Does this seif cover ALL meat types (beheima, chaya, of, dag), or should that be derived from YD 87?
- [Default: All meat that requires waiting per YD 87] ```
Step 1.3: Answer Questions¶
Respond to any questions the skill raised:
User: "Approved. Answers:
1. Encode six hours as the standard. The 'approximately' qualifier
can be noted in comments.
2. Cover all meat types that create basar bechalav concerns per YD 87
(beheima, chaya, of). Fish (dag) does not require waiting."
Checkpoint 1: Corpus Approval¶
Before proceeding to encoding, verify:
- [ ] Primary source text is accurate and complete
- [ ] Derivation chain reaches Talmudic source
- [ ] All TIER 1 commentaries are included
- [ ] Machloket (if any) is correctly identified
- [ ] Questions have been answered
Phase 2: HLL Encoding¶
The second phase transforms the approved corpus into formal HLL/ASP rules.
Step 2.1: Invoke the HLL-Encode Skill¶
The hll-encode skill will:
- Load the approved corpus
- Map statements to predicates from the registry
- Generate base definitions and helper predicates
- Generate world-specific rules with makor chains
- Create an encoding report for review
Step 2.2: Review Generated Rules¶
The skill generates encoding artifacts. Let's examine what was created:
Generated: corpus/yd_89/base.lp
% mistaber/ontology/corpus/yd_89/base.lp
% Yoreh Deah Siman 89: Waiting Between Meat and Dairy
%
% This file contains the foundational predicates and rules for reasoning
% about the required waiting period between eating meat and dairy,
% as codified in Shulchan Aruch Yoreh Deah 89.
%
% Source: SA YD 89:1
% "One who ate meat should not eat cheese afterward until the time
% between one meal and another has passed, which is approximately
% six hours."
% === Include Schema ===
#include "../../schema/sorts.lp".
% === Waiting Period Concepts ===
% Time units for waiting period
waiting_hours(6). % Standard waiting period (SA YD 89:1)
% Types of meat that require waiting
% Based on YD 87 basar bechalav categories
requires_waiting_before_dairy(beheima). % Domesticated animal
requires_waiting_before_dairy(chaya). % Wild animal
requires_waiting_before_dairy(of). % Poultry
% Fish does NOT require waiting before dairy
% (Though Mechaber considers fish+dairy sakana, there's no waiting)
no_waiting_required(dag).
% === Waiting State Predicates ===
% Predicate: person has eaten meat type
% ate_meat(Person, MeatType)
% Predicate: waiting period completed
% waiting_completed(Person, Hours)
% Predicate: may now eat dairy
% may_eat_dairy(Person)
% === Helper Rules ===
% Determine if meat type requires waiting
meat_requires_waiting(MeatType) :-
requires_waiting_before_dairy(MeatType).
% Waiting is complete when required hours have passed
waiting_satisfied(Person) :-
ate_meat(Person, MeatType),
meat_requires_waiting(MeatType),
waiting_completed(Person, Hours),
waiting_hours(Required),
Hours >= Required.
% May eat dairy if no meat was eaten OR waiting is complete
may_eat_dairy(Person) :-
not ate_any_requiring_meat(Person).
may_eat_dairy(Person) :-
waiting_satisfied(Person).
% Helper: ate any meat requiring waiting
ate_any_requiring_meat(Person) :-
ate_meat(Person, MeatType),
meat_requires_waiting(MeatType).
% === Show Directives ===
#show waiting_hours/1.
#show requires_waiting_before_dairy/1.
#show meat_requires_waiting/1.
#show waiting_satisfied/1.
#show may_eat_dairy/1.
Generated: worlds/mechaber.lp additions
% ============================================================================
% YOREH DEAH SIMAN 89: WAITING BETWEEN MEAT AND DAIRY
% ============================================================================
% ----------------------------------------------------------------------------
% YD 89:1 - STANDARD WAITING PERIOD: 6 HOURS
% ----------------------------------------------------------------------------
% "One who ate meat should not eat cheese afterward until the time
% between one meal and another has passed, which is approximately
% six hours."
%
% This is a rabbinic enactment based on Mar Ukva's statement in
% Chullin 105a. The "six hours" represents the typical interval
% between meals.
%
% Source: SA YD 89:1
% Derivation: Chullin 105a (Mar Ukva)
% === Rule: Waiting Period Required After Meat ===
rule(r_waiting_after_meat).
makor(r_waiting_after_meat, sa("yd:89:1")).
makor(r_waiting_after_meat, gemara("Chullin 105a")).
makor(r_waiting_after_meat, rambam("ma:9:28")).
madrega(r_waiting_after_meat, d_rabanan).
scope(r_waiting_after_meat, mechaber).
% Eating dairy without waiting is forbidden
asserts(mechaber, issur(achiila_dairy, Person, d_rabanan)) :-
ate_meat(Person, MeatType),
meat_requires_waiting(MeatType),
not waiting_satisfied(Person).
% === Rule: Six Hour Standard ===
rule(r_waiting_six_hours).
makor(r_waiting_six_hours, sa("yd:89:1")).
scope(r_waiting_six_hours, mechaber).
asserts(mechaber, required_waiting_hours(6)).
% === Rule: Dairy Permitted After Waiting ===
rule(r_dairy_after_waiting).
makor(r_dairy_after_waiting, sa("yd:89:1")).
scope(r_dairy_after_waiting, mechaber).
asserts(mechaber, heter(achiila_dairy, Person)) :-
waiting_satisfied(Person).
asserts(mechaber, heter(achiila_dairy, Person)) :-
not ate_any_requiring_meat(Person).
% === Include Base Definitions ===
#include "../corpus/yd_89/base.lp".
Step 2.3: Review the Encoding Report¶
The skill generates encoding-report-YD-89-1.md:
Sample Encoding Report (Expand)
# Encoding Report: YD 89:1
## Summary
| Metric | Value |
|--------|-------|
| Rules Created | 3 |
| Predicates Used | 8 |
| New Predicates | 2 |
| Files Modified | 2 |
## Rules Generated
### r_waiting_after_meat
- **Type**: Normative (issur)
- **Madrega**: d_rabanan
- **Scope**: mechaber
- **Makor**: sa("yd:89:1"), gemara("Chullin 105a"), rambam("ma:9:28")
**Logic**: Eating dairy is forbidden (d_rabanan) when person has eaten
meat requiring waiting and waiting period is not satisfied.
### r_waiting_six_hours
- **Type**: Declarative
- **Scope**: mechaber
- **Makor**: sa("yd:89:1")
**Logic**: Asserts the six-hour standard waiting period.
### r_dairy_after_waiting
- **Type**: Normative (heter)
- **Scope**: mechaber
- **Makor**: sa("yd:89:1")
**Logic**: Eating dairy is permitted when waiting is complete or no
relevant meat was consumed.
## Statement-to-Rule Mapping
| Source Statement | Rule ID | Predicate |
|------------------|---------|-----------|
| "should not eat cheese afterward" | r_waiting_after_meat | issur/3 |
| "approximately six hours" | r_waiting_six_hours | required_waiting_hours/1 |
| [implicit permission after wait] | r_dairy_after_waiting | heter/2 |
## Predicate Usage
| Predicate | Sort | Source |
|-----------|------|--------|
| issur/3 | action, subject, madrega | Core ontology |
| heter/2 | action, subject | Core ontology |
| ate_meat/2 | person, meat_type | **NEW** |
| waiting_completed/2 | person, hours | **NEW** |
| waiting_satisfied/1 | person | Derived |
| may_eat_dairy/1 | person | Derived |
## Pre-Compile Validation
- [x] All rules have makor citations
- [x] All normative rules have madrega
- [x] All rules have scope
- [x] No unknown predicates used
- [x] Rule IDs are semantic (r_waiting_*, not r_89_1)
- [x] No 'invalid' in override values
## Files Modified
1. `mistaber/ontology/corpus/yd_89/base.lp` - Created
2. `mistaber/ontology/worlds/mechaber.lp` - Appended
Step 2.4: Verify Encoding Quality¶
Check for common issues:
Encoding Verification
- [ ] Rule IDs are semantic (
r_waiting_after_meat, notr_89_1) - [ ] Every rule has at least one
makorcitation - [ ] Normative rules have
madrega(d_oraita/d_rabanan) - [ ] All rules have
scopespecification - [ ] World inheritance is correct (Rema should inherit if agreeing)
- [ ] Predicates match the registry
Checkpoint 2: Encoding Approval¶
Before proceeding to validation:
- [ ] Rules accurately represent the source text
- [ ] Predicate selection is appropriate
- [ ] World scoping is correct
- [ ] Makor chain is complete
- [ ] Pre-compile validation passes
Phase 3: Validation¶
The third phase compiles the rules and verifies correctness through automated testing.
Step 3.1: Invoke the Validate Skill¶
The validate skill will:
- Compile HLL to ASP
- Test grounding with Clingo
- Verify satisfiability (SAT)
- Run semantic validation checks
- Execute generated test scenarios
- Run regression tests on existing rules
Step 3.2: Review Compilation Results¶
Compilation Output
=== HLL Compilation ===
Input: mistaber/ontology/corpus/yd_89/base.lp
mistaber/ontology/worlds/mechaber.lp
Compilation: SUCCESS
Grounding: SUCCESS (0.23s)
Satisfiability: SAT
=== Semantic Checks ===
[PASS] All rule IDs start with 'r_'
[PASS] No siman:seif rule naming
[PASS] All normative rules have makor
[PASS] All normative rules have madrega
[PASS] No 'invalid' in override values
[PASS] No OWA predicate negation
=== Sort Verification ===
[PASS] ate_meat/2 sorts: (person, meat_type)
[PASS] waiting_completed/2 sorts: (person, number)
[PASS] issur/3 sorts: (action, subject, madrega)
Step 3.3: Review Test Results¶
The skill generates and runs test scenarios:
Generated Tests: tests/corpus/yd_89/test_waiting.py
"""Tests for YD 89:1 - Waiting between meat and dairy."""
import pytest
from mistaber import query
class TestWaitingAfterMeat:
"""Tests for the waiting period requirement."""
@pytest.fixture
def person_ate_beef(self):
"""Person who ate beef (beheima)."""
return """
ate_meat(reuven, beheima).
"""
@pytest.fixture
def person_ate_beef_waited(self):
"""Person who ate beef and waited 6 hours."""
return """
ate_meat(reuven, beheima).
waiting_completed(reuven, 6).
"""
@pytest.fixture
def person_ate_fish(self):
"""Person who ate fish (no waiting required)."""
return """
ate_meat(reuven, dag).
"""
# === Positive Tests (5 minimum) ===
def test_issur_without_waiting(self, person_ate_beef):
"""Eating dairy without waiting is forbidden."""
result = query(person_ate_beef, world="mechaber")
assert result.holds("issur(achiila_dairy, reuven, d_rabanan)")
def test_heter_after_waiting(self, person_ate_beef_waited):
"""Eating dairy after waiting is permitted."""
result = query(person_ate_beef_waited, world="mechaber")
assert result.holds("heter(achiila_dairy, reuven)")
assert result.holds("waiting_satisfied(reuven)")
def test_beheima_requires_waiting(self, person_ate_beef):
"""Beheima (beef) requires waiting."""
result = query(person_ate_beef, world="mechaber")
assert result.holds("meat_requires_waiting(beheima)")
def test_chaya_requires_waiting(self):
"""Chaya (wild animal) requires waiting."""
setup = "ate_meat(shimon, chaya)."
result = query(setup, world="mechaber")
assert result.holds("meat_requires_waiting(chaya)")
assert result.holds("issur(achiila_dairy, shimon, d_rabanan)")
def test_of_requires_waiting(self):
"""Of (poultry) requires waiting."""
setup = "ate_meat(levi, of)."
result = query(setup, world="mechaber")
assert result.holds("meat_requires_waiting(of)")
# === Negative Tests (3 minimum) ===
def test_fish_no_waiting_required(self, person_ate_fish):
"""Fish does not require waiting before dairy."""
result = query(person_ate_fish, world="mechaber")
assert not result.holds("meat_requires_waiting(dag)")
assert result.holds("may_eat_dairy(reuven)")
def test_no_meat_no_issur(self):
"""Person who ate no meat has no issur."""
setup = "" # Empty - no meat eaten
result = query(setup, world="mechaber")
# No issur should exist for any person
assert not result.holds("issur(achiila_dairy, _, _)")
def test_partial_waiting_still_forbidden(self):
"""Partial waiting (less than 6 hours) is still forbidden."""
setup = """
ate_meat(yehuda, beheima).
waiting_completed(yehuda, 3).
"""
result = query(setup, world="mechaber")
# 3 hours < 6 hours required
assert not result.holds("waiting_satisfied(yehuda)")
assert result.holds("issur(achiila_dairy, yehuda, d_rabanan)")
# === Edge Cases (2 minimum) ===
def test_exact_six_hours_permitted(self):
"""Exactly 6 hours of waiting is sufficient."""
setup = """
ate_meat(david, beheima).
waiting_completed(david, 6).
"""
result = query(setup, world="mechaber")
assert result.holds("waiting_satisfied(david)")
assert result.holds("heter(achiila_dairy, david)")
def test_multiple_meat_types_longest_waiting(self):
"""Multiple meat types still require standard waiting."""
setup = """
ate_meat(moshe, beheima).
ate_meat(moshe, of).
waiting_completed(moshe, 6).
"""
result = query(setup, world="mechaber")
assert result.holds("waiting_satisfied(moshe)")
class TestWorldInheritance:
"""Tests for world inheritance of waiting rules."""
@pytest.fixture
def standard_scenario(self):
return "ate_meat(person1, beheima)."
def test_rema_inherits_waiting(self, standard_scenario):
"""Rema inherits the waiting requirement from Mechaber."""
result = query(standard_scenario, world="rema")
assert result.holds("issur(achiila_dairy, person1, d_rabanan)")
def test_sefardi_yo_inherits(self, standard_scenario):
"""Sefardi YO inherits from Mechaber."""
result = query(standard_scenario, world="sefardi_yo")
assert result.holds("issur(achiila_dairy, person1, d_rabanan)")
def test_ashk_mb_inherits(self, standard_scenario):
"""Ashk MB inherits from Rema."""
result = query(standard_scenario, world="ashk_mb")
assert result.holds("issur(achiila_dairy, person1, d_rabanan)")
Test Execution Results
============================= test session starts ==============================
platform linux -- Python 3.11.5, pytest-7.4.3
collected 13 items
tests/corpus/yd_89/test_waiting.py::TestWaitingAfterMeat::test_issur_without_waiting PASSED
tests/corpus/yd_89/test_waiting.py::TestWaitingAfterMeat::test_heter_after_waiting PASSED
tests/corpus/yd_89/test_waiting.py::TestWaitingAfterMeat::test_beheima_requires_waiting PASSED
tests/corpus/yd_89/test_waiting.py::TestWaitingAfterMeat::test_chaya_requires_waiting PASSED
tests/corpus/yd_89/test_waiting.py::TestWaitingAfterMeat::test_of_requires_waiting PASSED
tests/corpus/yd_89/test_waiting.py::TestWaitingAfterMeat::test_fish_no_waiting_required PASSED
tests/corpus/yd_89/test_waiting.py::TestWaitingAfterMeat::test_no_meat_no_issur PASSED
tests/corpus/yd_89/test_waiting.py::TestWaitingAfterMeat::test_partial_waiting_still_forbidden PASSED
tests/corpus/yd_89/test_waiting.py::TestWaitingAfterMeat::test_exact_six_hours_permitted PASSED
tests/corpus/yd_89/test_waiting.py::TestWaitingAfterMeat::test_multiple_meat_types_longest_waiting PASSED
tests/corpus/yd_89/test_waiting.py::TestWorldInheritance::test_rema_inherits_waiting PASSED
tests/corpus/yd_89/test_waiting.py::TestWorldInheritance::test_sefardi_yo_inherits PASSED
tests/corpus/yd_89/test_waiting.py::TestWorldInheritance::test_ashk_mb_inherits PASSED
============================== 13 passed in 2.34s ==============================
=== Test Coverage ===
Positive tests: 5 (minimum: 5) [PASS]
Negative tests: 3 (minimum: 3) [PASS]
Edge cases: 2 (minimum: 2) [PASS]
Multi-world tests: 3 [PASS]
=== Regression Tests ===
Running existing test suite...
tests/corpus/yd_87/ ... 47 passed
tests/worlds/ ... 23 passed
Total: 70 passed, 0 failed
NO REGRESSIONS DETECTED
Step 3.4: Review Performance Metrics¶
Performance Metrics
Checkpoint 3: Validation Approval¶
Before proceeding to review:
- [ ] Compilation successful (no syntax errors)
- [ ] Program is SAT (no contradictions)
- [ ] All semantic checks pass
- [ ] All generated tests pass
- [ ] No regression failures
- [ ] Performance is acceptable
Phase 4: Review Package¶
The fourth phase assembles a comprehensive review package for final human approval.
Step 4.1: Invoke the Review Skill¶
The review skill will:
- Create executive summary
- Display source-to-rule mapping
- Show encoded rules with highlighting
- Present validation evidence
- Generate halachic accuracy checklist
- Generate technical accuracy checklist
Step 4.2: Complete the Halachic Checklist¶
Halachic Accuracy Checklist
## Halachic Accuracy Checklist
Complete each item by verifying against the sources:
### Source Fidelity
- [x] Encoding matches SA YD 89:1 text
- [x] Six-hour wait correctly encoded as standard
- [x] Madrega (d_rabanan) correctly identified
- [x] Gemara source (Chullin 105a) properly cited
### Scope Verification
- [x] Applies to beheima (domesticated animal) - CORRECT
- [x] Applies to chaya (wild animal) - CORRECT
- [x] Applies to of (poultry) - CORRECT
- [x] Does NOT apply to dag (fish) - CORRECT
### Authority Attribution
- [x] Mechaber is primary authority for this ruling
- [x] Rema has no gloss (silence = agreement) - CORRECT
- [x] Inheritance to all child worlds appropriate
### Practical Implications
- [x] Query "issur after meat, no waiting" returns issur - VERIFIED
- [x] Query "heter after 6 hours" returns heter - VERIFIED
- [x] Query "fish, no waiting" returns no issur - VERIFIED
Step 4.3: Complete the Technical Checklist¶
Technical Accuracy Checklist
## Technical Accuracy Checklist
Complete each item by reviewing the generated code:
### Naming Conventions
- [x] Rule IDs are semantic (r_waiting_*, not r_89_1)
- [x] Predicate names are descriptive
- [x] File names follow conventions
### Metadata Completeness
- [x] All rules have rule/1 declaration
- [x] All rules have at least one makor/2
- [x] Normative rules have madrega/2
- [x] All rules have scope/2
### Code Quality
- [x] File header comments present
- [x] Section comments for rule groups
- [x] Inline comments for complex logic
- [x] Follows existing patterns in codebase
### World Structure
- [x] Rules in correct world(s)
- [x] Inheritance is correct
- [x] No unnecessary overrides
- [x] Child worlds verified
### Testing
- [x] Minimum test counts met
- [x] All tests pass
- [x] No regressions
- [x] Performance acceptable
Step 4.4: Run Interactive Queries¶
Test the encoding interactively:
from pathlib import Path
from mistaber.engine import HsrsEngine
engine = HsrsEngine(Path("mistaber/ontology"))
# Test 1: Person ate beef, no waiting
scenario1 = """
ate_meat(reuven, beheima).
"""
result1 = engine.analyze(scenario1, world="mechaber")
print("After beef, no waiting:")
for atom in result1["atoms"]:
if "issur" in atom or "heter" in atom:
print(f" {atom}")
# Test 2: Person ate beef, waited 6 hours
scenario2 = """
ate_meat(reuven, beheima).
waiting_completed(reuven, 6).
"""
result2 = engine.analyze(scenario2, world="mechaber")
print("\nAfter beef, waited 6 hours:")
for atom in result2["atoms"]:
if "issur" in atom or "heter" in atom or "waiting" in atom:
print(f" {atom}")
# Test 3: Person ate fish
scenario3 = """
ate_meat(shimon, dag).
"""
result3 = engine.analyze(scenario3, world="mechaber")
print("\nAfter fish (no waiting required):")
for atom in result3["atoms"]:
if "may_eat" in atom:
print(f" {atom}")
Expected output:
After beef, no waiting:
issur(achiila_dairy, reuven, d_rabanan)
After beef, waited 6 hours:
heter(achiila_dairy, reuven)
waiting_satisfied(reuven)
After fish (no waiting required):
may_eat_dairy(shimon)
Checkpoint 4: Final Approval¶
Before committing:
- [ ] Halachic accuracy checklist complete
- [ ] Technical accuracy checklist complete
- [ ] Interactive queries behave as expected
- [ ] All questions answered or documented
- [ ] Ready for permanent inclusion
Phase 5: Commit¶
The final phase organizes files and creates a git commit.
Step 5.1: Invoke the Commit Skill¶
The commit skill will:
- Verify all checkpoints are cleared
- Run final validation
- Organize files in correct locations
- Create a descriptive git commit
- Archive session artifacts
- Suggest next seif to encode
Step 5.2: Review the Commit¶
Git Commit
feat(corpus): encode YD 89:1 - waiting between meat and dairy
Encode SA Yoreh Deah 89:1: the requirement to wait between eating
meat and dairy. Six-hour waiting period is encoded as d_rabanan
prohibition based on Chullin 105a.
Rules added:
- r_waiting_after_meat: issur on dairy without waiting
- r_waiting_six_hours: six-hour standard
- r_dairy_after_waiting: heter after waiting complete
Coverage:
- Beheima, chaya, of require waiting
- Dag (fish) does not require waiting
- All worlds inherit from mechaber (no machloket)
Tests: 13 new tests (5 positive, 3 negative, 2 edge, 3 multi-world)
Makor: sa("yd:89:1"), gemara("Chullin 105a"), rambam("ma:9:28")
Files:
A mistaber/ontology/corpus/yd_89/base.lp
M mistaber/ontology/worlds/mechaber.lp
A tests/corpus/yd_89/test_waiting.py
A tests/corpus/yd_89/conftest.py
Step 5.3: Next Seif Suggestion¶
The skill suggests the next logical seif to encode:
=== Suggested Next Encoding ===
Consider encoding: YD 89:2
YD 89:2 addresses waiting from dairy to meat, which is
the inverse of YD 89:1. It introduces the concept that
dairy-to-meat waiting is significantly shorter (or none),
providing an interesting contrast.
Complexity: Low (builds on 89:1 concepts)
Dependencies: YD 89:1 (now complete)
Summary¶
Congratulations! You have successfully encoded your first seif through the complete mistaber-skills workflow:
| Phase | Skill | Duration | Key Action |
|---|---|---|---|
| 1. Corpus Prep | corpus-prep |
30 min | Fetch and organize sources |
| 2. HLL Encoding | hll-encode |
45 min | Transform to formal rules |
| 3. Validation | validate |
20 min | Compile and test |
| 4. Review | review |
30 min | Complete checklists |
| 5. Commit | commit |
10 min | Finalize and commit |
What You Created¶
- 2 new files:
corpus/yd_89/base.lp,tests/corpus/yd_89/test_waiting.py - 1 modified file:
worlds/mechaber.lp - 3 rules:
r_waiting_after_meat,r_waiting_six_hours,r_dairy_after_waiting - 13 tests: Covering positive, negative, edge, and multi-world scenarios
Key Lessons¶
- Single seif granularity: Focus on one seif at a time for tractable review
- Complete attribution: Every rule needs makor, madrega, and scope
- Checkpoint discipline: Human approval required at each phase
- Testing rigor: Meet minimum test counts before proceeding
- Semantic naming: Rule IDs describe content, not location
Next Steps¶
Now that you've completed your first encoding, continue with:
- Tutorial 02: Handling Machloket - Learn override semantics
- Tutorial 03: Complex Conditions - Context-sensitive rules
- Tutorial 04: Testing Strategies - Comprehensive test suites
- Tutorial 05: Review Process - Navigate reviews successfully
Quick Reference¶
ENCODING WORKFLOW COMMANDS
==========================
Start: "Prepare corpus for YD XX:Y"
Encode: "Encode the rules"
Validate: "Run validation"
Review: "Prepare review"
Commit: "Commit the encoding"
Resume: "Resume encoding session"
Status: "What is the current phase?"
CHECKPOINT APPROVALS
====================
"Checkpoint 1 approved" - After corpus review
"Checkpoint 2 approved" - After encoding review
"Checkpoint 3 approved" - After validation
"Checkpoint 4 approved" - After final review