99Common flags:
1010 --project PATH project to evolve (default: cwd)
1111 --scope all|invoked harvest scope (default: invoked)
12- --backend mock|anthropic
12+ --backend mock|claude|codex
13+ --source claude|codex|auto
1314 --model NAME
1415 --lookback-hours N
1516 --auto-adopt
2526
2627from skillopt_sleep .config import load_config
2728from skillopt_sleep .cycle import run_sleep_cycle
28- from skillopt_sleep .harvest import harvest
29+ from skillopt_sleep .harvest_sources import harvest_for_config
2930from skillopt_sleep .mine import mine
31+ from skillopt_sleep .staging import adopt as adopt_staging
32+ from skillopt_sleep .staging import latest_staging
3033from skillopt_sleep .state import SleepState
31- from skillopt_sleep .staging import latest_staging , adopt as adopt_staging
3234
3335
3436def _add_common (p : argparse .ArgumentParser ) -> None :
@@ -38,6 +40,9 @@ def _add_common(p: argparse.ArgumentParser) -> None:
3840 p .add_argument ("--model" , default = "" )
3941 p .add_argument ("--codex-path" , default = "" , help = "path to the real @openai/codex binary" )
4042 p .add_argument ("--claude-home" , default = "" , help = "override ~/.claude (also isolates state)" )
43+ p .add_argument ("--codex-home" , default = "" , help = "override ~/.codex for archived session harvest" )
44+ p .add_argument ("--source" , default = "" , choices = ["" , "claude" , "codex" , "auto" ],
45+ help = "session transcript source" )
4146 p .add_argument ("--lookback-hours" , type = int , default = 0 )
4247 p .add_argument ("--edit-budget" , type = int , default = 0 )
4348 p .add_argument ("--auto-adopt" , action = "store_true" )
@@ -59,6 +64,10 @@ def _cfg_from_args(args) -> Any:
5964 overrides ["codex_path" ] = os .path .abspath (args .codex_path )
6065 if getattr (args , "claude_home" , "" ):
6166 overrides ["claude_home" ] = os .path .abspath (args .claude_home )
67+ if getattr (args , "codex_home" , "" ):
68+ overrides ["codex_home" ] = os .path .abspath (args .codex_home )
69+ if getattr (args , "source" , "" ):
70+ overrides ["transcript_source" ] = args .source
6271 if getattr (args , "lookback_hours" , 0 ):
6372 overrides ["lookback_hours" ] = args .lookback_hours
6473 if getattr (args , "edit_budget" , 0 ):
@@ -143,12 +152,7 @@ def cmd_adopt(args) -> int:
143152
144153def cmd_harvest (args ) -> int :
145154 cfg = _cfg_from_args (args )
146- digests = harvest (
147- cfg .transcripts_dir ,
148- scope = cfg .get ("projects" , "invoked" ),
149- invoked_project = cfg .get ("invoked_project" , "" ),
150- limit = cfg .get ("max_tasks_per_night" , 40 ) * 3 ,
151- )
155+ digests = harvest_for_config (cfg , limit = cfg .get ("max_tasks_per_night" , 40 ) * 3 )
152156 tasks = mine (digests , max_tasks = cfg .get ("max_tasks_per_night" , 40 ),
153157 holdout_fraction = cfg .get ("holdout_fraction" , 0.34 ), seed = cfg .get ("seed" , 42 ))
154158 if args .json :
0 commit comments