Skip to content

Commit 3dfb1be

Browse files
wjlgatechclaude
andcommitted
feat: add late evening capture/analyze slot for midnight work sessions
- CAPTURE_TIMES: add 22:55 (was 12:55 + 17:55 only) - ANALYZE_TIMES: add 23:00 (was 13:00 + 18:00 only) - capture_loop + analyze_loop: weekdays_only=False (late work happens any day) - daemon status upcoming schedule updated to match Sessions worked until midnight are now captured and analyzed the same night instead of waiting until the next afternoon's 1pm run. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 99e7545 commit 3dfb1be

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/workflowx/cli/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,8 @@ def daemon_status() -> None:
913913
now = datetime.now()
914914
console.print(f"\n[bold]Upcoming Runs[/bold] (as of {now.strftime('%H:%M')})")
915915
upcoming = [
916-
("capture", next_fire_time(CAPTURE_TIMES, weekdays_only=True, now=now)),
917-
("analyze", next_fire_time(ANALYZE_TIMES, weekdays_only=True, now=now)),
916+
("capture", next_fire_time(CAPTURE_TIMES, weekdays_only=False, now=now)),
917+
("analyze", next_fire_time(ANALYZE_TIMES, weekdays_only=False, now=now)),
918918
("measure", next_fire_time(MEASURE_TIMES, weekdays_only=False, now=now)),
919919
("brief", next_fire_time(BRIEF_TIMES, weekdays_only=True, now=now)),
920920
]

src/workflowx/daemon.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434

3535
# ── Schedule constants ────────────────────────────────────────────────────────
3636

37-
CAPTURE_TIMES = [time(12, 55), time(17, 55)] # 5 min before analyze
38-
ANALYZE_TIMES = [time(13, 0), time(18, 0)]
37+
CAPTURE_TIMES = [time(12, 55), time(17, 55), time(22, 55)] # 5 min before analyze
38+
ANALYZE_TIMES = [time(13, 0), time(18, 0), time(23, 0)] # +late evening slot
3939
MEASURE_TIMES = [time(7, 0)]
4040
BRIEF_TIMES = [time(8, 30)]
4141
HEALTH_INTERVAL_SECONDS = 300 # 5 minutes
@@ -544,9 +544,9 @@ async def health_loop(config: Any, state_path: Path) -> None:
544544

545545

546546
async def capture_loop(config: Any, store: Any, state_path: Path) -> None:
547-
"""Capture loop: fires at CAPTURE_TIMES on weekdays."""
547+
"""Capture loop: fires at CAPTURE_TIMES every day (including weekends)."""
548548
while True:
549-
target = next_fire_time(CAPTURE_TIMES, weekdays_only=True)
549+
target = next_fire_time(CAPTURE_TIMES, weekdays_only=False)
550550
state = read_state(state_path)
551551
state.jobs.setdefault("capture", JobState()).next_run = target
552552
write_state(state, state_path)
@@ -559,7 +559,7 @@ async def capture_loop(config: Any, store: Any, state_path: Path) -> None:
559559
state.jobs["capture"] = JobState(
560560
last_run=datetime.now(),
561561
last_status="ok" if n > 0 else "skipped",
562-
next_run=next_fire_time(CAPTURE_TIMES, weekdays_only=True),
562+
next_run=next_fire_time(CAPTURE_TIMES, weekdays_only=False),
563563
)
564564
except Exception as e:
565565
logger.error("capture_loop_error", error=str(e))
@@ -570,9 +570,9 @@ async def capture_loop(config: Any, store: Any, state_path: Path) -> None:
570570

571571

572572
async def analyze_loop(config: Any, store: Any, state_path: Path) -> None:
573-
"""Analyze loop: fires at ANALYZE_TIMES on weekdays, then event-triggers propose."""
573+
"""Analyze loop: fires at ANALYZE_TIMES every day, then event-triggers propose."""
574574
while True:
575-
target = next_fire_time(ANALYZE_TIMES, weekdays_only=True)
575+
target = next_fire_time(ANALYZE_TIMES, weekdays_only=False)
576576
state = read_state(state_path)
577577
state.jobs.setdefault("analyze", JobState()).next_run = target
578578
write_state(state, state_path)
@@ -593,7 +593,7 @@ async def analyze_loop(config: Any, store: Any, state_path: Path) -> None:
593593
state.jobs["analyze"] = JobState(
594594
last_run=datetime.now(),
595595
last_status="ok",
596-
next_run=next_fire_time(ANALYZE_TIMES, weekdays_only=True),
596+
next_run=next_fire_time(ANALYZE_TIMES, weekdays_only=False),
597597
)
598598
except Exception as e:
599599
logger.error("analyze_loop_error", error=str(e))

0 commit comments

Comments
 (0)