@tradejs/cli 3.1.18 → 3.1.19-beta.234

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 CHANGED
@@ -27259,7 +27259,7 @@ async function collectReleaseEvidenceReferences(references) {
27259
27259
  })
27260
27260
  );
27261
27261
  }
27262
- var import_node_crypto12, import_promises25, import_node_path20, import_types9, import_strategyReleaseEvidence2, SHA256_RE2, LINEAGE_FINGERPRINT_RE, STRATEGY_REVISION_RE, DEPLOYMENT_COMPOSITION_ID_RE, REQUIRED_LONG_WINDOWS, REQUIRED_STABLE_TERMINAL_WINDOWS, MIN_RECENT_DIRECTION_REPAIR_EVENTS, MIN_SELECTION_GRADE_TERMINAL_EVENTS, safeSegment3, compactTimestamp2, verifyFullPeriodChartArtifact, readVerifiedJsonArtifact, verifyResearchDecisionLineage, hasExactRuntimeTarget, deriveStrategyReleaseResearchDecision, canonicalStrategyReleaseJson, strategyReleaseSha256, assertFingerprint, assertLineageFingerprint, releaseReasons, deriveReleaseGates, verifyEvidenceComposition, createStrategyReleaseManifest, createStrategyReleaseEnvelope, verifyStrategyReleaseEnvelope, verifyStrategyEvidenceMarkerEnvelope, releaseMarkers, writeJsonAtomic2, publishStrategyRelease, publishStrategyLiveDiagnosis, finiteString3, finiteNumber6, finiteDirectionPolicy, uniqueStrings, incompleteEvidenceLineage, extractEvidenceLineage, verifyCompletedCoreResearchBundle;
27262
+ var import_node_crypto12, import_promises25, import_node_path20, import_types9, import_strategyReleaseEvidence2, SHA256_RE2, LINEAGE_FINGERPRINT_RE, STRATEGY_REVISION_RE, DEPLOYMENT_COMPOSITION_ID_RE, REQUIRED_LONG_WINDOWS, REQUIRED_DIAGNOSTIC_TERMINAL_WINDOWS, MIN_RECENT_DIRECTION_REPAIR_EVENTS, safeSegment3, compactTimestamp2, verifyFullPeriodChartArtifact, readVerifiedJsonArtifact, verifyResearchDecisionLineage, hasExactRuntimeTarget, deriveStrategyReleaseResearchDecision, canonicalStrategyReleaseJson, strategyReleaseSha256, assertFingerprint, assertLineageFingerprint, releaseReasons, deriveReleaseGates, verifyEvidenceComposition, createStrategyReleaseManifest, createStrategyReleaseEnvelope, verifyStrategyReleaseEnvelope, verifyStrategyEvidenceMarkerEnvelope, releaseMarkers, writeJsonAtomic2, publishStrategyRelease, publishStrategyLiveDiagnosis, finiteString3, finiteNumber6, finiteDirectionPolicy, uniqueStrings, incompleteEvidenceLineage, extractEvidenceLineage, verifyCompletedCoreResearchBundle;
27263
27263
  var init_strategyRelease = __esm({
27264
27264
  "src/lib/strategyRelease.ts"() {
27265
27265
  "use strict";
@@ -27276,9 +27276,8 @@ var init_strategyRelease = __esm({
27276
27276
  STRATEGY_REVISION_RE = /^sr1:[a-f0-9]{16}$/;
27277
27277
  DEPLOYMENT_COMPOSITION_ID_RE = /^dc1:[a-f0-9]{16}$/;
27278
27278
  REQUIRED_LONG_WINDOWS = [1095, 1460, 1825];
27279
- REQUIRED_STABLE_TERMINAL_WINDOWS = [365, 180, 90];
27279
+ REQUIRED_DIAGNOSTIC_TERMINAL_WINDOWS = [365, 180, 90];
27280
27280
  MIN_RECENT_DIRECTION_REPAIR_EVENTS = 20;
27281
- MIN_SELECTION_GRADE_TERMINAL_EVENTS = 50;
27282
27281
  safeSegment3 = import_strategyReleaseEvidence2.safeStrategyEvidenceSegment;
27283
27282
  compactTimestamp2 = import_strategyReleaseEvidence2.compactStrategyEvidenceTimestamp;
27284
27283
  verifyFullPeriodChartArtifact = async (input) => {
@@ -27340,8 +27339,8 @@ var init_strategyRelease = __esm({
27340
27339
  const directionPolicy = input.directionPolicy ?? "both";
27341
27340
  const activeDirections = directionPolicy === "long_only" ? ["long"] : directionPolicy === "short_only" ? ["short"] : ["long", "short"];
27342
27341
  const suppressedDirection = directionPolicy === "long_only" ? "short" : directionPolicy === "short_only" ? "long" : null;
27343
- const hasHistoricalEdge = (entry, supportConditioned = false) => (supportConditioned ? (entry.independentEvents ?? entry.trades ?? 0) < MIN_SELECTION_GRADE_TERMINAL_EVENTS || entry.pnl > 0 && entry.profitFactor >= 1 : entry.pnl > 0 && entry.profitFactor >= 1) && activeDirections.every(
27344
- (direction) => supportConditioned && (entry[direction].independentEvents ?? entry[direction].trades ?? 0) < MIN_SELECTION_GRADE_TERMINAL_EVENTS || entry[direction].pnl > 0 && entry[direction].profitFactor >= 1
27342
+ const hasHistoricalEdge = (entry) => entry.pnl > 0 && entry.profitFactor > 1 && activeDirections.every(
27343
+ (direction) => entry[direction].pnl > 0 && entry[direction].profitFactor > 1
27345
27344
  ) && (suppressedDirection == null || entry[suppressedDirection].trades === 0 && entry[suppressedDirection].pnl === 0);
27346
27345
  const byDays = new Map(
27347
27346
  input.historicalWindows.map((entry) => [entry.days, entry])
@@ -27349,19 +27348,23 @@ var init_strategyRelease = __esm({
27349
27348
  if (REQUIRED_LONG_WINDOWS.some((days) => !byDays.has(days))) {
27350
27349
  blockers.push("HISTORICAL_MATRIX_INCOMPLETE");
27351
27350
  }
27352
- if (REQUIRED_STABLE_TERMINAL_WINDOWS.some((days) => !byDays.has(days))) {
27351
+ if (REQUIRED_DIAGNOSTIC_TERMINAL_WINDOWS.some((days) => !byDays.has(days))) {
27353
27352
  blockers.push("HISTORICAL_MATRIX_INCOMPLETE");
27354
27353
  }
27355
27354
  const longWindows = REQUIRED_LONG_WINDOWS.map(
27356
27355
  (days) => byDays.get(days)
27357
27356
  ).filter((entry) => Boolean(entry));
27358
- if (longWindows.some((entry) => !hasHistoricalEdge(entry))) {
27357
+ const maximumCoveredWindow = longWindows.reduce((best, entry) => {
27358
+ if (!best) return entry;
27359
+ return (entry.coveredDays ?? entry.days) > (best.coveredDays ?? best.days) ? entry : best;
27360
+ }, null);
27361
+ if (maximumCoveredWindow && !hasHistoricalEdge(maximumCoveredWindow)) {
27359
27362
  blockers.push("HISTORICAL_EDGE_FAILED");
27360
27363
  }
27361
- const stableTerminalWindows = REQUIRED_STABLE_TERMINAL_WINDOWS.map(
27364
+ const diagnosticTerminalWindows = REQUIRED_DIAGNOSTIC_TERMINAL_WINDOWS.map(
27362
27365
  (days) => byDays.get(days)
27363
27366
  ).filter((entry) => Boolean(entry));
27364
- if (stableTerminalWindows.some(
27367
+ if (diagnosticTerminalWindows.some(
27365
27368
  (entry) => !Number.isFinite(entry.independentEvents ?? entry.trades) || activeDirections.some(
27366
27369
  (direction) => !Number.isFinite(
27367
27370
  entry[direction].independentEvents ?? entry[direction].trades
@@ -27370,9 +27373,6 @@ var init_strategyRelease = __esm({
27370
27373
  )) {
27371
27374
  blockers.push("HISTORICAL_MATRIX_INCOMPLETE");
27372
27375
  }
27373
- if (stableTerminalWindows.some((entry) => !hasHistoricalEdge(entry, true))) {
27374
- blockers.push("HISTORICAL_EDGE_FAILED");
27375
- }
27376
27376
  if (blockers.length) {
27377
27377
  return {
27378
27378
  strategy: input.strategy,
@@ -27382,7 +27382,7 @@ var init_strategyRelease = __esm({
27382
27382
  maxLossValue: null,
27383
27383
  requiresRuntimeBinding: false,
27384
27384
  blockers,
27385
- summary: `The final ${directionPolicy} composition fails the frozen long-window edge or a selection-grade terminal guardrail. Underpowered and diagnostic terminal cohorts do not cause this stop.`
27385
+ summary: `The final ${directionPolicy} composition lacks a positive maximum-covered historical edge or has an incomplete diagnostic matrix. Recent calendar windows are reported but do not gate a risk-1 prospective test.`
27386
27386
  };
27387
27387
  }
27388
27388
  const repairAllowed = Boolean(
@@ -282,9 +282,8 @@ var LINEAGE_FINGERPRINT_RE = /^[a-f0-9]{16}$/;
282
282
  var STRATEGY_REVISION_RE = /^sr1:[a-f0-9]{16}$/;
283
283
  var DEPLOYMENT_COMPOSITION_ID_RE = /^dc1:[a-f0-9]{16}$/;
284
284
  var REQUIRED_LONG_WINDOWS = [1095, 1460, 1825];
285
- var REQUIRED_STABLE_TERMINAL_WINDOWS = [365, 180, 90];
285
+ var REQUIRED_DIAGNOSTIC_TERMINAL_WINDOWS = [365, 180, 90];
286
286
  var MIN_RECENT_DIRECTION_REPAIR_EVENTS = 20;
287
- var MIN_SELECTION_GRADE_TERMINAL_EVENTS = 50;
288
287
  var safeSegment = import_strategyReleaseEvidence.safeStrategyEvidenceSegment;
289
288
  var compactTimestamp = import_strategyReleaseEvidence.compactStrategyEvidenceTimestamp;
290
289
  var verifyFullPeriodChartArtifact = async (input) => {
@@ -346,8 +345,8 @@ var deriveStrategyReleaseResearchDecision = async (input) => {
346
345
  const directionPolicy = input.directionPolicy ?? "both";
347
346
  const activeDirections = directionPolicy === "long_only" ? ["long"] : directionPolicy === "short_only" ? ["short"] : ["long", "short"];
348
347
  const suppressedDirection = directionPolicy === "long_only" ? "short" : directionPolicy === "short_only" ? "long" : null;
349
- const hasHistoricalEdge = (entry, supportConditioned = false) => (supportConditioned ? (entry.independentEvents ?? entry.trades ?? 0) < MIN_SELECTION_GRADE_TERMINAL_EVENTS || entry.pnl > 0 && entry.profitFactor >= 1 : entry.pnl > 0 && entry.profitFactor >= 1) && activeDirections.every(
350
- (direction) => supportConditioned && (entry[direction].independentEvents ?? entry[direction].trades ?? 0) < MIN_SELECTION_GRADE_TERMINAL_EVENTS || entry[direction].pnl > 0 && entry[direction].profitFactor >= 1
348
+ const hasHistoricalEdge = (entry) => entry.pnl > 0 && entry.profitFactor > 1 && activeDirections.every(
349
+ (direction) => entry[direction].pnl > 0 && entry[direction].profitFactor > 1
351
350
  ) && (suppressedDirection == null || entry[suppressedDirection].trades === 0 && entry[suppressedDirection].pnl === 0);
352
351
  const byDays = new Map(
353
352
  input.historicalWindows.map((entry) => [entry.days, entry])
@@ -355,19 +354,23 @@ var deriveStrategyReleaseResearchDecision = async (input) => {
355
354
  if (REQUIRED_LONG_WINDOWS.some((days) => !byDays.has(days))) {
356
355
  blockers.push("HISTORICAL_MATRIX_INCOMPLETE");
357
356
  }
358
- if (REQUIRED_STABLE_TERMINAL_WINDOWS.some((days) => !byDays.has(days))) {
357
+ if (REQUIRED_DIAGNOSTIC_TERMINAL_WINDOWS.some((days) => !byDays.has(days))) {
359
358
  blockers.push("HISTORICAL_MATRIX_INCOMPLETE");
360
359
  }
361
360
  const longWindows = REQUIRED_LONG_WINDOWS.map(
362
361
  (days) => byDays.get(days)
363
362
  ).filter((entry) => Boolean(entry));
364
- if (longWindows.some((entry) => !hasHistoricalEdge(entry))) {
363
+ const maximumCoveredWindow = longWindows.reduce((best, entry) => {
364
+ if (!best) return entry;
365
+ return (entry.coveredDays ?? entry.days) > (best.coveredDays ?? best.days) ? entry : best;
366
+ }, null);
367
+ if (maximumCoveredWindow && !hasHistoricalEdge(maximumCoveredWindow)) {
365
368
  blockers.push("HISTORICAL_EDGE_FAILED");
366
369
  }
367
- const stableTerminalWindows = REQUIRED_STABLE_TERMINAL_WINDOWS.map(
370
+ const diagnosticTerminalWindows = REQUIRED_DIAGNOSTIC_TERMINAL_WINDOWS.map(
368
371
  (days) => byDays.get(days)
369
372
  ).filter((entry) => Boolean(entry));
370
- if (stableTerminalWindows.some(
373
+ if (diagnosticTerminalWindows.some(
371
374
  (entry) => !Number.isFinite(entry.independentEvents ?? entry.trades) || activeDirections.some(
372
375
  (direction) => !Number.isFinite(
373
376
  entry[direction].independentEvents ?? entry[direction].trades
@@ -376,9 +379,6 @@ var deriveStrategyReleaseResearchDecision = async (input) => {
376
379
  )) {
377
380
  blockers.push("HISTORICAL_MATRIX_INCOMPLETE");
378
381
  }
379
- if (stableTerminalWindows.some((entry) => !hasHistoricalEdge(entry, true))) {
380
- blockers.push("HISTORICAL_EDGE_FAILED");
381
- }
382
382
  if (blockers.length) {
383
383
  return {
384
384
  strategy: input.strategy,
@@ -388,7 +388,7 @@ var deriveStrategyReleaseResearchDecision = async (input) => {
388
388
  maxLossValue: null,
389
389
  requiresRuntimeBinding: false,
390
390
  blockers,
391
- summary: `The final ${directionPolicy} composition fails the frozen long-window edge or a selection-grade terminal guardrail. Underpowered and diagnostic terminal cohorts do not cause this stop.`
391
+ summary: `The final ${directionPolicy} composition lacks a positive maximum-covered historical edge or has an incomplete diagnostic matrix. Recent calendar windows are reported but do not gate a risk-1 prospective test.`
392
392
  };
393
393
  }
394
394
  const repairAllowed = Boolean(
@@ -232,9 +232,8 @@ var LINEAGE_FINGERPRINT_RE = /^[a-f0-9]{16}$/;
232
232
  var STRATEGY_REVISION_RE = /^sr1:[a-f0-9]{16}$/;
233
233
  var DEPLOYMENT_COMPOSITION_ID_RE = /^dc1:[a-f0-9]{16}$/;
234
234
  var REQUIRED_LONG_WINDOWS = [1095, 1460, 1825];
235
- var REQUIRED_STABLE_TERMINAL_WINDOWS = [365, 180, 90];
235
+ var REQUIRED_DIAGNOSTIC_TERMINAL_WINDOWS = [365, 180, 90];
236
236
  var MIN_RECENT_DIRECTION_REPAIR_EVENTS = 20;
237
- var MIN_SELECTION_GRADE_TERMINAL_EVENTS = 50;
238
237
  var safeSegment = import_strategyReleaseEvidence.safeStrategyEvidenceSegment;
239
238
  var compactTimestamp = import_strategyReleaseEvidence.compactStrategyEvidenceTimestamp;
240
239
  var verifyFullPeriodChartArtifact = async (input) => {
@@ -296,8 +295,8 @@ var deriveStrategyReleaseResearchDecision = async (input) => {
296
295
  const directionPolicy = input.directionPolicy ?? "both";
297
296
  const activeDirections = directionPolicy === "long_only" ? ["long"] : directionPolicy === "short_only" ? ["short"] : ["long", "short"];
298
297
  const suppressedDirection = directionPolicy === "long_only" ? "short" : directionPolicy === "short_only" ? "long" : null;
299
- const hasHistoricalEdge = (entry, supportConditioned = false) => (supportConditioned ? (entry.independentEvents ?? entry.trades ?? 0) < MIN_SELECTION_GRADE_TERMINAL_EVENTS || entry.pnl > 0 && entry.profitFactor >= 1 : entry.pnl > 0 && entry.profitFactor >= 1) && activeDirections.every(
300
- (direction) => supportConditioned && (entry[direction].independentEvents ?? entry[direction].trades ?? 0) < MIN_SELECTION_GRADE_TERMINAL_EVENTS || entry[direction].pnl > 0 && entry[direction].profitFactor >= 1
298
+ const hasHistoricalEdge = (entry) => entry.pnl > 0 && entry.profitFactor > 1 && activeDirections.every(
299
+ (direction) => entry[direction].pnl > 0 && entry[direction].profitFactor > 1
301
300
  ) && (suppressedDirection == null || entry[suppressedDirection].trades === 0 && entry[suppressedDirection].pnl === 0);
302
301
  const byDays = new Map(
303
302
  input.historicalWindows.map((entry) => [entry.days, entry])
@@ -305,19 +304,23 @@ var deriveStrategyReleaseResearchDecision = async (input) => {
305
304
  if (REQUIRED_LONG_WINDOWS.some((days) => !byDays.has(days))) {
306
305
  blockers.push("HISTORICAL_MATRIX_INCOMPLETE");
307
306
  }
308
- if (REQUIRED_STABLE_TERMINAL_WINDOWS.some((days) => !byDays.has(days))) {
307
+ if (REQUIRED_DIAGNOSTIC_TERMINAL_WINDOWS.some((days) => !byDays.has(days))) {
309
308
  blockers.push("HISTORICAL_MATRIX_INCOMPLETE");
310
309
  }
311
310
  const longWindows = REQUIRED_LONG_WINDOWS.map(
312
311
  (days) => byDays.get(days)
313
312
  ).filter((entry) => Boolean(entry));
314
- if (longWindows.some((entry) => !hasHistoricalEdge(entry))) {
313
+ const maximumCoveredWindow = longWindows.reduce((best, entry) => {
314
+ if (!best) return entry;
315
+ return (entry.coveredDays ?? entry.days) > (best.coveredDays ?? best.days) ? entry : best;
316
+ }, null);
317
+ if (maximumCoveredWindow && !hasHistoricalEdge(maximumCoveredWindow)) {
315
318
  blockers.push("HISTORICAL_EDGE_FAILED");
316
319
  }
317
- const stableTerminalWindows = REQUIRED_STABLE_TERMINAL_WINDOWS.map(
320
+ const diagnosticTerminalWindows = REQUIRED_DIAGNOSTIC_TERMINAL_WINDOWS.map(
318
321
  (days) => byDays.get(days)
319
322
  ).filter((entry) => Boolean(entry));
320
- if (stableTerminalWindows.some(
323
+ if (diagnosticTerminalWindows.some(
321
324
  (entry) => !Number.isFinite(entry.independentEvents ?? entry.trades) || activeDirections.some(
322
325
  (direction) => !Number.isFinite(
323
326
  entry[direction].independentEvents ?? entry[direction].trades
@@ -326,9 +329,6 @@ var deriveStrategyReleaseResearchDecision = async (input) => {
326
329
  )) {
327
330
  blockers.push("HISTORICAL_MATRIX_INCOMPLETE");
328
331
  }
329
- if (stableTerminalWindows.some((entry) => !hasHistoricalEdge(entry, true))) {
330
- blockers.push("HISTORICAL_EDGE_FAILED");
331
- }
332
332
  if (blockers.length) {
333
333
  return {
334
334
  strategy: input.strategy,
@@ -338,7 +338,7 @@ var deriveStrategyReleaseResearchDecision = async (input) => {
338
338
  maxLossValue: null,
339
339
  requiresRuntimeBinding: false,
340
340
  blockers,
341
- summary: `The final ${directionPolicy} composition fails the frozen long-window edge or a selection-grade terminal guardrail. Underpowered and diagnostic terminal cohorts do not cause this stop.`
341
+ summary: `The final ${directionPolicy} composition lacks a positive maximum-covered historical edge or has an incomplete diagnostic matrix. Recent calendar windows are reported but do not gate a risk-1 prospective test.`
342
342
  };
343
343
  }
344
344
  const repairAllowed = Boolean(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tradejs/cli",
3
- "version": "3.1.18",
3
+ "version": "3.1.19-beta.234",
4
4
  "description": "Official CLI for the TradeJS TypeScript framework: infra setup, backtests, signals, bots, and ML workflows.",
5
5
  "keywords": [
6
6
  "tradejs",
@@ -36,13 +36,13 @@
36
36
  "tradejs": "dist/cli.js"
37
37
  },
38
38
  "dependencies": {
39
- "@tradejs/connectors": "^3.1.18",
40
- "@tradejs/core": "^3.1.18",
41
- "@tradejs/indicators": "^3.1.18",
42
- "@tradejs/infra": "^3.1.18",
43
- "@tradejs/node": "^3.1.18",
39
+ "@tradejs/connectors": "^3.1.19-beta.234",
40
+ "@tradejs/core": "^3.1.19-beta.234",
41
+ "@tradejs/indicators": "^3.1.19-beta.234",
42
+ "@tradejs/infra": "^3.1.19-beta.234",
43
+ "@tradejs/node": "^3.1.19-beta.234",
44
44
  "@tradejs/strategy-kit": "3.0.3",
45
- "@tradejs/types": "^3.1.18",
45
+ "@tradejs/types": "^3.1.19-beta.234",
46
46
  "args": "^5.0.3",
47
47
  "bcryptjs": "^2.4.3",
48
48
  "chalk": "4.1.2",