Research Plans View
Admin view for monitoring research plan execution, step progress, artifacts, extractions, and audit trails.
The Research Plans view (/admin/research-plans) provides a list page with health KPIs and a detail page with eight tabbed sub-views for deep inspection of individual plans.
List Page
Route: /admin/research-plans
Health KPI Cards
Five cards summarize overall plan health across the system:
| Card | Metric | Source |
|---|---|---|
| Active Plans | Plans not in completed or failed status | researchPlan.healthSummary |
| Stalled | Plans in stalled status (requiring attention) | researchPlan.healthSummary |
| Completed | Successfully finished plans | researchPlan.healthSummary |
| Failed | Plans that terminated with errors | researchPlan.healthSummary |
| Avg Steps/Plan | Average number of steps across all plans | researchPlan.healthSummary |
The healthSummary procedure runs five separate count queries against the research_plan table and one subquery averaging step counts from plan_step.
Plans Table
A paginated table (20 rows per page) listing all research plans, sorted by updated_at descending. Each row shows:
- Name -- linked to the plan detail page (
/admin/research-plans/{planId}) - Status -- color-coded badge (
planning,executing,awaiting_review,stalled,completed,failed) - Progress -- percentage and step fraction (e.g., "75% (3/4)")
- Question -- the research question (truncated)
- Updated -- last update timestamp
The researchPlan.list procedure returns plan rows joined with step counts computed per-plan via grouped queries on plan_step.
Detail Page
Route: /admin/research-plans/{planId}
The detail page shows the plan name, research question, and overview cards, then provides eight tabbed sections for inspecting different aspects of the plan.
Overview Cards
Five cards across the top:
| Card | Content |
|---|---|
| Status | Color-coded badge |
| Progress | Percentage with completed/total step count |
| Created | Creation timestamp |
| Completed | Completion timestamp (or dash if still running) |
| Session | Truncated Claude Code session ID that created the plan |
Below the cards, a metadata row shows Plan ID, User ID, Organization ID, and last update time. If the plan has output formatting notes, those appear in a separate card.
Skill Execution Card
If the plan has an associated skill execution (queried via researchPlan.skillExecution), a card shows:
- Skill name and status badge
- Duration
- Session ID
- Expandable metadata JSON
- Error message (if failed)
Tabbed Sections
Steps Tab
An expandable table of plan steps from researchPlan.stepResults. Each row shows:
| Column | Content |
|---|---|
| Step Order | Numeric sequence position |
| Type | Step type badge (e.g., web_search, analyze, synthesize) |
| Status | Color-coded badge (pending, in_progress, awaiting_input, completed, skipped, failed) |
| Instructions | Truncated step instructions |
| Confidence | Percentage (if set) |
| Duration | Computed from started_at to completed_at |
Clicking a row with details expands it to show:
- Start and completion timestamps, step ID
- Full instructions text
- Result summary JSON
- Step execution report JSON
- Output formatting notes
Artifacts Tab
A paginated, expandable table of research artifacts from researchPlan.artifacts (20 per page). Each row shows:
| Column | Content |
|---|---|
| Title | Artifact title |
| Type | Color-coded badge (analysis, synthesis, comparison, summary, source_list, finding) |
| Confidence | Percentage |
| Source | Source badge |
| Step | Truncated step ID |
| Created | Timestamp |
Expanding a row reveals the artifact ID, step ID, user ID, update timestamp, full text content, and structured content JSON.
Extractions Tab
A paginated, expandable table of data extraction results from researchPlan.extractionResults (20 per page). Each row shows:
| Column | Content |
|---|---|
| Status | Badge (pending, completed, failed, needs_review) |
| Schema Version | Version number |
| Confidence | Overall confidence percentage |
| Source | Source URL or artifact ID |
| Created | Timestamp |
Expanding a row reveals:
- Extraction ID, step ID, source artifact ID, source URL
- Error message (in a red alert box if present)
- Field-level confidence bars -- each extracted field gets a horizontal progress bar color-coded by confidence (green >= 80%, yellow >= 50%, red < 50%)
- Source location JSON, extracted data JSON, extraction schema JSON
Branching Tab
A flat table of branching conditions from researchPlan.branchingConditions. These control conditional step flow within a plan. Each row shows:
| Column | Content |
|---|---|
| After Step | Truncated step ID that triggers evaluation |
| Condition | The condition expression in a code block |
| If True Action | Action badge |
| Action Params | JSON of action parameters |
| Created | Timestamp |
Tool Calls Tab
A paginated, expandable table of MCP tool call logs from researchPlan.toolCallLog (50 per page). Each row shows:
| Column | Content |
|---|---|
| Tool | Tool name badge |
| Duration | Milliseconds |
| Error | OK/error badge |
| Session | Truncated Claude Code session ID |
| Time | Timestamp |
Expanding a row reveals the step ID, skill execution ID, request metadata JSON, and response metadata JSON.
Outputs Tab
A paginated, expandable table of research output deliverables from researchPlan.outputs (20 per page). Each row shows:
| Column | Content |
|---|---|
| Title | Output title |
| Media Type | Badge (e.g., markdown, json) |
| File Size | Human-readable size |
| Session | Truncated session ID |
| Created | Timestamp |
Expanding a row reveals the content summary, formatting notes used, and the full content (truncated at 2000 characters with a total character count shown).
Feedback Tab
An expandable table of user feedback entries from researchPlan.feedback. Each row shows:
| Column | Content |
|---|---|
| Type | Badge (initial, closing) |
| Satisfaction | Color-coded badge (positive, neutral, negative) |
| Follow-up | Whether follow-up was requested |
| Created | Timestamp |
Expanding a row reveals the user feedback summary, improvement suggestions, and follow-up details.
Audit Log Tab
A paginated table of audit events from researchPlan.auditLog (25 per page). Each row shows:
| Column | Content |
|---|---|
| Event | Color-coded badge (step_started, step_completed, step_failed, plan_modified, user_reviewed, session_resumed, skill_started, skill_completed) |
| Step | Truncated step ID |
| Session | Truncated Claude Code session ID |
| Data | Expandable JSON details |
| Time | Timestamp |
Component Structure
research-plans-content.tsx (list page)
|-- plan-health-cards.tsx (5 KPI cards)
|-- Paginated plans table with links to detail
research-plan-detail.tsx (detail page)
|-- PlanOverviewCards (5 status/progress cards)
|-- PlanSkillExecutionCard (linked skill execution)
|-- Tabs
|-- plan-steps-table.tsx (expandable)
|-- plan-artifacts-table.tsx (paginated, expandable)
|-- plan-extractions-table.tsx (paginated, expandable)
|-- plan-branching-conditions-table.tsx
|-- plan-tool-call-log-table.tsx (paginated, expandable)
|-- plan-outputs-table.tsx (paginated, expandable)
|-- plan-feedback-table.tsx (expandable)
|-- plan-audit-log-table.tsx (paginated)
Related Pages
- Admin Dashboard Overview -- all admin views and shared patterns
- Skill Executions View -- linked from the skill execution card on plan details
- Drizzle Patterns -- query patterns used in the
researchPlanrouter