Skip to content

Agent-driven quant R&D loop: run_qlib + guardrail (ADR 0002) - #1438

Closed
Chan Man Kit, Tom (chantomkit) wants to merge 1 commit into
microsoft:mainfrom
chantomkit:feat/agent-driven-quant-loop
Closed

Chan Man Kit, Tom (chantomkit) wants to merge 1 commit into
microsoft:mainfrom
chantomkit:feat/agent-driven-quant-loop

Conversation

@chantomkit

@chantomkit Chan Man Kit, Tom (chantomkit) commented Jul 6, 2026 •

Copy link
Copy Markdown

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/

…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
@chantomkit
Chan Man Kit, Tom (chantomkit) deleted the feat/agent-driven-quant-loop branch July 6, 2026 22:41
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.

1 participant