3.3 KiB
3.3 KiB
Implementation Plan: Advanced Log Management and Session Restoration
Phase 1: Storage Optimization (Offloading Data)
- Task: Implement file-based offloading for scripts and tool outputs.
- Update
src/session_logger.pyto includelog_tool_output(session_id, output)which saves output to a unique file in the session directory and returns the filename. - Modify
src/session_logger.py:log_tool_callto ensure scripts are consistently saved and return a unique filename/ID. - Update
src/app_controller.pyto use these unique IDs/filenames in thepayloadof comms and tool logs instead of raw content.
- Update
- Task: Verify that logs are smaller and scripts/outputs are correctly saved to the session directory.
- Task: Conductor - User Manual Verification 'Phase 1: Storage Optimization' (Protocol in workflow.md)
Phase 2: Session-Level Restoration & UI Relocation
- Task: Relocate the "Load Log" button.
- Remove the "Load Log" button from
_render_comms_history_panelinsrc/gui_2.py. - Add the "Load Log" button to the "Log Management" panel in
src/gui_2.py.
- Remove the "Load Log" button from
- Task: Rework
cb_load_prior_logfor session-level loading.- Update
src/app_controller.py:cb_load_prior_logto allow selecting a session directory or the main session log file. - Implement logic to load all related logs (comms, mma, tools) for that session.
- Ensure that for entries referencing external files (scripts/outputs), the content is loaded on-demand or during the restoration process.
- Update
- Task: Implement "Historical Replay" UI mode.
- In
src/gui_2.py, implement logic to tint the UI (as already partially done for comms) whenis_viewing_prior_sessionis True. - Populate
disc_entries,_comms_log, and MMA Dashboard states from the loaded session logs.
- In
- Task: Conductor - User Manual Verification 'Phase 2: Session-Level Restoration' (Protocol in workflow.md)
Phase 3: Diagnostic Log & Discussion Cleanup
- Task: Clean up discussion history and implement Diagnostic Tab.
- Add
self.diagnostic_log(a list of transient messages) toAppController. - Update
src/app_controller.py:_on_performance_alertto append toself.diagnostic_loginstead ofdisc_entries. - Update
src/ai_client.py(and other areas) to redirect "SYSTEM WARNING" and similar performance-related messages to the diagnostic log via a new event type. - Add a "Diagnostics" tab to the Log Management panel in
src/gui_2.pyto renderself.diagnostic_log. - Ensure
diagnostic_logis NOT persisted tomanual_slop.tomlor restored during session loads.
- Add
- Task: Conductor - User Manual Verification 'Phase 3: Diagnostic Log & Cleanup' (Protocol in workflow.md)
Phase 4: MMA Log Integration & Filtering
- Task: Improve MMA log visibility and filtering.
- Ensure MMA sub-agent
log_commscalls include sufficient metadata (tier, role) for filtering. - Update
_render_comms_history_panelinsrc/gui_2.pyto ensure MMA logs are clearly distinct and correctly filtered based on existing UI toggles.
- Ensure MMA sub-agent
- Task: Final end-to-end verification of session restoration and log management.
- Task: Conductor - User Manual Verification 'Phase 4: MMA Log Integration' (Protocol in workflow.md)