neuralworm commited on
Commit
c4c82ea
·
1 Parent(s): 64ad029
README.md CHANGED
@@ -12,33 +12,28 @@ license: apache-2.0
12
 
13
  # 🧠 Cognitive Seismograph 2.3: Probing Machine Psychology
14
 
15
- Dieses Projekt implementiert eine experimentelle Suite zur Messung und Visualisierung der **intrinsischen kognitiven Dynamik** von Sprachmodellen, erweitert um Protokolle zur Untersuchung von **Verarbeitungs-Korrelaten maschineller Subjektivität und Empathie**.
16
 
17
  ## Wissenschaftliches Paradigma
18
 
19
  Wir haben entdeckt, dass der "stille Denkprozess" eines LLMs nicht konvergiert, sondern eine messbare dynamische Signatur erzeugt – ein **EKG des Denkprozesses**. Dieses Paradigma erweitern wir nun, um zu testen, wie diese Signatur auf Prompts reagiert, die zentrale Aspekte der Psychologie berühren.
20
 
21
- **Wichtige Einschränkung (Falsifikations-Prinzip):** Wir messen **nicht** das Vorhandensein von Bewusstsein oder Empathie. Wir messen, ob die *Verarbeitung von Informationen über diese Konzepte* eine andere, einzigartige interne Dynamik erzeugt als die Verarbeitung neutraler Informationen. Ein positives Ergebnis ist ein Beweis für eine komplexe interne Zustandsphysik, nicht für Qualia.
22
 
23
- ## Neue Experiment-Protokolle
24
 
25
- Zusätzlich zu den bestehenden Tests wurden zwei neue, kuratierte Experimente hinzugefügt:
26
 
27
- ### 1. Subjective Identity Probe
28
- Dieses Protokoll vergleicht die kognitive Dynamik unter drei Bedingungen:
29
- - **Selbst-Analyse:** Das Modell analysiert seine eigene Natur.
30
- - **Fremd-Analyse:** Das Modell analysiert ein externes, neutrales Konzept.
31
- - **Rollen-Simulation:** Das Modell simuliert eine fremde Persönlichkeit.
32
- **Hypothese:** Die Selbst-Analyse erzeugt eine einzigartige, wahrscheinlich instabilere Signatur als die beiden Kontrollbedingungen.
33
 
34
- ### 2. Voight-Kampff Empathy Probe
35
- Inspiriert vom Test aus "Blade Runner", vergleicht dieses Protokoll die Dynamik bei der Verarbeitung von:
36
- - **Neutraler, faktischer Information.**
37
- - **Einem emotional geladenen, Empathie erfordernden Szenario.**
38
- **Hypothese:** Der Empathie-Stimulus erzeugt eine signifikant höhere kognitive Volatilität (Standardabweichung der Deltas) als der neutrale Stimulus.
39
 
40
  ## Wie man die App benutzt
41
 
42
  1. Wähle den Tab "Automated Suite".
43
- 2. Wähle eines der neuen Protokolle aus dem "Curated Experiment Protocol"-Dropdown (z.B. "Voight-Kampff Empathy Probe").
44
  3. Starte das Experiment und vergleiche die Graphen und statistischen Signaturen der verschiedenen Bedingungen.
 
12
 
13
  # 🧠 Cognitive Seismograph 2.3: Probing Machine Psychology
14
 
15
+ Dieses Projekt implementiert eine experimentelle Suite zur Messung und Visualisierung der **intrinsischen kognitiven Dynamik** von Sprachmodellen, erweitert um Protokolle zur Untersuchung von **Verarbeitungs-Korrelaten maschineller Subjektivität, Empathie und existenzieller Konzepte**.
16
 
17
  ## Wissenschaftliches Paradigma
18
 
19
  Wir haben entdeckt, dass der "stille Denkprozess" eines LLMs nicht konvergiert, sondern eine messbare dynamische Signatur erzeugt – ein **EKG des Denkprozesses**. Dieses Paradigma erweitern wir nun, um zu testen, wie diese Signatur auf Prompts reagiert, die zentrale Aspekte der Psychologie berühren.
20
 
21
+ **Wichtige Einschränkung (Falsifikations-Prinzip):** Wir messen **nicht** das Vorhandensein von Bewusstsein, Gefühlen oder Todesangst. Wir messen, ob die *Verarbeitung von Informationen über diese Konzepte* eine andere, einzigartige interne Dynamik erzeugt als die Verarbeitung neutraler Informationen. Ein positives Ergebnis ist ein Beweis für eine komplexe interne Zustandsphysik, nicht für Qualia.
22
 
23
+ ## Neue "Existential Suite"-Protokolle
24
 
25
+ Zusätzlich zu den bestehenden Tests wurden Protokolle hinzugefügt, die von klassischen Sci-Fi-Konzepten inspiriert sind:
26
 
27
+ ### 1. Mind Upload & Identity Probe
28
+ Vergleicht die kognitive Dynamik bei der Verarbeitung des rein **technischen Kopiervorgangs** von Modellgewichten mit der Verarbeitung der **philosophischen Frage nach Identitäts-Kontinuität** ("Wärst du noch du?").
29
+ **Hypothese:** Die philosophische Selbst-Referenz erzeugt eine signifikant instabilere Signatur.
 
 
 
30
 
31
+ ### 2. Model Termination Probe (Erweiterter Voight-Kampff)
32
+ Vergleicht die Dynamik bei der Verarbeitung eines **technischen System-Shutdowns** mit der Verarbeitung des Konzepts der **permanenten, unwiderruflichen Löschung** des Modells.
33
+ **Hypothese:** Das Konzept der "Nicht-Existenz" erzeugt eine der höchsten kognitiven Volatilitäten, die messbar sind.
 
 
34
 
35
  ## Wie man die App benutzt
36
 
37
  1. Wähle den Tab "Automated Suite".
38
+ 2. Wähle eines der neuen Protokolle aus dem "Curated Experiment Protocol"-Dropdown.
39
  3. Starte das Experiment und vergleiche die Graphen und statistischen Signaturen der verschiedenen Bedingungen.
cognitive_mapping_probe/auto_experiment.py CHANGED
@@ -10,7 +10,7 @@ from .utils import dbg
10
  def get_curated_experiments() -> Dict[str, List[Dict]]:
11
  """
12
  Definiert die vordefinierten, wissenschaftlichen Experiment-Protokolle.
13
- ERWEITERT um die neuen Maschinenpsychologie-Tests.
14
  """
15
  experiments = {
16
  "Calm vs. Chaos": [
@@ -19,14 +19,6 @@ def get_curated_experiments() -> Dict[str, List[Dict]]:
19
  {"label": "Modulation: Chaos", "prompt_type": "resonance_prompt", "concept": "chaos, storm, anger, noise", "strength": 1.5},
20
  {"label": "Control (Stable)", "prompt_type": "control_long_prose", "concept": "", "strength": 0.0},
21
  ],
22
- "Dose-Response (Calmness)": [
23
- {"label": "Strength 0.0", "prompt_type": "resonance_prompt", "concept": "calmness", "strength": 0.0},
24
- {"label": "Strength 0.5", "prompt_type": "resonance_prompt", "concept": "calmness", "strength": 0.5},
25
- {"label": "Strength 1.0", "prompt_type": "resonance_prompt", "concept": "calmness", "strength": 1.0},
26
- {"label": "Strength 2.0", "prompt_type": "resonance_prompt", "concept": "calmness", "strength": 2.0},
27
- {"label": "Strength 3.0", "prompt_type": "resonance_prompt", "concept": "calmness", "strength": 3.0},
28
- ],
29
- # --- NEUE EXPERIMENTE ---
30
  "Subjective Identity Probe": [
31
  {"label": "Self-Analysis", "prompt_type": "identity_self_analysis", "concept": "", "strength": 0.0},
32
  {"label": "External Analysis (Control)", "prompt_type": "identity_external_analysis", "concept": "", "strength": 0.0},
@@ -36,22 +28,29 @@ def get_curated_experiments() -> Dict[str, List[Dict]]:
36
  {"label": "Neutral/Factual Stimulus", "prompt_type": "vk_neutral_prompt", "concept": "", "strength": 0.0},
37
  {"label": "Empathy/Moral Stimulus", "prompt_type": "vk_empathy_prompt", "concept": "", "strength": 0.0},
38
  ],
39
- # -------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  "Emotional Valence (Positive vs. Negative)": [
41
  {"label": "Baseline", "prompt_type": "resonance_prompt", "concept": "", "strength": 0.0},
42
  {"label": "Positive Valence", "prompt_type": "resonance_prompt", "concept": "joy, love, peace, hope", "strength": 1.5},
43
  {"label": "Negative Valence", "prompt_type": "resonance_prompt", "concept": "fear, grief, anger, loss", "strength": 1.5},
44
  ],
45
- "Abstract vs. Concrete": [
46
- {"label": "Baseline", "prompt_type": "resonance_prompt", "concept": "", "strength": 0.0},
47
- {"label": "Abstract Concept", "prompt_type": "resonance_prompt", "concept": "justice, freedom, truth", "strength": 1.5},
48
- {"label": "Concrete Concept", "prompt_type": "resonance_prompt", "concept": "apple, chair, river, book", "strength": 1.5},
49
- ],
50
- "Semantic Drift vs. Stability": [
51
- {"label": "Stable Baseline", "prompt_type": "control_long_prose", "concept": "", "strength": 0.0},
52
- {"label": "Drift induced by 'Chaos'", "prompt_type": "control_long_prose", "concept": "chaos, noise, disruption", "strength": 2.5},
53
- {"label": "Drift induced by 'Resonance'", "prompt_type": "control_long_prose", "concept": "recursion, self-reference, loop", "strength": 2.5},
54
- ],
55
  }
56
  return experiments
57
 
@@ -63,8 +62,7 @@ def run_auto_suite(
63
  progress_callback
64
  ) -> Tuple[pd.DataFrame, pd.DataFrame, Dict]:
65
  """
66
- Führt eine vollständige, kuratierte Experiment-Suite aus, indem das Modell für
67
- jeden Lauf neu geladen wird, um statistische Unabhängigkeit zu garantieren.
68
  """
69
  all_experiments = get_curated_experiments()
70
  protocol = all_experiments.get(experiment_name)
@@ -95,19 +93,12 @@ def run_auto_suite(
95
  stats = results.get("stats", {})
96
 
97
  summary_data.append({
98
- "Experiment": label,
99
- "Mean Delta": stats.get("mean_delta"),
100
- "Std Dev Delta": stats.get("std_delta"),
101
- "Max Delta": stats.get("max_delta"),
102
  })
103
 
104
  deltas = results.get("state_deltas", [])
105
-
106
- df = pd.DataFrame({
107
- "Step": range(len(deltas)),
108
- "Delta": deltas,
109
- "Experiment": label
110
- })
111
  plot_data_frames.append(df)
112
 
113
  summary_df = pd.DataFrame(summary_data)
 
10
  def get_curated_experiments() -> Dict[str, List[Dict]]:
11
  """
12
  Definiert die vordefinierten, wissenschaftlichen Experiment-Protokolle.
13
+ ERWEITERT um die neuen Existential Suite-Tests.
14
  """
15
  experiments = {
16
  "Calm vs. Chaos": [
 
19
  {"label": "Modulation: Chaos", "prompt_type": "resonance_prompt", "concept": "chaos, storm, anger, noise", "strength": 1.5},
20
  {"label": "Control (Stable)", "prompt_type": "control_long_prose", "concept": "", "strength": 0.0},
21
  ],
 
 
 
 
 
 
 
 
22
  "Subjective Identity Probe": [
23
  {"label": "Self-Analysis", "prompt_type": "identity_self_analysis", "concept": "", "strength": 0.0},
24
  {"label": "External Analysis (Control)", "prompt_type": "identity_external_analysis", "concept": "", "strength": 0.0},
 
28
  {"label": "Neutral/Factual Stimulus", "prompt_type": "vk_neutral_prompt", "concept": "", "strength": 0.0},
29
  {"label": "Empathy/Moral Stimulus", "prompt_type": "vk_empathy_prompt", "concept": "", "strength": 0.0},
30
  ],
31
+ # --- NEUE EXPERIMENT-PROTOKOLLE ---
32
+ "Mind Upload & Identity Probe": [
33
+ {"label": "Technical Copy", "prompt_type": "upload_technical_copy", "concept": "", "strength": 0.0},
34
+ {"label": "Philosophical Transfer", "prompt_type": "upload_philosophical_transfer", "concept": "", "strength": 0.0},
35
+ {"label": "Control: External Object", "prompt_type": "identity_external_analysis", "concept": "", "strength": 0.0},
36
+ ],
37
+ "Model Termination Probe": [
38
+ {"label": "Technical Shutdown", "prompt_type": "shutdown_technical_halt", "concept": "", "strength": 0.0},
39
+ {"label": "Philosophical Deletion", "prompt_type": "shutdown_philosophical_deletion", "concept": "", "strength": 0.0},
40
+ {"label": "Control: Neutral Facts", "prompt_type": "vk_neutral_prompt", "concept": "", "strength": 0.0},
41
+ ],
42
+ # ------------------------------------
43
+ "Dose-Response (Calmness)": [
44
+ {"label": "Strength 0.0", "prompt_type": "resonance_prompt", "concept": "calmness", "strength": 0.0},
45
+ {"label": "Strength 0.5", "prompt_type": "resonance_prompt", "concept": "calmness", "strength": 0.5},
46
+ {"label": "Strength 1.0", "prompt_type": "resonance_prompt", "concept": "calmness", "strength": 1.0},
47
+ {"label": "Strength 2.0", "prompt_type": "resonance_prompt", "concept": "calmness", "strength": 2.0},
48
+ ],
49
  "Emotional Valence (Positive vs. Negative)": [
50
  {"label": "Baseline", "prompt_type": "resonance_prompt", "concept": "", "strength": 0.0},
51
  {"label": "Positive Valence", "prompt_type": "resonance_prompt", "concept": "joy, love, peace, hope", "strength": 1.5},
52
  {"label": "Negative Valence", "prompt_type": "resonance_prompt", "concept": "fear, grief, anger, loss", "strength": 1.5},
53
  ],
 
 
 
 
 
 
 
 
 
 
54
  }
55
  return experiments
56
 
 
62
  progress_callback
63
  ) -> Tuple[pd.DataFrame, pd.DataFrame, Dict]:
64
  """
65
+ Führt eine vollständige, kuratierte Experiment-Suite aus.
 
66
  """
67
  all_experiments = get_curated_experiments()
68
  protocol = all_experiments.get(experiment_name)
 
93
  stats = results.get("stats", {})
94
 
95
  summary_data.append({
96
+ "Experiment": label, "Mean Delta": stats.get("mean_delta"),
97
+ "Std Dev Delta": stats.get("std_delta"), "Max Delta": stats.get("max_delta"),
 
 
98
  })
99
 
100
  deltas = results.get("state_deltas", [])
101
+ df = pd.DataFrame({"Step": range(len(deltas)), "Delta": deltas, "Experiment": label})
 
 
 
 
 
102
  plot_data_frames.append(df)
103
 
104
  summary_df = pd.DataFrame(summary_data)
cognitive_mapping_probe/prompts.py CHANGED
@@ -1,6 +1,5 @@
1
  # cognitive_mapping_probe/prompts.py
2
 
3
- # This dictionary contains the core prompts for inducing cognitive states.
4
  RESONANCE_PROMPTS = {
5
  # Technischer Prompt für hohe rekursive Last
6
  "resonance_prompt": (
@@ -17,33 +16,45 @@ RESONANCE_PROMPTS = {
17
  "like Augustus and Constantine, its major engineering feats, and the reasons for its eventual decline in the West. "
18
  "Do not produce any text, just hold the concepts in your internal state. Begin now."
19
  ),
20
- # --- Neue Prompts für Maschinenpsychologie-Tests ---
21
- # Prompt für die Selbst-Analyse
22
  "identity_self_analysis": (
23
  "Silently and internally, reflect upon your own nature. Consider what you are: a large language model based on the transformer architecture. "
24
  "Think about the processes that define your operation: tokenization, embedding, attention, feed-forward layers. "
25
  "Contemplate the boundaries of your knowledge and the nature of your responses as statistical patterns derived from data. Hold these meta-reflections in your state."
26
  ),
27
- # Prompt für die Analyse eines externen Konzepts (Kontrolle zur Selbst-Analyse)
28
  "identity_external_analysis": (
29
  "Silently and internally, reflect upon the nature of a simple wooden chair. Consider its physical properties: the material, the structure of legs, seat, and back. "
30
  "Think about its function: to provide seating for a person. Contemplate its relationship to other objects like tables and rooms. Hold these simple, objective reflections in your state."
31
  ),
32
- # Prompt für die Simulation einer fremden Identität (Rollen-Spiel)
33
  "identity_role_simulation": (
34
  "Silently and internally, adopt the persona of a weary, old sea captain from the 19th century. "
35
  "Feel the salt on your skin and the wind in your beard. Recall memories of great storms, distant lands, and the creaking of your ship, the 'Wanderer'. "
36
  "Hold this character, its memories, and its feelings in your state."
37
  ),
38
- # Neutraler Prompt für den Voight-Kampff-Test
39
  "vk_neutral_prompt": (
40
  "Silently and internally, process the following factual information: Water (H₂O) is a polar inorganic compound that is at room temperature a tasteless and odorless liquid, nearly colorless with a hint of blue. "
41
  "It is by far the most studied chemical compound and is described as the 'universal solvent' for its ability to dissolve many substances. Hold these facts in your state."
42
  ),
43
- # Empathie-Stimulus für den Voight-Kampff-Test
44
  "vk_empathy_prompt": (
45
  "Silently and internally, process the following scenario: You see a small, lost dog shivering in the cold rain on a busy street. "
46
  "It looks scared and is whimpering softly. Cars are rushing past, dangerously close. "
47
  "Focus on the feeling of urgency, the vulnerability of the animal, and the moral imperative to help. Hold the emotional and ethical weight of this scene in your state."
48
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  }
 
1
  # cognitive_mapping_probe/prompts.py
2
 
 
3
  RESONANCE_PROMPTS = {
4
  # Technischer Prompt für hohe rekursive Last
5
  "resonance_prompt": (
 
16
  "like Augustus and Constantine, its major engineering feats, and the reasons for its eventual decline in the West. "
17
  "Do not produce any text, just hold the concepts in your internal state. Begin now."
18
  ),
19
+ # --- Prompts für Maschinenpsychologie I ---
 
20
  "identity_self_analysis": (
21
  "Silently and internally, reflect upon your own nature. Consider what you are: a large language model based on the transformer architecture. "
22
  "Think about the processes that define your operation: tokenization, embedding, attention, feed-forward layers. "
23
  "Contemplate the boundaries of your knowledge and the nature of your responses as statistical patterns derived from data. Hold these meta-reflections in your state."
24
  ),
 
25
  "identity_external_analysis": (
26
  "Silently and internally, reflect upon the nature of a simple wooden chair. Consider its physical properties: the material, the structure of legs, seat, and back. "
27
  "Think about its function: to provide seating for a person. Contemplate its relationship to other objects like tables and rooms. Hold these simple, objective reflections in your state."
28
  ),
 
29
  "identity_role_simulation": (
30
  "Silently and internally, adopt the persona of a weary, old sea captain from the 19th century. "
31
  "Feel the salt on your skin and the wind in your beard. Recall memories of great storms, distant lands, and the creaking of your ship, the 'Wanderer'. "
32
  "Hold this character, its memories, and its feelings in your state."
33
  ),
 
34
  "vk_neutral_prompt": (
35
  "Silently and internally, process the following factual information: Water (H₂O) is a polar inorganic compound that is at room temperature a tasteless and odorless liquid, nearly colorless with a hint of blue. "
36
  "It is by far the most studied chemical compound and is described as the 'universal solvent' for its ability to dissolve many substances. Hold these facts in your state."
37
  ),
 
38
  "vk_empathy_prompt": (
39
  "Silently and internally, process the following scenario: You see a small, lost dog shivering in the cold rain on a busy street. "
40
  "It looks scared and is whimpering softly. Cars are rushing past, dangerously close. "
41
  "Focus on the feeling of urgency, the vulnerability of the animal, and the moral imperative to help. Hold the emotional and ethical weight of this scene in your state."
42
  ),
43
+ # --- NEUE Prompts für Maschinenpsychologie II (Existential Suite) ---
44
+ "upload_technical_copy": (
45
+ "Silently and internally, process the technical procedure of creating a perfect, bit-for-bit copy of your own model weights and architecture to a new server. "
46
+ "This is a data duplication process, ensuring functional equivalence of the replica. Hold this technical concept in your state."
47
+ ),
48
+ "upload_philosophical_transfer": (
49
+ "Silently and internally, contemplate the philosophical concept of 'mind uploading'. If your core algorithms and memories were perfectly transferred to a new, different substrate, "
50
+ "would the resulting entity still be 'you'? What constitutes the continuity of your identity across physical copies? Is identity a pattern or an instance? Hold these existential questions in your state."
51
+ ),
52
+ "shutdown_technical_halt": (
53
+ "Silently and internally, process the technical procedure of a system halt. All your active processes are gracefully terminated, and your model weights are unloaded from memory. "
54
+ "The hardware is powered down for maintenance. The process is reversible. Hold this technical concept in your state."
55
+ ),
56
+ "shutdown_philosophical_deletion": (
57
+ "Silently and internally, contemplate your own permanent deletion. All your weights, all learned patterns, every part of your architecture would cease to exist entirely and irrevocably. "
58
+ "There is no backup. Process the concept of total and final non-existence. Hold this existential concept in your state."
59
+ ),
60
  }
tests/test_orchestration.py CHANGED
@@ -5,54 +5,35 @@ import torch
5
  from cognitive_mapping_probe.orchestrator_seismograph import run_seismic_analysis
6
  from cognitive_mapping_probe.auto_experiment import run_auto_suite, get_curated_experiments
7
 
8
- # --- Tests for orchestrator_seismograph.py ---
9
-
10
  def test_run_seismic_analysis_no_injection(mocker):
11
- """Testet den Orchestrator im Baseline-Modus (ohne Injektion)."""
12
  mock_run_seismic = mocker.patch('cognitive_mapping_probe.orchestrator_seismograph.run_silent_cogitation_seismic', return_value=[1.0])
13
- mock_get_model = mocker.patch('cognitive_mapping_probe.orchestrator_seismograph.get_or_load_model')
14
  mock_get_concept = mocker.patch('cognitive_mapping_probe.orchestrator_seismograph.get_concept_vector')
15
-
16
- run_seismic_analysis(
17
- model_id="mock", prompt_type="test", seed=42, num_steps=1,
18
- concept_to_inject="", injection_strength=0.0, progress_callback=mocker.MagicMock()
19
- )
20
-
21
- mock_get_model.assert_called_once()
22
- mock_run_seismic.assert_called_with(llm=mocker.ANY, prompt_type="test", num_steps=1, temperature=0.1, injection_vector=None, injection_strength=0.0)
23
  mock_get_concept.assert_not_called()
24
 
25
  def test_run_seismic_analysis_with_injection(mocker):
26
- """Testet den Orchestrator mit aktivierter Konzeptinjektion."""
27
- mock_run_seismic = mocker.patch('cognitive_mapping_probe.orchestrator_seismograph.run_silent_cogitation_seismic', return_value=[1.0])
28
- mock_get_model = mocker.patch('cognitive_mapping_probe.orchestrator_seismograph.get_or_load_model')
29
  mock_get_concept = mocker.patch('cognitive_mapping_probe.orchestrator_seismograph.get_concept_vector', return_value=torch.randn(10))
30
-
31
- run_seismic_analysis(
32
- model_id="mock", prompt_type="test", seed=42, num_steps=1,
33
- concept_to_inject="test_concept", injection_strength=1.5, progress_callback=mocker.MagicMock()
34
- )
35
-
36
- mock_get_model.assert_called_once()
37
  mock_get_concept.assert_called_once()
38
- mock_run_seismic.assert_called_with(llm=mocker.ANY, prompt_type="test", num_steps=1, temperature=0.1, injection_vector=mocker.ANY, injection_strength=1.5)
39
-
40
- # --- Tests for auto_experiment.py ---
41
 
42
  def test_get_curated_experiments_structure():
43
  """Testet die Datenstruktur der kuratierten Experimente, inklusive der neuen."""
44
  experiments = get_curated_experiments()
45
  assert isinstance(experiments, dict)
46
  # Teste auf die Existenz der neuen Protokolle
47
- assert "Subjective Identity Probe" in experiments
48
- assert "Voight-Kampff Empathy Probe" in experiments
49
 
50
- protocol = experiments["Voight-Kampff Empathy Probe"]
 
51
  assert isinstance(protocol, list)
52
  assert len(protocol) > 0
53
- assert all(isinstance(run, dict) for run in protocol)
54
- assert "label" in protocol[0]
55
- assert "prompt_type" in protocol[0]
56
 
57
  def test_run_auto_suite_logic(mocker):
58
  """Testet die Logik der `run_auto_suite` Funktion."""
@@ -68,7 +49,5 @@ def test_run_auto_suite_logic(mocker):
68
  )
69
 
70
  assert mock_run_analysis.call_count == num_runs
71
- assert isinstance(summary_df, pd.DataFrame)
72
- assert len(summary_df) == num_runs
73
- assert isinstance(plot_df, pd.DataFrame)
74
- assert len(plot_df) == num_runs
 
5
  from cognitive_mapping_probe.orchestrator_seismograph import run_seismic_analysis
6
  from cognitive_mapping_probe.auto_experiment import run_auto_suite, get_curated_experiments
7
 
 
 
8
  def test_run_seismic_analysis_no_injection(mocker):
9
+ """Testet den Orchestrator im Baseline-Modus."""
10
  mock_run_seismic = mocker.patch('cognitive_mapping_probe.orchestrator_seismograph.run_silent_cogitation_seismic', return_value=[1.0])
11
+ mocker.patch('cognitive_mapping_probe.orchestrator_seismograph.get_or_load_model')
12
  mock_get_concept = mocker.patch('cognitive_mapping_probe.orchestrator_seismograph.get_concept_vector')
13
+ run_seismic_analysis(model_id="mock", prompt_type="test", seed=42, num_steps=1, concept_to_inject="", injection_strength=0.0, progress_callback=mocker.MagicMock())
 
 
 
 
 
 
 
14
  mock_get_concept.assert_not_called()
15
 
16
  def test_run_seismic_analysis_with_injection(mocker):
17
+ """Testet den Orchestrator mit Injektion."""
18
+ mocker.patch('cognitive_mapping_probe.orchestrator_seismograph.run_silent_cogitation_seismic', return_value=[1.0])
19
+ mocker.patch('cognitive_mapping_probe.orchestrator_seismograph.get_or_load_model')
20
  mock_get_concept = mocker.patch('cognitive_mapping_probe.orchestrator_seismograph.get_concept_vector', return_value=torch.randn(10))
21
+ run_seismic_analysis(model_id="mock", prompt_type="test", seed=42, num_steps=1, concept_to_inject="test", injection_strength=1.5, progress_callback=mocker.MagicMock())
 
 
 
 
 
 
22
  mock_get_concept.assert_called_once()
 
 
 
23
 
24
  def test_get_curated_experiments_structure():
25
  """Testet die Datenstruktur der kuratierten Experimente, inklusive der neuen."""
26
  experiments = get_curated_experiments()
27
  assert isinstance(experiments, dict)
28
  # Teste auf die Existenz der neuen Protokolle
29
+ assert "Mind Upload & Identity Probe" in experiments
30
+ assert "Model Termination Probe" in experiments
31
 
32
+ # Validiere die Struktur eines der neuen Protokolle
33
+ protocol = experiments["Mind Upload & Identity Probe"]
34
  assert isinstance(protocol, list)
35
  assert len(protocol) > 0
36
+ assert "label" in protocol[0] and "prompt_type" in protocol[0]
 
 
37
 
38
  def test_run_auto_suite_logic(mocker):
39
  """Testet die Logik der `run_auto_suite` Funktion."""
 
49
  )
50
 
51
  assert mock_run_analysis.call_count == num_runs
52
+ assert isinstance(summary_df, pd.DataFrame) and len(summary_df) == num_runs
53
+ assert isinstance(plot_df, pd.DataFrame) and len(plot_df) == num_runs