@tradejs/cli 3.1.29-beta.261 → 3.1.29-beta.263

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 (32) hide show
  1. package/README.md +47 -8
  2. package/dist/cli.js +990 -1448
  3. package/dist/lib/aiPocketSearch.js +16 -0
  4. package/dist/lib/aiPocketSearchCli.js +3 -3
  5. package/dist/lib/jevMicroReferences.js +73 -0
  6. package/dist/lib/jevResearch.js +11 -0
  7. package/dist/lib/runtimeEvidenceArtifacts.js +3 -416
  8. package/dist/lib/runtimeEvidenceCompositionSnapshots.js +42 -211
  9. package/dist/lib/runtimeEvidenceCompositions.js +33 -310
  10. package/dist/lib/runtimeEvidenceDeployment.js +3 -315
  11. package/dist/lib/runtimeEvidenceProducer.js +3 -77
  12. package/dist/lib/runtimeEvidenceSync.js +32 -299
  13. package/dist/lib/runtimeFeedbackArtifacts.js +3 -545
  14. package/dist/lib/runtimeFeedbackNotification.js +7 -195
  15. package/dist/lib/runtimeFeedbackReplay.js +26 -525
  16. package/dist/lib/runtimeFeedbackSync.js +26 -219
  17. package/dist/lib/runtimeScorecard.js +5 -163
  18. package/dist/scripts/aiPocketSearch.js +101 -23
  19. package/dist/scripts/backtest.js +10 -1
  20. package/dist/scripts/jev.js +11 -0
  21. package/dist/scripts/mcpWorker.js +273 -0
  22. package/dist/scripts/replay.js +14 -250
  23. package/dist/scripts/replayRunner.js +14 -250
  24. package/dist/scripts/runtimeEvidence.js +47 -597
  25. package/dist/scripts/runtimeEvidenceSync.js +29 -296
  26. package/dist/scripts/runtimeFeedbackNotify.js +10 -188
  27. package/dist/scripts/runtimeFeedbackReplay.js +29 -528
  28. package/dist/scripts/runtimeFeedbackSync.js +28 -221
  29. package/dist/scripts/runtimeScorecard.js +88 -503
  30. package/dist/scripts/signals.js +55 -224
  31. package/dist/scripts/signalsDaemon.js +55 -224
  32. package/package.json +9 -8
package/README.md CHANGED
@@ -102,8 +102,10 @@ yarn exec tradejs backtest -c TrendFollow:base -d 30 --cacheOnly --jev --jevReco
102
102
  Without `--jev`, ordinary backtests do not evaluate Jev, even if a configuration
103
103
  contains `JEV`. Use `--ai --jev` to save completed trades with Jev features for
104
104
  AI training. `--jev` alone records Jev assessments without enabling AI export.
105
- Jev can ask eight independent questions: trend, swing, current participation,
106
- setup participation, entry extension, confirmation, setup strength, and geometry.
105
+ Jev uses one current set of nine questions: directional agreement, correction
106
+ containment, current volume expansion, setup volume contraction, entry proximity,
107
+ entry candle conviction, impulse persistence, boundary regularity, and overall
108
+ signal strength.
107
109
  It asks each question only when the corresponding signal-time facts exist and
108
110
  marks missing facts explicitly. The shared projection
109
111
  selects a few signal-time trend, swing, volume, delta, entry-distance and
@@ -114,6 +116,38 @@ which is available to the strategy's AI gate and AI export. Jev scores do not
114
116
  approve or reject entries. Backtests do not apply the AI gate; `ai-train`
115
117
  evaluates it on exported outcomes, while runtime follows `AI_MODE`.
116
118
 
119
+ `--jev` and runtime `JEV` always use the current compact nine-question set.
120
+ There is no question-set selector or fallback to older rubrics. The recorded
121
+ `micro-v3` marker and question hash identify the current meanings; old or
122
+ unversioned recordings and local models are rejected. Use a new recording
123
+ directory for the new backtest and retrain local models from current answers.
124
+
125
+ The first eight questions describe separate signal-time facts. The ninth asks
126
+ how strong and actionable the signal is: do the available facts support opening
127
+ a trade now? It weighs direction, setup, confirmation, placement and the
128
+ stop/target plan together. Essential missing facts and unresolved conflicts
129
+ reduce support. All eligible questions share the same compact state in one
130
+ request; outcomes and other Jev answers are excluded.
131
+
132
+ Its ten rubric levels appear as
133
+ `additionalIndicators.jev.scores.signalStrength`, from **1 to 10** (decimal
134
+ expected scores are retained). Confidence remains 0–1. The API returns a
135
+ zero-based 0–9 score; recordings and local teacher models normalize it to 0–1,
136
+ and AI features convert it to 1–10. This is an entry assessment, not a calibrated
137
+ probability of profit, and never automatically approves or blocks a trade.
138
+
139
+ ```bash
140
+ yarn exec tradejs backtest -c <Strategy>:<config> -d 365 --cacheOnly --ai --jev \
141
+ --jevRecordsDir data/ai/jev/<new-study>
142
+ ```
143
+
144
+ Use `--ai` to retain completed outcomes for comparing the score with realized
145
+ PnL. Freeze score thresholds on the first 60% with three internal stability
146
+ blocks before checking the last 40%. Compare with the current gate and ordinary
147
+ features on the same rows, include independent event support and costs, and do
148
+ not choose thresholds on the outer test. A fresh run does not make previously
149
+ inspected historical outcomes untouched.
150
+
117
151
  Any strategy can optionally attach `jevEvidence` through its `StrategyAPI.entry`
118
152
  `additionalIndicators` with a version, `knownAt` timestamp, up to 16 scalar
119
153
  setup facts and 16 scalar geometry facts:
@@ -147,9 +181,12 @@ Provider responses and decisions are saved under `data/ai/jev`, or the directory
147
181
  selected with `--jevRecordsDir`. Input, selected question version and provider
148
182
  identity determine each signal record. Equivalent facts reuse one provider
149
183
  response even when signal timestamps or symbols differ. Input v4 records
150
- explicitly store missing facts and their sources. The changed question hash
151
- prevents older four-question recordings and local models from being replayed as
152
- answers to the new questions.
184
+ explicitly store missing facts and their sources. Paid state groups fact paths
185
+ by namespace and retains exact values, units and missing reasons; signal identity,
186
+ internal versions and source metadata remain local. The current questions use
187
+ short rubrics with explicit thresholds and unknown-data rules. Recordings and
188
+ local models must match the current question marker and hash. Older versions
189
+ are not migrated or used as substitutes for missing current answers.
153
190
  `--jevRecorded` requires the same signal-time input facts, question set and
154
191
  provider as the recording run. A shorter backtest may warm up indicators from
155
192
  a different history or reach the same date with a different trade state, so its
@@ -179,9 +216,11 @@ path for each run.
179
216
 
180
217
  Training fits shallow trees to Jev scores, without trade outcomes as features or
181
218
  labels. It requires at least 30 samples across 10 distinct signal times, selects
182
- one strategy and one teacher/provider lineage, and separates train/validation/test
183
- chronologically as 60/20/20. Three additional expanding-window folds check later
184
- periods with independently fitted trees. The report measures teacher agreement, score error
219
+ one strategy and one teacher/provider lineage, and splits timestamp groups
220
+ chronologically into 60% development and 40% test. Three expanding-window folds
221
+ fit earlier development data and check later development data, entirely inside
222
+ the first 60%. The final teacher model uses the full development partition.
223
+ The outer test never fits or selects the model. The report measures teacher agreement, score error
185
224
  and matched-outcome economics. These summaries are not sequential portfolio
186
225
  backtests and do not establish profitability. Validate a frozen gate on a later
187
226
  period with `--jevModelFile` before runtime use. Studies are bounded to 20,000