feat(flow): feat(flow): eliminate cross-handler imports in dashboard handlers, add prax logger to aggregate_central, update README date (DPLAN-0141 Phase 3)
Co-Authored-By: @flow <flow@aipass>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
**Purpose:** Unified plan lifecycle management for AIPass. Creates, tracks, closes, and archives numbered work plans across multiple plan types via a filesystem-driven template registry. Foreground archival with vector intake verification, cross-branch aggregation, and self-healing registries.
|
||||
**Module:** `aipass.flow`
|
||||
**Created:** 2025-11-15
|
||||
**Last Updated:** 2026-04-07
|
||||
**Last Updated:** 2026-04-22
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -200,21 +200,23 @@ def _calculate_quick_status(sections: Dict[str, Any]) -> Dict[str, Any]:
|
||||
|
||||
|
||||
def _get_all_registry_files() -> List[str]:
|
||||
"""Return per-type registry filenames via plan-type discovery."""
|
||||
"""Return per-type registry filenames from template_registry.json."""
|
||||
try:
|
||||
from aipass.flow.apps.handlers.template.plan_type_loader import discover_plan_types
|
||||
|
||||
files: List[str] = []
|
||||
for _key, config in discover_plan_types().items():
|
||||
rf = config.get("registry_file")
|
||||
if rf and rf not in files:
|
||||
files.append(rf)
|
||||
if files:
|
||||
return files
|
||||
template_reg = FLOW_JSON_DIR / "template_registry.json"
|
||||
if template_reg.exists():
|
||||
with open(template_reg, "r", encoding="utf-8") as f:
|
||||
data = json.load(f)
|
||||
files: List[str] = []
|
||||
for _key, type_cfg in data.get("types", {}).items():
|
||||
prefix = type_cfg.get("prefix", "")
|
||||
if prefix:
|
||||
rf = f"{prefix.lower()}_registry.json"
|
||||
if rf not in files:
|
||||
files.append(rf)
|
||||
if files:
|
||||
return files
|
||||
except Exception as exc:
|
||||
logger.warning(
|
||||
"[push_branch_dashboard] Failed to discover plan types, falling back to default registry: %s", exc
|
||||
)
|
||||
logger.warning("[push_branch_dashboard] Failed to read template registry, falling back to default: %s", exc)
|
||||
return [REGISTRY_FILE.name]
|
||||
|
||||
|
||||
|
||||
@@ -93,20 +93,25 @@ DASHBOARD_FILE = FLOW_ROOT / "DASHBOARD.local.json"
|
||||
|
||||
|
||||
def _get_all_registry_files() -> List[str]:
|
||||
"""Return per-type registry filenames via plan-type discovery."""
|
||||
"""Return per-type registry filenames from template_registry.json."""
|
||||
template_reg = FLOW_JSON_DIR / "template_registry.json"
|
||||
if not template_reg.exists():
|
||||
return [REGISTRY_FILE.name]
|
||||
try:
|
||||
from aipass.flow.apps.handlers.template.plan_type_loader import discover_plan_types
|
||||
|
||||
with open(template_reg, "r", encoding="utf-8") as f:
|
||||
data = json.load(f)
|
||||
files: List[str] = []
|
||||
for _key, config in discover_plan_types().items():
|
||||
rf = config.get("registry_file")
|
||||
if rf and rf not in files:
|
||||
for _key, type_cfg in data.get("types", {}).items():
|
||||
prefix = type_cfg.get("prefix", "")
|
||||
if not prefix:
|
||||
continue
|
||||
rf = f"{prefix.lower()}_registry.json"
|
||||
if rf not in files:
|
||||
files.append(rf)
|
||||
if files:
|
||||
return files
|
||||
return files if files else [REGISTRY_FILE.name]
|
||||
except Exception as exc:
|
||||
logger.warning("[update_local] Failed to discover plan types, falling back to default registry: %s", exc)
|
||||
return [REGISTRY_FILE.name]
|
||||
logger.warning("[update_local] Failed to read template registry, falling back to default: %s", exc)
|
||||
return [REGISTRY_FILE.name]
|
||||
|
||||
|
||||
# =============================================
|
||||
|
||||
@@ -38,6 +38,7 @@ _PKG_ROOT = Path(__file__).resolve().parents[3] # file.py -> modules/ -> apps/
|
||||
FLOW_ROOT = _PKG_ROOT / "flow"
|
||||
|
||||
from aipass.cli.apps.modules import console
|
||||
from aipass.prax.apps.modules.logger import system_logger as logger
|
||||
|
||||
# JSON handler for operation tracking
|
||||
from aipass.flow.apps.handlers.json import json_handler
|
||||
@@ -167,6 +168,7 @@ def handle_command(command: str, args: List[str]) -> bool:
|
||||
if result:
|
||||
console.print("[green]Central plans aggregated successfully[/green]")
|
||||
else:
|
||||
logger.error("[aggregate_central] Central plans aggregation failed")
|
||||
console.print("[red]Central plans aggregation failed[/red]")
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user