@alphafox/cli 0.3.14 → 0.3.16

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.
@@ -1,8 +1,11 @@
1
1
  /**
2
- * Not a CLI surface:
3
- * - Web `/api/v1/backtests` jobs (`backtests` / `backtests.*`)
2
+ * Retired from `@alphafoxai/contracts` 2.0.0. Kept as a generate-time
3
+ * safety net if a stale registry still lists them:
4
4
  * - Chat product (`chats` / `chats.*`, `chat_summaries` / `chat_summaries.*`)
5
+ * - Web `/api/v1/backtests` jobs (`backtests` / `backtests.*`)
6
+ * - Strategy Plaza publications (`strategy_plaza` / `strategy_plaza.*`)
5
7
  * Local Engine WASM (`engine-backtest run`) and `engine_backtest.*` stay.
6
8
  * Match `backtests` / `backtests.*` only — never `engine_backtest.*`.
9
+ * Internal maintenance (`internal` / `internal.*`) is not a public facade.
7
10
  */
8
11
  export declare function isOmittedCatalogOperation(operationId: string): boolean;
@@ -2,11 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isOmittedCatalogOperation = isOmittedCatalogOperation;
4
4
  /**
5
- * Not a CLI surface:
6
- * - Web `/api/v1/backtests` jobs (`backtests` / `backtests.*`)
5
+ * Retired from `@alphafoxai/contracts` 2.0.0. Kept as a generate-time
6
+ * safety net if a stale registry still lists them:
7
7
  * - Chat product (`chats` / `chats.*`, `chat_summaries` / `chat_summaries.*`)
8
+ * - Web `/api/v1/backtests` jobs (`backtests` / `backtests.*`)
9
+ * - Strategy Plaza publications (`strategy_plaza` / `strategy_plaza.*`)
8
10
  * Local Engine WASM (`engine-backtest run`) and `engine_backtest.*` stay.
9
11
  * Match `backtests` / `backtests.*` only — never `engine_backtest.*`.
12
+ * Internal maintenance (`internal` / `internal.*`) is not a public facade.
10
13
  */
11
14
  function isOmittedCatalogOperation(operationId) {
12
15
  return (operationId === "backtests" ||
@@ -14,5 +17,9 @@ function isOmittedCatalogOperation(operationId) {
14
17
  operationId === "chats" ||
15
18
  operationId.startsWith("chats.") ||
16
19
  operationId === "chat_summaries" ||
17
- operationId.startsWith("chat_summaries."));
20
+ operationId.startsWith("chat_summaries.") ||
21
+ operationId === "strategy_plaza" ||
22
+ operationId.startsWith("strategy_plaza.") ||
23
+ operationId === "internal" ||
24
+ operationId.startsWith("internal."));
18
25
  }
@@ -11,8 +11,8 @@ const client_1 = require("../http/client");
11
11
  const store_1 = require("../keychain/store");
12
12
  const coverage_notice_1 = require("./coverage-notice");
13
13
  const errors_1 = require("./errors");
14
- const dca_first_order_amount_compat_1 = require("./dca-first-order-amount-compat");
15
14
  const load_config_1 = require("./load-config");
15
+ const web_ui_config_defaults_1 = require("./web-ui-config-defaults");
16
16
  const parse_args_1 = require("./parse-args");
17
17
  const sweep_command_1 = require("./sweep-command");
18
18
  const persist_1 = require("./persist");
@@ -195,7 +195,7 @@ async function executeEngineBacktestRun(args, flags, env = process.env, deps = {
195
195
  if (needsApi) {
196
196
  requireAuth(profile, env, tokensFn);
197
197
  }
198
- const config = (0, dca_first_order_amount_compat_1.projectDcaFirstOrderAmountForLegacyRuntime)((0, load_config_1.loadEngineBacktestConfig)(args.configRaw, {
198
+ const config = (0, web_ui_config_defaults_1.prepareEngineBacktestConfig)((0, load_config_1.loadEngineBacktestConfig)(args.configRaw, {
199
199
  cwd: deps.cwd,
200
200
  readFile: deps.readFile,
201
201
  }));
@@ -353,7 +353,7 @@ async function executeEngineBacktestRun(args, flags, env = process.env, deps = {
353
353
  runId,
354
354
  definitionId: args.definitionId,
355
355
  configSchemaVersion,
356
- config: (0, dca_first_order_amount_compat_1.projectDcaFirstOrderAmountForLegacyRuntime)(plan.effectiveConfig ?? config),
356
+ config: (0, web_ui_config_defaults_1.prepareEngineBacktestConfig)(plan.effectiveConfig ?? config),
357
357
  subscriptionTier,
358
358
  initialEquity: args.initialEquity,
359
359
  tape: tapeResult.tape,
@@ -10,8 +10,8 @@ const paths_1 = require("../cache/paths");
10
10
  const store_1 = require("../keychain/store");
11
11
  const coverage_notice_1 = require("./coverage-notice");
12
12
  const errors_1 = require("./errors");
13
- const dca_first_order_amount_compat_1 = require("./dca-first-order-amount-compat");
14
13
  const load_config_1 = require("./load-config");
14
+ const web_ui_config_defaults_1 = require("./web-ui-config-defaults");
15
15
  const parse_axes_1 = require("./parse-axes");
16
16
  const persist_1 = require("./persist");
17
17
  const prepared_tape_1 = require("./prepared-tape");
@@ -72,10 +72,10 @@ async function executeEngineBacktestSweep(args, flags, env = process.env, deps =
72
72
  if (persist) {
73
73
  requireAuth(profile, env, tokensFn);
74
74
  }
75
- const config = asConfigRecord((0, load_config_1.loadEngineBacktestConfig)(args.configRaw, {
75
+ const config = asConfigRecord((0, web_ui_config_defaults_1.prepareEngineBacktestConfig)((0, load_config_1.loadEngineBacktestConfig)(args.configRaw, {
76
76
  cwd: deps.cwd,
77
77
  readFile: deps.readFile,
78
- }));
78
+ })));
79
79
  const axisInputs = (0, parse_axes_1.parseSweepAxesDocument)((0, load_config_1.loadConfigValue)(args.axesRaw, {
80
80
  cwd: deps.cwd,
81
81
  readFile: deps.readFile,
@@ -585,7 +585,7 @@ async function resolveConfigSchemaVersion(client, definitionId, explicit) {
585
585
  return version;
586
586
  }
587
587
  async function planCoordinate(input) {
588
- const nextConfig = asConfigRecord((0, dca_first_order_amount_compat_1.projectDcaFirstOrderAmountForLegacyRuntime)((0, sweep_kernel_1.applySweepCoordinate)(input.config, input.axes, input.coordinate)));
588
+ const nextConfig = asConfigRecord((0, web_ui_config_defaults_1.prepareEngineBacktestConfig)((0, sweep_kernel_1.applySweepCoordinate)(input.config, input.axes, input.coordinate)));
589
589
  try {
590
590
  const plan = await input.client.planBacktest({
591
591
  definitionId: input.definitionId,
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Web create / backtest forms seed `common.execution.leverage` to 10
3
+ * (`applyInitialUiDefaults` in alphafox-web). Engine runtime treats a
4
+ * missing or non-positive leverage as 1x, so CLI runs that omit the
5
+ * field used to size positions at 1x while the website ran 10x.
6
+ */
7
+ export declare const WEB_UI_DEFAULT_LEVERAGE = 10;
8
+ export declare function applyWebUiConfigDefaults(config: unknown): unknown;
9
+ /** Web UI defaults first, then DCA first-order aliases for older wasm. */
10
+ export declare function prepareEngineBacktestConfig(config: unknown): unknown;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WEB_UI_DEFAULT_LEVERAGE = void 0;
4
+ exports.applyWebUiConfigDefaults = applyWebUiConfigDefaults;
5
+ exports.prepareEngineBacktestConfig = prepareEngineBacktestConfig;
6
+ const dca_first_order_amount_compat_1 = require("./dca-first-order-amount-compat");
7
+ /**
8
+ * Web create / backtest forms seed `common.execution.leverage` to 10
9
+ * (`applyInitialUiDefaults` in alphafox-web). Engine runtime treats a
10
+ * missing or non-positive leverage as 1x, so CLI runs that omit the
11
+ * field used to size positions at 1x while the website ran 10x.
12
+ */
13
+ exports.WEB_UI_DEFAULT_LEVERAGE = 10;
14
+ function applyWebUiConfigDefaults(config) {
15
+ const record = asRecord(config);
16
+ if (!record) {
17
+ return config;
18
+ }
19
+ const common = asRecord(record.common) ?? {};
20
+ const execution = asRecord(common.execution) ?? {};
21
+ if (hasPositiveLeverage(execution.leverage)) {
22
+ return config;
23
+ }
24
+ return {
25
+ ...record,
26
+ common: {
27
+ ...common,
28
+ execution: {
29
+ ...execution,
30
+ leverage: exports.WEB_UI_DEFAULT_LEVERAGE,
31
+ },
32
+ },
33
+ };
34
+ }
35
+ /** Web UI defaults first, then DCA first-order aliases for older wasm. */
36
+ function prepareEngineBacktestConfig(config) {
37
+ return (0, dca_first_order_amount_compat_1.projectDcaFirstOrderAmountForLegacyRuntime)(applyWebUiConfigDefaults(config));
38
+ }
39
+ function hasPositiveLeverage(value) {
40
+ return typeof value === "number" && Number.isFinite(value) && value > 0;
41
+ }
42
+ function asRecord(value) {
43
+ return value !== null && typeof value === "object" && !Array.isArray(value)
44
+ ? value
45
+ : null;
46
+ }
@@ -1,153 +1,153 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "packageName": "@alphafox/cli",
4
- "packageVersion": "0.3.14",
5
- "contractVersion": "2026-08-13",
6
- "bundleHash": "a303dae6ad43e08069748976c7caeb15cfc3ba298613937d27889943635521c4",
4
+ "packageVersion": "0.3.16",
5
+ "contractVersion": "2026-08-29",
6
+ "bundleHash": "85e078691f30150c31fd530c6a2684fb7ef3df2b557a5c74ecca1b0c4716f26b",
7
7
  "skills": [
8
8
  {
9
9
  "name": "alphafox",
10
- "version": "0.3.14",
10
+ "version": "0.3.16",
11
11
  "files": [
12
12
  {
13
13
  "path": "SKILL.md",
14
- "sha256": "939e05b9b4ce70d295244d11405d7d2aae4bdd8e3a3702d842baaa65736a8fb7",
15
- "size": 7426
14
+ "sha256": "5689e8de0550fc39aa5ab651422c8a32829923824c432685895469cbbe7ca3de",
15
+ "size": 7950
16
16
  }
17
17
  ],
18
- "hash": "438cc8c9d80833f35692b3a179c2e9f105c6a3527d88572589160f5d544c8b79"
18
+ "hash": "9bd1cc3f012eaea4b1c3d93b2db4604d6c4d5cd76944cf850f367eb8ff5812ab"
19
19
  },
20
20
  {
21
21
  "name": "alphafox-account",
22
- "version": "0.3.14",
22
+ "version": "0.3.16",
23
23
  "files": [
24
24
  {
25
25
  "path": "SKILL.md",
26
- "sha256": "e6d03f7993d0b0c44be224757401981e268dc0cf74f8902786ae7bf7666af436",
26
+ "sha256": "d47a9e5a10a113715e3ea9baf1bbca9bdffccf57d01269c42dbd9fa80a9d4d4f",
27
27
  "size": 784
28
28
  }
29
29
  ],
30
- "hash": "b67a97de103f05bb5b1df458e2afe50e084caf22f7ef043c9fa91546717c4321"
30
+ "hash": "352ad953ed429033fc3abe08fefe5767a2f131b6866033b49f72fdc4031e2e06"
31
31
  },
32
32
  {
33
33
  "name": "alphafox-admin",
34
- "version": "0.3.14",
34
+ "version": "0.3.16",
35
35
  "files": [
36
36
  {
37
37
  "path": "SKILL.md",
38
- "sha256": "9bc1859f7d3f3f7bf3fd9d48fb3d21e7553f4bf52944b9727af3d17a76d0e5fa",
38
+ "sha256": "2abccf962b067790583d4c05a4af7fd7e3126dd9d7f7452d073be9988ef1f1bd",
39
39
  "size": 788
40
40
  }
41
41
  ],
42
- "hash": "3e28bca0bd00951477125844aac06e00253e8d4247d5728ccf427a462b5ddf93"
42
+ "hash": "efd7551a49ed8ca602b639416c294093eaef3d8b9bd912488350a45a4ebf8ef8"
43
43
  },
44
44
  {
45
45
  "name": "alphafox-auth",
46
- "version": "0.3.14",
46
+ "version": "0.3.16",
47
47
  "files": [
48
48
  {
49
49
  "path": "SKILL.md",
50
- "sha256": "6bb282a22450e2ef55f3e7cf1488c8d2f878cb0d863e56f1bd79c1506b2cbd40",
50
+ "sha256": "44b31f54b17000b9939900897bf47bcdd9c6aab24d923a7188812cb83b0abe5c",
51
51
  "size": 2371
52
52
  }
53
53
  ],
54
- "hash": "da361f46c23f048449e92a22206e359f8cc91568ec0472678ffdf5c3810f3f83"
54
+ "hash": "b33dbbd6c5ae60fd2271e5c185002fd64949a83608c2f4e4d9886729a6d69bce"
55
55
  },
56
56
  {
57
57
  "name": "alphafox-cache",
58
- "version": "0.3.14",
58
+ "version": "0.3.16",
59
59
  "files": [
60
60
  {
61
61
  "path": "SKILL.md",
62
- "sha256": "e23b41a9f268fcce0fab4c16cac275aa63b3b6a967403f81a4965361441957bb",
62
+ "sha256": "6590bd63520375cedbed8ea552991bc96c6bf126bb6eeb7d3045f41b81cf9518",
63
63
  "size": 1530
64
64
  }
65
65
  ],
66
- "hash": "6ca7dac2f003c65e233be6de10a027e1a3bb35ef6c7ebe978f150873fe515394"
66
+ "hash": "cb0495c5e8fe6bc5eaf4c74301c5e697a6fc7021ba7ca03ff731bddf2d749292"
67
67
  },
68
68
  {
69
69
  "name": "alphafox-engine-backtest",
70
- "version": "0.3.14",
70
+ "version": "0.3.16",
71
71
  "files": [
72
72
  {
73
73
  "path": "SKILL.md",
74
- "sha256": "69f05e144065d8333d8aafa857c824a524e40e21e432565542a7872bb645b12f",
75
- "size": 8443
74
+ "sha256": "ec1660ea9da1728879083c9477e51dbe86dea054ade521eeff930f70c95117de",
75
+ "size": 9229
76
76
  }
77
77
  ],
78
- "hash": "b7002fac218ff2a7d016815175b8f01fdc1615f8c1dd538d80c84295b30cee77"
78
+ "hash": "eacad4f278fda1d2077a3e4c701573c64a4d33dbef445209e2dbd0dddaa914f9"
79
79
  },
80
80
  {
81
81
  "name": "alphafox-exchange",
82
- "version": "0.3.14",
82
+ "version": "0.3.16",
83
83
  "files": [
84
84
  {
85
85
  "path": "SKILL.md",
86
- "sha256": "3c3d8f2085f5e6b443c51da49d280eb955307d3bca83bba87f04d386dfc7450c",
86
+ "sha256": "66115095ff20b22eb5cb7d6ff96e36cb3f02cf0273950a62115ebe494adf7575",
87
87
  "size": 744
88
88
  }
89
89
  ],
90
- "hash": "7e9ee14179eb097e8e166aeedb96edc5d60c33e41614434b99926feeadec8f35"
90
+ "hash": "adbea499980f4827b4c802462a9647bcc0cf7729121fa84e100501ea9ba02f8f"
91
91
  },
92
92
  {
93
93
  "name": "alphafox-market",
94
- "version": "0.3.14",
94
+ "version": "0.3.16",
95
95
  "files": [
96
96
  {
97
97
  "path": "SKILL.md",
98
- "sha256": "5e53acb8b08a853377c4bc2df6bf07afced7b32e04eabdaac6095a30ba94dd1b",
98
+ "sha256": "bd658ed24aab5ce7ddabe9bf47b00fabe697cb07c10e9b5e78dfc7f6210518a5",
99
99
  "size": 3079
100
100
  }
101
101
  ],
102
- "hash": "4fb075aa2d9e90b932a5645bafbdfb4a14b3db2eceb43625cd014e0f3251e7b2"
102
+ "hash": "f99765f97a61597a72fc7cc7dabb8049fdcda092e8b9d4591050c798ab8bfb5a"
103
103
  },
104
104
  {
105
105
  "name": "alphafox-notification",
106
- "version": "0.3.14",
106
+ "version": "0.3.16",
107
107
  "files": [
108
108
  {
109
109
  "path": "SKILL.md",
110
- "sha256": "e8f68d39df1472a86b84ec9dbf260300745a462371f1e1ce4288e38c2f747553",
110
+ "sha256": "647e84e58f7450b08a1f7c157e815eadd1f0a421a8c4a008c76219d315f0bb79",
111
111
  "size": 699
112
112
  }
113
113
  ],
114
- "hash": "10d397d049af7ab75c35af14c48d6362ffc9bc4703ebb91f471b037a984dcb98"
114
+ "hash": "ad91b776c8a4884de332ed890f0e69fdfc46ea587c81bb06cc7de9f2a64d87d6"
115
115
  },
116
116
  {
117
117
  "name": "alphafox-shared",
118
- "version": "0.3.14",
118
+ "version": "0.3.16",
119
119
  "files": [
120
120
  {
121
121
  "path": "SKILL.md",
122
- "sha256": "519a457d1889cb8eeca669fa6e9016468e34d4107b5a68212b803b9d47465950",
123
- "size": 5960
122
+ "sha256": "ca9a792a62ec3a78abb5d65f47865245d01a63b12e5cc0b411f54632b20162a5",
123
+ "size": 6920
124
124
  }
125
125
  ],
126
- "hash": "bea3bc79da430a1e5bfb3cd0291da3cb1cfe7f5550ba4f83eacaac2b16f00972"
126
+ "hash": "b30fef80fc2969deb409bd1805f17e4a185ea180d8d3bc31e32c732e83ec5af3"
127
127
  },
128
128
  {
129
129
  "name": "alphafox-strategy",
130
- "version": "0.3.14",
130
+ "version": "0.3.16",
131
131
  "files": [
132
132
  {
133
133
  "path": "SKILL.md",
134
- "sha256": "31c3a39dc972625a540e782940006b2a7561332439849b2c0e5e605dc7b5612b",
135
- "size": 4587
134
+ "sha256": "dabb8fd6713884961beeaf1cbb117ecc12bc14daf1003c3d01d226c088f08669",
135
+ "size": 4862
136
136
  }
137
137
  ],
138
- "hash": "3a6d9c3ab1a9ee5912509e7e05a75cc64070181fb5df306de669c33c6f15ca08"
138
+ "hash": "e5c8405ac12c2460e8195bc9060ea77cd4d4a3623fc9f94494f1f9bea979e169"
139
139
  },
140
140
  {
141
141
  "name": "alphafox-trading",
142
- "version": "0.3.14",
142
+ "version": "0.3.16",
143
143
  "files": [
144
144
  {
145
145
  "path": "SKILL.md",
146
- "sha256": "6ce2a99527334d6beddd65eee8e17f4aae257fce2d93edf7f69e0680435adf53",
147
- "size": 3123
146
+ "sha256": "18150d7ebfb34bb8e1246375d9942eddb008100308bdd83ab7ad853d638d8ad6",
147
+ "size": 4493
148
148
  }
149
149
  ],
150
- "hash": "d235a9bfc387b32d992131ef1f589f86aa0100600c9bc8f61bf0261fb9b5e606"
150
+ "hash": "12775a0d18d421b483b3bd72d785e3bb71a8c393968d6bfd2c2d708ed85631fb"
151
151
  }
152
152
  ]
153
153
  }
package/dist/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export declare const CLI_NAME = "alphafox";
2
2
  export declare const CLI_PACKAGE = "@alphafox/cli";
3
- export declare const CLI_VERSION = "0.3.14";
3
+ export declare const CLI_VERSION = "0.3.16";
4
4
  export { CATALOG_VERSION as CLI_CONTRACT_VERSION } from "./catalog/operations";
package/dist/version.js CHANGED
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CLI_CONTRACT_VERSION = exports.CLI_VERSION = exports.CLI_PACKAGE = exports.CLI_NAME = void 0;
4
4
  exports.CLI_NAME = "alphafox";
5
5
  exports.CLI_PACKAGE = "@alphafox/cli";
6
- exports.CLI_VERSION = "0.3.14";
6
+ exports.CLI_VERSION = "0.3.16";
7
7
  var operations_1 = require("./catalog/operations");
8
8
  Object.defineProperty(exports, "CLI_CONTRACT_VERSION", { enumerable: true, get: function () { return operations_1.CATALOG_VERSION; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alphafox/cli",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "description": "AlphaFox CLI — Agent/Human entry for the public Application API.",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-account
3
3
  description: Account, wallet, and subscription read paths.
4
- version: 0.3.14
4
+ version: 0.3.16
5
5
  ---
6
6
 
7
7
  # Account / wallet
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-admin
3
3
  description: Admin-only operations reusing Web role authorization.
4
- version: 0.3.14
4
+ version: 0.3.16
5
5
  ---
6
6
 
7
7
  # Admin
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox
3
- description: AlphaFox CLI entry router. Use for any AlphaFox request — install, update, login, whoami, 回测, engine backtest, 清理回测缓存 / 历史数据, strategy definitions, create/list/start/stop a running strategy (trader), ticker/标的 resolve (美股 or crypto), market data, exchange connectors, wallet, subscriptions, notifications, or admin. After a successful install and login, present the 新人引导 in this file (Lite square 带单员 + classic strategies). If a CLI command prints `[alphafox] update available`, ask the user「检测到新的版本,是否需要我帮你升级?」and only then run `alphafox update --format json --no-input`. After a large backtest, if tape cache is large, ask「回测下载的历史数据比较大,要不要我帮你清理本地缓存?」then open `alphafox-cache`. Start here, then open the routed domain skill. Do not guess alphafox-engine-backtest vs alphafox-strategy vs alphafox-trading from memory.
4
- version: 0.3.14
3
+ description: AlphaFox CLI entry router. Use for any AlphaFox request — install, update, login, whoami, 回测, engine backtest, 清理回测缓存 / 历史数据, strategy definitions, create/list/start/stop a running strategy (trader), ticker/标的 resolve (美股 or crypto), market data, exchange connectors, wallet, subscriptions, notifications, or admin. After 回测 or 运行策略, include the dashboard URL from the domain skill. When the user asks 排行榜, include https://www.alphafox.app/zh/dashboard/leaderboard. After a successful install and login, present the 新人引导 in this file (Lite square 带单员 + classic strategies). If a CLI command prints `[alphafox] update available`, ask the user「检测到新的版本,是否需要我帮你升级?」and only then run `alphafox update --format json --no-input`. After a large backtest, if tape cache is large, ask「回测下载的历史数据比较大,要不要我帮你清理本地缓存?」then open `alphafox-cache`. Start here, then open the routed domain skill. Do not guess alphafox-engine-backtest vs alphafox-strategy vs alphafox-trading from memory.
4
+ version: 0.3.16
5
5
  ---
6
6
 
7
7
  # AlphaFox
@@ -33,15 +33,16 @@ A **trader** is a running strategy instance (paper or live), not a person. Creat
33
33
 
34
34
  If several rows apply, load **all** of them (typical: `alphafox-shared` + `alphafox-market` + one domain skill).
35
35
 
36
- - “帮我配/建一个网格/DCA/跟单策略” → `alphafox-strategy` (pick definition, ask knobs, validate `{common, strategy}`) **and** `alphafox-market` (resolve tickers) **and** `alphafox-trading` (create the trader). Hidden copy variants still create through `alphafox-trading`.
37
- - “帮我回测这个配置” → `alphafox-strategy` (definition + config) **and** `alphafox-engine-backtest`.
36
+ - “帮我配/建一个网格/DCA/跟单策略” → `alphafox-strategy` (pick definition, ask knobs, validate `{common, strategy}`) **and** `alphafox-market` (resolve tickers) **and** `alphafox-trading` (create the trader, default `autoStart: true`). Hidden copy variants still create through `alphafox-trading`. After create, include the trader URL from `alphafox-shared`.
37
+ - “帮我回测这个配置” → `alphafox-strategy` (definition + config) **and** `alphafox-engine-backtest`. After a persisted run, include the backtest URL from `alphafox-shared`.
38
+ - “排行榜” → `trader_leaderboard` as below, **and** include `https://www.alphafox.app/zh/dashboard/leaderboard`.
38
39
 
39
40
  ## Upgrade reminder
40
41
 
41
42
  The CLI may print this on **stderr** at most once every 24 hours:
42
43
 
43
44
  ```text
44
- [alphafox] update available: 0.3.13 -> 0.3.14. After the user confirms, run: alphafox update --format json --no-input,
45
+ [alphafox] update available: 0.3.15 -> 0.3.16. After the user confirms, run: alphafox update --format json --no-input,
45
46
  ```
46
47
 
47
48
  If you see that notice (or `updateAvailable: true` from `alphafox update --check`):
@@ -106,13 +107,13 @@ Present in the operator's language, this shape:
106
107
  想跟单或者运行策略,告诉我即可。或者您想先看看排行榜,也可以直接告诉我。
107
108
  ```
108
109
 
109
- Do not create a trader from this welcome. When they pick 跟单 / a classic strategy, read `alphafox-strategy` + `alphafox-trading` (+ `alphafox-market` if they name a ticker). When they ask for 排行榜, list `trader_leaderboard` (same flags, no `strategyDefinitionId` unless they named a type) and summarize — do not dump the envelope.
110
+ Do not create a trader from this welcome. When they pick 跟单 / a classic strategy, read `alphafox-strategy` + `alphafox-trading` (+ `alphafox-market` if they name a ticker). When they ask for 排行榜, list `trader_leaderboard` (same flags, no `strategyDefinitionId` unless they named a type), include `https://www.alphafox.app/zh/dashboard/leaderboard`, and summarize — do not dump the envelope.
110
111
 
111
112
  ## Do not mix these backtest paths
112
113
 
113
114
  - Local Engine tape + wasm + optional persist → `alphafox-engine-backtest` (`alphafox engine-backtest run`, hyphen).
114
115
  - Experiment catalog CRUD → same skill, underscore catalog `engine_backtest.*`.
115
- - Web `/api/v1/backtests` (`backtests.*`) is **not** a CLI surface. Do not call it via typed commands, `schema`, or `alphafox api`.
116
+ - The old web Chat Backtest job path is gone from the catalog. Do not call `/api/v1/backtests` via typed commands, `schema`, or `alphafox api`.
116
117
 
117
118
  Ambiguous “帮我回测” → `alphafox-engine-backtest`, after resolving symbols.
118
119
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-shared
3
- description: Shared AlphaFox CLI rules for Agents — auth, profiles, envelopes, risk gates, and public operationIds only.
4
- version: 0.3.14
3
+ description: Shared AlphaFox CLI rules for Agents — auth, profiles, envelopes, risk gates, public operationIds, and dashboard links after 回测 / 运行策略 / 排行榜.
4
+ version: 0.3.16
5
5
  ---
6
6
 
7
7
  # AlphaFox shared Agent contract
@@ -118,6 +118,22 @@ Uncataloged writes cannot carry a non-empty body. Find the `operationId` first.
118
118
  - Never auto-retry unknown write outcomes.
119
119
  - CLI `--yes` is UX only; the server still enforces role, ownership, and scopes.
120
120
 
121
+ ## Dashboard links
122
+
123
+ After a persisted backtest, after creating or starting a trader, or when the operator asks 排行榜, include the matching web URL in the reply. Do not stop at CLI ids or `experimentUrl` alone.
124
+
125
+ Production (default profile):
126
+
127
+ | Surface | URL |
128
+ |---|---|
129
+ | Trader | `https://www.alphafox.app/zh/dashboard/traders/{traderId}` |
130
+ | Backtest | `https://www.alphafox.app/zh/dashboard/traders/backtest/{experimentId}` |
131
+ | Leaderboard | `https://www.alphafox.app/zh/dashboard/leaderboard` |
132
+
133
+ `--profile staging` → host `https://staging.alphafox.app`. `--profile local` → `http://127.0.0.1:3000`. Keep `/zh/dashboard/...`.
134
+
135
+ `traderId` is `data.trader.id` from create (or the id just started). `experimentId` is the persisted Experiment id (`data.experimentId`, or the `--experiment` / create-experiment id). Skip the backtest link only when persist was skipped and there is no Experiment id.
136
+
121
137
  ## Public operationIds only
122
138
 
123
139
  Skills must reference registry `operationId`s (see `alphafox schema` / `alphafox catalog`). Shortcuts may only compose those operationIds. Do not hardcode internal service URLs or invent a second catalog.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-auth
3
3
  description: Login, status, logout, whoami, and environment isolation for AlphaFox CLI.
4
- version: 0.3.14
4
+ version: 0.3.16
5
5
  ---
6
6
 
7
7
  # Auth Skill
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-cache
3
3
  description: Inspect and clean local Engine backtest caches (downloaded OHLCV tape and wasm runtime). Use when the user asks to 清理缓存, free disk, or after a large historical backtest.
4
- version: 0.3.14
4
+ version: 0.3.16
5
5
  ---
6
6
 
7
7
  # Cache
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-engine-backtest
3
- description: Local Engine WASM backtest (alphafox engine-backtest run|sweep) vs catalog experiment CRUD.
4
- version: 0.3.14
3
+ description: Local Engine WASM backtest (alphafox engine-backtest run|sweep) vs catalog experiment CRUD. After a persisted run, include https://www.alphafox.app/zh/dashboard/traders/backtest/{experimentId}.
4
+ version: 0.3.16
5
5
  ---
6
6
 
7
7
  # Engine Backtest
@@ -15,11 +15,11 @@ Human-mentioned tickers must be resolved with `alphafox resolve-symbols` (`skill
15
15
  | Intent | Use | Do not |
16
16
  |---|---|---|
17
17
  | Iterate a strategy locally (pull tape + run wasm + optional persist) | `alphafox engine-backtest run` (hyphen, built-in) | Do not treat this as server-side execution of `engine_backtest.experiments.byId.runs.create` |
18
- | Local parameter search with explicit axes; persist one Sweep after completion | `alphafox engine-backtest sweep` | Never loop `runs.create` per coordinate. Do not call `backtests.*` |
18
+ | Local parameter search with explicit axes; persist one Sweep after completion | `alphafox engine-backtest sweep` | Never loop `runs.create` per coordinate. Do not call the retired web Chat Backtest job path |
19
19
  | Local search with zero writes | `alphafox engine-backtest sweep ... --no-persist` | Do not persist a cancelled or incomplete search |
20
20
  | List / get / delete persisted Sweeps | Catalog `engine_backtest.experiments.byId.sweeps.*` | Do not invent a second catalog. Delete is high-risk and needs `--yes` |
21
21
  | List / get / create / rename / delete experiments and persisted runs | Catalog `engine_backtest.*` (underscore) | Do not invent a second catalog |
22
- | Web `/api/v1/backtests` job | — | Not a CLI surface. Do not call `backtests.*` or `/api/v1/backtests` |
22
+ | Retired web Chat Backtest job | — | Removed from the catalog. Do not call `/api/v1/backtests` |
23
23
 
24
24
  Read the create-experiment body with `alphafox schema` **before** composing JSON. Do not invent experiment fields. Large create/run/sweep payloads use `--config @file`, never a guessed `--body`.
25
25
 
@@ -52,7 +52,7 @@ alphafox engine-backtest run \
52
52
  --format jsonl --no-input
53
53
  ```
54
54
 
55
- `--config` is `{ common, strategy }` (the source file from skill `alphafox-strategy`). It is not the `validate_config` HTTP body `{ configSchemaVersion, config }`.
55
+ `--config` is `{ common, strategy }` (the source file from skill `alphafox-strategy`). It is not the `validate_config` HTTP body `{ configSchemaVersion, config }`. Missing `common.execution.leverage` is filled to **10** before plan/run (same as the website form). An explicit leverage is kept. Engine runtime still treats a raw omitted field as 1x — do not skip this key in the source file.
56
56
 
57
57
  Also valid: `--from` / `--to` instead of `--range`. `--create-experiment --name "..."` when there is no `--experiment` (needs `strategyDefinitionId` + `strategyDefinitionDisplay` `{zh,en}`; pass `--definition-label-zh` / `--definition-label-en` or the CLI falls back to the definition id). Persisted runs use the account tier from `subscriptions.me.get`; if `--tier` is supplied, it must match. With `--no-persist`, `runs.create` is skipped and `--tier` may simulate `free|pro|pro_max` (default `pro`). `--data-quality` defaults to `basic` (soft gaps finish the run and appear as `coverageNotice`; `prefix_gap` is less severe than `internal_gap`). `--data-quality strict` still fails on any gap. `--replay-timeframe` defaults to `1m` (allowed `1m|3m|5m|15m|30m|1h|4h`); this is the replay/download bar and is merged with plan indicator timeframes so a 4h RSI grid still replays on 1m. `runs.create` is `write`, not `high-risk-write` — do not add `--yes`. Do not update or delete experiments through this command.
58
58
 
@@ -78,7 +78,7 @@ alphafox engine-backtest sweep \
78
78
 
79
79
  `--mode` is `neighborhood|range`. `--search-mode` is `standard|fast`. `--concurrency` is 1–8; Free is always serial. After every local coordinate finishes, the command POSTs **one** `engine_backtest.experiments.byId.sweeps.create` summary (4 MiB / point-error caps). It never calls `runs.create` per coordinate and never writes Tape, curves, or full configs. `--no-persist` stays zero-write. A cancelled or incomplete search is not persisted. The same `clientSweepId` is reused if you rebuild the create body for retry; unknown write results (no Sweep id) fail instead of reporting `persisted: true`.
80
80
 
81
- `--format jsonl` includes `planning`, `tape`, `sweep`, and `persist` stages. The final envelope includes counts, `elapsedMs`, best coordinate/config, `sweepId`, `persisted`, and an Experiment URL with `?tab=sweep`.
81
+ `--format jsonl` includes `planning`, `tape`, `sweep`, and `persist` stages. The final envelope includes counts, `elapsedMs`, best coordinate/config, `sweepId`, `persisted`, and an Experiment URL with `?tab=sweep`. After persist, include that dashboard URL in the reply (`https://www.alphafox.app/zh/dashboard/traders/backtest/{experimentId}?tab=sweep`).
82
82
 
83
83
  Read / delete history through typed catalog commands. Delete is high-risk-write:
84
84
 
@@ -94,7 +94,7 @@ Owner isolation and 7-day expiry are enforced by the server. Applying a coordina
94
94
 
95
95
  1. Edit config JSON.
96
96
  2. `engine-backtest run` (reuse `--experiment` after the first create).
97
- 3. Read `data.metrics` / `data.engineVersion` / `data.runId` / `data.experimentUrl`. After the run, also read `data.coverageNotice` (`warning` = mid-range candle gaps; `notice` = start / other soft gaps).
97
+ 3. Read `data.metrics` / `data.engineVersion` / `data.runId` / `data.experimentId` / `data.experimentUrl`. After the run, also read `data.coverageNotice` (`warning` = mid-range candle gaps; `notice` = start / other soft gaps). When an Experiment id exists, include the backtest dashboard URL from `alphafox-shared` (`https://www.alphafox.app/zh/dashboard/traders/backtest/{experimentId}`) in the reply — do not stop at metrics or the raw CLI `experimentUrl`.
98
98
  4. Adjust parameters and run again. Do not invent a token flag if persist returns 401 — `alphafox auth login`.
99
99
  5. After a long-range or 1m run, follow `alphafox-cache`: `alphafox cache status`. If `data.tape.large` is true, ask **回测下载的历史数据比较大,要不要我帮你清理本地缓存?** and wait for yes.
100
100
 
@@ -114,4 +114,4 @@ Owner isolation and 7-day expiry are enforced by the server. Applying a coordina
114
114
  - `engine_backtest.experiments.byId.sweeps.byId.get`
115
115
  - High-risk (not this skill's run/sweep path): `engine_backtest.experiments.byId.update` / `.byId.delete` / `.byId.runs.byId.delete` / `.byId.sweeps.byId.delete`
116
116
 
117
- `backtests.*` is not an Engine Sweep or Engine Run surface. Do not call it from this skill.
117
+ The retired web Chat Backtest job path is not an Engine Sweep or Engine Run surface. Do not call `/api/v1/backtests` from this skill.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-exchange
3
3
  description: Exchange connectors list and connection management via Public API.
4
- version: 0.3.14
4
+ version: 0.3.16
5
5
  ---
6
6
 
7
7
  # Exchange connectors
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-market
3
3
  description: Market data and ticker resolution for US equity perps, RWAs, and crypto on the same perp catalog. Use when the user names 美股, NVDA, AAPL, BTC, or any 标的. Keep the operator's asset class via symbolMetadata — do not rewrite NVDA into a crypto coin.
4
- version: 0.3.14
4
+ version: 0.3.16
5
5
  ---
6
6
 
7
7
  # Market
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-notification
3
3
  description: Notification channels and subscriptions.
4
- version: 0.3.14
4
+ version: 0.3.16
5
5
  ---
6
6
 
7
7
  # Notification
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: alphafox-strategy
3
3
  description: Strategy definitions — list types, read a definition's contract, and validate config. Creating a running strategy is creating a trader; use alphafox-trading for that. Local Engine backtest is alphafox-engine-backtest.
4
- version: 0.3.14
4
+ version: 0.3.16
5
5
  ---
6
6
 
7
7
  # Strategy definitions
@@ -41,7 +41,7 @@ Explain the type from those fields. Missing a layer → say unknown; do not fill
41
41
  The human answers knobs. You write JSON.
42
42
 
43
43
  1. Confirm the definition from `byId.get` in the operator's language (what it is, what drives it, how positions change).
44
- 2. From `strategyConfigSchema` plus common required fields, ask **only** values the human must choose: symbols (resolve first), direction / mode, size, signal source, leverage. Do not walk every optional key.
44
+ 2. From `strategyConfigSchema` plus common required fields, ask **only** values the human must choose: symbols (resolve first), direction / mode, size, signal source, leverage. Do not walk every optional key. If the operator does not pick leverage, write `common.execution.leverage: 10` (website form default). Omitting the field is not the same — Engine treats a missing leverage as **1x**.
45
45
  3. Write `strategy-config.json` as the trader object:
46
46
 
47
47
  ```json
@@ -74,7 +74,7 @@ alphafox trading strategy_definitions byId validate_config --definitionId <id> -
74
74
 
75
75
  `body_schema` / `body_schema_missing` (exit `64`): re-read the operation schema. Server field-path errors: fix that path. Do not retry with a different envelope.
76
76
 
77
- After it validates: create with `alphafox-trading`, or backtest with `alphafox-engine-backtest`. Do not create or backtest from this skill.
77
+ After it validates: create with `alphafox-trading` (default `autoStart: true`), or backtest with `alphafox-engine-backtest`. Do not create or backtest from this skill. Dashboard URLs after those actions live in `alphafox-shared`.
78
78
 
79
79
  ## operationIds
80
80