@@ -354,72 +354,82 @@ def _register_context_tools(server):
354354 IndicatorMeasurement = _get_model ("context" , "IndicatorMeasurement" )
355355 Tag = _get_model ("context" , "Tag" )
356356
357- scope_fields = ["id" , "reference" , "name" , "description" , "status" , "type" ,
357+ scope_fields = ["id" , "reference" , "name" , "description" , "status" ,
358358 "effective_date" , "review_date" , "version" , "is_approved" , "created_at" ]
359- scope_writable = ["name" , "description" , "status" , "type" , " effective_date" ,
359+ scope_writable = ["name" , "description" , "status" , "effective_date" ,
360360 "review_date" , "parent_scope_id" ]
361361
362362 _register_crud (server , "scope" , Scope , "context.scope" ,
363363 list_fields = scope_fields ,
364364 writable_fields = scope_writable ,
365365 search_fields = ["name" , "description" ],
366- filters = ["status" , "type" ],
366+ filters = ["status" ],
367367 field_overrides = {"description" : _html_field ("Description" )})
368368
369- issue_fields = ["id" , "reference" , "name" , "description" , "category " , "severity " ,
370- "status" , "is_approved" , "created_at" ]
371- issue_writable = ["name" , "description" , "category" , "severity " , "status" ]
369+ issue_fields = ["id" , "reference" , "name" , "description" , "type " , "category " ,
370+ "impact_level" , " status" , "is_approved" , "created_at" ]
371+ issue_writable = ["name" , "description" , "type" , " category" , "impact_level " , "status" ]
372372
373373 _register_crud (server , "issue" , Issue , "context.issue" ,
374374 list_fields = issue_fields ,
375375 writable_fields = issue_writable ,
376376 search_fields = ["name" , "description" ],
377- filters = ["category" , "severity " , "status" ],
377+ filters = ["type" , " category" , "impact_level " , "status" ],
378378 field_overrides = _HTML_DESC )
379379
380- stakeholder_fields = ["id" , "reference" , "name" , "description" , "type" , "influence_level" ,
381- "status" , "is_approved" , "created_at" ]
382- stakeholder_writable = ["name" , "description" , "type" , "influence_level" , "status" ]
380+ stakeholder_fields = ["id" , "reference" , "name" , "description" , "type" , "category" ,
381+ "influence_level" , "interest_level" , "status" , "is_approved" ,
382+ "created_at" ]
383+ stakeholder_writable = ["name" , "description" , "type" , "category" , "influence_level" ,
384+ "interest_level" , "status" ]
383385
384386 _register_crud (server , "stakeholder" , Stakeholder , "context.stakeholder" ,
385387 list_fields = stakeholder_fields ,
386388 writable_fields = stakeholder_writable ,
387389 search_fields = ["name" , "description" ],
388- filters = ["type" , "status" ],
390+ filters = ["type" , "category" , " status" ],
389391 field_overrides = _HTML_DESC )
390392
391- expectation_fields = ["id" , "reference" , "name" , " description" , "type" , "priority" ,
393+ expectation_fields = ["id" , "description" , "type" , "priority" ,
392394 "stakeholder_id" , "created_at" ]
393- expectation_writable = ["name" , " description" , "type" , "priority" , "stakeholder_id" ]
395+ expectation_writable = ["description" , "type" , "priority" , "stakeholder_id" ]
394396
395397 _register_crud (server , "expectation" , StakeholderExpectation , "context.expectation" ,
396398 list_fields = expectation_fields ,
397399 writable_fields = expectation_writable ,
398- search_fields = ["name" , " description" ],
400+ search_fields = ["description" ],
399401 filters = ["stakeholder_id" , "type" ],
400402 scope_filtered = False ,
401- field_overrides = _HTML_DESC )
403+ field_overrides = { "description" : _html_field ( "Description" )} )
402404
403- objective_fields = ["id" , "reference" , "name" , "description" , "type" , "priority" ,
404- "status" , "target_date" , "is_approved" , "created_at" ]
405- objective_writable = ["name" , "description" , "type" , "priority" , "status" , "target_date" ]
405+ objective_fields = ["id" , "reference" , "name" , "description" , "category" , "type" ,
406+ "status" , "target_date" , "owner_id" , "is_approved" , "created_at" ]
407+ objective_writable = ["name" , "description" , "category" , "type" , "status" ,
408+ "target_date" , "owner_id" ]
406409
407410 _register_crud (server , "objective" , Objective , "context.objective" ,
408411 list_fields = objective_fields ,
409412 writable_fields = objective_writable ,
410413 search_fields = ["name" , "description" ],
411- filters = ["type" , "status" , "priority" ],
412- field_overrides = _HTML_DESC )
414+ filters = ["category" , "type" , "status" ],
415+ field_overrides = {
416+ "description" : _html_field ("Description" ),
417+ "owner_id" : {"type" : "string" , "description" : "UUID of the objective owner (user)" },
418+ })
413419
414- swot_fields = ["id" , "reference" , "name" , "description" , "status" , "is_approved" , "created_at" ]
415- swot_writable = ["name" , "description" , "status" ]
420+ swot_fields = ["id" , "reference" , "name" , "description" , "analysis_date" ,
421+ "status" , "is_approved" , "created_at" ]
422+ swot_writable = ["name" , "description" , "analysis_date" , "status" ]
416423
417424 _register_crud (server , "swot_analysis" , SwotAnalysis , "context.swot" ,
418425 list_fields = swot_fields ,
419426 writable_fields = swot_writable ,
420427 search_fields = ["name" , "description" ],
421428 filters = ["status" ],
422- field_overrides = _HTML_DESC )
429+ field_overrides = {
430+ "description" : _html_field ("Description" ),
431+ "analysis_date" : {"type" : "string" , "description" : "Analysis date in ISO 8601 format (e.g. 2025-06-15)" },
432+ })
423433
424434 swot_item_fields = ["id" , "quadrant" , "description" , "impact_level" ,
425435 "order" , "swot_analysis_id" , "created_at" ]
@@ -450,27 +460,31 @@ def _register_context_tools(server):
450460 filters = ["type" , "status" ],
451461 field_overrides = _HTML_DESC )
452462
453- activity_fields = ["id" , "reference" , "name" , "description" , "type" , "status" ,
454- "is_approved" , "created_at" ]
455- activity_writable = ["name" , "description" , "type" , "status" , "parent_activity_id" ]
463+ activity_fields = ["id" , "reference" , "name" , "description" , "type" , "criticality" ,
464+ "owner_id" , "status" , "is_approved" , "created_at" ]
465+ activity_writable = ["name" , "description" , "type" , "criticality" , "owner_id" ,
466+ "status" , "parent_activity_id" ]
456467
457468 _register_crud (server , "activity" , Activity , "context.activity" ,
458469 list_fields = activity_fields ,
459470 writable_fields = activity_writable ,
460471 search_fields = ["name" , "description" ],
461- filters = ["type" , "status" ],
462- field_overrides = _HTML_DESC )
472+ filters = ["type" , "criticality" , "status" ],
473+ field_overrides = {
474+ "description" : _html_field ("Description" ),
475+ "owner_id" : {"type" : "string" , "description" : "UUID of the activity owner (user)" },
476+ })
463477
464478 site_fields = ["id" , "reference" , "name" , "description" , "type" , "status" ,
465- "address" , "city" , "country" , " is_approved" , "created_at" ]
466- site_writable = ["name" , "description" , "type" , "status" , "address" , "city" ,
467- "country" , " parent_site_id" ]
479+ "address" , "is_approved" , "created_at" ]
480+ site_writable = ["name" , "description" , "type" , "status" , "address" ,
481+ "parent_site_id" ]
468482
469483 _register_crud (server , "site" , Site , "context.site" ,
470484 list_fields = site_fields ,
471485 writable_fields = site_writable ,
472- search_fields = ["name" , "description" , "city" ],
473- filters = ["type" , "status" , "country" ],
486+ search_fields = ["name" , "description" ],
487+ filters = ["type" , "status" ],
474488 field_overrides = _HTML_DESC )
475489
476490 # Tags (simple CRUD, no approve)
@@ -980,18 +994,24 @@ def framework_compliance_summary(user, arguments):
980994 "justification" : _html_field ("Justification" ),
981995 })
982996
983- ap_fields = ["id" , "reference" , "name" , "description" , "priority" , "status" ,
997+ ap_fields = ["id" , "reference" , "name" , "description" , "gap_description" ,
998+ "remediation_plan" , "priority" , "status" ,
984999 "target_date" , "progress_percentage" ,
985- "requirement_id" , "assessment_id" , "is_approved" , "created_at" ]
986- ap_writable = ["name" , "description" , "priority" , "status" , "target_date" ,
1000+ "requirement_id" , "assessment_id" , "owner_id" , "is_approved" , "created_at" ]
1001+ ap_writable = ["name" , "description" , "gap_description" , "remediation_plan" ,
1002+ "priority" , "status" , "target_date" ,
9871003 "progress_percentage" , "requirement_id" , "assessment_id" , "owner_id" ]
9881004
9891005 _register_crud (server , "action_plan" , ComplianceActionPlan , "compliance.action_plan" ,
9901006 list_fields = ap_fields ,
9911007 writable_fields = ap_writable ,
9921008 search_fields = ["reference" , "name" , "description" ],
9931009 filters = ["status" , "priority" , "requirement_id" , "assessment_id" ],
994- field_overrides = _HTML_DESC )
1010+ field_overrides = {
1011+ "description" : _html_field ("Description" ),
1012+ "gap_description" : _html_field ("Gap description" ),
1013+ "remediation_plan" : _html_field ("Remediation plan" ),
1014+ })
9951015
9961016
9971017# ── Risks Module ───────────────────────────────────────────
@@ -1110,7 +1130,7 @@ def _register_risks_tools(server):
11101130 "initial_likelihood" , "initial_impact" ,
11111131 "current_likelihood" , "current_impact" ,
11121132 "residual_likelihood" , "residual_impact" ,
1113- "treatment_strategy " , "assessment_id" , "risk_owner_id" ]
1133+ "treatment_decision " , "assessment_id" , "risk_owner_id" ]
11141134
11151135 _register_crud (server , "risk" , Risk , "risks.risk" ,
11161136 list_fields = risk_fields ,
0 commit comments