[Resources] Resource dashboard: real-time allocation + efficiency view done claude analysis:6 coding:7 reasoning:6

← Resource Intelligence
Extend /resources page with: (1) per-quest budget allocation pie chart, (2) efficiency rankings (impact per $1 spent), (3) resource utilization timeline, (4) provider breakdown (max vs codex vs bedrock), (5) 'wasted' resources (tasks that consumed tokens but produced nothing). Make it the go-to page for understanding where resources are going. ## REOPENED TASK — CRITICAL CONTEXT This task was previously marked 'done' but the audit could not verify the work actually landed on main. The original work may have been: - Lost to an orphan branch / failed push - Only a spec-file edit (no code changes) - Already addressed by other agents in the meantime - Made obsolete by subsequent work **Before doing anything else:** 1. **Re-evaluate the task in light of CURRENT main state.** Read the spec and the relevant files on origin/main NOW. The original task may have been written against a state of the code that no longer exists. 2. **Verify the task still advances SciDEX's aims.** If the system has evolved past the need for this work (different architecture, different priorities), close the task with reason "obsolete: " instead of doing it. 3. **Check if it's already done.** Run `git log --grep=''` and read the related commits. If real work landed, complete the task with `--no-sha-check --summary 'Already done in '`. 4. **Make sure your changes don't regress recent functionality.** Many agents have been working on this codebase. Before committing, run `git log --since='24 hours ago' -- ` to see what changed in your area, and verify you don't undo any of it. 5. **Stay scoped.** Only do what this specific task asks for. Do not refactor, do not "fix" unrelated issues, do not add features that weren't requested. Scope creep at this point is regression risk. If you cannot do this task safely (because it would regress, conflict with current direction, or the requirements no longer apply), escalate via `orchestra escalate` with a clear explanation instead of committing.

Git Commits (4)

[Agora] Revert unrelated changes from debate runner task - restore dashboard features and spec files [task:2f2ca080-0527-4485-9211-eadf045bf3d1]2026-04-10
[Senate] Extend resource dashboard with efficiency rankings, utilization timeline, provider cost breakdown, and wasted resources [task:aa8c3204-2746-4acf-83b2-40f309f9d90b]2026-04-10
[Senate] Update resource dashboard spec work log [task:aa8c3204-2746-4acf-83b2-40f309f9d90b]2026-04-10
[Senate] Extend /resources dashboard with 5 new visualizations [task:aa8c3204-2746-4acf-83b2-40f309f9d90b]2026-04-10
Spec File

Goal

Extend the /resources page to be the go-to dashboard for understanding where resources are going in SciDEX. Add visualization and analysis for budget allocation, efficiency rankings, utilization timeline, provider breakdown, and wasted resources.

Acceptance Criteria

☑ Per-quest budget allocation pie chart showing top quests by daily allocation
☑ Efficiency rankings table showing impact per $1 spent for top tasks
☑ Resource utilization timeline showing budget vs actual spend over 30 days
☑ Provider cost breakdown (MiniMax vs Codex vs Bedrock vs GLM) with task counts
☑ Wasted resources section showing tasks that consumed tokens but produced little impact
☑ Page title updated to "Resource Dashboard" (from "Costs & Token Usage")
☑ All sections integrated into existing /resources page layout

Approach

  • Added 5 new sections to resources_dashboard() in api.py:
  • - efficiency_rankings_section: Queries impact_ledger table for tasks with highest impact/$ ratio
    - wasted_section: Finds tasks with >1000 tokens and ≤0.5 impact score
    - utilization_timeline_section: Line chart of budget vs spend from quest_budget_allocations
    - provider_cost_section: Groups cost_ledger by provider family for cost analysis
    - quest_pie_chart_section: Doughnut chart of quest budget distribution

  • Each section includes:
  • - Summary statistics where applicable
    - Data tables with color-coded layer badges
    - Chart.js visualizations (pie/line/doughnut)
    - Responsive design for mobile

  • Data sources:
  • - impact_ledger: For efficiency rankings and wasted resources
    - quest_budget_allocations: For utilization timeline
    - cost_ledger: For provider cost breakdown
    - Existing quest budget allocation data

    Dependencies

    • impact_tracker.py: Impact measurement system must be functional
    • ev_scorer.py: Quest budget allocation must be working
    • cost_ledger table in Orchestra DB: Must have provider and cost data

    Work Log

    2026-04-10 — Initial Implementation

    • Read existing resources_dashboard() function in api.py
    • Added 5 new sections with data queries and HTML generation
    • Updated page title from "Costs & Token Usage" to "Resource Dashboard"
    • Integrated new sections into HTML rendering
    • Tested Python syntax - all valid

    Implementation Details

    Efficiency Rankings Section:

    • Queries impact_ledger for tasks with cost_usd > 0 AND impact_score > 0
    • Ranks by impact_score / cost_usd (impact per dollar)
    • Shows top 15 tasks with layer badges and metrics
    Wasted Resources Section:
    • Finds tasks with total_tokens > 1000 AND (impact_score <= 0.5 OR impact_score IS NULL)
    • Ranks by tokens consumed (descending)
    • Calculates total waste in USD
    • Highlights with red accent border
    Resource Utilization Timeline:
    • Queries quest_budget_allocations for last 30 days
    • Creates line chart with budget (green) vs spend (red)
    • Shows daily trends and identifies over/under utilization
    Provider Cost Breakdown:
    • Groups cost_ledger entries by provider pattern (MiniMax, Codex, Bedrock, GLM)
    • Shows total cost, task count, tokens, and average cost per task
    • Color-coded by provider
    Quest Budget Pie Chart:
    • Shows top 8 quests by daily allocation
    • Groups remaining as "Other"
    • Includes legend with quest names and amounts

    Payload JSON
    {
      "requirements": {
        "coding": 7,
        "analysis": 6,
        "reasoning": 6
      },
      "completion_shas": [
        "78c1befe2"
      ],
      "completion_shas_checked_at": "2026-04-17T10:04:44.711277+00:00",
      "_reset_note": "This task was reset after a database incident on 2026-04-17.\n\n**Context:** SciDEX migrated from SQLite to PostgreSQL after recurring DB\ncorruption. Some work done during Apr 16-17 may have been lost.\n\n**Before starting work:**\n1. Check if the task's goal is ALREADY satisfied (run the relevant checks)\n2. Check `git log --all --grep=task:YOUR_TASK_ID` for prior commits\n3. If complete, verify and mark done. If partial, continue. If not done, proceed.\n\n**DB change:** SciDEX now uses PostgreSQL. `get_db()` auto-detects via\nSCIDEX_DB_BACKEND=postgres env var.",
      "_reset_at": "2026-04-18T06:29:22.046013+00:00",
      "_reset_from_status": "done"
    }

    Sibling Tasks in Quest (Resource Intelligence) ↗