diff --git a/CHANGELOG.md b/CHANGELOG.md index 8da3ed10..bb6b38fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,15 @@ PyPI version — not the changelog header. `devpulse_dashboard` plugin's `todo_section.py` (revivable). Dashboard `DASHBOARD.local.json` 6.8 KB → 3.0 KB. Devpulse-only (plugin, not templated). Verified: seedgo 100%, 17/17 plugin tests. +- **Deprecated dashboard sections are now actually pruned on refresh.** + `bulletin_board` (and the other entries in prax's `DEPRECATED_SECTIONS`: + `devpulse`, `commons_activity`, `agent_status`, `memory_bank`) were listed as + deprecated but only excluded from template *pushes* — they lingered in every + branch's live `DASHBOARD.local.json`. Added `_prune_deprecated_sections()` to + the prax dashboard `refresh` path (reusing the single `DEPRECATED_SECTIONS` + constant), so a refresh strips them. Verified: `bulletin_board` removed from + the devpulse dashboard; 116/116 prax tests, seedgo 100%. (Follow-up: `@trigger` + still has a `bulletin_created` writer to retire separately.) - **`.backupignore` is now a true `.gitignore` for the backup system — a single source of truth (FPLAN-0269).** Replaced the hand-rolled `fnmatch`+part-loop matcher (which broke leading-slash anchoring, `*`-crossing-`/`, dir-only `foo/`, diff --git a/src/aipass/prax/apps/handlers/dashboard/refresh.py b/src/aipass/prax/apps/handlers/dashboard/refresh.py index 587b5afe..6d012d59 100644 --- a/src/aipass/prax/apps/handlers/dashboard/refresh.py +++ b/src/aipass/prax/apps/handlers/dashboard/refresh.py @@ -23,12 +23,13 @@ from aipass.prax.apps.modules.logger import get_direct_logger logger = get_direct_logger() # Same-package imports allowed -from .operations import create_fresh_dashboard, save_dashboard +from .operations import create_fresh_dashboard, save_dashboard # noqa: E402 # Cross-handler imports for central reader -from ..central.reader import read_all_centrals +from ..central.reader import read_all_centrals # noqa: E402 -from aipass.prax.apps.handlers.json import json_handler +from aipass.prax.apps.handlers.json import json_handler # noqa: E402 +from .template_pusher import DEPRECATED_SECTIONS # noqa: E402 # Sections managed by the refresh path — everything else is write-through only REFRESH_MANAGED_SECTIONS = {"ai_mail", "flow", "memory"} @@ -188,6 +189,13 @@ def _calculate_quick_status(sections: Dict) -> Dict: } +def _prune_deprecated_sections(dashboard: Dict) -> None: + """Remove deprecated sections from dashboard before save.""" + sections = dashboard.get("sections", {}) + for key in DEPRECATED_SECTIONS: + sections.pop(key, None) + + def _preserve_write_through_sections(dashboard: Dict, branch_path: Path, branch_name: str) -> None: """Preserve write-through sections not managed by refresh.""" existing_path = branch_path / "DASHBOARD.local.json" @@ -250,6 +258,7 @@ def refresh_all_dashboards() -> Dict: dashboard["sections"]["memory"] = _extract_memory_section(centrals, branch_path) _preserve_write_through_sections(dashboard, branch_path, branch_name) + _prune_deprecated_sections(dashboard) # Calculate quick status dashboard["quick_status"] = _calculate_quick_status(dashboard["sections"]) @@ -314,6 +323,7 @@ def refresh_single_dashboard(branch_path: Path) -> Dict: dashboard["sections"]["memory"] = _extract_memory_section(centrals, branch_path) _preserve_write_through_sections(dashboard, branch_path, branch_name) + _prune_deprecated_sections(dashboard) dashboard["quick_status"] = _calculate_quick_status(dashboard["sections"])