P0-2: Control Assessment Agent — Readiness Scoring
AI agent that continuously evaluates how ready an organization is for compliance audits. Calculates per-control scores, aggregates to framework/project level, identifies weaknesses, and generates improvement recommendations.
Dependencies
Tasks
Backend — Scoring Algorithm
Backend — Agent and AI Logic
Backend — Route / Controller / Utils
Frontend — Components
Frontend — Pages, Hooks, and Integration
Scoring Formula
overall = evidence_quality * 0.30
+ evidence_count * 0.20
+ evidence_recency * 0.15
+ task_completion * 0.20
+ risk_mitigation * 0.15
Levels: ready (>=80) | needs_work (60-79) | at_risk (30-59) | not_started (<30)
API Endpoints
| Route |
Method |
Purpose |
/api/readiness/calculate |
POST |
Trigger calculation (all) |
/api/readiness/calculate/:frameworkType |
POST |
Trigger for framework |
/api/readiness/scores |
GET |
All framework scores |
/api/readiness/scores/:frameworkType |
GET |
Framework scores |
/api/readiness/controls/:frameworkType |
GET |
Per-control scores |
/api/readiness/weakest |
GET |
Weakest controls |
/api/readiness/recommendations |
GET |
Top recommendations |
/api/readiness/history |
GET |
Historical trend |
Branch
feat/ai-foundation-infra
Assignees
@haJ1t @HarshP4585
Part of Phase 0 — Immediate Priority AI Features
P0-2: Control Assessment Agent — Readiness Scoring
AI agent that continuously evaluates how ready an organization is for compliance audits. Calculates per-control scores, aggregates to framework/project level, identifies weaknesses, and generates improvement recommendations.
Dependencies
Tasks
Backend — Scoring Algorithm
Servers/advisor/scoring/readinessCalculator.ts— Deterministic weighted formula:Backend — Agent and AI Logic
Servers/advisor/agents/controlAssessment.agent.ts— Control Assessment Agent definitionServers/advisor/tools/readinessTools.ts— Tool schemasServers/advisor/functions/readinessFunctions.ts— Tool implementationsBackend — Route / Controller / Utils
Servers/utils/readiness.utils.ts— DB queries (insert/get scores, aggregations, history)Servers/controllers/readiness.ctrl.ts— Request handlingServers/routes/readiness.route.ts— 8 endpoints:POST /api/readiness/calculate— Trigger calculation (all frameworks)POST /api/readiness/calculate/:frameworkType— Trigger for specific frameworkGET /api/readiness/scores— All framework readiness scoresGET /api/readiness/scores/:frameworkType— Scores for specific frameworkGET /api/readiness/controls/:frameworkType— Per-control scoresGET /api/readiness/weakest— Weakest controls across all frameworksGET /api/readiness/recommendations— Top improvement recommendationsGET /api/readiness/history— Historical readiness scores (trend)Servers/index.tsFrontend — Components
ReadinessScoreCard/— Score card with overall score, level badge, component breakdownReadinessHeatmap/— Framework heatmap (controls colored by readiness level)ReadinessTrend/— Historical trend chart (line chart over time)WeakControlsList/— Top weakest controls with recommendationsFrontend — Pages, Hooks, and Integration
Clients/src/presentation/pages/ReadinessDashboard/— New page at/readinessClients/src/application/hooks/useReadiness.ts— React Query hooksClients/src/application/repository/readiness.repository.ts— Axios calls/readinessinClients/src/application/config/routes.tsxScoring Formula
API Endpoints
/api/readiness/calculate/api/readiness/calculate/:frameworkType/api/readiness/scores/api/readiness/scores/:frameworkType/api/readiness/controls/:frameworkType/api/readiness/weakest/api/readiness/recommendations/api/readiness/historyBranch
feat/ai-foundation-infraAssignees
@haJ1t @HarshP4585
Part of Phase 0 — Immediate Priority AI Features