"""Create fact_checker
Generated by Phi-Octopus Eden
2025-11-08 09:48:25.341835
"""

```python
from typing import List, Tuple

class FactChecker:
    """
    A class for checking the validity of facts based on a set of predefined rules.

    Args:
        rules: A list of functions that define the rules to check against.
    
    Methods:
        check_facts: Takes a list of facts and returns a boolean indicating if all are valid according to defined rules.
    """

    def __init__(self, rules: List[Tuple[str, callable]]):
        self.rules = rules

    def check_facts(self, facts: List[dict]) -> bool:
        """
        Check each fact against the predefined rules.

        Args:
            facts: A list of dictionaries where each dictionary represents a fact with key-value pairs.

        Returns:
            True if all facts are valid according to the defined rules, False otherwise.
        """
        for rule in self.rules:
            key, checker = rule
            for fact in facts:
                if key not in fact:
                    return False
                if not checker(fact[key]):
                    return False
        return True

# Example usage:

def is_positive(n: int) -> bool:
    """Check if a number is positive."""
    return n > 0

def contains_a(s: str) -> bool:
    """Check if a string contains the letter 'a'."""
    return 'a' in s.lower()

example_rules = [
    ('number', is_positive),
    ('text', contains_a)
]

checker = FactChecker(example_rules)

# Test cases
test_facts_valid = [
    {'number': 1, 'text': "Apple"},
    {'number': 2, 'text': "Banana"}
]
assert checker.check_facts(test_facts_valid) == True

test_facts_invalid_number = [
    {'number': -1, 'text': "Apple"},
    {'number': 2, 'text': "Banana"}
]
assert checker.check_facts(test_facts_invalid_number) == False

test_facts_invalid_text = [
    {'number': 2, 'text': "Orange"},
    {'number': 3, 'text': "Pineapple"}
]
assert checker.check_facts(test_facts_invalid_text) == False
```