Agent-driven quant R&D loop: run_qlib + guardrail (ADR 0002) - #1438
Closed
Chan Man Kit, Tom (chantomkit) wants to merge 1 commit into
Closed
Chan Man Kit, Tom (chantomkit) wants to merge 1 commit into
Chan Man Kit, Tom (chantomkit) wants to merge 1 commit into
Conversation
…tools + ADR 0002 Adds agent_loop/, a deterministic, LLM-free package the Claude Code session agent drives directly — the agent is the brain (propose/code/judge); these tools are the hands. No .env / ANTHROPIC_API_KEY is needed; the LLM choke point (APIBackend) is removed from the execution path. - run_qlib.py: wraps QlibFBWorkspace.execute() -> Dockerized qlib backtest -> metrics JSON. Bakes in two bring-up fixes: force env_type=docker (default conda would auto-build a heavy rdagent4qlib env) and MLFLOW_ALLOW_FILE_STORE=true (container mlflow refuses the file store). - guardrail.py: deterministic promote/reject gate replacing the LLM-judge summarizer — locked holdout + trial-aware Deflated Sharpe (Bailey & Lopez de Prado 2014) + net-of-cost margin. - tests/test_guardrail.py: 4 passing acceptance tests (overfit factor rejected on the holdout gate; DSR haircut flips a Sharpe-2.2 winner from PROMOTE at N=1 to REJECT after 200 trials). - docs/proposals/0002-agent-driven-loop.md: ADR recording the agent-as-loop decision (amends 0001), the verified LLM-free spine, and the operational model for long-running jobs (§9). - docs/proposals/0001-autonomous-quant-rd-loop.md: foundational ADR (project context). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jv1sQsVSXgWex1dt4B6VxZ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See docs/proposals/0002-agent-driven-loop.md. Adds agent_loop/ (LLM-free tools the session agent drives): run_qlib (Docker qlib backtest) + guardrail (deterministic holdout + Deflated Sharpe promote/reject). 4 passing guardrail tests. No .env / API key in the execution path.
📚 Documentation preview 📚: https://RDAgent--1438.org.readthedocs.build/en/1438/