@tradejs/cli 2.0.19 → 2.0.20
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/dist/cli.js +8787 -3214
- package/dist/lib/aiExport.js +14 -1
- package/dist/lib/aiPocketSearch.js +499 -67
- package/dist/lib/aiPocketSearchCli.js +113 -0
- package/dist/lib/aiTrainCharts.js +14 -1
- package/dist/lib/aiTrainMetrics.js +4 -1
- package/dist/lib/aiTrainResearch.js +88 -54
- package/dist/lib/coreResearch.js +2738 -0
- package/dist/lib/executionCalibration.js +6 -3
- package/dist/lib/runtimeLineage.js +81 -48
- package/dist/lib/runtimeScorecard.js +153 -10
- package/dist/lib/strategyGateFingerprint.js +80 -0
- package/dist/lib/strategyRelease.js +1365 -0
- package/dist/scripts/aiExport.js +16 -3
- package/dist/scripts/aiPocketSearch.js +1069 -163
- package/dist/scripts/aiTrain.js +91 -65
- package/dist/scripts/backtest.js +10 -1
- package/dist/scripts/coreResearch.js +2830 -0
- package/dist/scripts/executionCalibration.js +6 -3
- package/dist/scripts/replay.js +106 -73
- package/dist/scripts/replayRunner.js +106 -73
- package/dist/scripts/replayRuntimeEvidence.js +27 -14
- package/dist/scripts/runtimeEvidence.js +16 -8
- package/dist/scripts/runtimeScorecard.js +883 -29
- package/dist/scripts/signals.js +133 -89
- package/dist/scripts/signalsDaemon.js +133 -89
- package/dist/scripts/strategyRelease.js +1469 -0
- package/package.json +11 -9
package/dist/scripts/aiExport.js
CHANGED
|
@@ -82,6 +82,13 @@ var loadBacktestCheckpointResults = async ({
|
|
|
82
82
|
}) => (0, import_redis.getHashJsonValues)(
|
|
83
83
|
import_redis.redisKeys.backtestRunResults(userName, runId)
|
|
84
84
|
);
|
|
85
|
+
var loadBacktestRunManifest = async ({
|
|
86
|
+
runId,
|
|
87
|
+
userName
|
|
88
|
+
}) => await (0, import_redis.getData)(
|
|
89
|
+
import_redis.redisKeys.backtestRun(userName, runId),
|
|
90
|
+
null
|
|
91
|
+
);
|
|
85
92
|
|
|
86
93
|
// src/lib/aiExport.ts
|
|
87
94
|
var resolveRunScopedAiChunks = async ({
|
|
@@ -96,6 +103,12 @@ var resolveRunScopedAiChunks = async ({
|
|
|
96
103
|
if (!runId) {
|
|
97
104
|
return null;
|
|
98
105
|
}
|
|
106
|
+
const manifest = await loadBacktestRunManifest({ runId, userName });
|
|
107
|
+
if (manifest?.status === "running") {
|
|
108
|
+
throw new Error(
|
|
109
|
+
`AI export run "${runId}" is still running; wait for completion before merging its chunks`
|
|
110
|
+
);
|
|
111
|
+
}
|
|
99
112
|
const chunkFiles = await (0, import_ai.listAiChunkFiles)({ strategyName, outDir, runId });
|
|
100
113
|
if (!chunkFiles.length) {
|
|
101
114
|
return {
|
|
@@ -115,7 +128,7 @@ var exportAiStrategy = async (params) => {
|
|
|
115
128
|
const {
|
|
116
129
|
outDir,
|
|
117
130
|
strategyName,
|
|
118
|
-
keepChunks,
|
|
131
|
+
keepChunks = true,
|
|
119
132
|
requestedRunId,
|
|
120
133
|
userName,
|
|
121
134
|
now = Date.now
|
|
@@ -323,8 +336,8 @@ import_args.default.option(["o", "outDir"], "Dataset directory", "data/ai/export
|
|
|
323
336
|
import_args.default.option(["s", "strategy"], "Strategy name", "");
|
|
324
337
|
import_args.default.option(
|
|
325
338
|
["k", "keepChunks"],
|
|
326
|
-
"Keep source chunk files after successful merge",
|
|
327
|
-
|
|
339
|
+
"Keep source chunk files after successful merge (safe default for active writers)",
|
|
340
|
+
true
|
|
328
341
|
);
|
|
329
342
|
import_args.default.option(
|
|
330
343
|
"partMonths",
|