ReMe/reme/utils
jinliyl d5e0d2837b
Some checks failed
Tests ReMe / Unit Tests - py3.12 (push) Has been cancelled
Tests ReMe / Unit Tests - py3.13 (push) Has been cancelled
Windows Smoke / CLI smoke - py3.11 (push) Has been cancelled
Pre-commit / run (ubuntu-latest) (push) Has been cancelled
Tests ReMe / Unit Tests - py3.11 (push) Has been cancelled
refactor: rebuild auto-fin and daily-paper cookbooks on structured-output agents (#432)
* refactor: rebuild auto-fin and daily-paper cookbooks on structured-output agents

Rework the auto-fin and daily-paper cookbooks to run on structured-output
LLM agents instead of Claude Code agent wrappers, replace the SSH proxy with
data-source mirrors, and rewrite the affected unit tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* refactor(auto_fin): unify JSON output serialization and writing

- Extracted _write_output static method to serialize and write Pydantic models as compact JSON
- Replaced inline JSON dump and write calls with _write_output usage across auto_fin steps
- Added _report_path and _current_report for managing intra-day reports in AutoFinMergeStep
- Updated auto_fin merge step to write output via new _write_output method
- Enhanced news reading with caching in AutoFinHistoryStep
- Refined returns calculation to handle events before close on non-trading days correctly

feat(daily_paper): improve note path resolution and metadata handling

- Introduced iter_note_metadata generator for safe Markdown frontmatter iteration
- Added resolve_unique_note_path to avoid note filename conflicts on disk and in used titles
- Updated analyze, collect, digest, and select steps to use centralized constants and helpers
- Used utc_now_iso for consistent timestamping in metadata
- Replaced direct frontmatter loads with iter_note_metadata in collect and analyze steps
- Replaced hardcoded paper selection count with PAPER_COUNT constant in all relevant places
- Added _MAX_SELECT_ATTEMPTS constant in select step for attempt management
- Improved error messages for filename validation in daily paper title normalization

feat(auto_fin): add multi-run cron schedules for intraday refinement

- Defined three auto_fin cron jobs at 09:30, 11:30, and 18:00 Shanghai time for gradual report updates
- Each intraday run adds evidence cumulatively instead of replacing prior output wholly
- Updated daily_cookbook.yaml to register new cron schedules and remove legacy 12:00 cron

refactor(auto_fin_data): clean ETF code handling and page limits

- Replaced hardcoded DEFAULT_ETF_CODES with required non-empty config value "etf_codes"
- Added constants for major news and fund page limits to control pagination
- Improved ETF name extraction logic to handle missing fields consistently

fix(auto_fin_merge): fix report retrieval and merging logic

- Added support for getting current intra-day report in addition to previous day's report
- Modified merge template to include prior and current report sections for better context
- Adjusted report path handling to consistently use Path objects

test(auto_fin): add coverage for returns calculation and report retrieval

- Added test for returns when event occurs before close on non-trading day, checking next session entry
- Added test for previous and current report retrieval feeding merge context with disk files
- Extended test asserts for auto_fin cron schedule changes in config

style(daily_paper): reorder and cleanup imports

- Reorganized imports in _common.py for clarity and added missing collections.abc.Iterator import
- Cleaned up commented and unused imports across daily_paper steps

* feat: add configurable upstream mirror proxy

* style: format auto-fin data step

* fix: align cookbook mirrors and contracts

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-07 23:53:14 +08:00
..
__init__.py feat: simplify wikilink semantics and support line anchors (#412) 2026-08-05 11:47:50 +08:00
agent_state_io.py init: reme version 0.4.0 (#284) 2026-06-22 15:41:19 +08:00
arxiv.py refactor: rebuild auto-fin and daily-paper cookbooks on structured-output agents (#432) 2026-08-07 23:53:14 +08:00
common_utils.py init: reme version 0.4.0 (#284) 2026-06-22 15:41:19 +08:00
counter.py feat(evaluation): track job calls and agent token usage in benchmarks (#406) 2026-08-04 11:42:18 +08:00
env_utils.py init: reme version 0.4.0 (#284) 2026-06-22 15:41:19 +08:00
evaluation_interface.py feat(evaluation): track job calls and agent token usage in benchmarks (#406) 2026-08-04 11:42:18 +08:00
huggingface_papers.py refactor: rebuild auto-fin and daily-paper cookbooks on structured-output agents (#432) 2026-08-07 23:53:14 +08:00
jsonl_zst.py init: reme version 0.4.0 (#284) 2026-06-22 15:41:19 +08:00
line_anchor.py feat: simplify wikilink semantics and support line anchors (#412) 2026-08-05 11:47:50 +08:00
link_expansion.py feat: simplify wikilink semantics and support line anchors (#412) 2026-08-05 11:47:50 +08:00
logger_utils.py feat: add Auto Fin cookbook and managed outbound proxy support (#392) 2026-07-25 18:09:39 +08:00
logo_utils.py init: reme version 0.4.0 (#284) 2026-06-22 15:41:19 +08:00
service_utils.py feat(core): add shell execution and runtime memory status (#344) 2026-07-14 16:31:41 +08:00
similarity_utils.py init: reme version 0.4.0 (#284) 2026-06-22 15:41:19 +08:00
token_utils.py init: reme version 0.4.0 (#284) 2026-06-22 15:41:19 +08:00
tushare.py refactor: rebuild auto-fin and daily-paper cookbooks on structured-output agents (#432) 2026-08-07 23:53:14 +08:00
wikilink_handler.py feat: simplify wikilink semantics and support line anchors (#412) 2026-08-05 11:47:50 +08:00