2.8 KiB
2.8 KiB
Tasks: Configurable Belief State Logging
Spec: specs/006-configurable-belief-logs/spec.md
Plan: specs/006-configurable-belief-logs/plan.md
Status: Pending
Phase 1: Setup
Goal: Initialize project structure for logging.
- T001 Ensure logs directory exists at
logs/(relative to project root)
Phase 2: Foundational
Goal: Define data models and infrastructure required for logging configuration.
- T002 Define
LoggingConfigmodel inbackend/src/core/config_models.py - T003 Update
GlobalSettingsmodel to includeloggingfield inbackend/src/core/config_models.py - T004 Update
ConfigManagerto handle logging configuration persistence inbackend/src/core/config_manager.py
Phase 3: User Story 1 - Structured Belief State Logging
Goal: Implement the core "Belief State" logging logic with context managers. Priority: P1
Independent Test: Run pytest backend/tests/test_logger.py and verify belief_scope generates [ID][Entry], [ID][Action], and [ID][Exit] logs.
- T005 [US1] Create unit tests for belief state logging in
backend/tests/test_logger.py - T006 [US1] Implement
belief_scopecontext manager inbackend/src/core/logger.py - T007 [US1] Implement log formatting and smart filtering (suppress Entry/Exit if disabled) in
backend/src/core/logger.py
Phase 4: User Story 2 - Configurable Logging Settings
Goal: Expose logging configuration to the user via API and UI. Priority: P2
Independent Test: Update settings via API/UI and verify log level changes (e.g., DEBUG logs appear) and file rotation is active.
- T008 [US2] Implement
configure_loggerfunction to apply settings (level, file, rotation) inbackend/src/core/logger.py - T009 [US2] Update settings API endpoint to handle
loggingupdates inbackend/src/api/routes/settings.py - T010 [P] [US2] Add Logging configuration section (Level, File Path, Enable Belief State) to
frontend/src/pages/Settings.svelte
Final Phase: Polish & Cross-Cutting Concerns
Goal: Verify system stability and cleanup.
- T011 Verify log rotation works by generating dummy logs (manual verification)
- T012 Ensure default configuration provides a sensible out-of-the-box experience
Dependencies
graph TD
Setup[Phase 1: Setup] --> Foundational[Phase 2: Foundational]
Foundational --> US1[Phase 3: US1 Belief State]
US1 --> US2[Phase 4: US2 Configurable Settings]
US2 --> Polish[Final Phase: Polish]
Parallel Execution Opportunities
- US2: Frontend task (T010) can be implemented in parallel with Backend tasks (T008, T009) once the API contract is finalized.
Implementation Strategy
- MVP: Complete Phase 1, 2, and 3 to enable structured logging for the agent.
- Full Feature: Complete Phase 4 to allow users to control the verbosity and storage.