lifeos-agent / data /sample_tasks.py
Dhanushkumarps
Update app UI: reward chart, issue trends, warnings, summary banner
8eb34b1
Raw
History Blame Contribute Delete
14.2 kB
"""
LifeOS — Sample Data Fixtures
Defines the canonical SAMPLE_* constants (Section 4) and TRAINING_SCENARIOS
used by the Streamlit demo, training script, and baseline evaluator.
The SAMPLE_* constants match exactly the Section 9 demo scenario so that
judges see the expected reward curve (iteration 1 ~35, iter 2 ~60, iter 3 ~80).
GAP 4: Each training scenario has a "difficulty" field (easy/medium/hard).
Two new scenarios added: "gentle_start" (easy) and "deadline_storm" (hard).
"""
from typing import Any, Dict, List
# ---------------------------------------------------------------------------
# Section 9 demo scenario — use this for the pitch
# ---------------------------------------------------------------------------
SAMPLE_TASKS: List[Dict[str, Any]] = [
{
"id": 1,
"name": "Math exam preparation",
"deadline": "2026-04-24 18:00",
"duration_hrs": 6.0,
"priority": "high",
"subject": "Mathematics",
},
{
"id": 2,
"name": "Write essay on climate change",
"deadline": "2026-04-26 23:59",
"duration_hrs": 4.0,
"priority": "high",
"subject": "English",
},
{
"id": 3,
"name": "Physics project submission",
"deadline": "2026-04-25 17:00",
"duration_hrs": 3.0,
"priority": "medium",
"subject": "Physics",
},
{
"id": 4,
"name": "Daily homework review",
"deadline": "2026-04-23 22:00",
"duration_hrs": 1.5,
"priority": "low",
"subject": "General",
},
{
"id": 5,
"name": "Presentation practice",
"deadline": "2026-04-23 16:00",
"duration_hrs": 2.0,
"priority": "medium",
"subject": "Communication",
},
]
SAMPLE_CALENDAR: Dict[str, Any] = {
"2026-04-22": {
"slots": ["09:00-12:00", "14:00-17:00", "19:00-21:00"],
"day_name": "Tuesday",
},
"2026-04-23": {
"slots": ["09:00-12:00", "14:00-17:00", "19:00-21:00"],
"day_name": "Wednesday",
},
"2026-04-24": {
"slots": ["09:00-12:00", "14:00-17:00"],
"day_name": "Thursday",
},
"2026-04-25": {
"slots": ["09:00-12:00", "14:00-17:00", "19:00-21:00"],
"day_name": "Friday",
},
"2026-04-26": {
"slots": ["10:00-13:00", "15:00-18:00"],
"day_name": "Saturday",
},
}
SAMPLE_PREFERENCES: Dict[str, Any] = {
"prefers_morning": True,
"max_daily_hours": 8,
"min_break_gap_mins": 90,
"end_by": "22:00",
}
SAMPLE_ENERGY_PROFILE: Dict[str, float] = {
"morning": 0.9,
"afternoon": 0.7,
"evening": 0.5,
}
# ---------------------------------------------------------------------------
# 7 training scenarios — varied difficulty, priorities, and deadlines
# ---------------------------------------------------------------------------
TRAINING_SCENARIOS: List[Dict[str, Any]] = [
# 1 — Gentle start (easy: 2 tasks, 2 days, relaxed deadlines)
{
"label": "gentle_start",
"difficulty": "easy",
"tasks": [
{"id": 1, "name": "Read short story", "deadline": "2026-05-10 23:59", "duration_hrs": 1.5, "priority": "low", "subject": "English"},
{"id": 2, "name": "Practice math basics", "deadline": "2026-05-11 23:59", "duration_hrs": 2.0, "priority": "medium", "subject": "Mathematics"},
],
"calendar": {
"2026-05-09": {"slots": ["10:00-12:00", "14:00-16:00"], "day_name": "Friday"},
"2026-05-10": {"slots": ["09:00-12:00", "14:00-16:00"], "day_name": "Saturday"},
},
"preferences": {"prefers_morning": True, "max_daily_hours": 4, "min_break_gap_mins": 90, "end_by": "21:00"},
"energy_profile": {"morning": 0.85, "afternoon": 0.7, "evening": 0.5},
},
# 2 — Light week (easy: 3 low-stakes tasks)
{
"label": "light_week",
"difficulty": "easy",
"tasks": [
{"id": 1, "name": "Read history chapter", "deadline": "2026-05-09 23:59", "duration_hrs": 2.0, "priority": "low", "subject": "History"},
{"id": 2, "name": "French vocabulary", "deadline": "2026-05-10 12:00", "duration_hrs": 1.5, "priority": "low", "subject": "French"},
{"id": 3, "name": "Art portfolio review", "deadline": "2026-05-08 17:00", "duration_hrs": 2.5, "priority": "medium", "subject": "Art"},
],
"calendar": {
"2026-05-05": {"slots": ["09:00-11:00", "16:00-18:00"], "day_name": "Monday"},
"2026-05-06": {"slots": ["10:00-12:00", "14:00-16:00"], "day_name": "Tuesday"},
"2026-05-07": {"slots": ["09:00-11:00"], "day_name": "Wednesday"},
"2026-05-08": {"slots": ["10:00-13:00"], "day_name": "Thursday"},
},
"preferences": {"prefers_morning": False, "max_daily_hours": 4, "min_break_gap_mins": 90, "end_by": "21:00"},
"energy_profile": {"morning": 0.6, "afternoon": 0.85, "evening": 0.7},
},
# 3 — Exam crunch (medium: 3 high-priority, tight 4-day window)
{
"label": "exam_crunch",
"difficulty": "medium",
"tasks": [
{"id": 1, "name": "Chemistry revision", "deadline": "2026-05-03 18:00", "duration_hrs": 5.0, "priority": "high", "subject": "Chemistry"},
{"id": 2, "name": "Biology diagrams", "deadline": "2026-05-04 12:00", "duration_hrs": 3.0, "priority": "high", "subject": "Biology"},
{"id": 3, "name": "Math problem sets", "deadline": "2026-05-02 20:00", "duration_hrs": 4.0, "priority": "high", "subject": "Mathematics"},
],
"calendar": {
"2026-05-01": {"slots": ["09:00-13:00", "15:00-19:00"], "day_name": "Thursday"},
"2026-05-02": {"slots": ["09:00-13:00", "14:00-18:00"], "day_name": "Friday"},
"2026-05-03": {"slots": ["09:00-12:00", "13:00-17:00"], "day_name": "Saturday"},
"2026-05-04": {"slots": ["09:00-11:00"], "day_name": "Sunday"},
},
"preferences": {"prefers_morning": True, "max_daily_hours": 8, "min_break_gap_mins": 60, "end_by": "20:00"},
"energy_profile": {"morning": 0.95, "afternoon": 0.75, "evening": 0.4},
},
# 4 — Weekend warrior (medium: free only Sat/Sun)
{
"label": "weekend_warrior",
"difficulty": "medium",
"tasks": [
{"id": 1, "name": "Statistics homework", "deadline": "2026-05-19 23:59", "duration_hrs": 3.0, "priority": "high", "subject": "Statistics"},
{"id": 2, "name": "Philosophy essay draft", "deadline": "2026-05-19 23:59", "duration_hrs": 4.0, "priority": "medium", "subject": "Philosophy"},
{"id": 3, "name": "Geography map work", "deadline": "2026-05-18 17:00", "duration_hrs": 2.0, "priority": "medium", "subject": "Geography"},
],
"calendar": {
"2026-05-17": {"slots": ["08:00-12:00", "13:00-17:00", "18:00-21:00"], "day_name": "Saturday"},
"2026-05-18": {"slots": ["09:00-12:00", "13:00-16:00"], "day_name": "Sunday"},
},
"preferences": {"prefers_morning": True, "max_daily_hours": 8, "min_break_gap_mins": 60, "end_by": "21:00"},
"energy_profile": {"morning": 0.9, "afternoon": 0.65, "evening": 0.45},
},
# 5 — Project-heavy (hard: 7 tasks, mixed priorities, 6 days)
{
"label": "project_heavy",
"difficulty": "hard",
"tasks": [
{"id": 1, "name": "CS assignment code", "deadline": "2026-05-15 23:59", "duration_hrs": 5.0, "priority": "high", "subject": "CS"},
{"id": 2, "name": "CS assignment writeup", "deadline": "2026-05-15 23:59", "duration_hrs": 2.0, "priority": "high", "subject": "CS"},
{"id": 3, "name": "Economics essay", "deadline": "2026-05-17 12:00", "duration_hrs": 4.0, "priority": "high", "subject": "Economics"},
{"id": 4, "name": "Physics lab report", "deadline": "2026-05-16 17:00", "duration_hrs": 3.0, "priority": "medium", "subject": "Physics"},
{"id": 5, "name": "Spanish speaking prep", "deadline": "2026-05-14 09:00", "duration_hrs": 1.5, "priority": "medium", "subject": "Spanish"},
{"id": 6, "name": "Weekly reading", "deadline": "2026-05-18 23:59", "duration_hrs": 2.0, "priority": "low", "subject": "English"},
{"id": 7, "name": "Revision session", "deadline": "2026-05-18 23:59", "duration_hrs": 1.0, "priority": "low", "subject": "General"},
],
"calendar": {
"2026-05-12": {"slots": ["09:00-13:00", "14:00-18:00", "19:00-21:00"], "day_name": "Monday"},
"2026-05-13": {"slots": ["09:00-13:00", "14:00-18:00"], "day_name": "Tuesday"},
"2026-05-14": {"slots": ["09:00-13:00", "14:00-18:00", "19:00-21:00"], "day_name": "Wednesday"},
"2026-05-15": {"slots": ["09:00-13:00", "14:00-18:00"], "day_name": "Thursday"},
"2026-05-16": {"slots": ["09:00-13:00", "14:00-17:00"], "day_name": "Friday"},
"2026-05-17": {"slots": ["10:00-13:00", "15:00-18:00"], "day_name": "Saturday"},
},
"preferences": {"prefers_morning": True, "max_daily_hours": 8, "min_break_gap_mins": 90, "end_by": "22:00"},
"energy_profile": {"morning": 0.9, "afternoon": 0.7, "evening": 0.5},
},
# 6 — Balanced (medium: 5 tasks, 5 days, moderate load)
{
"label": "balanced_week",
"difficulty": "medium",
"tasks": [
{"id": 1, "name": "Algebra problem sets", "deadline": "2026-05-22 18:00", "duration_hrs": 3.0, "priority": "high", "subject": "Mathematics"},
{"id": 2, "name": "Literature analysis", "deadline": "2026-05-23 23:59", "duration_hrs": 2.5, "priority": "medium", "subject": "English"},
{"id": 3, "name": "Biology notes", "deadline": "2026-05-24 12:00", "duration_hrs": 2.0, "priority": "medium", "subject": "Biology"},
{"id": 4, "name": "Music theory worksheet", "deadline": "2026-05-25 17:00", "duration_hrs": 1.0, "priority": "low", "subject": "Music"},
{"id": 5, "name": "Weekly review session", "deadline": "2026-05-25 23:59", "duration_hrs": 1.5, "priority": "low", "subject": "General"},
],
"calendar": {
"2026-05-19": {"slots": ["09:00-12:00", "15:00-17:00"], "day_name": "Monday"},
"2026-05-20": {"slots": ["09:00-11:00", "14:00-17:00"], "day_name": "Tuesday"},
"2026-05-21": {"slots": ["09:00-12:00", "16:00-18:00"], "day_name": "Wednesday"},
"2026-05-22": {"slots": ["09:00-12:00", "14:00-16:00"], "day_name": "Thursday"},
"2026-05-23": {"slots": ["10:00-13:00"], "day_name": "Friday"},
},
"preferences": {"prefers_morning": True, "max_daily_hours": 6, "min_break_gap_mins": 90, "end_by": "21:00"},
"energy_profile": {"morning": 0.85, "afternoon": 0.7, "evening": 0.55},
},
# 7 — Deadline storm (hard: 8 tasks, 5 days, 3 same-day deadlines)
{
"label": "deadline_storm",
"difficulty": "hard",
"tasks": [
{"id": 1, "name": "Calculus final prep", "deadline": "2026-05-27 09:00", "duration_hrs": 4.0, "priority": "high", "subject": "Mathematics"},
{"id": 2, "name": "Data structures project", "deadline": "2026-05-27 09:00", "duration_hrs": 5.0, "priority": "high", "subject": "CS"},
{"id": 3, "name": "Technical writing report", "deadline": "2026-05-27 09:00", "duration_hrs": 3.0, "priority": "high", "subject": "English"},
{"id": 4, "name": "Chemistry lab analysis", "deadline": "2026-05-28 17:00", "duration_hrs": 2.5, "priority": "medium", "subject": "Chemistry"},
{"id": 5, "name": "Psychology case study", "deadline": "2026-05-28 23:59", "duration_hrs": 3.0, "priority": "medium", "subject": "Psychology"},
{"id": 6, "name": "Statistics problem set", "deadline": "2026-05-29 12:00", "duration_hrs": 2.0, "priority": "medium", "subject": "Statistics"},
{"id": 7, "name": "Group presentation prep", "deadline": "2026-05-26 20:00", "duration_hrs": 1.5, "priority": "high", "subject": "Communication"},
{"id": 8, "name": "Final review session", "deadline": "2026-05-29 23:59", "duration_hrs": 1.0, "priority": "low", "subject": "General"},
],
"calendar": {
"2026-05-25": {"slots": ["08:00-12:00", "13:00-17:00", "18:00-21:00"], "day_name": "Sunday"},
"2026-05-26": {"slots": ["08:00-12:00", "13:00-17:00", "18:00-21:00"], "day_name": "Monday"},
"2026-05-27": {"slots": ["09:00-13:00", "14:00-18:00"], "day_name": "Tuesday"},
"2026-05-28": {"slots": ["09:00-13:00", "14:00-18:00", "19:00-21:00"], "day_name": "Wednesday"},
"2026-05-29": {"slots": ["09:00-12:00", "14:00-17:00"], "day_name": "Thursday"},
},
"preferences": {"prefers_morning": True, "max_daily_hours": 9, "min_break_gap_mins": 60, "end_by": "22:00"},
"energy_profile": {"morning": 0.95, "afternoon": 0.8, "evening": 0.5},
},
]
# Difficulty ordering for training curriculum
DIFFICULTY_ORDER = {"easy": 0, "medium": 1, "hard": 2}
# ---------------------------------------------------------------------------
# Backward-compat alias for run_baseline.py
# ---------------------------------------------------------------------------
SCENARIOS = [
{
"label": s["label"],
"difficulty": s.get("difficulty", "medium"),
"student_id": f"train_{s['label']}",
"tasks": s["tasks"],
"calendar": s["calendar"],
"preferences": s["preferences"],
"energy_profile": s.get("energy_profile", {}),
"history": [],
"iteration": 0,
"current_plan": None,
}
for s in TRAINING_SCENARIOS
]