quantlab-factor-agent 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. factor_agent/KUNQUANT_LICENSE +201 -0
  2. factor_agent/__init__.py +8 -0
  3. factor_agent/_acceptance_model.py +93 -0
  4. factor_agent/_admission.py +168 -0
  5. factor_agent/_expression_fold.py +48 -0
  6. factor_agent/_feedback.py +399 -0
  7. factor_agent/_max_drawdown.py +51 -0
  8. factor_agent/_model_cache.py +100 -0
  9. factor_agent/_scheduler.py +35 -0
  10. factor_agent/acceptance.py +808 -0
  11. factor_agent/accepted/__init__.py +1 -0
  12. factor_agent/aggregations.py +122 -0
  13. factor_agent/campaign.py +797 -0
  14. factor_agent/candidate.py +51 -0
  15. factor_agent/config.py +651 -0
  16. factor_agent/derived.py +98 -0
  17. factor_agent/evaluator.py +1096 -0
  18. factor_agent/events.py +343 -0
  19. factor_agent/exported.py +177 -0
  20. factor_agent/gate/__init__.py +359 -0
  21. factor_agent/gate/_canonical.py +331 -0
  22. factor_agent/gate/_checks.py +85 -0
  23. factor_agent/gate/_constraints.py +85 -0
  24. factor_agent/gate/_dimension.py +177 -0
  25. factor_agent/gate/_originality.py +146 -0
  26. factor_agent/gate/_sandbox.py +105 -0
  27. factor_agent/gate/graph.py +223 -0
  28. factor_agent/gate/stages.py +383 -0
  29. factor_agent/gate/vocabulary.py +1097 -0
  30. factor_agent/ledger.py +85 -0
  31. factor_agent/llm/__init__.py +0 -0
  32. factor_agent/llm/_common.py +18 -0
  33. factor_agent/llm/_raw.py +78 -0
  34. factor_agent/llm/anthropic.py +100 -0
  35. factor_agent/llm/base.py +124 -0
  36. factor_agent/llm/claude_code.py +101 -0
  37. factor_agent/llm/log.py +74 -0
  38. factor_agent/llm/openai_compatible.py +113 -0
  39. factor_agent/llm/replay.py +59 -0
  40. factor_agent/llm/scripted.py +39 -0
  41. factor_agent/period_lag.py +91 -0
  42. factor_agent/prompts.py +557 -0
  43. factor_agent/researcher.py +615 -0
  44. factor_agent/scoring.py +143 -0
  45. factor_agent/segments.py +184 -0
  46. factor_agent/session.py +500 -0
  47. factor_agent/snapshot.py +219 -0
  48. factor_agent/web/__init__.py +7 -0
  49. factor_agent/web/_acceptance.py +145 -0
  50. factor_agent/web/_config.py +51 -0
  51. factor_agent/web/_diagnosis.py +110 -0
  52. factor_agent/web/_files.py +78 -0
  53. factor_agent/web/_health.py +207 -0
  54. factor_agent/web/_ic.py +27 -0
  55. factor_agent/web/_ledger.py +293 -0
  56. factor_agent/web/_memory.py +42 -0
  57. factor_agent/web/_results.py +77 -0
  58. factor_agent/web/_round.py +219 -0
  59. factor_agent/web/_trials.py +112 -0
  60. factor_agent/web/app.py +118 -0
  61. factor_agent/web/run_view.py +329 -0
  62. factor_agent/web/static/assets/index-9QjjJgl3.css +1 -0
  63. factor_agent/web/static/assets/index-iOE9ei_S.js +74 -0
  64. factor_agent/web/static/index.html +13 -0
  65. factor_agent/zoo.py +136 -0
  66. quantlab_factor_agent-0.1.0.dist-info/METADATA +172 -0
  67. quantlab_factor_agent-0.1.0.dist-info/RECORD +72 -0
  68. quantlab_factor_agent-0.1.0.dist-info/WHEEL +5 -0
  69. quantlab_factor_agent-0.1.0.dist-info/entry_points.txt +2 -0
  70. quantlab_factor_agent-0.1.0.dist-info/licenses/LICENSE +21 -0
  71. quantlab_factor_agent-0.1.0.dist-info/licenses/factor_agent/KUNQUANT_LICENSE +201 -0
  72. quantlab_factor_agent-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>factor-agent</title>
7
+ <script type="module" crossorigin src="/assets/index-iOE9ei_S.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-9QjjJgl3.css">
9
+ </head>
10
+ <body>
11
+ <div id="root"></div>
12
+ </body>
13
+ </html>
factor_agent/zoo.py ADDED
@@ -0,0 +1,136 @@
1
+ """The Zoo: the factors a candidate must not rewrite, as graphs the Gate compares it with.
2
+
3
+ It holds one graph per output of every KunQuant factor of the reference set,
4
+ of the known factors and of every factor the campaign has accepted so far,
5
+ each entry tagged with its ``Kind``; a known factor's label says it is one,
6
+ so a refusal names it as known. A reference or known factor without a
7
+ KunQuant graph (a Polars factor, a view over a store) cannot be compared by
8
+ graph; its names are kept in ``not_covered`` so the gap is visible, and only
9
+ the correlation check of admission covers them. A view or wrapper that keeps
10
+ its factor's output names (``NeutralizedFactor``, ``StartClippedFactor``,
11
+ ...) is compared by the graph of the factor it wraps (``owner``).
12
+ """
13
+
14
+ from collections.abc import Iterable
15
+ from dataclasses import dataclass
16
+ from typing import TYPE_CHECKING, Literal
17
+
18
+ from KunQuant.Op import Output
19
+ from quantlab.factor.kunquant import FactorKunQuant
20
+
21
+ from factor_agent.gate.graph import Graph
22
+
23
+ if TYPE_CHECKING:
24
+ from factor_agent.gate.vocabulary import Vocabulary
25
+
26
+
27
+ def owner(factor):
28
+ """The factor whose outputs ``factor`` shows: through every wrapper (``config.factor``) that keeps the names.
29
+
30
+ The walk stops at a ``FactorKunQuant``, at a factor that wraps none, or
31
+ before a wrapped factor lacking one of the outer names (a composite
32
+ that derives new outputs); that factor is returned.
33
+ """
34
+ names = set(factor.get_factor_names())
35
+ while not isinstance(factor, FactorKunQuant):
36
+ inner = getattr(factor.config, "factor", None)
37
+ if inner is None or not names <= set(inner.get_factor_names()):
38
+ break
39
+ factor = inner
40
+ return factor
41
+
42
+
43
+ #: Where a zoo entry comes from: the reference set, the known factors or the campaign's accepted factors.
44
+ Kind = Literal["reference", "known", "accepted"]
45
+
46
+ #: What a known factor's label adds after its source.
47
+ KNOWN = "a known factor"
48
+
49
+
50
+ def factor_label(name: str, source: str, kind: Kind) -> str:
51
+ """How rejection reasons and metrics name a factor.
52
+
53
+ ``name (source)``, or ``name (source, a known factor)`` when ``kind`` is
54
+ ``"known"``; ``source`` is the factor's class, or where the campaign
55
+ accepted it.
56
+ """
57
+ return f"{name} ({source}, {KNOWN})" if kind == "known" else f"{name} ({source})"
58
+
59
+
60
+ @dataclass(frozen=True)
61
+ class ZooEntry:
62
+ """One factor: its name, its source, its ``Kind`` and its graph."""
63
+
64
+ name: str
65
+ source: str
66
+ graph: Graph
67
+ kind: Kind = "reference"
68
+
69
+ @property
70
+ def label(self) -> str:
71
+ """The factor as rejection reasons name it (``factor_label``)."""
72
+ return factor_label(self.name, self.source, self.kind)
73
+
74
+
75
+ class Zoo:
76
+ """The factors the Gate checks originality against.
77
+
78
+ Parameters
79
+ ----------
80
+ entries : sequence of ZooEntry
81
+ The factors with a graph.
82
+ not_covered : sequence of str
83
+ Labels of reference and known factors without a KunQuant graph.
84
+ """
85
+
86
+ def __init__(self, entries: Iterable[ZooEntry] = (), not_covered: Iterable[str] = ()):
87
+ self._entries = list(entries)
88
+ self._not_covered = tuple(not_covered)
89
+
90
+ @classmethod
91
+ def from_existing(cls, reference, vocabulary: "Vocabulary", known=()) -> "Zoo":
92
+ """Return the zoo of the existing factors: ``reference`` and ``known``, quantlab factor objects.
93
+
94
+ Each output of a ``FactorKunQuant`` among ``config.factor_names`` is
95
+ an entry named after it, with the factor's class as its source, its
96
+ graph recorded under ``vocabulary``'s operator names; the names of
97
+ every other factor go to ``not_covered``. The reference factors come
98
+ first; ``known`` (``CampaignConfig.load_factors`` has dropped the
99
+ outputs already in the reference set) are tagged as known.
100
+ """
101
+ entries, not_covered = [], []
102
+ groups: tuple[tuple[Kind, Iterable], ...] = (("reference", reference), ("known", known))
103
+ for kind, group in groups:
104
+ for factor in group:
105
+ names = factor.get_factor_names()
106
+ factor = owner(factor)
107
+ source = type(factor).__name__
108
+ if not isinstance(factor, FactorKunQuant):
109
+ not_covered += [factor_label(name, source, kind) for name in names]
110
+ continue
111
+ outputs = {op.attrs["name"]: op for op in factor.graph().ops if isinstance(op, Output)}
112
+ for name in names:
113
+ graph = Graph.record(outputs[name].inputs[0], vocabulary, strict=False)
114
+ entries.append(ZooEntry(name, source, graph, kind))
115
+ return cls(entries, not_covered)
116
+
117
+ def add(self, name: str, source: str, graph: Graph) -> ZooEntry:
118
+ """Add a factor the campaign has just accepted, and return its entry."""
119
+ entry = ZooEntry(name, source, graph, "accepted")
120
+ self._entries.append(entry)
121
+ return entry
122
+
123
+ @property
124
+ def entries(self) -> tuple[ZooEntry, ...]:
125
+ """Every factor with a graph: reference factors, then known factors, then accepted ones."""
126
+ return tuple(self._entries)
127
+
128
+ @property
129
+ def covered(self) -> tuple[str, ...]:
130
+ """The labels of the factors compared by graph."""
131
+ return tuple(entry.label for entry in self._entries)
132
+
133
+ @property
134
+ def not_covered(self) -> tuple[str, ...]:
135
+ """The labels of the reference and known factors the graph comparison cannot cover."""
136
+ return self._not_covered
@@ -0,0 +1,172 @@
1
+ Metadata-Version: 2.4
2
+ Name: quantlab-factor-agent
3
+ Version: 0.1.0
4
+ Summary: LLM-driven, mechanism-first formulaic factor research on quantlab, evaluated with KunQuant.
5
+ Author: Zhaorong Dai
6
+ License-Expression: MIT AND Apache-2.0
7
+ Project-URL: Homepage, https://github.com/ZhaorongDai/quantlab-factor-agent
8
+ Project-URL: Repository, https://github.com/ZhaorongDai/quantlab-factor-agent
9
+ Project-URL: Documentation, https://zhaorongdai.github.io/quantlab-factor-agent/
10
+ Project-URL: Issues, https://github.com/ZhaorongDai/quantlab-factor-agent/issues
11
+ Project-URL: Changelog, https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/CHANGELOG.md
12
+ Keywords: quant,factor,alpha,llm,agent,kunquant,quantlab
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Financial and Insurance Industry
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Office/Business :: Financial :: Investment
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Requires-Python: >=3.13
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ License-File: factor_agent/KUNQUANT_LICENSE
26
+ Requires-Dist: anthropic>=2.3.0
27
+ Requires-Dist: openai>=3.37.0
28
+ Requires-Dist: psutil>=7.2.2
29
+ Requires-Dist: pyyaml>=6.0.3
30
+ Requires-Dist: quantlab-py>=0.3.1
31
+ Provides-Extra: web
32
+ Requires-Dist: fastapi>=0.162.0; extra == "web"
33
+ Requires-Dist: uvicorn>=0.54.0; extra == "web"
34
+ Dynamic: license-file
35
+
36
+ <p align="center">
37
+ <img src="https://raw.githubusercontent.com/ZhaorongDai/quantlab-factor-agent/main/docs/_static/logo.svg" alt="quantlab-factor-agent logo" width="112">
38
+ </p>
39
+
40
+ <h1 align="center">quantlab-factor-agent</h1>
41
+
42
+ <p align="center">
43
+ <a href="https://github.com/ZhaorongDai/quantlab-factor-agent/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/ZhaorongDai/quantlab-factor-agent/ci.yml?branch=main&label=ci"></a>
44
+ <a href="https://zhaorongdai.github.io/quantlab-factor-agent/"><img alt="Docs" src="https://img.shields.io/badge/docs-online-3776ab"></a>
45
+ <a href="https://pypi.org/project/quantlab-factor-agent/"><img alt="PyPI" src="https://img.shields.io/pypi/v/quantlab-factor-agent?label=pypi&color=3776ab"></a>
46
+ <a href="https://www.python.org/downloads/"><img alt="Python 3.13+" src="https://img.shields.io/badge/python-3.13%2B-3776ab?logo=python&logoColor=white"></a>
47
+ <a href="https://zhaorongdai.github.io/quantlab-factor-agent/getting-started/installation.html"><img alt="Platform: Linux and macOS" src="https://img.shields.io/badge/platform-Linux%20%7C%20macOS-3776ab"></a>
48
+ <a href="https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/LICENSE"><img alt="License: MIT and Apache-2.0" src="https://img.shields.io/badge/license-MIT%20%2B%20Apache--2.0-green"></a>
49
+ <a href="https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/CHANGELOG.md"><img alt="Changelog" src="https://img.shields.io/badge/changelog-latest-3776ab"></a>
50
+ <img alt="Status: alpha" src="https://img.shields.io/badge/status-alpha-orange">
51
+ <a href="https://github.com/ZhaorongDai/quantlab"><img alt="Built on quantlab" src="https://img.shields.io/badge/built%20on-quantlab-3776ab"></a>
52
+ <a href="https://github.com/Menooker/KunQuant"><img alt="Factors: KunQuant" src="https://img.shields.io/badge/factors-KunQuant-0ea5e9"></a>
53
+ </p>
54
+
55
+ <p align="center">English | <a href="https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/README.zh-CN.md">简体中文</a></p>
56
+
57
+ quantlab-factor-agent mines daily stock factors with language models, mechanism first. A
58
+ model states an economic mechanism and writes the factor it implies as KunQuant code. Fixed
59
+ checks and statistics from [quantlab](https://github.com/ZhaorongDai/quantlab) then decide
60
+ whether the factor is new and adds to the factors you already have. The model only proposes
61
+ and reviews, and it sees nothing but the training segment.
62
+
63
+ [Documentation](https://zhaorongdai.github.io/quantlab-factor-agent/) ·
64
+ [Example configs](https://github.com/ZhaorongDai/quantlab-factor-agent/tree/main/configs/) · [Changelog](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/CHANGELOG.md)
65
+
66
+ > **Status: alpha (0.x).** The API, the config format and the run directory's layout may
67
+ > change between minor versions.
68
+
69
+ ## How it works
70
+
71
+ <p align="center">
72
+ <img src="https://raw.githubusercontent.com/ZhaorongDai/quantlab-factor-agent/main/docs/_static/research-loop.svg" alt="Each round: the planner picks directions, the proposer writes candidates, the Gate checks them in a sandbox, the reviewer checks that hypothesis and code agree, the Evaluator scores them on the training segment and admission decides; trials go to the ledger for the next round. After the campaign, acceptance validates, opens the hold-out once and exports." width="100%">
73
+ </p>
74
+
75
+ A campaign runs in rounds. The planner picks one research direction per slot, and the
76
+ proposer writes a hypothesis, a description and KunQuant code for each. The Gate builds the
77
+ code in a sandbox and refuses rewrites of existing factors; the reviewer checks that
78
+ hypothesis and code describe the same factor. The Evaluator then scores what is left on the
79
+ training segment, and admission accepts or rejects it. After the campaign, `Acceptance`
80
+ trains a quantlab return model with and without the accepted factors, opens the hold-out
81
+ once and exports the chosen factors.
82
+
83
+ - **Mechanism first.** The Gate compares KunQuant graphs and refuses
84
+ rewrites, parameter-only variants and large shared subtrees of every reference, known and
85
+ accepted factor.
86
+ - **No look-ahead.** Prompts carry training-segment statistics only: no return, no date, no
87
+ validation or hold-out metric. The hold-out opens once, behind a lock.
88
+ - **Only code accepts.** The Evaluator scores candidates on quantlab's
89
+ whole-market panels, masked to each day's members, and the partial-IC t threshold
90
+ tightens with every evaluated trial.
91
+ - **Nothing hard-coded about the market.** Fields, operators, prompts, mechanism types and
92
+ scoring come from the config's files, so a new input family is a new field file.
93
+ - **Any provider, replayable.** Each role picks its backend: OpenAI-compatible endpoints
94
+ (DeepSeek, OpenAI, vLLM, ...), Anthropic or Claude Code. Every call is logged, and the
95
+ `replay` backend reproduces a run byte for byte without a provider.
96
+ - **Resumable.** `run()` picks up from the run directory after a crash or an exhausted
97
+ balance.
98
+
99
+ The diagram below shows how the parts fit together: what the models search, what each
100
+ judge refuses, how every trial feeds the next round, and where the data the models see
101
+ ends. [How the agent mines factors](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/docs/user-guide/mechanism.md) explains it in full.
102
+
103
+ <p align="center">
104
+ <img src="https://raw.githubusercontent.com/ZhaorongDai/quantlab-factor-agent/main/docs/_static/mining-mechanism.svg" alt="The four parts of the mechanism: language models search over mechanism types and directions; the Gate, the reviewer, the Evaluator and admission each refuse what is not valid, consistent, new or significant; accepted factors join the zoo and pool and every trial feeds back to the planner; the models see only training-segment statistics, and the hold-out opens once behind a lock." width="100%">
105
+ </p>
106
+
107
+ With themes turned on, the planner also reads a map of the directions tried so far; see
108
+ [the direction map](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/docs/user-guide/mechanism.md#3-learning-every-trial-shapes-the-next-round).
109
+
110
+ ## Install
111
+
112
+ You need Python 3.13+ and a C++ compiler on the `PATH` (KunQuant compiles factor graphs to
113
+ native code):
114
+
115
+ ```bash
116
+ pip install "quantlab-factor-agent[web]" # [web] adds the factor-agent-web frontend
117
+ ```
118
+
119
+ To work on the code, or to run the example configs and the offline test suite, install
120
+ from a checkout with [uv](https://docs.astral.sh/uv/), with quantlab's checkout beside it:
121
+
122
+ ```bash
123
+ git clone https://github.com/ZhaorongDai/quantlab.git
124
+ git clone https://github.com/ZhaorongDai/quantlab-factor-agent.git
125
+ cd quantlab-factor-agent
126
+ uv sync --extra web
127
+ uv run pytest -n auto # offline: no LLM call, a synthetic market
128
+ ```
129
+
130
+ On macOS, xgboost also needs `brew install libomp`. Keys come from environment variables
131
+ only (`ANTHROPIC_API_KEY`, or the variable a role's `api_key_env` names), and a config that
132
+ holds a key is refused. See [installation](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/docs/getting-started/installation.md).
133
+
134
+ ## Run a campaign
135
+
136
+ ```python
137
+ from factor_agent.acceptance import Acceptance
138
+ from factor_agent.campaign import Campaign
139
+ from factor_agent.config import CampaignConfig
140
+
141
+ config = CampaignConfig.from_file("configs/us3000_ret5.yaml")
142
+ result = Campaign(config).run() # resumes when run_dir already holds a state
143
+ print(result.stop, len(result.accepted), "accepted of", len(result.records))
144
+
145
+ report = Acceptance(config).validate() # baseline vs baseline + accepted, on validation
146
+ print(report.markdown())
147
+ ```
148
+
149
+ Point the config's data paths at your own quantlab stores first. A campaign runs for hours,
150
+ mostly waiting on the model, and needs no GPU; `Acceptance` uses CUDA when it is available.
151
+ Watch a run in the browser with `factor-agent-web` ([web frontend](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/docs/user-guide/web.md)).
152
+
153
+ ## Documentation
154
+
155
+ - [How the agent mines factors](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/docs/user-guide/mechanism.md): the search, the judges, the learning loop and what the models may see, in one diagram
156
+ - [First campaign](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/docs/getting-started/quickstart.md): run one and read its outcome
157
+ - [Concepts](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/docs/user-guide/concepts.md): roles, factor sets, segments, what "accepted" means
158
+ - [The campaign config](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/docs/user-guide/campaign.md): every section, stopping and resuming
159
+ - [The vocabulary](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/docs/user-guide/vocabulary.md) and [prompts](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/docs/user-guide/prompts.md): what candidates may read and write, and what the models are told
160
+ - [LLM backends](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/docs/user-guide/llm-backends.md): providers, the LLM log, replay, cost
161
+ - [Gate, review and evaluation](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/docs/user-guide/evaluation.md) and [acceptance](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/docs/user-guide/acceptance.md): how a factor is judged
162
+
163
+ ## Contributing
164
+
165
+ Bug reports, questions and pull requests are welcome; see [CONTRIBUTING.md](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/CONTRIBUTING.md).
166
+ Report security problems privately, as [SECURITY.md](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/SECURITY.md) describes.
167
+
168
+ ## License
169
+
170
+ [MIT](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/LICENSE). `factor_agent/_max_drawdown.py` adapts code from
171
+ [KunQuant](https://github.com/Menooker/KunQuant) under the
172
+ [Apache License 2.0](https://github.com/ZhaorongDai/quantlab-factor-agent/blob/main/factor_agent/KUNQUANT_LICENSE).
@@ -0,0 +1,72 @@
1
+ factor_agent/KUNQUANT_LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
2
+ factor_agent/__init__.py,sha256=qo6TMmj12MhPEainNP6owsyE4OTqQtHz_GOTtzZfXpc,202
3
+ factor_agent/_acceptance_model.py,sha256=GDR5B4PlhRjOIwHPwtXT6fM0aOFEY_tYYp4NlBKU9gM,4416
4
+ factor_agent/_admission.py,sha256=1Ihxogo5AVNybZYK4ejv2Egd01YLSPYua3bFfzjGwAU,8282
5
+ factor_agent/_expression_fold.py,sha256=KnuoVYwjs0omPvgo96hxYFQJRqS3C9FdDwnRwxLjzYc,2140
6
+ factor_agent/_feedback.py,sha256=8NyF-9SA0SJSMhf3nC_HPaTCgDAu6Evxzl_wtmhPZsY,18598
7
+ factor_agent/_max_drawdown.py,sha256=7Xzs64yjnYn_KMNgClZysfg_rIdw0ifbeiH6sIEDwsM,2545
8
+ factor_agent/_model_cache.py,sha256=OguQI3T6TT5eK5Y_uP58tYs5KS_UP72HRURkI8DMXwI,4315
9
+ factor_agent/_scheduler.py,sha256=1sthQHWlXP_hYC6TNeAyfY6s6SM3QRcJuks19UuNUr8,1664
10
+ factor_agent/acceptance.py,sha256=Z07yoPCmyARMiv1_F6lfBd8MHhtlIE7VwYkt0E4k3no,41449
11
+ factor_agent/aggregations.py,sha256=jX9ymq4p1BaJcIqCR6TbFD8xDyM9SUjlDs46C2lWILk,4358
12
+ factor_agent/campaign.py,sha256=26lr_eKOTpl0_1N_CIucuuuA94cJ-8Ti2dDUmvee66I,41692
13
+ factor_agent/candidate.py,sha256=BaG1LvQ1dSNKsCby0KdDJ7WLERXzFwe7zPqX4FtbWW0,1991
14
+ factor_agent/config.py,sha256=4eUfCWKsnD4jDhx-4qda_u-uPyjaBhYtILn92HhE9xI,29208
15
+ factor_agent/derived.py,sha256=aMZ9d_F-FfH_qSpTFjmAY9Pp_tSssCChq1E_eHN5NII,4398
16
+ factor_agent/evaluator.py,sha256=6qid79UK_Ob68objceeLAJ-1DKwtJp-7OYjVF5lXaI4,54385
17
+ factor_agent/events.py,sha256=ue3S6HTN9zRRzCforiDt-IdgqSwzddD1LIQxYlrrPws,11874
18
+ factor_agent/exported.py,sha256=_ItC-No_LmQKxeg7vM1Xdp9QQ3LJkQE1af4X4i_oARY,8367
19
+ factor_agent/ledger.py,sha256=0shj3BNEAEMP4RHgirhF9qs0e393ug_dxUWYU1tzaLs,3525
20
+ factor_agent/period_lag.py,sha256=c7OfFwhkzKNcY0-dbQD0sLw5AVPb60DUSkxyCdMbV9c,4289
21
+ factor_agent/prompts.py,sha256=FufwrCea-Pc7xT-KHZ2DxkmRrth11Y7T5IQsL7RDc0M,26840
22
+ factor_agent/researcher.py,sha256=bxxHyf8BSMc66uv2Om72b6x8cO-USWNIgqHXR9b20oQ,29246
23
+ factor_agent/scoring.py,sha256=RGTaFtN6U-WNv3uJh8VdiewZfIc8Ea3fYPNSJbaD0a4,6824
24
+ factor_agent/segments.py,sha256=w67KcU5UT8f6KPgMInQwW77G5bB_avitBLbTHIP-0Tw,6982
25
+ factor_agent/session.py,sha256=g1f6NFkZvNuTKv7EOLtQLxGbIBu-KHFK3kCwl8WeMyc,24956
26
+ factor_agent/snapshot.py,sha256=HFO_KXrtVXNiKN08lJbGsKrS8uzTcusrdgGOAAmh_mA,9535
27
+ factor_agent/zoo.py,sha256=RZYefb07d2uIASQZmhr7YvI9E4BnbxJr8xG_xIgmt_Y,5511
28
+ factor_agent/accepted/__init__.py,sha256=0UowLxq3Lfjyw0Axt6DEA3eCqnIr8Ku83puouqI-kKY,114
29
+ factor_agent/gate/__init__.py,sha256=OzrsLLA9Fop3DJO3EOJN99mKrBrqibEvPS54dHEVRZA,15504
30
+ factor_agent/gate/_canonical.py,sha256=42rB1ZVR5IuaZ2Vu-oEpEAg3YljG5RcVGJtmHjv-hWU,13583
31
+ factor_agent/gate/_checks.py,sha256=XEmJwiJ6t91oFPJIVqrckpxIxtTwLoLvgLAqRXyssUU,3705
32
+ factor_agent/gate/_constraints.py,sha256=627lcqlshnK3wCLmiXjLoU-b0zRNneg4pOdV9IWiPaE,3422
33
+ factor_agent/gate/_dimension.py,sha256=KqCtoc-4Bx20ptFordO_7JgaO1Vbkei7GrWn1id53GA,6648
34
+ factor_agent/gate/_originality.py,sha256=CQ_nPxgDXCuqp6faVJz8LNqp5qW1QwGe6OR54k1BVKM,6373
35
+ factor_agent/gate/_sandbox.py,sha256=MR_rDDH_2bI2KdQ__wN1R7jVy4U-z1lRJOCeLvM9wW0,4610
36
+ factor_agent/gate/graph.py,sha256=KISG-yuhdNsekg2hk9oDgC6soj2R3d7R-OteuF1WJfo,9675
37
+ factor_agent/gate/stages.py,sha256=8PTXNZQ2XCvr3JIHWPXs6VFPiW1V16O8fZaW3BPEDdI,18248
38
+ factor_agent/gate/vocabulary.py,sha256=87AdP8AV_JIbHutKbo96gwFVbXbg2SPF5yYD6s_Osoc,51984
39
+ factor_agent/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
+ factor_agent/llm/_common.py,sha256=T_9yZFyLtA_BIxTuKNc_broqpzd_zN5oafoMtBPYDXY,445
41
+ factor_agent/llm/_raw.py,sha256=Z2bDolz6p404IDwsBvhdzOfOlgP4e1_5LsDOkWuOSuI,3198
42
+ factor_agent/llm/anthropic.py,sha256=enZikI8lTnEIfddYQjkBMyCwh9jxSAnjIAclwdzVJ7k,4282
43
+ factor_agent/llm/base.py,sha256=SMRxJLiPqeRVkbEkFLEGya3RgyUSpxDvbuPtakQx5hQ,4447
44
+ factor_agent/llm/claude_code.py,sha256=Qg84s0r78M-E8sZJPDnth2yrtwDLQhika0B9-NI2OF4,4298
45
+ factor_agent/llm/log.py,sha256=uWhOvO4DD06xdz9EX7B_79zJX-Ok9Z26qnU40orw_eg,3036
46
+ factor_agent/llm/openai_compatible.py,sha256=fxtpdJpI-fA5R6ZCVYm1cWBXkPzcYnz-KVu-yr1pFOI,5021
47
+ factor_agent/llm/replay.py,sha256=NZRW1T88bBlnHiyFKxnX2DT-7cIvZxD2RhWPPOkItcI,2213
48
+ factor_agent/llm/scripted.py,sha256=RGAOpn1TeenJyajcYkQLw78bRcAMYLEovkmqhlHxbHo,1399
49
+ factor_agent/web/__init__.py,sha256=2iW2cpOWKgzZ5OUhC4o2ShwQK_1hU66uJcG-pzw-yYo,385
50
+ factor_agent/web/_acceptance.py,sha256=YENNU6dF0GxonEX5BNOKiljz8L-Ui52hh4ap5ACUm1s,6433
51
+ factor_agent/web/_config.py,sha256=5OgIW5RQhnBZhUtWSrQqmrPmTUAe-Z3SYgRj9w9cX0Y,2004
52
+ factor_agent/web/_diagnosis.py,sha256=kT8A5U7fI0a5kKXMdF7BqTRbN9jC_J-9lj3XjhTC0tU,5214
53
+ factor_agent/web/_files.py,sha256=bIijka3MBZaGsZxAXhRe5wWrHwWgFCMi13f7VNZzY5Q,2742
54
+ factor_agent/web/_health.py,sha256=6qDcdS6jtpZQ7rXIB8hxZfLv6URGb_Y2oJ01UFy5Lx8,9104
55
+ factor_agent/web/_ic.py,sha256=LS0f8DZXK8c-6lJE_sxVByEVDXaCSgGroqsPg3b30Bs,1030
56
+ factor_agent/web/_ledger.py,sha256=JNQ9SGiDq1VYTdsBYFK07RBiUZYo_NULTiwkI1bSOGU,12821
57
+ factor_agent/web/_memory.py,sha256=MgtmPs3b5Vrfzzj_ljQ2imVgUyPBgHpA6Okw4ga_Ctw,1462
58
+ factor_agent/web/_results.py,sha256=0_Q9wnfrHeEQrIK_UTS_KLFkiw4kahMP1Sbj0Ks1ZEg,3606
59
+ factor_agent/web/_round.py,sha256=pf-81C_VG3ax_p1TY7JFOX3OvKfxVUrQM0CimWkDhU8,9331
60
+ factor_agent/web/_trials.py,sha256=TirXbHgWyG0oRrOAFjaRxNVot8zX0HwY2kC4dUtGBUE,4641
61
+ factor_agent/web/app.py,sha256=8w4xjasdFWhM07IL_6pxeKywFCE-zuopdok-cHH9ecM,4727
62
+ factor_agent/web/run_view.py,sha256=ood3YFAdK0_fZBkUc6k0bpuYUj1GweaVF3tDeVmyz5o,16510
63
+ factor_agent/web/static/index.html,sha256=0Neg-8css2MoFkR5TrVfBzhf2qA7Eik3Cb8X-WfKxBc,397
64
+ factor_agent/web/static/assets/index-9QjjJgl3.css,sha256=hmhk4wkgEtjoSohJyNhptj311HOY-AtXRswNGHrsRXg,16171
65
+ factor_agent/web/static/assets/index-iOE9ei_S.js,sha256=C_xBlekChlezJ8zcau4CzQ8cVBSxvfhk-qY9aAikow4,246623
66
+ quantlab_factor_agent-0.1.0.dist-info/licenses/LICENSE,sha256=ETa_dJhcS9M4X4TGRJ7YC-LVWDiW2rkbfgZMsyWozM4,1069
67
+ quantlab_factor_agent-0.1.0.dist-info/licenses/factor_agent/KUNQUANT_LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
68
+ quantlab_factor_agent-0.1.0.dist-info/METADATA,sha256=Xr4LiuG-Cmmd0bkvYnb0btSeh-QOAxVDMW1EqN5jbak,11571
69
+ quantlab_factor_agent-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
70
+ quantlab_factor_agent-0.1.0.dist-info/entry_points.txt,sha256=X8U2BCFPwTEymkZUe7Tm9xyC641KuIX-KZpH1f_0FgM,63
71
+ quantlab_factor_agent-0.1.0.dist-info/top_level.txt,sha256=QOKt6Y_tjxbKk2SvryzL72m02FEQ0MQiutG21wf29zo,13
72
+ quantlab_factor_agent-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ factor-agent-web = factor_agent.web.app:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zhaorong Dai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1 @@
1
+ factor_agent