Files
Aegis/tasks/todo.md

1.8 KiB

Aegis — Architectural Refactoring Task Tracker

Tier 1 — Quick Wins

  • QW-1: Wire existing repos into techniques.py router
  • QW-2: Fix audit_service to follow UoW (no direct db.commit())
  • QW-3: Consolidate status_service with TechniqueEntity.recalculate_status()
  • QW-4: Remove remaining HTTPException from services

Tier 2 — Service Extraction (fat routers → thin routers + services)

  • SE-1: Extract reports service from reports.py
  • SE-2: Extract metrics service from metrics.py
  • SE-3: Extract compliance service from compliance.py
  • SE-4: Extract detection_rules service from detection_rules.py
  • SE-5: Extract threat_actors service from threat_actors.py

Tier 3 — Architectural Fixes

  • AF-1: Persist scoring weights in DB (replace mutable settings)
  • AF-2: Slim tests.py router (CRUD to repo/service)
  • AF-3: Slim evidence.py router (permissions to domain)
  • AF-4: Slim campaigns.py router (CRUD to service)

Tier 4 — Polish

  • P-1: Structured JSON logging
  • P-2: Create architecture skill file for future agents

Completed (prior sessions)

  • Domain exceptions hierarchy (domain/errors.py)
  • TestEntity with state machine (domain/test_entity.py)
  • TechniqueEntity (domain/entities/technique.py)
  • Value objects: MitreId, ScoringWeights
  • Unit of Work (domain/unit_of_work.py)
  • Error handler middleware (middleware/error_handler.py)
  • Redis-backed token blacklist (auth.py)
  • CI pipeline (.github/workflows/ci.yml)
  • Heatmap service extracted (services/heatmap_service.py)
  • Scoring bulk queries (bulk_technique_scores)
  • Repository ports + implementations (Technique, Test)
  • Agent validation script (scripts/agent_validate_backend.sh)