@bitget-ai/getagent-skill 0.2.2 → 0.3.0
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.
- package/.claude-plugin/marketplace.json +15 -4
- package/.claude-plugin/plugin.json +1 -1
- package/VERSION +1 -1
- package/package.json +1 -1
- package/skills/getagent/SKILL.md +145 -10
- package/skills/getagent/references/api/confirm.md +59 -0
- package/skills/getagent/references/api/index.md +9 -7
- package/skills/getagent/references/api/publish.md +13 -10
- package/skills/getagent/references/api/run.md +5 -5
- package/skills/getagent/references/api/upload.md +22 -4
- package/skills/getagent/references/backtest-engine.md +11 -10
- package/skills/getagent/references/package-schema.md +8 -7
- package/skills/getagent/references/sdk/backtest/catalog.md +5 -3
- package/skills/getagent/references/sdk/data/catalog.md +2 -4
- package/skills/getagent/references/sdk/data/commodity.md +46 -0
- package/skills/getagent/references/sdk/data/crypto.md +1468 -88
- package/skills/getagent/references/sdk/data/currency.md +48 -0
- package/skills/getagent/references/sdk/data/derivatives.md +126 -0
- package/skills/getagent/references/sdk/data/economy.md +736 -0
- package/skills/getagent/references/sdk/data/equity.md +1462 -0
- package/skills/getagent/references/sdk/data/etf.md +510 -0
- package/skills/getagent/references/sdk/data/fixedincome.md +485 -0
- package/skills/getagent/references/sdk/data/news.md +76 -0
- package/skills/getagent/references/sdk/data/regulators.md +85 -0
- package/skills/getagent/references/sdk/data/sentiment.md +176 -0
- package/skills/getagent/references/sdk.md +14 -5
- package/skills/getagent/scripts/validate.py +9 -29
- package/skills/getagent/scripts/version_check.sh +13 -12
- package/skills/getagent/references/sdk/data/playbook-supported.md +0 -9236
|
@@ -6,23 +6,34 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Official GetAgent Agent Skill for trading Playbook authoring",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.3.0"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "getagent",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "Create, validate, upload, backtest, publish, and enable GetAgent quantitative trading Playbooks.",
|
|
16
|
-
"version": "0.
|
|
16
|
+
"version": "0.3.0",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "GetAgent",
|
|
19
19
|
"email": "support@bitget.com"
|
|
20
20
|
},
|
|
21
21
|
"repository": "git@gitlab.bitget.tools:algorithm/upex-algorithm-getall-skill-sdk.git",
|
|
22
22
|
"license": "Proprietary",
|
|
23
|
-
"keywords": [
|
|
23
|
+
"keywords": [
|
|
24
|
+
"getagent",
|
|
25
|
+
"trading",
|
|
26
|
+
"playbooks",
|
|
27
|
+
"backtesting",
|
|
28
|
+
"agent-skills"
|
|
29
|
+
],
|
|
24
30
|
"category": "external-integrations",
|
|
25
|
-
"tags": [
|
|
31
|
+
"tags": [
|
|
32
|
+
"trading",
|
|
33
|
+
"backtesting",
|
|
34
|
+
"agent-skills",
|
|
35
|
+
"playbooks"
|
|
36
|
+
]
|
|
26
37
|
}
|
|
27
38
|
]
|
|
28
39
|
}
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.3.0
|
package/package.json
CHANGED
package/skills/getagent/SKILL.md
CHANGED
|
@@ -12,7 +12,7 @@ compatibility: >-
|
|
|
12
12
|
access to the GetAgent Playbook control-plane API for upload/run/publish.
|
|
13
13
|
metadata:
|
|
14
14
|
author: getagent
|
|
15
|
-
version: v0.
|
|
15
|
+
version: v0.3.0
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
# GetAgent Playbook Creator
|
|
@@ -66,6 +66,10 @@ D. 我已有策略代码(贴在这里或给路径),先 review 修复再跑
|
|
|
66
66
|
|
|
67
67
|
Use the English equivalent when the user's first message is English.
|
|
68
68
|
|
|
69
|
+
For option A, do not author from scratch: use the bundled runnable demo at
|
|
70
|
+
`examples/btc-ema-cross-demo/` (read its `README.md` first), validate it
|
|
71
|
+
locally, then walk the user through upload and a sandbox run.
|
|
72
|
+
|
|
69
73
|
## Default Workflow
|
|
70
74
|
|
|
71
75
|
1. Clarify only missing strategy requirements that block authoring. Ask one
|
|
@@ -73,18 +77,24 @@ Use the English equivalent when the user's first message is English.
|
|
|
73
77
|
2. Scaffold the package shape from `references/package-schema.md`.
|
|
74
78
|
3. Write strategy code against `getagent.*` imports only, plus allowed
|
|
75
79
|
scientific/runtime packages documented in the schema.
|
|
76
|
-
4. Validate locally
|
|
80
|
+
4. Validate locally (requires Python 3.11+; install PyYAML once with
|
|
81
|
+
`pip install pyyaml` if missing — without it the validator falls back to a
|
|
82
|
+
weaker parser):
|
|
77
83
|
|
|
78
84
|
```bash
|
|
79
|
-
|
|
80
|
-
python "scripts/validate.py" ./my-strategy/
|
|
85
|
+
python3 scripts/validate.py ./my-strategy/
|
|
81
86
|
```
|
|
82
87
|
|
|
88
|
+
If validation fails, fix every reported issue and re-run until it prints
|
|
89
|
+
`Validation PASSED`. Never upload a package that fails local validation.
|
|
83
90
|
5. Ask for the user's Bitget OpenAPI `ACCESS-KEY` only before the first
|
|
84
91
|
authenticated upload/run/publish/enable call. Never write credentials to disk.
|
|
85
|
-
6. Upload the package through the documented control-plane API
|
|
92
|
+
6. Upload the package through the documented control-plane API; uploads are
|
|
93
|
+
temporary iteration artifacts until confirmed.
|
|
86
94
|
7. Run a sandbox evaluation before publish when the package supports backtests.
|
|
87
95
|
8. Read results back in plain language before proposing publish or iteration.
|
|
96
|
+
9. When the user accepts the final package, confirm the latest temporary as a
|
|
97
|
+
draft. Publish only after explicit user intent.
|
|
88
98
|
|
|
89
99
|
## Reference Map
|
|
90
100
|
|
|
@@ -93,11 +103,16 @@ Use the English equivalent when the user's first message is English.
|
|
|
93
103
|
- Sandbox runtime and blocked imports: `references/sandbox-runtime.md`
|
|
94
104
|
- Backtest engine behavior: `references/backtest-engine.md`
|
|
95
105
|
- Control-plane APIs: `references/api/index.md`
|
|
96
|
-
- Data SDK: `references/sdk/data/
|
|
106
|
+
- Data SDK domain index: `references/sdk/data/catalog.md`; high-frequency
|
|
107
|
+
domain files: `references/sdk/data/crypto.md`,
|
|
108
|
+
`references/sdk/data/equity.md`, `references/sdk/data/economy.md`,
|
|
109
|
+
`references/sdk/data/derivatives.md` (other domains via the catalog)
|
|
97
110
|
- Trade SDK: `references/sdk/trade/patterns.md`
|
|
98
111
|
- Backtest SDK: `references/sdk/backtest/catalog.md`
|
|
99
112
|
- Runtime SDK: `references/sdk/runtime/catalog.md`
|
|
100
113
|
- LLM SDK: `references/sdk/llm/catalog.md`
|
|
114
|
+
- Runnable demo package: `examples/btc-ema-cross-demo/` (BTC EMA cross,
|
|
115
|
+
signal-only; used by option A of the opening)
|
|
101
116
|
|
|
102
117
|
## Backtest Output Pitfalls
|
|
103
118
|
|
|
@@ -115,6 +130,125 @@ Output Contract. The three most common publish failures are:
|
|
|
115
130
|
`raw["net_pnl"]` and `raw["total_return_pct"]` with correct absolute values
|
|
116
131
|
before writing `backtest_report.json`.
|
|
117
132
|
|
|
133
|
+
## Data SDK Constraints
|
|
134
|
+
|
|
135
|
+
Rules that apply every time `getagent.data` is used in Playbook code.
|
|
136
|
+
|
|
137
|
+
### Before writing any data call
|
|
138
|
+
|
|
139
|
+
1. Read `references/sdk.md` §`getagent.data` read order. Follow its links to
|
|
140
|
+
`references/sdk/data/catalog.md` (domain table), then open the matching
|
|
141
|
+
domain file (e.g. `references/sdk/data/crypto.md`).
|
|
142
|
+
2. Locate the exact endpoint section and read its **Query parameters** table
|
|
143
|
+
and **Response fields** table before writing any code.
|
|
144
|
+
3. Never invent endpoint names, namespaces, or keyword arguments by guessing
|
|
145
|
+
from plausible names. If the needed capability is absent, report missing
|
|
146
|
+
coverage instead of falling back to a direct HTTP client.
|
|
147
|
+
|
|
148
|
+
### Symbol format
|
|
149
|
+
|
|
150
|
+
There are **two separate symbol namespaces**. Always check the endpoint's
|
|
151
|
+
parameter note to determine which one it expects.
|
|
152
|
+
|
|
153
|
+
**Exchange-native format** — e.g. `"BTCUSDT"`, `"RAAPLUSDT"` (no slash,
|
|
154
|
+
no colon). Used by all price / OHLCV / derivatives data endpoints:
|
|
155
|
+
|
|
156
|
+
- `crypto.futures.kline`, `crypto.spot.kline`
|
|
157
|
+
- `crypto.futures.funding_rate`, `crypto.futures.taker_volume`
|
|
158
|
+
- `crypto.futures.open_interest`, `crypto.futures.long_short_ratio`
|
|
159
|
+
- `crypto.spot.ticker`, `crypto.spot.taker_volume`, `crypto.spot.trades`
|
|
160
|
+
- Most other time-series endpoints under `crypto.futures.*` and
|
|
161
|
+
`crypto.spot.*`
|
|
162
|
+
|
|
163
|
+
This is the format used by `bitget_data` provider. Pass the symbol
|
|
164
|
+
exactly as the exchange exposes it (e.g. `"BTCUSDT"`, `"RAAPLUSDT"`).
|
|
165
|
+
|
|
166
|
+
**CCXT unified format** — e.g. `"BTC/USDT"` (spot), `"BTC/USDT:USDT"`
|
|
167
|
+
(perpetual linear), `"BTC/USD:BTC"` (inverse). Used by the market
|
|
168
|
+
metadata endpoint:
|
|
169
|
+
|
|
170
|
+
- `crypto.market` — `symbol` filter param uses CCXT format; response
|
|
171
|
+
`symbol` field also returns CCXT format.
|
|
172
|
+
- ccxt provider: response `exchange_id` field returns the exchange-native ID.
|
|
173
|
+
- bitget_data provider: no `exchange_id` field; use `symbol` directly.
|
|
174
|
+
|
|
175
|
+
**How to resolve an unknown symbol:**
|
|
176
|
+
|
|
177
|
+
```python
|
|
178
|
+
rows = data.crypto.market(symbol="BTC/USDT", exchange="bitget",
|
|
179
|
+
market_type="perpetual").to_dataframe()
|
|
180
|
+
# ccxt provider response:
|
|
181
|
+
exchange_id = rows["exchange_id"].iloc[0] # → "BTCUSDT"
|
|
182
|
+
unified = rows["symbol"].iloc[0] # → "BTC/USDT:USDT"
|
|
183
|
+
# bitget_data provider response: no exchange_id field;
|
|
184
|
+
# use unified = rows["symbol"].iloc[0] directly
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Use `exchange_id` (ccxt only) when calling kline / taker_volume / funding_rate etc.
|
|
188
|
+
Use the `symbol` (unified) when passing to `manifest.trading_symbols` and
|
|
189
|
+
`backtest.yaml` instruments.
|
|
190
|
+
|
|
191
|
+
- Do not mix the two formats. Do not pass `"BTC/USDT:USDT"` to `kline`
|
|
192
|
+
and do not pass `"BTCUSDT"` to `crypto.market(symbol=...)`.
|
|
193
|
+
- When the parameter note is ambiguous (just says "Symbol to get data for"),
|
|
194
|
+
default to exchange-native format for all `crypto.futures.*` /
|
|
195
|
+
`crypto.spot.*` endpoints.
|
|
196
|
+
|
|
197
|
+
### Parameter compliance
|
|
198
|
+
|
|
199
|
+
- Pass only parameters that appear in the endpoint's documented signature.
|
|
200
|
+
Never add undocumented kwargs.
|
|
201
|
+
- Required parameters (marked `yes` in the table) must always be supplied.
|
|
202
|
+
Optional parameters with a documented default may be omitted.
|
|
203
|
+
- Respect documented enum values exactly (e.g. `interval` must be one of
|
|
204
|
+
`5m`, `15m`, `1h`, `4h`, `1d` for kline endpoints; `market_type` must be
|
|
205
|
+
one of `spot`, `perpetual`, `future`, `option`).
|
|
206
|
+
- For paginated endpoints, respect the documented maximum `size`/`limit`
|
|
207
|
+
(e.g. `size ≤ 200` for `crypto.market`, `limit ≤ 1000` for klines).
|
|
208
|
+
Loop over pages when more data is needed rather than requesting beyond
|
|
209
|
+
the cap.
|
|
210
|
+
|
|
211
|
+
### Time ranges
|
|
212
|
+
|
|
213
|
+
- Use `start_time` / `end_time` (millisecond Unix-epoch integers) in
|
|
214
|
+
preference to the deprecated `start_date` / `end_date` string params.
|
|
215
|
+
- `crypto.futures.kline` and `crypto.spot.kline` cap **each request** at
|
|
216
|
+
**90 days** of data. This is a per-fetch API limit, not a backtest window
|
|
217
|
+
restriction — when the replay window is longer, fetch multiple 90-day
|
|
218
|
+
chunks and concatenate them.
|
|
219
|
+
- The canonical datetime column in SDK responses is `time`. Call
|
|
220
|
+
`data.to_dataframe(bars)` without `datetime_index` to let the SDK pick it;
|
|
221
|
+
only override when the endpoint's response fields table names a different
|
|
222
|
+
time column (e.g. `date`).
|
|
223
|
+
|
|
224
|
+
### Response handling
|
|
225
|
+
|
|
226
|
+
- Always convert `OBBject` responses with `data.to_dataframe()`,
|
|
227
|
+
`data.to_dict()`, or `data.to_records()` before accessing individual fields.
|
|
228
|
+
- Reference only field names that appear in the endpoint's **Response fields**
|
|
229
|
+
table. Never guess a field name from context.
|
|
230
|
+
- Fields documented as `string` from market info endpoints (e.g.
|
|
231
|
+
`min_order_qty`, `price_precision`) are decimal strings, not floats.
|
|
232
|
+
Cast explicitly when arithmetic is needed.
|
|
233
|
+
- Endpoints that return a context-only snapshot (no `time` column) cannot
|
|
234
|
+
be aligned into a replay feature frame. Use them as decision context only
|
|
235
|
+
and do not declare their fields in `backtest.yaml.data_requirements`.
|
|
236
|
+
|
|
237
|
+
### Endpoint discovery
|
|
238
|
+
|
|
239
|
+
- When in doubt which endpoint to use, read `catalog.md` for the domain
|
|
240
|
+
table, then read the domain file. Do not rely on memory or path guessing.
|
|
241
|
+
- Domain files are large (crypto.md ≈ 4000 lines). Jump to an endpoint
|
|
242
|
+
section with grep instead of reading the whole file, e.g.
|
|
243
|
+
`grep -n "crypto.futures.funding_rate" references/sdk/data/crypto.md`,
|
|
244
|
+
then read that section's parameter and response tables.
|
|
245
|
+
- `data.coverage.commands()` lists every available endpoint at runtime.
|
|
246
|
+
Use it programmatically if the domain file and catalog are insufficient.
|
|
247
|
+
- CoinGecko-based endpoints (`crypto.coin_info`, `crypto.coin_history`, etc.)
|
|
248
|
+
accept a **CoinGecko coin ID** (e.g. `"bitcoin"`), not a trading-pair symbol.
|
|
249
|
+
Futures/spot kline endpoints accept trading-pair symbols. These are
|
|
250
|
+
different namespaces — do not mix them.
|
|
251
|
+
|
|
118
252
|
## Hard Boundaries
|
|
119
253
|
|
|
120
254
|
- Do not tell users to install or execute the private GetAgent SDK locally.
|
|
@@ -127,11 +261,12 @@ Output Contract. The three most common publish failures are:
|
|
|
127
261
|
- Do not call trade mutation APIs directly in a signal-only branch. Emit the
|
|
128
262
|
signal successfully and let the runtime decide whether follow-trade is
|
|
129
263
|
allowed.
|
|
130
|
-
- For `backtest_support: full`,
|
|
131
|
-
`backtest.yaml.execution.start` / `execution.end` window, never pass
|
|
132
|
-
`provider=...`, and ensure any
|
|
264
|
+
- For `backtest_support: full`, never pass `provider=...`, and ensure any
|
|
133
265
|
`data_requirements.required_bar_fields` are actually built and referenced in
|
|
134
|
-
`src/**`.
|
|
266
|
+
`src/**`. The `execution.start` / `execution.end` replay window is entirely
|
|
267
|
+
the author's choice — the platform never polices window presence, length,
|
|
268
|
+
or recency; the only hard rule is that evidence must be real, never
|
|
269
|
+
fabricated.
|
|
135
270
|
- Keep symbols consistent across `manifest.trading_symbols`, display text,
|
|
136
271
|
README, `backtest.yaml` instruments, data calls, and emitted signals. If the
|
|
137
272
|
submitted symbol is a typo or unavailable and you replace it with a supported
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Confirm Playbook Draft
|
|
2
|
+
|
|
3
|
+
Confirm the final temporary Playbook artifact and save it as a draft. Use this
|
|
4
|
+
after the package has passed the required sandbox evaluation and the user agrees
|
|
5
|
+
that this is the version to keep.
|
|
6
|
+
|
|
7
|
+
## `POST /api/v1/playbook/confirm`
|
|
8
|
+
|
|
9
|
+
**Auth**: `ACCESS-KEY` header from the Bitget OpenAPI credential. Missing it returns 401.
|
|
10
|
+
|
|
11
|
+
**Content-Type**: `application/json`
|
|
12
|
+
|
|
13
|
+
### Request
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"temporary_id": "temporary-playbook-id"
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
For backward compatibility, the server also accepts `draft_id` or `playbook_id`
|
|
22
|
+
with the same value.
|
|
23
|
+
|
|
24
|
+
### Success Response
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"strategy_id": "strategy-...",
|
|
29
|
+
"draft_id": "draft-playbook-id",
|
|
30
|
+
"name": "btc-ema-crossover",
|
|
31
|
+
"status": "draft",
|
|
32
|
+
"suggested_version": "1.0.1"
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The id does not change during confirmation. The same package id that was used
|
|
37
|
+
for the final backtest becomes the draft id used by `publish`.
|
|
38
|
+
|
|
39
|
+
### When To Call
|
|
40
|
+
|
|
41
|
+
Call `confirm` only after:
|
|
42
|
+
|
|
43
|
+
1. local validation passed,
|
|
44
|
+
2. required sandbox backtests completed successfully,
|
|
45
|
+
3. you summarized the results for the user, and
|
|
46
|
+
4. the user accepted this package as the final draft to keep.
|
|
47
|
+
|
|
48
|
+
Do not confirm every failed iteration. Upload replaces older temporary artifacts
|
|
49
|
+
automatically; confirm is the boundary where the final package becomes visible
|
|
50
|
+
as a draft.
|
|
51
|
+
|
|
52
|
+
### Error Responses
|
|
53
|
+
|
|
54
|
+
| Status | Description |
|
|
55
|
+
|--------|-------------|
|
|
56
|
+
| 401 | Missing `ACCESS-KEY` header |
|
|
57
|
+
| 403 | Not the Playbook owner, access key revoked, or principal not found / inactive |
|
|
58
|
+
| 404 | temporary id not found |
|
|
59
|
+
| 409 | The package is neither `temporary` nor already `draft` |
|
|
@@ -11,19 +11,21 @@ Use these docs after the local package is ready. For Python imports inside
|
|
|
11
11
|
|
|
12
12
|
## Read order
|
|
13
13
|
|
|
14
|
-
1. [`upload.md`](upload.md) — upload a packaged Playbook archive
|
|
15
|
-
2. [`
|
|
16
|
-
3. [`
|
|
17
|
-
4. [`
|
|
18
|
-
5. [`
|
|
14
|
+
1. [`upload.md`](upload.md) — upload a temporary packaged Playbook archive
|
|
15
|
+
2. [`run.md`](run.md) — trigger a manual backtest/evaluation run
|
|
16
|
+
3. [`confirm.md`](confirm.md) — save the final temporary artifact as a draft
|
|
17
|
+
4. [`publish.md`](publish.md) — publish a validated draft Playbook
|
|
18
|
+
5. [`list.md`](list.md) and `detail` response docs — inspect public Playbooks
|
|
19
|
+
6. [`enable.md`](enable.md) and [`my-playbooks.md`](my-playbooks.md) — manage
|
|
19
20
|
subscriptions
|
|
20
|
-
|
|
21
|
+
7. [`error-responses.md`](error-responses.md) — common failure modes
|
|
21
22
|
|
|
22
23
|
## Control-plane docs
|
|
23
24
|
|
|
24
25
|
| Document | Purpose |
|
|
25
26
|
|---|---|
|
|
26
|
-
| [`upload.md`](upload.md) | Request format, package validation, and server-side checks |
|
|
27
|
+
| [`upload.md`](upload.md) | Request format, package validation, temporary artifact behavior, and server-side checks |
|
|
28
|
+
| [`confirm.md`](confirm.md) | Convert the accepted temporary artifact into a draft |
|
|
27
29
|
| [`publish.md`](publish.md) | Publish contract, evidence requirements, and 409 cases |
|
|
28
30
|
| [`run.md`](run.md) | Manual run contract and runtime gating |
|
|
29
31
|
| [`list.md`](list.md) | Public list surface |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Publish Playbook
|
|
2
2
|
|
|
3
|
-
Publish a draft Playbook to make it publicly available. Publishing is
|
|
4
|
-
step that assigns the formal public version number.
|
|
3
|
+
Publish a confirmed draft Playbook to make it publicly available. Publishing is
|
|
4
|
+
the only step that assigns the formal public version number.
|
|
5
5
|
|
|
6
6
|
## `POST /api/v1/playbook/publish`
|
|
7
7
|
|
|
@@ -22,6 +22,10 @@ step that assigns the formal public version number.
|
|
|
22
22
|
`minor`, and `major`. The server computes the final semver from the strategy's
|
|
23
23
|
latest published version; clients must not edit `manifest.version` manually.
|
|
24
24
|
|
|
25
|
+
New clients should call [`confirm.md`](confirm.md) before publish. For backward
|
|
26
|
+
compatibility, publishing a temporary id directly is accepted and the server
|
|
27
|
+
internally confirms it before assigning the published version.
|
|
28
|
+
|
|
25
29
|
### Success Response
|
|
26
30
|
|
|
27
31
|
```json
|
|
@@ -40,9 +44,9 @@ Only the Playbook owner can publish. Others receive 403.
|
|
|
40
44
|
|
|
41
45
|
### Publish Contract
|
|
42
46
|
|
|
43
|
-
Publishing freezes the draft artifact into an immutable version and
|
|
44
|
-
parent version within the same strategy tree. A published Playbook
|
|
45
|
-
stable public contract for:
|
|
47
|
+
Publishing freezes the confirmed draft artifact into an immutable version and
|
|
48
|
+
records its parent version within the same strategy tree. A published Playbook
|
|
49
|
+
should carry a stable public contract for:
|
|
46
50
|
|
|
47
51
|
- `decision_mode`
|
|
48
52
|
- `backtest_support`
|
|
@@ -55,10 +59,9 @@ stable public contract for:
|
|
|
55
59
|
- If `backtest_support = full`
|
|
56
60
|
- the current runtime must be able to execute it (`runtime_profile = deterministic`)
|
|
57
61
|
- the owner must first produce one successful historical evaluation run
|
|
58
|
-
- that run must include a real equity/NAV curve, not only aggregate metrics
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
at least `lookback_bars` points when the playbook uses a lookback-only replay
|
|
62
|
+
- that run must include a real equity/NAV curve, not only aggregate metrics —
|
|
63
|
+
this is an anti-fabrication check, not a window check: curve density,
|
|
64
|
+
window length, and recency are never validated
|
|
62
65
|
- the Playbook should expose one official public backtest snapshot
|
|
63
66
|
- list / detail surfaces should use that snapshot, not an arbitrary recent run
|
|
64
67
|
- If `backtest_support = none`
|
|
@@ -77,4 +80,4 @@ performance is not.
|
|
|
77
80
|
| 401 | Missing `ACCESS-KEY` header |
|
|
78
81
|
| 403 | Not the Playbook owner, access key revoked, or principal not found / inactive |
|
|
79
82
|
| 404 | draft_id not found |
|
|
80
|
-
| 409 | Status is not draft; no successful historical evaluation exists for `backtest_support=full`; or runtime profile is not currently publishable |
|
|
83
|
+
| 409 | Status is not draft/temporary; no successful historical evaluation exists for `backtest_support=full`; or runtime profile is not currently publishable |
|
|
@@ -14,13 +14,13 @@ the run reaches `completed` or `failed`.
|
|
|
14
14
|
|
|
15
15
|
```json
|
|
16
16
|
{
|
|
17
|
-
"version_id": "draft-or-version-id"
|
|
17
|
+
"version_id": "temporary-draft-or-version-id"
|
|
18
18
|
}
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
### Supported Use Cases
|
|
22
22
|
|
|
23
|
-
- creator runs a draft or published Playbook to validate a new version
|
|
23
|
+
- creator runs a temporary, draft, or published Playbook to validate a new version
|
|
24
24
|
- any authenticated user runs a published Playbook evaluation when `backtest_support = full`
|
|
25
25
|
|
|
26
26
|
### Backtest Eligibility
|
|
@@ -40,7 +40,7 @@ fairly replayable on historical data.
|
|
|
40
40
|
{
|
|
41
41
|
"run_id": "e5f6g7h8-...",
|
|
42
42
|
"strategy_id": "strategy-...",
|
|
43
|
-
"version_id": "draft-or-version-id",
|
|
43
|
+
"version_id": "temporary-draft-or-version-id",
|
|
44
44
|
"status": "pending",
|
|
45
45
|
"dispatched": true
|
|
46
46
|
}
|
|
@@ -125,9 +125,9 @@ public backtest.
|
|
|
125
125
|
|
|
126
126
|
### Permissions
|
|
127
127
|
|
|
128
|
-
- Owner can run draft and published Playbooks they control
|
|
128
|
+
- Owner can run temporary, draft, and published Playbooks they control
|
|
129
129
|
- Any authenticated user can run published Playbooks when `backtest_support = full`
|
|
130
|
-
- Users must not be allowed to run draft versions they do not own
|
|
130
|
+
- Users must not be allowed to run temporary or draft versions they do not own
|
|
131
131
|
|
|
132
132
|
### Error Responses
|
|
133
133
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Upload Playbook
|
|
2
2
|
|
|
3
|
-
Upload a Playbook package
|
|
3
|
+
Upload a Playbook package to GetAgent Cloud as a temporary iteration artifact.
|
|
4
4
|
|
|
5
5
|
> Before dispatching this call, follow the **Endpoint Confirmation Discipline** in `SKILL.md` — echo a one-line preflight (`upload draft {name} → GetAgent prod https://api.bitget.com with ACCESS-KEY=<masked>`) and obtain the user's Bitget OpenAPI `ACCESS-KEY` if not already collected this session.
|
|
6
6
|
|
|
@@ -30,13 +30,31 @@ curl -X POST \
|
|
|
30
30
|
```json
|
|
31
31
|
{
|
|
32
32
|
"strategy_id": "strategy-...",
|
|
33
|
-
"draft_id": "
|
|
33
|
+
"draft_id": "temporary-playbook-id",
|
|
34
34
|
"name": "btc-ema-crossover",
|
|
35
|
-
"status": "
|
|
35
|
+
"status": "temporary",
|
|
36
36
|
"suggested_version": "1.0.1"
|
|
37
37
|
}
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
+
`draft_id` is the package id to pass to `run` during this iteration. It is
|
|
41
|
+
named `draft_id` for backward compatibility, but uploads now remain temporary
|
|
42
|
+
until confirmed.
|
|
43
|
+
|
|
44
|
+
### Temporary Artifact Behavior
|
|
45
|
+
|
|
46
|
+
- Every upload is persisted because backtests are asynchronous and run by
|
|
47
|
+
workers that load the package later by id.
|
|
48
|
+
- When a newer package for the same strategy is uploaded, GetAgent deletes the
|
|
49
|
+
previous temporary package record and package archive after any active run has
|
|
50
|
+
finished.
|
|
51
|
+
- Temporary packages are hidden from user-facing draft lists and "my creations".
|
|
52
|
+
- Once the package is final and acceptable to the user, call
|
|
53
|
+
[`confirm.md`](confirm.md) to convert the latest temporary package into a
|
|
54
|
+
real draft.
|
|
55
|
+
- Publishing a temporary package directly is accepted for older clients, but new
|
|
56
|
+
clients should call `confirm` before `publish` so the workflow is explicit.
|
|
57
|
+
|
|
40
58
|
### Server-side Validation
|
|
41
59
|
|
|
42
60
|
The server runs these checks on upload (client-side validation is not trusted):
|
|
@@ -49,7 +67,7 @@ The server runs these checks on upload (client-side validation is not trusted):
|
|
|
49
67
|
6. **backtest.yaml shape** — only valid when `backtest_support: full`; basic type checks enforced
|
|
50
68
|
7. **Syntax** — Python files under `src/**` must compile
|
|
51
69
|
8. **Import allowlist** — Only `getagent`, `pandas`, `numpy`, `json`, `math`, `datetime`, `pathlib`, `asyncio`, etc. Imports like `requests`, `subprocess`, `os` are blocked.
|
|
52
|
-
9. **Version assignment** — upload never consumes a public version. The server returns a `draft_id`; the formal version is assigned later by `publish`.
|
|
70
|
+
9. **Version assignment** — upload never consumes a public version. The server returns a temporary `draft_id`; the formal version is assigned later by `publish`.
|
|
53
71
|
10. **Local-only paths rejected** — `tests/`, `research/`, `data/`, `output/`, caches and virtualenv folders must not be included
|
|
54
72
|
|
|
55
73
|
### Error Responses
|
|
@@ -93,9 +93,10 @@ Required sections:
|
|
|
93
93
|
- `class`
|
|
94
94
|
- optional `config_class`
|
|
95
95
|
- optional `config`
|
|
96
|
-
- `execution`
|
|
97
|
-
-
|
|
98
|
-
|
|
96
|
+
- `execution` (optional)
|
|
97
|
+
- optional `start` / `end` — bar filters applied when present; omit them to
|
|
98
|
+
replay every bar you fetched. The window is the author's choice and the
|
|
99
|
+
platform never polices its presence, length, or recency.
|
|
99
100
|
|
|
100
101
|
## Execution Model
|
|
101
102
|
|
|
@@ -332,13 +333,13 @@ file size and prevents read failures for long backtest windows.
|
|
|
332
333
|
|
|
333
334
|
```
|
|
334
335
|
1. Run backtest.run()
|
|
335
|
-
2. Build an equity curve from real replay/account values
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
336
|
+
2. Build an equity curve from real replay/account values — never fabricate
|
|
337
|
+
or forward-fill points
|
|
338
|
+
3. Compute net_pnl from account report
|
|
339
|
+
4. Override raw top-level metrics
|
|
340
|
+
5. Write backtest_report.json (without equity curve)
|
|
341
|
+
6. Write equity_curve.csv
|
|
342
|
+
7. runtime.emit_signal() with correct metrics
|
|
342
343
|
```
|
|
343
344
|
|
|
344
345
|
### `csv` Module Is Blocked
|
|
@@ -357,16 +357,17 @@ Sections:
|
|
|
357
357
|
| `venue` | mapping | Venue name, account type, OMS type, and starting balances |
|
|
358
358
|
| `instrument` or `instruments` | mapping or list[mapping] | Explicit instrument definitions and `bar_type` declarations |
|
|
359
359
|
| `strategy` | mapping | Author strategy module/class entry plus config payload |
|
|
360
|
-
| `execution` | mapping |
|
|
360
|
+
| `execution` | mapping | Optional replay window filters `start` and `end` |
|
|
361
361
|
| `data_requirements` | mapping | Optional replay data contract such as required enriched bar columns |
|
|
362
362
|
|
|
363
363
|
|
|
364
|
-
`execution.start` and `execution.end` are
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
364
|
+
`execution.start` and `execution.end` are optional bar filters: when present
|
|
365
|
+
the engine drops bars outside the window before replay; when omitted the
|
|
366
|
+
replay covers every bar the strategy fetched. The window is entirely the
|
|
367
|
+
author's choice — the platform never polices window presence, length, or
|
|
368
|
+
recency. Pick whatever range the strategy needs; if a single fetch cannot
|
|
369
|
+
cover it, batch history requests. The only hard rule is honesty: the replay
|
|
370
|
+
must run on real bars, and metrics/curves must come from the actual run.
|
|
370
371
|
|
|
371
372
|
Symbols are part of the package contract. Keep `manifest.trading_symbols`,
|
|
372
373
|
`display_name`, `description`, README, `backtest.yaml` instrument symbols, data
|
|
@@ -75,7 +75,8 @@ Parameters:
|
|
|
75
75
|
- `venue`
|
|
76
76
|
- `instrument` or `instruments`
|
|
77
77
|
- `strategy`
|
|
78
|
-
-
|
|
78
|
+
- optional `execution.start` / `execution.end` bar filters (the replay
|
|
79
|
+
window is the author's choice; omit to replay every fetched bar)
|
|
79
80
|
- optional `data_requirements.required_bar_fields`
|
|
80
81
|
|
|
81
82
|
### Generate a chart
|
|
@@ -182,8 +183,9 @@ runtime.emit_signal(
|
|
|
182
183
|
- Keep public backtest claims tied to deterministic strategy logic
|
|
183
184
|
- Do not pass `provider=...` to `getagent.data` calls; the managed DataSDK
|
|
184
185
|
provider is selected by the platform
|
|
185
|
-
-
|
|
186
|
-
|
|
186
|
+
- The `backtest.yaml.execution.start` / `execution.end` window is optional and
|
|
187
|
+
entirely the author's choice — the platform never polices it. When you do
|
|
188
|
+
declare one, verify the selected endpoint returns real bars inside it
|
|
187
189
|
- Keep `manifest.trading_symbols`, display text, README, `backtest.yaml`
|
|
188
190
|
instruments, data calls, and emitted signal symbols aligned. If you correct a
|
|
189
191
|
typo or replace an unavailable symbol, rename the package/title and explain
|
|
@@ -7,9 +7,7 @@ Playbook creator source tree.
|
|
|
7
7
|
|
|
8
8
|
## Read order
|
|
9
9
|
|
|
10
|
-
1.
|
|
11
|
-
Playbook-callable `getagent.data` surface.
|
|
12
|
-
2. Use the domain files below for exact signatures, defaults, enums,
|
|
10
|
+
1. Use the domain files below for exact signatures, defaults, enums,
|
|
13
11
|
and parameter details.
|
|
14
12
|
|
|
15
13
|
## Domain index
|
|
@@ -19,7 +17,7 @@ Playbook creator source tree.
|
|
|
19
17
|
| `Coverage` | [coverage.md](coverage.md) | 3 |
|
|
20
18
|
| `arxiv` | [arxiv.md](arxiv.md) | 1 |
|
|
21
19
|
| `commodity` | [commodity.md](commodity.md) | 7 |
|
|
22
|
-
| `crypto` | [crypto.md](crypto.md) |
|
|
20
|
+
| `crypto` | [crypto.md](crypto.md) | 96 |
|
|
23
21
|
| `currency` | [currency.md](currency.md) | 4 |
|
|
24
22
|
| `derivatives` | [derivatives.md](derivatives.md) | 8 |
|
|
25
23
|
| `economy` | [economy.md](economy.md) | 42 |
|