File size: 1,952 Bytes
3d46076
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"""LLM/VLM + scripted teacher protocols. LLMs stay OUTSIDE the brain (REAL interface, HONEST status)."""
from abc import ABC, abstractmethod
from typing import Any, Dict, List


class TeacherProtocol(ABC):
    @abstractmethod
    def observe(self, organism) -> Dict[str, Any]:
        ...

    @abstractmethod
    def propose_lesson(self, organism) -> Dict[str, Any]:
        ...

    @abstractmethod
    def demonstrate(self, domain: str):
        ...


class ScriptTeacher(TeacherProtocol):
    """Deterministic curriculum teacher (IMPLEMENTED). Lessons never write neural state
    directly; they go through the cultural teaching channel (culture.transmission.teach)."""
    def __init__(self, lessons: List[str]):
        self.lessons = list(lessons)
        self.id = "script-teacher"

    def observe(self, organism) -> Dict[str, Any]:
        return {"organism_id": organism.id, "skills": dict(organism.skills),
                "stage": organism.stage.value}

    def propose_lesson(self, organism) -> Dict[str, Any]:
        weak = min(organism.skills, key=lambda k: organism.skills[k])
        lesson = weak if weak in self.lessons else self.lessons[0]
        return {"domain": lesson, "method": "demonstration"}

    def demonstrate(self, domain: str):
        return [0.8]


class UnavailableLLMTeacher(TeacherProtocol):
    """Placeholder for an external LLM/VLM teacher (NOT IMPLEMENTED -- no weights configured).

    Raises instead of faking. Wire a real model backend here; it may only act via
    observe/propose/demonstrate -> cultural channel, never direct neural writes.
    """
    STATUS = "MODEL_UNAVAILABLE"

    def _fail(self):
        raise RuntimeError("LLM teacher unavailable: no model backend configured (honest status: MODEL_UNAVAILABLE)")

    def observe(self, organism):
        self._fail()

    def propose_lesson(self, organism):
        self._fail()

    def demonstrate(self, domain: str):
        self._fail()