Compare commits

..

3 Commits

17 changed files with 34 additions and 14 deletions

View File

@@ -74,7 +74,6 @@ class ApiHookClient:
def get_session(self) -> dict | None: def get_session(self) -> dict | None:
res = self._make_request('GET', '/api/session') res = self._make_request('GET', '/api/session')
print(f"RAW SESSION RESPONSE: {res}")
return res return res
def get_mma_status(self) -> dict | None: def get_mma_status(self) -> dict | None:

View File

@@ -34,8 +34,10 @@ class HookHandler(BaseHTTPRequestHandler):
self.send_response(200) self.send_response(200)
self.send_header('Content-Type', 'application/json') self.send_header('Content-Type', 'application/json')
self.end_headers() self.end_headers()
with app._disc_entries_lock:
entries_snapshot = list(app.disc_entries)
self.wfile.write( self.wfile.write(
json.dumps({'session': {'entries': app.disc_entries}}). json.dumps({'session': {'entries': entries_snapshot}}).
encode('utf-8')) encode('utf-8'))
elif self.path == '/api/performance': elif self.path == '/api/performance':
self.send_response(200) self.send_response(200)
@@ -211,7 +213,8 @@ class HookHandler(BaseHTTPRequestHandler):
self.send_response(500) self.send_response(500)
self.end_headers() self.end_headers()
elif self.path == '/api/session': elif self.path == '/api/session':
app.disc_entries = data.get('session', {}).get('entries', app.disc_entries) with app._disc_entries_lock:
app.disc_entries = data.get('session', {}).get('entries', app.disc_entries)
self.send_response(200) self.send_response(200)
self.send_header('Content-Type', 'application/json') self.send_header('Content-Type', 'application/json')
self.end_headers() self.end_headers()

View File

@@ -1,22 +1,32 @@
# Project Tracks # Project Tracks
This file tracks all major tracks for the project. Each track has its own detailed plan in its respective folder. This file tracks all major tracks for the project. Each track has its own detailed plan in its respective folder.
--- ---
- [x] **Track: Robust Live Simulation Verification** ## Active
*Link: [./tracks/robust_live_simulation_verification/](./tracks/robust_live_simulation_verification/)*
- [ ] **Track: Context & Token Visualization**
*Link: [./tracks/context_token_viz_20260301/](./tracks/context_token_viz_20260301/)*
- [ ] **Track: UX Sim Test**
*Link: [./tracks/ux_sim_test_20260301/](./tracks/ux_sim_test_20260301/)*
--- ---
- [~] **Track: Comprehensive Conductor & MMA GUI UX** ## Completed / Archived
*Link: [./tracks/comprehensive_gui_ux_20260228/](./tracks/comprehensive_gui_ux_20260228/)*
- [x] **Track: Comprehensive Conductor & MMA GUI UX**
*Link: [./archive/comprehensive_gui_ux_20260228/](./archive/comprehensive_gui_ux_20260228/)*
- [x] **Track: MMA Pipeline Fix & Worker Stream Verification**
*Link: [./archive/mma_pipeline_fix_20260301/](./archive/mma_pipeline_fix_20260301/)*
--- - [x] **Track: Simulation Hardening**
*Link: [./archive/simulation_hardening_20260301/](./archive/simulation_hardening_20260301/)*
- [x] **Track: Deep Architectural Documentation Refresh** - [x] **Track: Deep Architectural Documentation Refresh**
*Link: [./tracks/documentation_refresh_20260224/](./tracks/documentation_refresh_20260224/)* *Link: [./archive/documentation_refresh_20260224/](./archive/documentation_refresh_20260224/)*
- [x] **Track: Robust Live Simulation Verification**
*Link: [./archive/robust_live_simulation_verification/](./archive/robust_live_simulation_verification/)*

View File

@@ -792,7 +792,6 @@ class App:
with self._disc_entries_lock: with self._disc_entries_lock:
self.disc_entries = _parse_history_entries(disc_data.get("history", []), self.disc_roles) self.disc_entries = _parse_history_entries(disc_data.get("history", []), self.disc_roles)
self.ai_status = f"discussion: {name}" self.ai_status = f"discussion: {name}"
sys.stderr.write(f'[DEBUG] Switched to {name}. disc_entries len: {len(self.disc_entries)}\n')
def _flush_disc_entries_to_project(self) -> None: def _flush_disc_entries_to_project(self) -> None:
history_strings = [project_manager.entry_to_str(e) for e in self.disc_entries] history_strings = [project_manager.entry_to_str(e) for e in self.disc_entries]
@@ -1069,7 +1068,6 @@ class App:
disc_data["last_updated"] = project_manager.now_ts() disc_data["last_updated"] = project_manager.now_ts()
with self._disc_entries_lock: with self._disc_entries_lock:
self.disc_entries.append(item) self.disc_entries.append(item)
print(f'[DEBUG] Added to disc_entries. Current len: {len(self.disc_entries)}')
def _handle_approve_script(self) -> None: def _handle_approve_script(self) -> None:
"""Logic for approving a pending script via API hooks.""" """Logic for approving a pending script via API hooks."""

View File

@@ -14,7 +14,12 @@ def test_gemini_cli_context_bleed_prevention(live_gui: Any) -> None:
""" """
client = ApiHookClient("http://127.0.0.1:8999") client = ApiHookClient("http://127.0.0.1:8999")
client.click("btn_reset") client.click("btn_reset")
time.sleep(1.5) _start = time.time()
while time.time() - _start < 8.0:
s = client.get_session()
if not s or not s.get('session', {}).get('entries'):
break
time.sleep(0.2)
client.set_value("auto_add_history", True) client.set_value("auto_add_history", True)
# Create a specialized mock for context bleed # Create a specialized mock for context bleed
bleed_mock = os.path.abspath("tests/mock_context_bleed.py") bleed_mock = os.path.abspath("tests/mock_context_bleed.py")
@@ -31,7 +36,12 @@ print(json.dumps({"type": "result", "stats": {"total_tokens": 10}}), flush=True)
client.set_value("ai_input", "Test context bleed") client.set_value("ai_input", "Test context bleed")
client.click("btn_gen_send") client.click("btn_gen_send")
# Wait for completion # Wait for completion
time.sleep(3) _start = time.time()
while time.time() - _start < 15.0:
s = client.get_session()
if any(e.get('role') == 'AI' for e in s.get('session', {}).get('entries', [])):
break
time.sleep(0.3)
session = client.get_session() session = client.get_session()
entries = session.get("session", {}).get("entries", []) entries = session.get("session", {}).get("entries", [])
# Verify: We expect exactly one AI entry, and it must NOT contain the echoed user message # Verify: We expect exactly one AI entry, and it must NOT contain the echoed user message