create-tradejs 3.1.22 → 3.1.23-beta.239

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 (40) hide show
  1. package/README.md +19 -3
  2. package/dist/index.js +36 -5
  3. package/dist/skill-bundle/.codex/skills/ai-train-local-research/SKILL.md +596 -0
  4. package/dist/skill-bundle/.codex/skills/ai-train-local-research/references/gate-ablation.md +324 -0
  5. package/dist/skill-bundle/.codex/skills/ai-train-local-research/references/reporting.md +227 -0
  6. package/dist/skill-bundle/.codex/skills/ai-train-local-research/scripts/ai-gate-ablation.mjs +5082 -0
  7. package/dist/skill-bundle/.codex/skills/ai-train-local-research/scripts/ai-gate-ablation.test.mjs +1170 -0
  8. package/dist/skill-bundle/.codex/skills/backtest-config-redis/SKILL.md +17 -0
  9. package/dist/skill-bundle/.codex/skills/backtest-config-redis/scripts/get_backtest_config.sh +21 -0
  10. package/dist/skill-bundle/.codex/skills/runtime-parity-mismatch-analysis/SKILL.md +146 -0
  11. package/dist/skill-bundle/.codex/skills/save-strategy-config-from-backtest/SKILL.md +58 -0
  12. package/dist/skill-bundle/.codex/skills/save-strategy-config-from-backtest/agents/openai.yaml +4 -0
  13. package/dist/skill-bundle/.codex/skills/strategy-backtest-research/SKILL.md +334 -0
  14. package/dist/skill-bundle/.codex/skills/strategy-backtest-research/references/research-notes.md +247 -0
  15. package/dist/skill-bundle/.codex/skills/strategy-backtest-research/scripts/backtest-run-metrics.mjs +647 -0
  16. package/dist/skill-bundle/.codex/skills/strategy-backtest-research/scripts/backtest-run-metrics.test.mjs +321 -0
  17. package/dist/skill-bundle/.codex/skills/strategy-backtest-research/scripts/fast-ai-export-metrics.mjs +744 -0
  18. package/dist/skill-bundle/.codex/skills/strategy-backtest-research/scripts/fast-ai-export-metrics.test.mjs +553 -0
  19. package/dist/skill-bundle/.codex/skills/strategy-backtest-research/scripts/research-notes-check.mjs +125 -0
  20. package/dist/skill-bundle/.codex/skills/strategy-improvement-research/SKILL.md +18 -1
  21. package/dist/skill-bundle/.codex/skills/strategy-release/SKILL.md +22 -0
  22. package/dist/skill-bundle/.codex/skills/strategy-release/agents/openai.yaml +4 -0
  23. package/dist/skill-bundle/.codex/skills/strategy-release/references/diagnose-live.md +126 -0
  24. package/dist/skill-bundle/.codex/skills/strategy-release/references/direction-policy.md +141 -0
  25. package/dist/skill-bundle/.codex/skills/strategy-release/references/directional-parameter-split.md +93 -0
  26. package/dist/skill-bundle/.codex/skills/strategy-release/references/evidence-limitations.md +76 -0
  27. package/dist/skill-bundle/.codex/skills/strategy-release/references/evidence-retention.md +157 -0
  28. package/dist/skill-bundle/.codex/skills/strategy-release/references/historical-hypothesis-audit.md +163 -0
  29. package/dist/skill-bundle/.codex/skills/strategy-release/references/professional-research-loop.md +198 -0
  30. package/dist/skill-bundle/.codex/skills/strategy-release/references/release-workflow.md +755 -0
  31. package/dist/skill-bundle/.codex/skills/strategy-release/references/research-objective.md +255 -0
  32. package/dist/skill-bundle/.codex/skills/strategy-release/references/verdict-contract.md +200 -0
  33. package/dist/skill-bundle/.codex/skills/strategy-release/scripts/direction-policy-checkpoint.mjs +137 -0
  34. package/dist/skill-bundle/.codex/skills/strategy-release/scripts/direction-policy-checkpoint.test.mjs +85 -0
  35. package/dist/skill-bundle/.codex/skills/strategy-release/scripts/directional-parameter-checkpoint.mjs +149 -0
  36. package/dist/skill-bundle/.codex/skills/strategy-release/scripts/directional-parameter-checkpoint.test.mjs +120 -0
  37. package/dist/skill-bundle/.codex/skills/strategy-release/scripts/release-progress-checkpoint.mjs +621 -0
  38. package/dist/skill-bundle/.codex/skills/strategy-release/scripts/release-progress-checkpoint.test.mjs +349 -0
  39. package/dist/skill-bundle/.codex/tradejs-skill-bundle.json +44 -3
  40. package/package.json +1 -1
package/README.md CHANGED
@@ -18,9 +18,20 @@ npx create-tradejs my-trading-project
18
18
 
19
19
  Docker with the Compose plugin and Node.js 20.19 or newer are required.
20
20
 
21
- ## Codex strategy skills
21
+ ## Codex TradeJS skills
22
22
 
23
- Every generated project includes focused workflow skills in `.codex/skills`:
23
+ Every generated project includes the complete checksum-managed TradeJS skill
24
+ set in `.codex/skills`. The supporting skills execute one bounded operation:
25
+
26
+ - `$strategy-backtest-research` — implement or execute one preregistered core
27
+ backtest experiment;
28
+ - `$ai-train-local-research` — analyze a frozen core/export's deterministic
29
+ gate;
30
+ - `$backtest-config-redis` and `$save-strategy-config-from-backtest` — read a
31
+ research grid or explicitly promote it into the Git-owned Project;
32
+ - `$runtime-parity-mismatch-analysis` — diagnose an existing parity artifact.
33
+
34
+ The focused lifecycle skills own user-level decisions:
24
35
 
25
36
  - `$strategy-candidate-report` — show the latest selected candidate;
26
37
  - `$strategy-candidate-compare` — compare it with production;
@@ -34,6 +45,9 @@ Every generated project includes focused workflow skills in `.codex/skills`:
34
45
  - `$strategy-risk-scale` — change only `MAX_LOSS_VALUE` after an explicit
35
46
  scaling request.
36
47
 
48
+ `$strategy-release` remains only as a deprecated compatibility router to one
49
+ focused lifecycle skill. It is not another research/deployment workflow.
50
+
37
51
  Invoke one skill with one strategy name, for example:
38
52
 
39
53
  ```text
@@ -57,7 +71,9 @@ npx create-tradejs@<approved-version> --update-skills .
57
71
  ```
58
72
 
59
73
  The updater preserves unrelated custom skills and refuses to overwrite a
60
- managed file that no longer matches its installed checksum.
74
+ modified managed file. When a new release first brings an existing official
75
+ TradeJS skill under bundle management, the explicit update adopts that
76
+ same-named official snapshot from the canonical bundle.
61
77
 
62
78
  ## License
63
79
 
package/dist/index.js CHANGED
@@ -52,6 +52,11 @@ var import_node_fs = require("fs");
52
52
  var import_node_path = __toESM(require("path"));
53
53
  var PROJECT_SKILL_BUNDLE_MANIFEST = ".codex/tradejs-skill-bundle.json";
54
54
  var PROJECT_SKILL_NAMES = [
55
+ "ai-train-local-research",
56
+ "backtest-config-redis",
57
+ "runtime-parity-mismatch-analysis",
58
+ "save-strategy-config-from-backtest",
59
+ "strategy-backtest-research",
55
60
  "strategy-candidate-report",
56
61
  "strategy-candidate-compare",
57
62
  "strategy-improvement-plan",
@@ -59,7 +64,8 @@ var PROJECT_SKILL_NAMES = [
59
64
  "strategy-period-revalidate",
60
65
  "strategy-forward-start",
61
66
  "strategy-forward-status",
62
- "strategy-risk-scale"
67
+ "strategy-risk-scale",
68
+ "strategy-release"
63
69
  ];
64
70
  var sha256 = (contents) => (0, import_node_crypto.createHash)("sha256").update(contents).digest("hex");
65
71
  var toProjectPath = (...parts) => import_node_path.default.posix.join(...parts);
@@ -86,6 +92,17 @@ var calculateBundleSha256 = (fileHashes) => sha256(
86
92
  );
87
93
  var createProjectSkillBundle = (canonicalSkillsRoot) => {
88
94
  const files = {};
95
+ const canonicalSkillNames = (0, import_node_fs.readdirSync)(canonicalSkillsRoot, {
96
+ withFileTypes: true
97
+ }).filter(
98
+ (entry) => entry.isDirectory() && (0, import_node_fs.existsSync)(import_node_path.default.join(canonicalSkillsRoot, entry.name, "SKILL.md"))
99
+ ).map((entry) => entry.name).sort();
100
+ const managedSkillNames = [...PROJECT_SKILL_NAMES].sort();
101
+ if (JSON.stringify(canonicalSkillNames) !== JSON.stringify(managedSkillNames)) {
102
+ throw new Error(
103
+ "PROJECT_SKILL_NAMES must include every canonical TradeJS skill exactly once"
104
+ );
105
+ }
89
106
  for (const skillName of PROJECT_SKILL_NAMES) {
90
107
  const skillRoot = import_node_path.default.join(canonicalSkillsRoot, skillName);
91
108
  if (!(0, import_node_fs.existsSync)(import_node_path.default.join(skillRoot, "SKILL.md"))) {
@@ -179,6 +196,11 @@ var syncProjectSkillBundle = (projectRoot, bundleFiles) => {
179
196
  bundleFiles[PROJECT_SKILL_BUNDLE_MANIFEST]
180
197
  );
181
198
  const installedManifest = readInstalledManifest(projectRoot);
199
+ const newlyManagedSkills = new Set(
200
+ newManifest.skills.filter(
201
+ (skillName) => !installedManifest?.skills.includes(skillName)
202
+ )
203
+ );
182
204
  for (const [relativePath, contents] of Object.entries(bundleFiles)) {
183
205
  if (!isManagedSkillPath(relativePath)) {
184
206
  throw new Error(`Unsafe managed skill path: ${relativePath}`);
@@ -193,7 +215,9 @@ var syncProjectSkillBundle = (projectRoot, bundleFiles) => {
193
215
  const currentContents = (0, import_node_fs.readFileSync)(destination, "utf8");
194
216
  const installedSha256 = installedManifest?.files[relativePath];
195
217
  const isKnownInstalledFile = installedSha256 !== void 0 && sha256(currentContents) === installedSha256;
196
- if (!isKnownInstalledFile && currentContents !== contents) {
218
+ const skillName = relativePath.split("/")[2];
219
+ const isNewlyManagedOfficialSkill = newlyManagedSkills.has(skillName);
220
+ if (!isKnownInstalledFile && !isNewlyManagedOfficialSkill && currentContents !== contents) {
197
221
  throw new Error(
198
222
  `Refusing to overwrite a modified skill: ${relativePath}`
199
223
  );
@@ -421,10 +445,13 @@ npm run dev
421
445
  Open [http://localhost:${port}/routes/dashboard](http://localhost:${port}/routes/dashboard).
422
446
  On the first launch, TradeJS asks you to create the local root password.
423
447
 
424
- ## Codex strategy workflow
448
+ ## Codex TradeJS workflows
425
449
 
426
- The project includes focused TradeJS skills under \`.codex/skills\`. Invoke a
427
- skill with a strategy name, for example:
450
+ The project includes the complete checksum-managed TradeJS skill set under
451
+ \`.codex/skills\`. Use \`$strategy-improvement-research\` to orchestrate a full
452
+ bounded lineage, \`$strategy-backtest-research\` for one preregistered core
453
+ experiment, and \`$ai-train-local-research\` for the frozen gate stage. For
454
+ example:
428
455
 
429
456
  \`$strategy-candidate-report MarketFlushReversal\`
430
457
 
@@ -432,6 +459,10 @@ Use \`$strategy-forward-start <Strategy>\` only when you want Codex to publish
432
459
  and launch the selected candidate as a bounded forward test. It installs the
433
460
  exact candidate configuration with \`MAX_LOSS_VALUE=1\` and requires an exact
434
461
  deployment/account binding.
462
+
463
+ Update the complete official skill snapshot only through:
464
+
465
+ \`npx create-tradejs@<approved-version> --update-skills .\`
435
466
  `,
436
467
  ...readProjectSkillBundle().files
437
468
  };