[Economics] Impact scoring for completed tasks and analyses
Task ID: q06-b2-D8197D99
Priority: 88
Layer: Senate (The Senate — governance and quality layer)
Goal
Build a comprehensive task effectiveness dashboard that measures which work is actually moving the needle on SciDEX. Leverage the existing task_effectiveness table and task_analyzer.py to score each completed task by its downstream impact: KG edges created, hypotheses generated, citations validated, wiki pages enriched. Display top performers and trends on the /senate dashboard to guide resource allocation and identify high-leverage work patterns.
Acceptance Criteria
☐ API endpoint /api/task-effectiveness created, returning task effectiveness data
☐ New "Task Effectiveness" section added to /senate.html showing:
- [ ] Top 10 tasks by impact score
- [ ] Top 10 tasks by effectiveness score (impact/cost ratio)
- [ ] Layer breakdown (which layers produce most impact)
- [ ] Average metrics per layer
☐ Data visualization with sortable tables or charts
☐ Run task_analyzer.py to backfill recent completed tasks
☐ Verify data populates correctly on senate dashboard
☐ Test: curl http://localhost/api/task-effectiveness returns valid JSON
☐ Test: /senate.html loads and displays task effectiveness section
Approach
Add API endpoint for task effectiveness
- Route:
/api/task-effectiveness in
api.py - Query
task_effectiveness table
- Return JSON with: top tasks by impact, top tasks by effectiveness, layer stats
- Include fields: task_id, quest_name, layer, impact_score, effectiveness_score, code metrics, DB impact
Enhance senate.html with Task Effectiveness section
- Add new section after "Coverage Overview"
- Display two tables: "Top Tasks by Impact" and "Top Tasks by Effectiveness"
- Show layer breakdown stats (avg impact per layer, total work per layer)
- Use existing styling (stat-cards, tables)
- Fetch data from
/api/task-effectiveness via JavaScript
Backfill task effectiveness data
- Run
python3 task_analyzer.py to analyze recent completed tasks
- Verify records are inserted into
task_effectiveness table
- Check for any errors or missing data
Test and verify
- Test API:
curl http://localhost/api/task-effectiveness | python3 -m json.tool - Test page:
curl http://localhost/senate.html → should load without errors
- Verify data displays correctly in browser
- Check that sorting/filtering works if implemented
Work Log
2026-04-02 03:00 UTC — Slot 6
- Started task: impact scoring for completed tasks
- Created spec file at
docs/planning/specs/q06-b2-D8197D99_spec.md
- Reviewed existing code:
task_analyzer.py, api.py, senate.html
- Confirmed
task_effectiveness table exists with comprehensive schema
- Next: implement API endpoint and UI