docs: cleanup debug logs + document goal system enhancements
- Removed all debug print statements from placeholder_resolver.py - Removed debug print statements from goals.py (list_goals, update_goal) - Updated CLAUDE.md with Phase 0a completion details: * Auto-population of start_date/start_value from historical data * Time-based tracking (behind schedule = time-deviated) * Hybrid goal display (with/without target_date) * Timeline visualization in goal lists * 7 bug fixes documented - Created memory file for future sessions (feedback_goal_system.md) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
dd395180a3
commit
255d1d61c5
3 files changed
+39
-54
No files matched your search
@@ -824,7 +824,6 @@ def _format_goals_behind(profile_id: str, n: int = 3) -> str:
|
||||
today = date.today()
|
||||
goals_with_deviation = []
|
||||
|
||||
print(f"[DEBUG] _format_goals_behind: Processing {len(goals)} goals")
|
||||
|
||||
for g in goals:
|
||||
goal_name = g.get('name') or g.get('goal_type', 'Unknown')
|
||||
@@ -834,16 +833,13 @@ def _format_goals_behind(profile_id: str, n: int = 3) -> str:
|
||||
start_date = g.get('start_date')
|
||||
target_date = g.get('target_date')
|
||||
|
||||
print(f"[DEBUG] Goal '{goal_name}': current={current}, target={target}, start={start}, start_date={start_date}, target_date={target_date}")
|
||||
|
||||
# Skip if missing required values
|
||||
if None in [current, target, start]:
|
||||
print(f"[DEBUG] → Skipped: Missing current/target/start")
|
||||
continue
|
||||
|
||||
# Skip if no target_date (can't calculate time-based progress)
|
||||
if not target_date:
|
||||
print(f"[DEBUG] → Skipped: No target_date")
|
||||
continue
|
||||
|
||||
try:
|
||||
@@ -867,9 +863,7 @@ def _format_goals_behind(profile_id: str, n: int = 3) -> str:
|
||||
created_at = g.get('created_at')
|
||||
if created_at:
|
||||
start_dt = date.fromisoformat(str(created_at).split('T')[0])
|
||||
print(f"[DEBUG] → Using created_at as start_date: {start_dt}")
|
||||
else:
|
||||
print(f"[DEBUG] → Skipped: No start_date and no created_at")
|
||||
continue # Can't calculate without start date
|
||||
|
||||
target_dt = target_date if isinstance(target_date, date) else date.fromisoformat(str(target_date))
|
||||
@@ -879,7 +873,6 @@ def _format_goals_behind(profile_id: str, n: int = 3) -> str:
|
||||
elapsed_days = (today - start_dt).days
|
||||
|
||||
if total_days <= 0:
|
||||
print(f"[DEBUG] → Skipped: Invalid date range (total_days={total_days})")
|
||||
continue # Invalid date range
|
||||
|
||||
expected_progress_pct = (elapsed_days / total_days) * 100
|
||||
@@ -892,15 +885,12 @@ def _format_goals_behind(profile_id: str, n: int = 3) -> str:
|
||||
g['_expected_progress'] = int(expected_progress_pct)
|
||||
g['_deviation'] = int(deviation)
|
||||
goals_with_deviation.append(g)
|
||||
print(f"[DEBUG] → Added: actual={int(actual_progress_pct)}%, expected={int(expected_progress_pct)}%, deviation={int(deviation)}%")
|
||||
|
||||
except (ValueError, ZeroDivisionError, TypeError) as e:
|
||||
print(f"[DEBUG] → Exception: {type(e).__name__}: {e}")
|
||||
continue
|
||||
|
||||
# Also process goals WITHOUT target_date (simple progress)
|
||||
goals_without_date = []
|
||||
print(f"[DEBUG] Processing goals without target_date for simple progress")
|
||||
|
||||
for g in goals:
|
||||
if g.get('target_date'):
|
||||
@@ -912,7 +902,6 @@ def _format_goals_behind(profile_id: str, n: int = 3) -> str:
|
||||
start = g.get('start_value')
|
||||
|
||||
if None in [current, target, start]:
|
||||
print(f"[DEBUG] Goal '{goal_name}' (no date): Skipped - missing values")
|
||||
continue
|
||||
|
||||
try:
|
||||
@@ -928,16 +917,13 @@ def _format_goals_behind(profile_id: str, n: int = 3) -> str:
|
||||
|
||||
g['_simple_progress'] = int(progress_pct)
|
||||
goals_without_date.append(g)
|
||||
print(f"[DEBUG] Goal '{goal_name}' (no date): Added with {int(progress_pct)}% progress")
|
||||
except (ValueError, ZeroDivisionError, TypeError) as e:
|
||||
print(f"[DEBUG] Goal '{goal_name}' (no date): Exception - {e}")
|
||||
continue
|
||||
|
||||
# Combine: Goals with negative deviation + Goals without date with low progress
|
||||
behind_with_date = [g for g in goals_with_deviation if g['_deviation'] < 0]
|
||||
behind_without_date = [g for g in goals_without_date if g['_simple_progress'] < 50]
|
||||
|
||||
print(f"[DEBUG] Behind with date: {len(behind_with_date)}, Behind without date: {len(behind_without_date)}")
|
||||
|
||||
# Create combined list with sort keys
|
||||
combined = []
|
||||
@@ -1002,7 +988,6 @@ def _format_goals_on_track(profile_id: str, n: int = 3) -> str:
|
||||
today = date.today()
|
||||
goals_with_deviation = []
|
||||
|
||||
print(f"[DEBUG] _format_goals_on_track: Processing {len(goals)} goals")
|
||||
|
||||
for g in goals:
|
||||
goal_name = g.get('name') or g.get('goal_type', 'Unknown')
|
||||
@@ -1012,16 +997,13 @@ def _format_goals_on_track(profile_id: str, n: int = 3) -> str:
|
||||
start_date = g.get('start_date')
|
||||
target_date = g.get('target_date')
|
||||
|
||||
print(f"[DEBUG] Goal '{goal_name}': current={current}, target={target}, start={start}, start_date={start_date}, target_date={target_date}")
|
||||
|
||||
# Skip if missing required values
|
||||
if None in [current, target, start]:
|
||||
print(f"[DEBUG] → Skipped: Missing current/target/start")
|
||||
continue
|
||||
|
||||
# Skip if no target_date
|
||||
if not target_date:
|
||||
print(f"[DEBUG] → Skipped: No target_date")
|
||||
continue
|
||||
|
||||
try:
|
||||
@@ -1065,15 +1047,12 @@ def _format_goals_on_track(profile_id: str, n: int = 3) -> str:
|
||||
g['_expected_progress'] = int(expected_progress_pct)
|
||||
g['_deviation'] = int(deviation)
|
||||
goals_with_deviation.append(g)
|
||||
print(f"[DEBUG] → Added: actual={int(actual_progress_pct)}%, expected={int(expected_progress_pct)}%, deviation={int(deviation)}%")
|
||||
|
||||
except (ValueError, ZeroDivisionError, TypeError) as e:
|
||||
print(f"[DEBUG] → Exception: {type(e).__name__}: {e}")
|
||||
continue
|
||||
|
||||
# Also process goals WITHOUT target_date (simple progress)
|
||||
goals_without_date = []
|
||||
print(f"[DEBUG] Processing goals without target_date for simple progress")
|
||||
|
||||
for g in goals:
|
||||
if g.get('target_date'):
|
||||
@@ -1085,7 +1064,6 @@ def _format_goals_on_track(profile_id: str, n: int = 3) -> str:
|
||||
start = g.get('start_value')
|
||||
|
||||
if None in [current, target, start]:
|
||||
print(f"[DEBUG] Goal '{goal_name}' (no date): Skipped - missing values")
|
||||
continue
|
||||
|
||||
try:
|
||||
@@ -1101,16 +1079,13 @@ def _format_goals_on_track(profile_id: str, n: int = 3) -> str:
|
||||
|
||||
g['_simple_progress'] = int(progress_pct)
|
||||
goals_without_date.append(g)
|
||||
print(f"[DEBUG] Goal '{goal_name}' (no date): Added with {int(progress_pct)}% progress")
|
||||
except (ValueError, ZeroDivisionError, TypeError) as e:
|
||||
print(f"[DEBUG] Goal '{goal_name}' (no date): Exception - {e}")
|
||||
continue
|
||||
|
||||
# Combine: Goals with positive deviation + Goals without date with high progress
|
||||
ahead_with_date = [g for g in goals_with_deviation if g['_deviation'] >= 0]
|
||||
ahead_without_date = [g for g in goals_without_date if g['_simple_progress'] >= 50]
|
||||
|
||||
print(f"[DEBUG] Ahead with date: {len(ahead_with_date)}, Ahead without date: {len(ahead_without_date)}")
|
||||
|
||||
# Create combined list with sort keys
|
||||
combined = []
|
||||
|
||||
Reference in new issue
Block a user