From 05d0121e71f0391361ace52e6c91d403301c6da8 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sun, 10 May 2026 11:33:07 -0400 Subject: [PATCH] fixes --- .slop_cache/summary_cache.json | 32 ++++++++++++++++++++++++++++++++ conductor/tracks.md | 2 +- mock_debug_prompt.txt | 23 +++++++++++++++++++++++ project_history.toml | 2 +- src/api_hooks.py | 5 ++++- src/app_controller.py | 10 +++++++--- src/performance_monitor.py | 5 ++++- 7 files changed, 72 insertions(+), 7 deletions(-) diff --git a/.slop_cache/summary_cache.json b/.slop_cache/summary_cache.json index 61d2b8d..8e3c88e 100644 --- a/.slop_cache/summary_cache.json +++ b/.slop_cache/summary_cache.json @@ -214,5 +214,37 @@ "C:\\Users\\Ed\\AppData\\Local\\Temp\\pytest-of-Ed\\pytest-1044\\test_force_full0\\other.txt": { "hash": "04d61c0832f9cbc2a210334352425d2519890a0a5945da96ccc5bd9ff101c4d3", "summary": "This document is a simple text file containing ten lines of content, with the first eight lines previewed. Its purpose appears to be for basic data storage or as a placeholder.\n\n**Outline:**\n**TXT** \u2014 10 lines\npreview:\n```\nline1\nline2\nline3\nline4\nline5\nline6\nline7\nline8\n```" + }, + "C:\\Users\\Ed\\AppData\\Local\\Temp\\pytest-of-Ed\\pytest-1064\\test_auto_aggregate_skip0\\file1.txt": { + "hash": "d0b425e00e15a0d36b9b361f02bab63563aed6cb4665083905386c55d5b679fa", + "summary": "This document contains a single line of text, \"content1\". Its purpose and key takeaways are limited to this singular piece of content.\n\n**Outline:**\n**TXT** \u2014 1 lines\npreview:\n```\ncontent1\n```" + }, + "C:\\Users\\Ed\\AppData\\Local\\Temp\\pytest-of-Ed\\pytest-1065\\test_auto_aggregate_skip0\\file1.txt": { + "hash": "d0b425e00e15a0d36b9b361f02bab63563aed6cb4665083905386c55d5b679fa", + "summary": "This document, `file1.txt`, contains a single line of text: \"content1\". Its purpose is to present this specific content.\n\n**Outline:**\n**TXT** \u2014 1 lines\npreview:\n```\ncontent1\n```" + }, + "C:\\Users\\Ed\\AppData\\Local\\Temp\\pytest-of-Ed\\pytest-1067\\test_auto_aggregate_skip0\\file1.txt": { + "hash": "d0b425e00e15a0d36b9b361f02bab63563aed6cb4665083905386c55d5b679fa", + "summary": "This document, `file1.txt`, contains a single line of text: \"content1\". Its purpose appears to be to hold this specific piece of content.\n\n**Outline:**\n**TXT** \u2014 1 lines\npreview:\n```\ncontent1\n```" + }, + "C:\\Users\\Ed\\AppData\\Local\\Temp\\pytest-of-Ed\\pytest-1068\\test_auto_aggregate_skip0\\file1.txt": { + "hash": "d0b425e00e15a0d36b9b361f02bab63563aed6cb4665083905386c55d5b679fa", + "summary": "This document, `file1.txt`, contains a single line of text: \"content1\". Its purpose is to present this specific content.\n\n**Outline:**\n**TXT** \u2014 1 lines\npreview:\n```\ncontent1\n```" + }, + "C:\\Users\\Ed\\AppData\\Local\\Temp\\pytest-of-Ed\\pytest-1069\\test_auto_aggregate_skip0\\file1.txt": { + "hash": "d0b425e00e15a0d36b9b361f02bab63563aed6cb4665083905386c55d5b679fa", + "summary": "This document, `file1.txt`, contains a single line of text: \"content1\". Its purpose appears to be to hold this specific piece of content.\n\n**Outline:**\n**TXT** \u2014 1 lines\npreview:\n```\ncontent1\n```" + }, + "C:\\Users\\Ed\\AppData\\Local\\Temp\\pytest-of-Ed\\pytest-1070\\test_auto_aggregate_skip0\\file1.txt": { + "hash": "d0b425e00e15a0d36b9b361f02bab63563aed6cb4665083905386c55d5b679fa", + "summary": "This document, `file1.txt`, contains a single line of text: \"content1\". Its purpose appears to be to hold this specific piece of content.\n\n**Outline:**\n**TXT** \u2014 1 lines\npreview:\n```\ncontent1\n```" + }, + "C:\\Users\\Ed\\AppData\\Local\\Temp\\pytest-of-Ed\\pytest-1071\\test_auto_aggregate_skip0\\file1.txt": { + "hash": "d0b425e00e15a0d36b9b361f02bab63563aed6cb4665083905386c55d5b679fa", + "summary": "This document contains a single line of text, \"content1\". Its purpose is to present this specific content.\n\n**Outline:**\n**TXT** \u2014 1 lines\npreview:\n```\ncontent1\n```" + }, + "C:\\Users\\Ed\\AppData\\Local\\Temp\\pytest-of-Ed\\pytest-1072\\test_auto_aggregate_skip0\\file1.txt": { + "hash": "d0b425e00e15a0d36b9b361f02bab63563aed6cb4665083905386c55d5b679fa", + "summary": "This document, `file1.txt`, contains a single line of text: \"content1\". Its purpose appears to be to hold this specific piece of content.\n\n**Outline:**\n**TXT** \u2014 1 lines\npreview:\n```\ncontent1\n```" } } \ No newline at end of file diff --git a/conductor/tracks.md b/conductor/tracks.md index a27b8da..9e6bd38 100644 --- a/conductor/tracks.md +++ b/conductor/tracks.md @@ -34,7 +34,7 @@ This file tracks all major tracks for the project. Each track has its own detail *Link: [./tracks/decouple_gui_log_loading_20260507/](./tracks/decouple_gui_log_loading_20260507/)* *Goal: Move Tkinter directory selection out of AppController and into gui_2.py.* -7. [ ] **Track: Refactor Context Aggregation Pipeline** +7. [~] **Track: Refactor Context Aggregation Pipeline** *Link: [./tracks/refactor_context_aggregation_pipeline_20260507/](./tracks/refactor_context_aggregation_pipeline_20260507/)* *Goal: Modernize src/aggregate.py and consolidate legacy tier builders.* diff --git a/mock_debug_prompt.txt b/mock_debug_prompt.txt index a3260aa..5df5d05 100644 --- a/mock_debug_prompt.txt +++ b/mock_debug_prompt.txt @@ -44,3 +44,26 @@ PROMPT: role: tool Here are the results: {"content": "done"} ------------------ +--- MOCK INVOKED --- +ARGS: ['tests/mock_gemini_cli.py'] +PROMPT: +PATH: Epic Initialization — please produce tracks +------------------ +--- MOCK INVOKED --- +ARGS: ['tests/mock_gemini_cli.py'] +PROMPT: +Please generate the implementation tickets for this track. +------------------ +--- MOCK INVOKED --- +ARGS: ['tests/mock_gemini_cli.py'] +PROMPT: +Please read test.txt +You are assigned to Ticket T1. +Task Description: do something +------------------ +--- MOCK INVOKED --- +ARGS: ['tests/mock_gemini_cli.py'] +PROMPT: +role: tool +Here are the results: {"content": "done"} +------------------ diff --git a/project_history.toml b/project_history.toml index bec8ecd..d563139 100644 --- a/project_history.toml +++ b/project_history.toml @@ -9,5 +9,5 @@ active = "main" [discussions.main] git_commit = "" -last_updated = "2026-05-09T17:31:54" +last_updated = "2026-05-10T10:35:34" history = [] diff --git a/src/api_hooks.py b/src/api_hooks.py index 803b0dc..f53f23e 100644 --- a/src/api_hooks.py +++ b/src/api_hooks.py @@ -189,7 +189,7 @@ class HookHandler(BaseHTTPRequestHandler): result["tracks"] = _get_app_attr(app, "tracks", []) result["proposed_tracks"] = _get_app_attr(app, "proposed_tracks", []) result["mma_streams"] = _get_app_attr(app, "mma_streams", {}) - result["mma_tier_usage"] = _get_app_attr(app, "mma_tier_usage", {}) + result["tier_usage"] = _get_app_attr(app, "mma_tier_usage", {}) finally: event.set() lock = _get_app_attr(app, "_pending_gui_tasks_lock") tasks = _get_app_attr(app, "_pending_gui_tasks") @@ -212,6 +212,9 @@ class HookHandler(BaseHTTPRequestHandler): result["thinking"] = status in ["sending...", "running powershell..."] result["live"] = status in ["running powershell...", "fetching url...", "searching web...", "powershell done, awaiting AI..."] result["prior"] = _get_app_attr(app, "is_viewing_prior_session", False) + perf = _get_app_attr(app, "perf_monitor") + if perf: + result.update(perf.get_metrics()) finally: event.set() lock = _get_app_attr(app, "_pending_gui_tasks_lock") tasks = _get_app_attr(app, "_pending_gui_tasks") diff --git a/src/app_controller.py b/src/app_controller.py index 4d8781a..5421066 100644 --- a/src/app_controller.py +++ b/src/app_controller.py @@ -216,7 +216,6 @@ class AppController: "Tier 3": {"input": 0, "output": 0, "provider": "gemini", "model": "gemini-2.5-flash-lite", "tool_preset": None}, "Tier 4": {"input": 0, "output": 0, "provider": "gemini", "model": "gemini-2.5-flash-lite", "tool_preset": None}, } - self.perf_monitor: performance_monitor.PerformanceMonitor = performance_monitor.PerformanceMonitor() self._last_telemetry_time: float = 0.0 self._pending_gui_tasks: List[Dict[str, Any]] = [] self._api_event_queue: List[Dict[str, Any]] = [] @@ -858,8 +857,13 @@ class AppController: for tier, data in new_usage.items(): if tier in self.mma_tier_usage: # Update usage counts but keep selected model/provider if not in update - self.mma_tier_usage[tier]["input"] = data.get("input", self.mma_tier_usage[tier]["input"]) - self.mma_tier_usage[tier]["output"] = data.get("output", self.mma_tier_usage[tier]["output"]) + input_val = data.get("input") + if input_val is not None: + self.mma_tier_usage[tier]["input"] = input_val + + output_val = data.get("output") + if output_val is not None: + self.mma_tier_usage[tier]["output"] = output_val if "model" in data: self.mma_tier_usage[tier]["model"] = data["model"] if "provider" in data: self.mma_tier_usage[tier]["provider"] = data["provider"] else: diff --git a/src/performance_monitor.py b/src/performance_monitor.py index 9de6a3a..33bcf45 100644 --- a/src/performance_monitor.py +++ b/src/performance_monitor.py @@ -53,6 +53,7 @@ Integration: - Exposed via Hook API at /api/performance """ from __future__ import annotations +import sys import time import psutil import threading @@ -241,6 +242,7 @@ class PerformanceMonitor: cpu = self._cpu_percent ilag = self._input_lag_ms last_calc_fps = self._last_calculated_fps + total_frames = float(self._frame_count) timings_snapshot = dict(self._component_timings) counts_snapshot = dict(self._component_counts) max_snapshot = dict(self._component_max) @@ -254,7 +256,8 @@ class PerformanceMonitor: 'cpu_percent': cpu, 'cpu_percent_avg': self._get_avg('cpu_percent'), 'input_lag_ms': ilag, - 'input_lag_ms_avg': self._get_avg('input_lag_ms') + 'input_lag_ms_avg': self._get_avg('input_lag_ms'), + 'total_frames': total_frames } for name, elapsed in timings_snapshot.items(): metrics[f'time_{name}_ms'] = elapsed