Trovella Wiki

Progress Tracking

How get_plan_status computes progress percentage, surfaces stall warnings, returns derived status, and breaks down step states.

Progress tracking gives the AI platform and administrators visibility into where a research plan stands. The primary tool is get_plan_status, which combines stored plan state, derived status from step states, stall detection, and step-level breakdowns into a single response.

get_plan_status Response

The tool returns a JSON object with these fields:

FieldTypeDescription
planIdstringThe plan identifier
namestringHuman-readable plan name
statusstringStored plan status from the database
derivedStatusstringComputed status from derivePlanStatus based on current step states
stalledbooleanWhether any step exceeds the stall threshold (see Stall Detection)
progressnumberPercentage of steps completed or skipped (0-100, rounded)
totalStepsnumberTotal number of steps in the plan
currentStepobject | nullThe step currently in_progress or awaiting_input, if any
completedStepsarraySteps with completed or skipped status, including result summaries
pendingStepsarraySteps still in pending status

Stored vs. Derived Status

The response includes both status (the value stored in research_plan.status) and derivedStatus (computed by derivePlanStatus from current step states). These can diverge temporarily -- for example, if a plan is marked stalled in the database but all its steps have since been completed. The derived status is the more accurate representation of the plan's actual state.

Progress Calculation

Progress is computed as the ratio of terminal steps to total steps:

const completedSteps = steps.filter((s) => s.status === "completed" || s.status === "skipped");
const progress = steps.length > 0 ? completedSteps.length / steps.length : 0;
// Response: Math.round(progress * 100)

Note that only completed and skipped steps count toward progress. Steps with failed status do not contribute to the progress percentage, even though they are terminal states for the purpose of derivePlanStatus. This means a plan where every step has failed shows 0% progress but a derived status of completed.

Step Breakdowns

The response partitions steps into three categories:

completedSteps includes both completed and skipped steps, ordered by step_order:

{
  "stepId": "...",
  "stepOrder": 2,
  "stepType": "analyze",
  "status": "completed",
  "resultSummary": { "key findings": "..." },
  "confidence": 0.85
}

currentStep is the single step in in_progress or awaiting_input, or null:

{
  "stepId": "...",
  "stepOrder": 3,
  "stepType": "synthesize",
  "status": "in_progress"
}

pendingSteps are steps not yet started:

{
  "stepId": "...",
  "stepOrder": 4,
  "stepType": "checkpoint"
}

list_active_plans

The list_active_plans tool returns all non-terminal plans (status not completed or failed) for the user's organization. Each entry includes a progress percentage, computed the same way as get_plan_status. This gives the AI platform a quick overview of ongoing work when starting a new session.

Admin Dashboard Integration

The research plans view in the admin dashboard uses the same progress calculation and stall detection logic. It displays:

  • All plans with their status and progress bars
  • Stall warnings for plans with stuck steps
  • Step-by-step breakdowns with timing information
  • Audit log entries for each plan

On this page