Merge PR #391: Add workflow provenance quality metrics and classification
- Introduce task provenance tracking: agent_proposal, llm_backfill, controlled_fallback - Add quality computation function to classify workflows as 'AI-personalized' or 'guided baseline' - Calculate agent origin ratio, fallback ratio, and per-pillar coverage metrics - Implement configurable agent personalization threshold (default 35%) - Enhance plan metadata with comprehensive quality dimensions: - agentOriginRatio, agentOriginPercent, agentOriginTaskCount - agentOriginPillars, fallbackRatio, fallbackPercent, fallbackTaskCount - totalTaskCount and configurable thresholds - Simplify task provenance metadata handling in sanitization - Add backfill logic for existing plans to populate missing quality metrics - Maintain backward compatibility with existing plan storage
This commit is contained in:
@@ -161,6 +161,9 @@ async def get_today_workflow(
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
plan_json = plan.plan_json if isinstance(plan.plan_json, dict) else {}
|
||||
quality = plan_json.get("quality") if isinstance(plan_json.get("quality"), dict) else None
|
||||
|
||||
return {
|
||||
"success": True,
|
||||
"data": {
|
||||
@@ -180,6 +183,7 @@ async def get_today_workflow(
|
||||
"id": plan.id,
|
||||
"date": plan.date,
|
||||
"source": plan.source,
|
||||
"quality": quality,
|
||||
"created_at": plan.created_at.isoformat() if plan.created_at else None,
|
||||
"updated_at": plan.updated_at.isoformat() if plan.updated_at else None,
|
||||
"generation_mode": (plan.plan_json or {}).get("generation_mode"),
|
||||
|
||||
Reference in New Issue
Block a user