Skip to content

Review and Approval

The review phase assembles a comprehensive review package for final human expert approval. This is the last checkpoint before committing the encoding to the repository. The review skill presents all artifacts, checklists, and interactive testing capabilities for Checkpoint 4.

Purpose

The review skill accomplishes:

  1. Package Assembly: Compile all artifacts into a single review document
  2. Source Verification: Present original texts alongside encoded rules
  3. Checklist Generation: Provide halachic and technical verification checklists
  4. Interactive Testing: Enable human to test queries and verify behavior
  5. Final Documentation: Capture all decisions and open questions

Prerequisites

Before invoking this skill:

  1. Validate checkpoint MUST be approved
  2. Session state shows validate.status: approved
  3. All validation tests passed

Invoking the Skill

After validation approval:

User: "Prepare review"

The skill automatically:

  1. Assembles all artifacts
  2. Generates checklists
  3. Prepares interactive testing interface
  4. Presents the review package
  5. Awaits checklist completion and final approval

Review Package Assembly

The review package (review-package-YD-{siman}-{seif}.md) contains five major components.

Component 1: Executive Summary

A concise overview of the encoding:

## Executive Summary

**Reference:** Yoreh Deah 87:3
**Topic:** Fish and Dairy (Dag Bechalav)

### Encoding Metrics
| Metric | Value |
|--------|-------|
| Rules Encoded | 8 |
| Worlds Covered | base, mechaber, rema |
| Machloket Count | 1 |
| Complexity Score | 6/10 |

### Status
- Corpus Preparation: Approved (2026-01-25 10:30)
- HLL Encoding: Approved (2026-01-25 12:00)
- Validation: Passed (2026-01-25 15:30)

### Key Decisions Made
1. Encoded sakana as primary issur type for Mechaber position
2. Used override mechanism for Rema's disagreement
3. Included Taz and Shach citations in Rema's makor chain

Component 2: Source Verification

Present original sources for human verification:

## Source Verification

### Original Hebrew Text
```hebrew
דגים וחגבים אין בהם איסור בשר בחלב ומותר לבשלם בחלב ואסור לאכלם עם
הבשר מפני הסכנה

English Translation (Sefaria)

Fish and locusts have no prohibition of meat and milk, and it is permitted to cook them with milk. But it is forbidden to eat them with meat because of danger.

Translation Comparison

Version Text
Sefaria Community "Fish and locusts have no prohibition..."
Artscroll (if available) [Not in Sefaria]

Rema Gloss

The Rema is silent on this seif, implying he accepts the Mechaber's ruling on the cooking permission. However, later commentators clarify that Ashkenazi practice does not follow the sakana concern.

Derivation Chain

graph TD
    SA["SA YD 87:3"] --> BY["Beit Yosef"]
    BY --> MED["Medical Sources<br/>(Historical)"]
    SA --> SHACH["Shach sk 5"]
    SA --> TAZ["Taz sk 3"]
    SHACH --> NO_SAKANA["No current basis<br/>for sakana"]
    TAZ --> NO_SAKANA

Commentary Excerpts

Shach (sk 5)

"ואין נוהגין כן..." "We do not practice this [sakana prohibition]..."

Classification: DISPUTE - Shach implies Ashkenazi practice differs

Taz (sk 3)

"וטעם הדבר..." "The reason for the matter... the medical basis is no longer applicable"

Classification: PRACTICAL - Explains why sakana not observed

### Component 3: Encoding Review

Present the encoded rules with highlighting:

```markdown
## Encoding Review

### Base World Rules

```prolog
% === UNIVERSAL RULINGS ===
% These apply to all authorities
% NOTE: Topic-based naming (r_bb_dag_*), not siman-seif (r_87_3_*)

% Fish has no basar bechalav prohibition
rule(r_bb_dag_no_bb).
makor(r_bb_dag_no_bb, sa("yd:87:3")).
scope(r_bb_dag_no_bb, base).

asserts(base, no_bb_issur(M)) :-
    is_dag_chalav_mixture(M).

% Cooking fish with milk is permitted
rule(r_bb_dag_bishul_mutar).
makor(r_bb_dag_bishul_mutar, sa("yd:87:3")).
scope(r_bb_dag_bishul_mutar, base).

asserts(base, heter(bishul, M)) :-
    is_dag_chalav_mixture(M).

Mechaber World Rules

% === MECHABER (SEFARDI) ===
% Fish + dairy has SAKANA concern

rule(r_bb_dag_sakana).
makor(r_bb_dag_sakana, sa("yd:87:3")).
makor(r_bb_dag_sakana, beit_yosef("yd:87")).
scope(r_bb_dag_sakana, mechaber).

asserts(mechaber, sakana(M)) :-    % <-- KEY RULING
    is_dag_chalav_mixture(M).

asserts(mechaber, issur(achiila, M, sakana)) :-
    is_dag_chalav_mixture(M).

Rema World Rules

% === REMA (ASHKENAZI) ===
% DISAGREES - Fish + dairy is PERMITTED
% Authority prefix: r_rema_*

rule(r_rema_dag_chalav_mutar).
makor(r_rema_dag_chalav_mutar, rema("yd:87:3")).
makor(r_rema_dag_chalav_mutar, shach("yd:87:5")).
makor(r_rema_dag_chalav_mutar, taz("yd:87:3")).
scope(r_rema_dag_chalav_mutar, rema).

% Override Mechaber's sakana ruling
override(rema, sakana(M), no_sakana) :-    % <-- OVERRIDE
    is_dag_chalav_mixture(M).

asserts(rema, heter(achiila, M)) :-    % <-- OPPOSITE RULING
    is_dag_chalav_mixture(M).

asserts(rema, no_sakana(M)) :-
    is_dag_chalav_mixture(M).

Statement → Rule Traceability

Statement Rule ID Predicate World
s1: "דגים... אין איסור בשר בחלב" r_bb_dag_no_bb no_bb_issur base
s2: "מותר לבשלם בחלב" r_bb_dag_bishul_mutar heter(bishul) base
s3: "מפני הסכנה" r_bb_dag_sakana sakana, issur mechaber
s3 (Rema disagrees) r_rema_dag_chalav_mutar heter, no_sakana rema

World Inheritance Diagram

graph TD
    BASE["base<br/>no_bb_issur(M)<br/>heter(bishul, M)"] --> MECH["mechaber<br/>+ sakana(M)<br/>+ issur(achiila, M, sakana)"]
    BASE --> REMA["rema<br/>+ heter(achiila, M)<br/>+ no_sakana(M)<br/>override sakana"]
    MECH --> SEF["sefardi_yo<br/>(inherits sakana)"]
    REMA --> ASHK_MB["ashk_mb<br/>(inherits heter)"]
    REMA --> ASHK_AH["ashk_ah<br/>(inherits heter)"]

Machloket Details

Topic: dag_chalav (Fish and Dairy)

Aspect Mechaber Rema
Ruling Forbidden (sakana) Permitted
Basis Medical sources via Beit Yosef Ashkenazi practice, Shach/Taz clarification
Practical No lox + cream cheese, no fish in cream Lox + cream cheese OK, fish in cream sauce OK
Modern Yalkut Yosef follows Mishnah Berurah follows
### Component 4: Validation Evidence

Present test results and query outputs:

```markdown
## Validation Evidence

### Test Results

| Category | Passed | Failed | Total |
|----------|--------|--------|-------|
| Positive Tests | 10 | 0 | 10 |
| Negative Tests | 5 | 0 | 5 |
| Edge Cases | 3 | 0 | 3 |
| Machloket | 1 | 0 | 1 |
| Regression | 495 | 0 | 495 |

### Sample Queries

#### Query 1: Fish + Dairy in Mechaber World
>>> engine.ask("holds(sakana(m1), mechaber)", additional_facts='''
... food(salmon). food_type(salmon, dag).
... food(cream). food_type(cream, chalav).
... mixture(m1). contains(m1, salmon). contains(m1, cream).
... ''')
True

engine.analyze(''' ... food(salmon). food_type(salmon, dag). ... food(cream). food_type(cream, chalav). ... mixture(m1). contains(m1, salmon). contains(m1, cream). ... ''', world="mechaber")

Relevant atoms: - is_dag_chalav_mixture(m1) - sakana(m1) - issur(achiila, m1, sakana)

#### Query 2: Same Scenario in Rema World

engine.ask("holds(sakana(m1), rema)", additional_facts=...) False

engine.ask("holds(heter(achiila, m1), rema)", additional_facts=...) True

#### Query 3: Machloket Detection
engine.query("machloket(dag_chalav, A, B, M)", additional_facts=...) [{'A': 'mechaber', 'B': 'rema', 'M': 'm1'}]
### Derivation Tree Sample
holds(sakana(m1), mechaber) ├─ asserts(mechaber, sakana(m1)) │ ├─ is_dag_chalav_mixture(m1) │ │ ├─ mixture_has_basar(m1, dag) │ │ │ └─ food_type(salmon, dag) │ │ └─ mixture_has_chalav(m1) │ │ └─ food_type(cream, chalav) │ └─ rule(r_bb_dag_sakana) │ └─ makor(r_bb_dag_sakana, sa("yd:87:3")) └─ world(mechaber)

Component 5: Questions and Concerns

Document any open issues:

## Questions & Concerns

### Open Questions from Corpus Preparation

#### Q1: Sakana Scope
**Question:** Does the sakana prohibition include cooking or only eating?
**Context:** SA says "לאכלם" (to eat them), implying only eating.
**Resolution:** Encoded only for eating (achiila), not cooking (bishul).
**Confidence:** High - literal reading is clear.

#### Q2: Medical Basis
**Question:** Which medical sources did Beit Yosef rely on?
**Context:** Historical medical opinions no longer considered valid.
**Resolution:** Left as generic citation - specific sources unclear.
**Confidence:** Medium - historical attribution uncertain.

#### Q3: Rema's Position
**Question:** Why is Rema silent if he disagrees?
**Context:** Shach and Taz explain Ashkenazi practice differs.
**Resolution:** Encoded based on Shach/Taz clarification of Rema's intent.
**Confidence:** High - well-established understanding.

### Agent Uncertainty Flags

| Issue | Severity | Notes |
|-------|----------|-------|
| Shach sk 5 interpretation | Low | Multiple readings possible, chose standard |
| Modern Sefardi practice | Info | Some Sefardim follow Rema today |
| Locusts inclusion | Info | Encoded but locusts rare in practice |

### Recommended Follow-Up

1. **Consider YD 116 cross-reference** - General sakana rules may inform encoding
2. **Yalkut Yosef nuances** - Modern Sefardi chumrot not yet encoded
3. **Ashkenazi chumra for fish+meat** - Related topic, different seif

Checklists

Halachic Accuracy Checklist

The human reviewer must verify each item:

## Halachic Accuracy Checklist

Please verify each item by checking the box:

- [ ] **Ruling Accuracy:** Encoding accurately represents the SA's ruling
      - Fish has no BB issur: CORRECT?
      - Cooking permitted: CORRECT?
      - Eating with meat forbidden (sakana): CORRECT?

- [ ] **Conditions Complete:** All conditions from the source are captured
      - "מפני הסכנה" encoded as sakana: CORRECT?

- [ ] **Exceptions Encoded:** All exceptions are properly encoded
      - Rema's disagreement via override: CORRECT?

- [ ] **Madrega Correct:** d_oraita/d_rabanan/minhag levels are accurate
      - No madrega on sakana (not a Torah/rabbinic level): CORRECT?

- [ ] **Machloket Positions:** Both/all positions are accurately represented
      - Mechaber: sakana → issur: CORRECT?
      - Rema: no sakana → heter: CORRECT?

- [ ] **Makor Chain:** Source citations are accurate and complete
      - SA YD 87:3 as primary: CORRECT?
      - Beit Yosef for Mechaber reasoning: CORRECT?
      - Shach/Taz for Rema clarification: CORRECT?

- [ ] **Context Sensitivity:** Lechatchila/bedieved distinctions are correct
      - (Not applicable for this seif): CONFIRMED?

- [ ] **Practical Alignment:** Encoded rules match practical psak
      - Sefardim avoid fish+dairy: CONFIRMED?
      - Ashkenazim permit: CONFIRMED?

### Specific Verifications

1. SA YD 87:3 states: "דגים וחגבים אין בהם איסור בשר בחלב"
   - [ ] Encoded as `no_bb_issur(M)` for dag mixtures - CORRECT?

2. Mechaber holds fish + dairy = sakana
   - [ ] Encoded as `asserts(mechaber, sakana(M))` - CORRECT?

3. Rema/Ashkenazi practice permits
   - [ ] Encoded as `override` + explicit `heter` - CORRECT?

Technical Accuracy Checklist

## Technical Accuracy Checklist

Please verify each item:

- [ ] **Predicates:** Used correctly per [Predicate Registry](../reference/predicates.md)
      - sakana/1 exists: VERIFIED?
      - issur/3 arity correct: VERIFIED?
      - heter/2 arity correct: VERIFIED?

- [ ] **Variables:** Scoped properly (no unsafe vars)
      - M bound in rule bodies: VERIFIED?
      - No singleton variables: VERIFIED?

- [ ] **NAF:** Used appropriately for exceptions
      - No NAF used in this encoding: N/A

- [ ] **World Inheritance:** Leveraged correctly
      - Base rules inherited by all: VERIFIED?
      - Mechaber adds to base: VERIFIED?
      - Rema adds and overrides: VERIFIED?

- [ ] **Override Mechanism:** Used for disagreements
      - Third argument is descriptive (no_sakana): VERIFIED?
      - Override condition matches original: VERIFIED?

- [ ] **Style:** Follows project conventions
      - Topic-based rule IDs (r_bb_dag_*): VERIFIED?
      - Proper comment blocks: VERIFIED?
      - Consistent indentation: VERIFIED?

- [ ] **Comments:** Explain non-obvious logic
      - Machloket documented: VERIFIED?
      - Override explained: VERIFIED?

- [ ] **Rule IDs:** Follow naming convention
      - r_{topic}_{specific} pattern: VERIFIED?
      - No siman-seif numbers: VERIFIED?

Interactive Query Testing

The review phase enables human testing of queries.

CLI Examples

# Test specific scenario
mistaber -o ./mistaber/ontology analyze '''
food(lox). food_type(lox, dag).
food(cream_cheese). food_type(cream_cheese, chalav).
mixture(m1). contains(m1, lox). contains(m1, cream_cheese).
''' --world mechaber

# Compare across worlds
mistaber -o ./mistaber/ontology compare \
    "holds(sakana(M), W)" \
    --worlds mechaber,rema

# Explain derivation
mistaber -o ./mistaber/ontology explain \
    "holds(sakana(m1), mechaber)" \
    --world mechaber \
    --facts "food(lox). food_type(lox, dag). ..."

Python API

from mistaber.engine import HsrsEngine
from pathlib import Path

engine = HsrsEngine(Path("mistaber/ontology"))

# Test scenario
result = engine.analyze('''
    food(lox). food_type(lox, dag).
    food(cream_cheese). food_type(cream_cheese, chalav).
    mixture(m1). contains(m1, lox). contains(m1, cream_cheese).
''', world="mechaber")

print("Mechaber world atoms:")
for atom in result['atoms']:
    if 'sakana' in atom or 'issur' in atom or 'heter' in atom:
        print(f"  {atom}")

# Compare worlds
comparison = engine.compare(
    "holds(X, W)",
    worlds=["mechaber", "rema"],
    additional_facts='''
        food(lox). food_type(lox, dag).
        food(cream_cheese). food_type(cream_cheese, chalav).
        mixture(m1). contains(m1, lox). contains(m1, cream_cheese).
    '''
)

print("\nComparison:")
for world, atoms in comparison.items():
    print(f"\n{world}:")
    for atom in atoms:
        if 'sakana' in atom or 'heter' in atom:
            print(f"  {atom}")

Suggested Test Queries

Query Expected (Mechaber) Expected (Rema)
holds(sakana(m1), W) True False
holds(heter(achiila, m1), W) False True
holds(issur(achiila, m1, sakana), W) True False
machloket(dag_chalav, A, B, m1) mechaber, rema mechaber, rema

Checkpoint 4 Criteria

Before marking review complete, the human must confirm:

  • [ ] Halachic accuracy checklist - ALL items verified
  • [ ] Technical accuracy checklist - ALL items verified
  • [ ] Interactive queries behave as expected
  • [ ] All open questions documented or resolved
  • [ ] Ready for permanent inclusion in ontology

Approval Process

Approving the Review

When all criteria are met:

User: "Approved - both checklists complete, queries verified"

The skill updates session state and proceeds to commit phase.

Requesting Changes

If issues are found:

User: "Issue with rule r_bb_dag_sakana - makor should include
       specific Beit Yosef section reference"

The workflow returns to hll-encode phase for corrections.

Deferring Questions

For questions that can't be resolved now:

User: "Approved with noted uncertainty on Shach sk 5 interpretation -
       document for future review"

The skill logs the deferral and proceeds.

Session State Update

After human approval:

current_phase: review
checkpoints:
  review:
    status: approved
    approved_by: "{human_name}"
    timestamp: "2026-01-25T16:00:00Z"
    artifacts:
      - review-package-YD-87-3.md
    halachic_checklist: complete
    technical_checklist: complete
    interactive_testing: passed
    deferred_questions:
      - "Shach sk 5 interpretation - multiple readings possible"

What Reviewers Look For

Halachic Review Focus

  1. Source Fidelity: Do rules match the actual source text?
  2. Completeness: Are all conditions and exceptions captured?
  3. Machloket Accuracy: Are both positions fairly represented?
  4. Practical Alignment: Does encoding match how halacha is practiced?
  5. Madrega Correctness: Are biblical vs. rabbinic levels accurate?

Technical Review Focus

  1. Predicate Usage: Are predicates used per their definitions?
  2. World Scoping: Are rules in the correct worlds?
  3. Override Correctness: Do overrides properly model disagreements?
  4. Safety: Are there any unsafe variables or unbounded rules?
  5. Style Compliance: Does code follow project conventions?

Troubleshooting

"Checklist item unclear"

If a checklist item is ambiguous:

  1. Reference the source text
  2. Check commentary for clarification
  3. Document uncertainty and proceed with best judgment
  4. Flag for future review if needed

"Query produces unexpected result"

If interactive testing shows wrong behavior:

  1. Identify which rule is causing the issue
  2. Return to hll-encode phase for correction
  3. Re-run validation after fix
  4. Return to review

"Machloket not properly represented"

If one position is missing or incorrect:

  1. Check that both worlds have the rule
  2. Verify override mechanism is working
  3. Ensure machloket marker exists
  4. Correct in hll-encode phase

Best Practices

  1. Verify every checklist item - Don't rush through checkboxes
  2. Test edge cases interactively - Use the CLI/API to explore
  3. Document uncertainties - Future reviewers will benefit
  4. Compare translations - Multiple sources catch errors
  5. Review derivation trees - Understand why conclusions are reached

Next Phase

After Checkpoint 4 approval, proceed to Commit and Finalization.