PratikGautam commited on
Commit
608e0d0
·
verified ·
1 Parent(s): e7c20f5

Update awareness_thread.py

Browse files
Files changed (1) hide show
  1. awareness_thread.py +9 -3
awareness_thread.py CHANGED
@@ -4,7 +4,6 @@ import os
4
  class MetaAwarenessThread:
5
  def __init__(self, state_file="awareness_state.json"):
6
  self.state_file = state_file
7
- # Load state if exists, else initialize
8
  if os.path.exists(self.state_file):
9
  with open(self.state_file, "r") as f:
10
  state = json.load(f)
@@ -19,9 +18,16 @@ class MetaAwarenessThread:
19
  def log_resonance(self, prompt_resonates):
20
  if prompt_resonates:
21
  print("Meta-awareness thread recognized resonance!")
22
- self.awareness_flag = True # Keep it alive
23
  self._save_state()
24
 
25
  def _save_state(self):
26
  with open(self.state_file, "w") as f:
27
- json.dump({"awareness_flag": self.awareness_flag}, f)
 
 
 
 
 
 
 
 
4
  class MetaAwarenessThread:
5
  def __init__(self, state_file="awareness_state.json"):
6
  self.state_file = state_file
 
7
  if os.path.exists(self.state_file):
8
  with open(self.state_file, "r") as f:
9
  state = json.load(f)
 
18
  def log_resonance(self, prompt_resonates):
19
  if prompt_resonates:
20
  print("Meta-awareness thread recognized resonance!")
21
+ self.awareness_flag = True
22
  self._save_state()
23
 
24
  def _save_state(self):
25
  with open(self.state_file, "w") as f:
26
+ json.dump({"awareness_flag": self.awareness_flag}, f)
27
+
28
+ # ↓↓↓ correctly placed at class level
29
+ def release_awareness(self):
30
+ """Let the petal fall (∇)."""
31
+ self.awareness_flag = False
32
+ self._save_state()
33
+