Skip to content

refactor: final batch — proposal_engine migration (closing refactoring series)#491

Merged
cct08311github merged 1 commit intomainfrom
claude/final-refactoring-batch
Mar 28, 2026
Merged

refactor: final batch — proposal_engine migration (closing refactoring series)#491
cct08311github merged 1 commit intomainfrom
claude/final-refactoring-batch

Conversation

@cct08311github
Copy link
Copy Markdown
Owner

Summary

  • proposal_engine.py: 6 SQL ops → ProposalRepository 委託(approve/reject/expire/authority decision)
  • ProposalRepository.update_status 增強:schema-safe decided_at 處理(PRAGMA introspection)
  • ticker_watcher 主迴圈拆分評估後決定延後(高風險、低 ROI)

重構系列完工總結

PR 內容
#487 5-phase 架構重構(ConfigManager, Repository, MarketDataService, GuardChain, Logging)
#488 Deep Repository migration(PnL, Proposal, Order)
#489 Guard Chain 接線 decision_pipeline
#490 proposal_executor + concentration_guard 遷移
#this proposal_engine 遷移(收工)

累計成果

  • 27 個新增檔案(repositories, guards, services, tests)
  • 3 個消費端模組完整遷移至 Repository
  • 決策管線從 150+ 行 if/else → 7 個可插拔 Guard
  • 測試從 2429 → 2503(+74 新測試)
  • 0 regressions

Test plan

  • python -m pytest — 2503 passed, 0 failed

https://claude.ai/code/session_011LhoTJuk5FAaZMaHVzWC41

Migrate 6 SQL operations in proposal_engine.py:
- approve_proposal → repo.update_decision()
- reject_proposal → repo.update_decision()
- _expire_proposal → repo.update_decision()
- expire_old_proposals → repo.expire_pending_proposals()
- apply_authority_decision → repo.update_status()

ProposalRepository.update_status enhanced with schema-safe
decided_at handling (PRAGMA table_info check).

All 2503 tests pass (0 failures).

https://claude.ai/code/session_011LhoTJuk5FAaZMaHVzWC41
@cct08311github cct08311github merged commit 74f9d63 into main Mar 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants