refactor: retain decision state instead of full logs
This commit is contained in:
@@ -19,7 +19,6 @@ from history_stats import (
|
||||
build_empty_pre_submit_report,
|
||||
count_submissions_for_day,
|
||||
load_ledger,
|
||||
update_history_archive,
|
||||
)
|
||||
from market_intelligence import (
|
||||
DEFAULT_FETCH_WORKERS,
|
||||
@@ -1142,7 +1141,6 @@ def run_submission(
|
||||
preflight_advisor.set_feedback_stats(None)
|
||||
|
||||
updated_after = determine_updated_after(args, now)
|
||||
history_begin = now - timedelta(days=args.stats_window_days)
|
||||
day_start = now.replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
# Count today's submissions from the local ledger (avoids expensive paginated API call)
|
||||
daily_snapshot = count_submissions_for_day(tasks=[], ledger_entries=ledger_entries, day_start=day_start, day_end=now)
|
||||
@@ -1186,7 +1184,7 @@ def run_submission(
|
||||
if platform_available_slots is not None:
|
||||
remaining_daily_quota = min(remaining_daily_quota, platform_available_slots)
|
||||
|
||||
history_report_reason = "history_archive_skipped" if getattr(args, "skip_history_archive", False) else "history_archive_only_mode"
|
||||
history_report_reason = "decision_state_only"
|
||||
if args.daily_target > 0 and remaining_daily_quota <= 0:
|
||||
archived_history: list[dict[str, Any]] = []
|
||||
report = build_empty_pre_submit_report(
|
||||
@@ -1322,20 +1320,7 @@ def run_submission(
|
||||
)
|
||||
strategy_summary = strategy_manager.summary()
|
||||
|
||||
if getattr(args, "skip_history_archive", False):
|
||||
archived_history = []
|
||||
else:
|
||||
history_tasks = modelhub_client.list_tasks(
|
||||
page_size=50,
|
||||
only_mine=True,
|
||||
begin_time=history_begin,
|
||||
end_time=now,
|
||||
)
|
||||
archived_history = update_history_archive(
|
||||
history_archive_path,
|
||||
history_tasks,
|
||||
limit=getattr(args, "history_archive_limit", 5000),
|
||||
)
|
||||
archived_history = []
|
||||
|
||||
report = build_empty_pre_submit_report(
|
||||
window_days=args.stats_window_days,
|
||||
|
||||
Reference in New Issue
Block a user