Skip to content

Conversation

@SL-Mar
Copy link
Owner

@SL-Mar SL-Mar commented Jan 28, 2026

Title: Merge automate-backtest-workflow features into gamma
Description:

Summary

  • Merges new features from automate-backtest-workflow into production-ready gamma branch
  • Resolves 5 merge conflicts, keeping best of both branches

New Features Added

  • Scheduler and automated pipeline for strategy generation
  • Tavily deep search for semantic paper discovery
  • Notion client integration for publishing
  • Centralized logging with rotation and webhook alerts
  • Multi-article workflow with consolidated summaries

Production Features Preserved (from gamma)

  • Async HTTP with aiohttp (non-blocking)
  • Keyring-based secure credential storage
  • Security CVE fixes in dependencies
  • Docker support and operational docs

Files Changed

  • 28 files modified/added
  • New modules: scheduler/, logging_config.py, deep_search.py
  • Combined dependencies: apscheduler + security packages

SL-Mar and others added 30 commits January 26, 2026 08:52
Add code validation, API docs fetching, and comprehensive test suite
Replace generic `except:` with specific `except json.JSONDecodeError:`
to improve error handling and satisfy flake8-bandit security linting.
…-H2GzE

Improve error handling in coordinator agent JSON parsing
Co-authored-by: SL-Mar <126812704+SL-Mar@users.noreply.github.com>
Co-authored-by: SL-Mar <126812704+SL-Mar@users.noreply.github.com>
Change license to Apache 2.0 and document all CLI functions
Co-authored-by: SL-Mar <126812704+SL-Mar@users.noreply.github.com>
…to-apache-2-0

[WIP] Update all license references to Apache 2.0
[WIP] Fix mypy errors in gamma branch CI
[WIP] Fix MIT license references in the repository
Co-authored-by: SL-Mar <126812704+SL-Mar@users.noreply.github.com>
Remove legacy version references from README
Script to fix branch/tag mismatch:
- Resets main to restored beta content (v1.0.0)
- Updates gamma with v2.0.0 and testing warning
- Creates proper version tags (v1.0.0, v1.1.0, v2.0.0)
- Deletes deprecated v0.x tags
Add branch and tag cleanup script for repository restructuring
- Add comprehensive CLI integration tests with smoke tests and mocked workflows
- Fix pip-audit to fail on vulnerabilities (remove || true)
- Add coverage threshold (50%) and update codecov action
- Add separate integration test job in CI
- Add CONTRIBUTING.md with development setup and coding standards
- Add requirements-lock.txt with pinned versions for reproducible builds
- Add optional extras for LLM providers (openai, anthropic, mistral, all-llm)
- Add http_utils.py with retry logic (exponential backoff) and response caching
- Update article_tools.py to use new HTTP utilities for better reliability
- Simplify code of conduct section in CONTRIBUTING.md
Enhance CI/CD pipeline and add comprehensive integration tests
Add a new scheduler module for fully automated strategy generation:
- NotionClient: Publish strategy articles to Notion databases
- ArticleGenerator: Generate formatted reports from backtest results
- ScheduledRunner: APScheduler-based job runner with persistence
- AutomatedBacktestPipeline: End-to-end workflow orchestration

New CLI commands:
- quantcoder schedule start: Start scheduled automation
- quantcoder schedule run: Run pipeline once manually
- quantcoder schedule status: View run statistics
- quantcoder schedule config: Configure Notion credentials

Features:
- Papers -> Backtest -> Best Strategy -> Notion workflow
- Algorithms kept in QuantConnect, articles published to Notion
- Configurable schedules (hourly, daily, weekly)
- Tracks processed papers to avoid duplicates
- Persistent state across restarts
- Min Sharpe thresholds for generation and publishing

https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
- Set default max_strategies_per_run (batch limit) to 10
- Align notion_min_sharpe with min_sharpe_ratio by default
- Clarify in help text: algos meeting acceptance criteria stay in QC
- Notion article published only for successful algos

https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
New spot generation workflow:
- `quantcoder download 1 2 3` - Download multiple articles
- `quantcoder summarize 1 2 3` - Creates individual summaries + consolidated
- `quantcoder summaries` - List all available summaries with IDs
- `quantcoder generate 6` - Generate code from consolidated summary #6

Storage model:
- Individual summaries stored in ~/.quantcoder/summaries/
- Consolidated summaries auto-created when summarizing multiple articles
- Consolidated gets next available ID, stores references to sources
- Same `generate` command works for both individual and consolidated

Implementation:
- SummaryStore: Manages summary storage with index
- IndividualSummary/ConsolidatedSummary: Data models
- LLM consolidation: Merges multiple summaries into coherent strategy
- Updated CLI commands to accept multiple IDs

https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
- Add --backtest flag to generate command to run QuantConnect backtest
- Add --min-sharpe option (default 0.5) for acceptance threshold
- Add --start-date and --end-date options for backtest period
- Auto-publish to Notion when Sharpe meets threshold
- Add _publish_to_notion helper for article creation
- Export StrategyArticle, ScheduleConfig, ScheduleInterval, PipelineConfig from scheduler

This enables the spot generation workflow to optionally backtest
generated code and publish successful strategies to Notion, matching
the batch workflow behavior.

https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
- Add TavilyClient for Tavily Search API integration
- Add DeepSearchTool with LLM-based relevance filtering
- Add --deep flag to search command for semantic search
- Add --no-filter flag to skip LLM filtering
- Add --tavily-key option to schedule config command
- Add has_tavily_api_key() and get_tavily_api_key() to Config
- Export DeepSearchTool and TavilyClient from tools module
- Add 19 tests for deep search functionality

Usage:
  quantcoder search "momentum strategy" --deep
  quantcoder schedule config --tavily-key tvly-xxx

The deep search uses Tavily's semantic search with academic domain
filtering (arXiv, SSRN, etc.) and optional LLM filtering to identify
papers with implementable quantitative trading strategies.

https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
Spot workflow (generate command):
- Add --evolve flag to run evolution after backtest passes
- Add --gens option (default 5) for evolution generations
- Add --variants option (default 3) for variants per generation
- Add _run_evolution() helper function for evolution execution

Batch workflow (schedule run/start commands):
- Add --evolve, --gens, --variants options to schedule run
- Add same options to schedule start for scheduled runs
- Add evolve_strategies, evolution_generations, evolution_variants
  to PipelineConfig

Usage:
  # Spot workflow
  quantcoder generate 1 --backtest --evolve --gens 5

  # Batch workflow
  quantcoder schedule run --evolve --gens 5
  quantcoder schedule start --interval daily --evolve

https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
- Create logging_config.py with log rotation, JSON structured logging, and webhook alerting
- Add LoggingConfigSettings to config.toml for configurable log levels, rotation size/count
- Update CLI with `logs` command group: show, list, clear, config subcommands
- Add AutoStats persistence to disk (session history, load_latest, list_sessions)
- Integrate new logging system into CLI setup with Rich console handler

https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
Complete guide covering all QuantCoder features:
- Two workflows (Spot and Batch)
- All CLI commands
- Configuration options
- Logging and monitoring
- Deep search with Tavily
- Strategy evolution
- Notion integration

https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
Combines gamma's production-ready features with new capabilities:
- Scheduler and automated pipeline from backtest-workflow
- Tavily deep search for semantic paper discovery
- Notion integration for publishing
- Centralized logging with rotation and webhooks

Kept gamma's production features:
- Async aiohttp for article tools
- Keyring-based secure credential storage
- Security CVE fixes in dependencies
- Docker support and production docs

https://claude.ai/code/session_01C3JqCdz2wAs1RmPhW3SMrT
@SL-Mar SL-Mar merged commit de6394e into gamma Jan 28, 2026
3 of 15 checks passed
@SL-Mar SL-Mar deleted the claude/merge-backtest-to-gamma-1ug7u branch January 28, 2026 21:53
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.

3 participants