create-tradejs 3.1.29-beta.268 → 3.1.29-beta.270
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/skill-bundle/.codex/skills/ai-train-local-research/SKILL.md +44 -1
- package/dist/skill-bundle/.codex/skills/ai-train-local-research/references/gate-ablation.md +303 -0
- package/dist/skill-bundle/.codex/skills/ai-train-local-research/scripts/ai-gate-ablation.mjs +1650 -16
- package/dist/skill-bundle/.codex/skills/ai-train-local-research/scripts/ai-gate-ablation.test.mjs +2125 -14
- package/dist/skill-bundle/.codex/skills/ai-train-local-research/scripts/decision-capture-join.mjs +1148 -0
- package/dist/skill-bundle/.codex/skills/ai-train-local-research/scripts/decision-capture-join.test.mjs +841 -0
- package/dist/skill-bundle/.codex/skills/ai-train-local-research/scripts/decision-capture-storage.mjs +1122 -0
- package/dist/skill-bundle/.codex/skills/ai-train-local-research/scripts/decision-capture-storage.test.mjs +656 -0
- package/dist/skill-bundle/.codex/skills/ai-train-local-research/scripts/research-entry-gate-bridge.mjs +945 -0
- package/dist/skill-bundle/.codex/skills/ai-train-local-research/scripts/research-entry-gate-bridge.test.mjs +1122 -0
- package/dist/skill-bundle/.codex/skills/strategy-backtest-research/SKILL.md +33 -1
- package/dist/skill-bundle/.codex/skills/strategy-backtest-research/scripts/fast-ai-export-metrics.mjs +185 -6
- package/dist/skill-bundle/.codex/skills/strategy-backtest-research/scripts/fast-ai-export-metrics.test.mjs +314 -3
- package/dist/skill-bundle/.codex/skills/strategy-improvement-research/references/final-composition-board.md +139 -0
- package/dist/skill-bundle/.codex/skills/strategy-improvement-research/scripts/build-final-composition-spec.mjs +137 -1
- package/dist/skill-bundle/.codex/skills/strategy-improvement-research/scripts/build-final-composition-spec.test.mjs +32 -0
- package/dist/skill-bundle/.codex/skills/strategy-improvement-research/scripts/executed-composition-report.mjs +2203 -0
- package/dist/skill-bundle/.codex/skills/strategy-improvement-research/scripts/executed-composition-report.test.mjs +1172 -0
- package/dist/skill-bundle/.codex/skills/strategy-improvement-research/scripts/final-composition-board.mjs +960 -18
- package/dist/skill-bundle/.codex/skills/strategy-improvement-research/scripts/final-composition-board.test.mjs +393 -1
- package/dist/skill-bundle/.codex/tradejs-skill-bundle.json +21 -13
- package/package.json +1 -1
|
@@ -57,6 +57,43 @@ For calendar-duration stability diagnostics from frozen realized equity, use
|
|
|
57
57
|
time under water and recovery duration without rebuilding approvals. Keep
|
|
58
58
|
full-history diagnostics separate from development-only candidate selection.
|
|
59
59
|
|
|
60
|
+
For frozen historical-coverage symbol groups, use `--symbolCohorts` with
|
|
61
|
+
`--realizedMetrics`. It reports complete group economics without moving the
|
|
62
|
+
common partitions, repeating capacity selection, or exposing membership as a
|
|
63
|
+
gate feature. Read the input and report contract in the ablation reference.
|
|
64
|
+
|
|
65
|
+
For a frozen extra round-trip stress criterion on actual entry notional, use
|
|
66
|
+
`--roundTripCostStressBps 20 --realizedMetrics` with explicit common window
|
|
67
|
+
bounds. This is different from per-leg `--costStressBps`. Read the reference
|
|
68
|
+
for the exit-ordered acceptance evidence and missing-economics rules.
|
|
69
|
+
Displayed execution price remains the default notional source. Fee-derived
|
|
70
|
+
full-closure notional is allowed only through `--entryNotionalAuthority` with a
|
|
71
|
+
verified runtime checkpoint, the permanent tool's exact reviewed
|
|
72
|
+
semantics-receipt/module allowlist, equal positive frozen maker/taker rates,
|
|
73
|
+
and ordered export hashes. Unsupported module semantics and incomplete rows
|
|
74
|
+
fail closed without a displayed-price fallback; read the authority and
|
|
75
|
+
analytical rounding contract in the reference before use.
|
|
76
|
+
|
|
77
|
+
For development-only ablation, use `--labelEndBefore` equal to the frozen
|
|
78
|
+
`--windowEnd` and `--testSince`, with `--validationSplit 0`. It purges unknown
|
|
79
|
+
and crossing completed labels before gate/feature evaluation and reports their
|
|
80
|
+
counts. Final full-period evaluation omits this discovery-only option after
|
|
81
|
+
all gate rules and development selections are frozen. Calendar pocket search
|
|
82
|
+
must likewise exclude development outcomes that mature beyond its boundary.
|
|
83
|
+
|
|
84
|
+
Freeze the parent's outer 60/40 calendar boundary without gate or outcome
|
|
85
|
+
evaluation using `--timestampPartitionMetadata <json>` with explicit common
|
|
86
|
+
window bounds, `--validationSplit 0 --testSplit 0.4`. Read the reference for
|
|
87
|
+
timestamp-only evidence and the mature-DEV native search path when an installed
|
|
88
|
+
CLI has no exact calendar-boundary option; do not split the isolated DEV again.
|
|
89
|
+
|
|
90
|
+
Before native development-only `ai-train`, prepare its raw source view with
|
|
91
|
+
`--materializeDiscoveryExport <jsonl>` using the same exact discovery bounds
|
|
92
|
+
and `--labelEndBefore`. Native `--until cutoff-1` alone does not purge crossing
|
|
93
|
+
labels. This mode does not load a strategy/runtime or evaluate features/gates;
|
|
94
|
+
its immutable receipt binds full parent input hashes, the output hash and purge
|
|
95
|
+
counts. Read the reference for the safe native filename and source binding.
|
|
96
|
+
|
|
60
97
|
Mandatory rule:
|
|
61
98
|
|
|
62
99
|
- Do not create `/tmp` parsers, heredoc ESM replays, or strategy-specific
|
|
@@ -67,6 +104,12 @@ Mandatory rule:
|
|
|
67
104
|
directory.
|
|
68
105
|
- Build changed strategy/node/CLI packages before running the tool because it
|
|
69
106
|
reconstructs current gate context from `dist`.
|
|
107
|
+
Alternatively, explicit `--runtimeCheckpoint` and
|
|
108
|
+
`--strategyArtifactAuthority` authorize a checksum-verified historical
|
|
109
|
+
standalone build with the frozen Project-installed runtime. This mode does
|
|
110
|
+
not rebuild packages or substitute the currently installed strategy. Read
|
|
111
|
+
the authority contract in the ablation reference first; source roots remain
|
|
112
|
+
exact Git checkouts, while execution artifacts are recorded separately.
|
|
70
113
|
- Keep `yarn ai-train --localOnly --json -n 0` as the authoritative baseline;
|
|
71
114
|
do not interpret variants until baseline qN+ support, PnL, PF, max drawdown,
|
|
72
115
|
strict loss, and loss streak match.
|
|
@@ -391,7 +434,7 @@ Interpretation:
|
|
|
391
434
|
both approved sides.
|
|
392
435
|
- `yarn ai-pocket-search` is the default pocket discovery tool for future AI-gate rules. It reconstructs current strategy AI payloads, excludes outcome/current gate-output fields by default, shows progress bars, deduplicates equivalent row-selection pockets, and writes a Markdown report under `data/ai/output`.
|
|
393
436
|
- `ai-pocket-search` defaults to outer 60/40 (`--validationSplit 0
|
|
394
|
-
|
|
437
|
+
--testSplit 0.4 --sealTest`). Search and ranking use the whole first 60%.
|
|
395
438
|
Three consecutive timestamp-grouped blocks inside that development partition
|
|
396
439
|
diagnose temporal stability; they are not independent holdouts and do not
|
|
397
440
|
refit pocket discovery. Stable candidates rank before sparse and unstable
|
|
@@ -36,6 +36,68 @@ and does not require either source root.
|
|
|
36
36
|
interpreting a candidate, compare the tool's baseline qN+ support, PnL, PF,
|
|
37
37
|
max drawdown, strict loss, and loss streak with the matching `ai-train` run.
|
|
38
38
|
|
|
39
|
+
### Explicit frozen runtime and strategy artifact
|
|
40
|
+
|
|
41
|
+
Use `--runtimeCheckpoint <json>` only with an immutable Project runtime
|
|
42
|
+
checkpoint. It verifies each declared installed package's name, version,
|
|
43
|
+
package JSON SHA256 and complete dist SHA256, then imports Project AI,
|
|
44
|
+
registry and pocket modules. Required framework packages share the declared
|
|
45
|
+
generation. Source roots still name their exact Git checkouts; canonical dist
|
|
46
|
+
freshness is not the authority in this explicit mode. Cross-strategy mode can
|
|
47
|
+
use the same runtime resolver but cannot use a strategy artifact authority.
|
|
48
|
+
When the checkpoint declares `projectTracked`, every checksum is mandatory:
|
|
49
|
+
only `package.json`, `yarn.lock` and `tradejs.config.ts` are allowed. Paths must
|
|
50
|
+
remain inside Project after realpath resolution. Verified hashes are included
|
|
51
|
+
in `run.executionRuntime.projectTracked`; a changed declaration blocks execution
|
|
52
|
+
before any export read. Generic fixture checkpoints may omit this optional map.
|
|
53
|
+
|
|
54
|
+
A standalone source requires `--strategyArtifactAuthority <json>` as well:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"schema": "tradejs-strategy-artifact-authority/v1",
|
|
59
|
+
"sourceRepositoryRoot": "/absolute/exact/strategy-worktree",
|
|
60
|
+
"sourceGitSha": "<40-character frozen baseline HEAD>",
|
|
61
|
+
"sourceDiff": { "path": "source.patch", "sha256": "<sha256>" },
|
|
62
|
+
"buildReceipt": {
|
|
63
|
+
"path": "source-dependency-overlay.json",
|
|
64
|
+
"sha256": "<sha256>"
|
|
65
|
+
},
|
|
66
|
+
"packageRoot": "compiled-package",
|
|
67
|
+
"packageJsonSha256": "<sha256>",
|
|
68
|
+
"distSha256": "<sha256>",
|
|
69
|
+
"runtimeCheckpoint": {
|
|
70
|
+
"path": "runtime-checkpoint.json",
|
|
71
|
+
"sha256": "<sha256>"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Relative paths resolve from their authority/checkpoint JSON. Every evidence
|
|
77
|
+
path and compiled package must remain inside Project after realpath resolution;
|
|
78
|
+
the source checkout is separately verified as the exact Git root. Source HEAD
|
|
79
|
+
must match the frozen baseline. The historical patch checksum is verified,
|
|
80
|
+
but the current worktree dirty diff is deliberately not compared with that
|
|
81
|
+
historical patch. The target package name must match the baseline source.
|
|
82
|
+
|
|
83
|
+
The build receipt must use
|
|
84
|
+
`tradejs-source-development-dependency-overlay/v1`, identify the exact source
|
|
85
|
+
root, have `status=passed` and `restored=true`, and bind the same dist checksum.
|
|
86
|
+
Its Core/Types/Kit dependency checks must match the execution checkpoint.
|
|
87
|
+
Never fabricate this receipt for an installed baseline; build and freeze the
|
|
88
|
+
exact baseline under the fixed dependencies first. Compiled artifacts cannot
|
|
89
|
+
be the installed Project strategy package or use worktree/foreign dependencies.
|
|
90
|
+
All compiled external imports must resolve to verified Project packages.
|
|
91
|
+
|
|
92
|
+
Dist hashing uses binary lexical `.sort()` of complete file paths, then SHA256
|
|
93
|
+
of concatenated `SHA256(file bytes) + " " + relative path + "\n"` lines.
|
|
94
|
+
Symlinks inside dist are rejected. This is the runtime checkpoint's declared
|
|
95
|
+
`SHA256 of sorted SHA256(relativefilebytes) space relativepath newline`
|
|
96
|
+
algorithm. Runtime and strategy authorities are validated before reading any
|
|
97
|
+
export. `run.executionRuntime` and `run.strategyArtifact` separately record
|
|
98
|
+
execution packages and historical source/build/compiled identity. These are
|
|
99
|
+
execution controls, not candidate rules or permission to open a sealed tail.
|
|
100
|
+
|
|
39
101
|
## Dataset Discovery
|
|
40
102
|
|
|
41
103
|
List all merged groups or only one strategy:
|
|
@@ -472,6 +534,121 @@ ordering; they are not a substitute for exit-time realized portfolio drawdown
|
|
|
472
534
|
or occupancy-sensitive backtests. Both diagnostic options are opt-in, leave
|
|
473
535
|
original report fields unchanged, and do not create additional gate candidates.
|
|
474
536
|
|
|
537
|
+
Use `--roundTripCostStressBps 20 --realizedMetrics` when the frozen acceptance
|
|
538
|
+
contract specifies extra bps on the entire round trip using entry notional.
|
|
539
|
+
This is distinct from `--costStressBps`, which applies the supplied bps to each
|
|
540
|
+
entry and exit. The round-trip calculation subtracts
|
|
541
|
+
`closedQty * actual entryPrice * roundTripBps / 10000`, using `qty` only when
|
|
542
|
+
`closedQty` is absent. It never uses a requested signal price. Historical
|
|
543
|
+
approvals, quantity and risk are frozen before the adjustment, including
|
|
544
|
+
timestamp-local capacity selection.
|
|
545
|
+
|
|
546
|
+
Each baseline, variant and named-policy comparison receives
|
|
547
|
+
`roundTripCostStress[]`. An entry contains `basisPointsRoundTrip`, the exact
|
|
548
|
+
formula, total extra cost, and `realized` with full/terminal, development/test,
|
|
549
|
+
three development blocks, LONG/SHORT and exit-ordered equity. Its `byDirection`
|
|
550
|
+
retains independently measurable LONG/SHORT reports when another direction has
|
|
551
|
+
missing economics. Missing entry notional or inconsistent original completed
|
|
552
|
+
PnL makes the affected realized evidence unavailable, not zero. The option
|
|
553
|
+
requires `--realizedMetrics` and explicit common window bounds; use its
|
|
554
|
+
`realized.test` for completed-trade acceptance criteria, not decision-order DD.
|
|
555
|
+
This arithmetic stress does not simulate changed fills or approval decisions.
|
|
556
|
+
|
|
557
|
+
The displayed execution-price calculation remains the default. Use the optional
|
|
558
|
+
`--entryNotionalAuthority <json>` only when a frozen execution model preserves
|
|
559
|
+
an unrounded `tradeResult.openFee` but rounds its displayed `entryPrice`. The
|
|
560
|
+
option is supported only with single-core `--runtimeCheckpoint`, positive
|
|
561
|
+
`--roundTripCostStressBps`, `--realizedMetrics`, and explicit common window
|
|
562
|
+
bounds. Cross-strategy, moving-average, and raw-materialization modes reject it.
|
|
563
|
+
|
|
564
|
+
The authority uses this closed contract:
|
|
565
|
+
|
|
566
|
+
```json
|
|
567
|
+
{
|
|
568
|
+
"schema": "tradejs-entry-notional-authority/v1",
|
|
569
|
+
"method": "fee-derived-full-closed",
|
|
570
|
+
"runtimeCheckpoint": {
|
|
571
|
+
"path": "runtime-checkpoint.json",
|
|
572
|
+
"sha256": "<sha256>"
|
|
573
|
+
},
|
|
574
|
+
"semanticsReceipt": {
|
|
575
|
+
"path": "entry-notional-semantics.json",
|
|
576
|
+
"sha256": "<reviewed-sha256>"
|
|
577
|
+
},
|
|
578
|
+
"executionModule": {
|
|
579
|
+
"packageName": "@tradejs/node",
|
|
580
|
+
"relativePath": "dist/backtest.mjs",
|
|
581
|
+
"sha256": "<reviewed-module-sha256>"
|
|
582
|
+
},
|
|
583
|
+
"resolvedExecutionConfig": {
|
|
584
|
+
"path": "resolved-execution.json",
|
|
585
|
+
"sha256": "<sha256>",
|
|
586
|
+
"executionCostsJsonPointer": "/execution/costs",
|
|
587
|
+
"executionCostsCanonicalSha256": "<sha256>",
|
|
588
|
+
"fees": { "makerRate": 0.001, "takerRate": 0.001 }
|
|
589
|
+
},
|
|
590
|
+
"sourceExports": [{ "path": "part1.jsonl", "sha256": "<sha256>" }],
|
|
591
|
+
"displayPriceDecimals": 8,
|
|
592
|
+
"roundingPolicy": {
|
|
593
|
+
"id": "decimal-half-unit-plus-binary64-interval-v1"
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
Every path must remain inside Project after realpath resolution. The checkpoint
|
|
599
|
+
must equal the already verified execution runtime. The module must live at the
|
|
600
|
+
declared path inside that runtime's verified `@tradejs/node` package. Authority
|
|
601
|
+
text cannot declare its own fee semantics: the permanent tool has an explicit
|
|
602
|
+
allowlist of reviewed semantics-receipt bytes, semantics id, module path and
|
|
603
|
+
module SHA256. The initial supported combination is receipt SHA256
|
|
604
|
+
`2734c38558d7318106e8ed729c7b403468c9cf06e7b4ff011ddb6cd958ecb0c0`
|
|
605
|
+
and module SHA256
|
|
606
|
+
`2b6f586211b9057a73758909cc2816e0df90028f66f6b293362ba8661f24221f`.
|
|
607
|
+
A different runtime module requires a new reviewed receipt and a tested tool
|
|
608
|
+
change; it fails closed until then.
|
|
609
|
+
|
|
610
|
+
The resolved config file, exact JSON pointer, and canonical execution-cost
|
|
611
|
+
object must agree. Canonical JSON recursively sorts object keys, preserves
|
|
612
|
+
array order, serializes with `JSON.stringify`, and hashes its UTF-8 bytes. Both
|
|
613
|
+
maker and taker rates must be numeric, finite, positive, exactly equal, and
|
|
614
|
+
equal to the declared rate. Ordered source paths and complete file SHA256 values
|
|
615
|
+
must match before row evaluation. The same ordered path, byte-size, and SHA256
|
|
616
|
+
list is verified again after evaluation; a changed input prevents a report.
|
|
617
|
+
|
|
618
|
+
In this mode a row is complete only when `qty`, `closedQty`, `openFee`, and
|
|
619
|
+
`entryPrice` are finite positive numbers and `closedQty === qty` exactly. Its
|
|
620
|
+
entry notional is `openFee / entryFeeRate`. Missing `closedQty`, partial or
|
|
621
|
+
over-closure, invalid/zero fee, invalid price, or a failed precision check makes
|
|
622
|
+
the row unavailable. It never falls back to displayed/requested prices, `qty`
|
|
623
|
+
substitution, another row, or zero.
|
|
624
|
+
|
|
625
|
+
The displayed-price consistency allowance is analytical and fixed before data
|
|
626
|
+
inspection. Let `ulp(x)` be the larger distance from positive finite `x` to its
|
|
627
|
+
adjacent IEEE-754 binary64 values found with `nextDown` and `nextUp`. Then:
|
|
628
|
+
|
|
629
|
+
```text
|
|
630
|
+
feeNotional = openFee / entryFeeRate
|
|
631
|
+
displayNotional = qty * entryPrice
|
|
632
|
+
displayAllowance = qty * 0.5 * 10^-8
|
|
633
|
+
binary64Allowance =
|
|
634
|
+
ulp(openFee) / entryFeeRate
|
|
635
|
+
+ ulp(feeNotional)
|
|
636
|
+
+ abs(entryPrice) * ulp(qty)
|
|
637
|
+
+ abs(qty) * ulp(entryPrice)
|
|
638
|
+
+ ulp(displayNotional)
|
|
639
|
+
allowance = displayAllowance + binary64Allowance
|
|
640
|
+
abs(feeNotional - displayNotional) <= allowance
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
There is no fitted epsilon. A larger scale-in accumulation discrepancy remains
|
|
644
|
+
missing rather than widening the allowance. The explicit report records the
|
|
645
|
+
authority and input before/after hashes, method, complete/missing counts and
|
|
646
|
+
stable missing-reason counts. One missing selected row makes only its affected
|
|
647
|
+
aggregate/direction/symbol realized stress cohorts unavailable; independently
|
|
648
|
+
complete cohorts remain measurable. Without the option, existing formula,
|
|
649
|
+
partial-close/quantity fallback behavior, report fields, and metrics are
|
|
650
|
+
unchanged.
|
|
651
|
+
|
|
475
652
|
Use `--realizedMetrics` for additional `baseline.realized` and
|
|
476
653
|
`variant.realized` JSON evidence. Original approvals and decision-time metrics
|
|
477
654
|
stay unchanged. This option requires explicit `--windowStart` and `--windowEnd`;
|
|
@@ -501,6 +678,19 @@ one-off script for capabilities that belong here. Extend this script and its
|
|
|
501
678
|
`node:test` coverage, then update this reference and `SKILL.md` when the
|
|
502
679
|
research contract changes.
|
|
503
680
|
|
|
681
|
+
For development-only gate selection, set `--windowEnd`, `--testSince` and
|
|
682
|
+
`--labelEndBefore` to the same frozen outer UTC boundary, with an explicit
|
|
683
|
+
`--windowStart` and `--validationSplit 0`. The last option excludes development
|
|
684
|
+
decisions whose completed exit is at or after the boundary, or whose exit is
|
|
685
|
+
unknown, before payload construction, gate evaluation and feature inventory.
|
|
686
|
+
It reports separate crossing/unknown counts in `sourceSelection.labelHorizon`
|
|
687
|
+
and marks `run.discoveryOnly`. Exits preceding decisions and invalid numeric
|
|
688
|
+
source timestamps fail closed. No test outcomes are evaluated by this mode.
|
|
689
|
+
It does not shift the boundary to replace purged support. Omit this option for
|
|
690
|
+
the final full-period evaluation only after every gate specification and
|
|
691
|
+
development selection has been frozen. Discovery requires UTC ISO ending in
|
|
692
|
+
`Z` or epoch milliseconds, and cannot use the cross-strategy contour.
|
|
693
|
+
|
|
504
694
|
Run the tool tests after every change:
|
|
505
695
|
|
|
506
696
|
```bash
|
|
@@ -511,3 +701,116 @@ With the standard 60/40 cross-strategy split, the field `tuning` is the last
|
|
|
511
701
|
third of development, overlapping the discovery partition. It is a diagnostic
|
|
512
702
|
stability block, not an independent validation set. All three development
|
|
513
703
|
blocks are reported separately; the outer test remains distinct.
|
|
704
|
+
|
|
705
|
+
## Raw discovery export for native local training
|
|
706
|
+
|
|
707
|
+
Before maturity purging, freeze one common calendar boundary from the parent
|
|
708
|
+
export using the metadata-only mode:
|
|
709
|
+
|
|
710
|
+
```bash
|
|
711
|
+
node <checksum-bound-ai-gate-ablation.mjs> --file <parent-full-export.jsonl> \
|
|
712
|
+
--timestampPartitionMetadata <Project-path>/timestamp-partition.json \
|
|
713
|
+
--windowStart <start-ms> --windowEnd <end-ms> \
|
|
714
|
+
--validationSplit 0 --testSplit 0.4
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
This mode hashes ordered complete source files before and after reading, retains
|
|
718
|
+
only timestamps, sorts whole timestamp groups, and uses the standard outer
|
|
719
|
+
60/40 split. It requires two independent groups, rejects invalid timestamps,
|
|
720
|
+
and writes a new exclusive checksum-bound metadata file. It never loads source,
|
|
721
|
+
runtime, payload, gate or features, nor reads outcome/label fields. The metadata
|
|
722
|
+
contains row/group counts and `testSince`/UTC boundary, not individual trades.
|
|
723
|
+
Evaluation/runtime/variant, label-purge and exact-boundary options are forbidden.
|
|
724
|
+
Use the same frozen `testSince` for every candidate, before any discovery.
|
|
725
|
+
|
|
726
|
+
When the installed native pocket CLI lacks `--testSince`, first materialize
|
|
727
|
+
each candidate's mature DEV view below using that common boundary, then search
|
|
728
|
+
the view with `--validationSplit 0 --testSplit 0 --sealTest`, separately LONG and
|
|
729
|
+
SHORT. This searches all of the already isolated outer DEV60% and retains its
|
|
730
|
+
three diagnostic blocks; `.4` on this view would incorrectly split DEV again.
|
|
731
|
+
Bind the parent partition metadata and view receipt in the report. Never run
|
|
732
|
+
the older full-export native search just to find a cutoff: it can evaluate
|
|
733
|
+
reserved-tail payloads before sealing the search result.
|
|
734
|
+
|
|
735
|
+
`--materializeDiscoveryExport <jsonl>` is a raw-only mode, before source,
|
|
736
|
+
runtime, plugin, payload and gate loading. It requires explicit `--windowStart`,
|
|
737
|
+
`--windowEnd`, `--testSince`, `--labelEndBefore`, with the latter three equal and
|
|
738
|
+
`--validationSplit 0`. Evaluation, runtime, artifact, variant and report options
|
|
739
|
+
are rejected. Only mature source objects in the half-open window are written:
|
|
740
|
+
decision timestamp is inside the window and finite numeric exit timestamp is
|
|
741
|
+
at least the decision timestamp and strictly before the cutoff. Unknown or
|
|
742
|
+
crossing label horizons are counted and purged before any feature work. A bad
|
|
743
|
+
raw timestamp or inverted chronology fails closed.
|
|
744
|
+
|
|
745
|
+
The output and `<jsonl>.receipt.json` must be new files inside Project and use
|
|
746
|
+
exclusive creation. Full input files are hashed before and after streaming;
|
|
747
|
+
the output is hashed while writing and again on readback. Zero eligible rows,
|
|
748
|
+
changed input or malformed evidence fail without a success receipt; partial
|
|
749
|
+
output is retained as failure evidence, never silently reused. The receipt
|
|
750
|
+
contains all input/output hashes, byte sizes, exact bounds and scan/purge counts.
|
|
751
|
+
Source objects are not evaluated or rewritten apart from JSON serialization.
|
|
752
|
+
|
|
753
|
+
```bash
|
|
754
|
+
node <checksum-bound-ai-gate-ablation.mjs> --strategy LiquidityZones \
|
|
755
|
+
--file <own-full-export.jsonl> --outDir <original-export-directory> \
|
|
756
|
+
--materializeDiscoveryExport <Project-path>/discovery-view.jsonl \
|
|
757
|
+
--windowStart <start-ms> --windowEnd <cutoff-ms> \
|
|
758
|
+
--testSince <cutoff-ms> --labelEndBefore <cutoff-ms> --validationSplit 0
|
|
759
|
+
```
|
|
760
|
+
|
|
761
|
+
Use a non-merged filename such as `discovery-view.jsonl` for native training.
|
|
762
|
+
Native `ai-train` recognizes `ai-dataset-*-merged-*` names and may substitute
|
|
763
|
+
the original shard group from `--outDir` when its merge ID is reused. Keep the
|
|
764
|
+
view's explicit absolute `--file` and a valid original `--outDir`, then use
|
|
765
|
+
`--since start-ms --until cutoff-ms-1` (native bounds are inclusive). Native
|
|
766
|
+
`research.lineage.sourceSha256s` now identifies the view, not its parents:
|
|
767
|
+
bind the materialization receipt and original source/core/config authority
|
|
768
|
+
separately. Do not confuse this view with a new backtest export.
|
|
769
|
+
|
|
770
|
+
Native local reports execute the Project-registered compiled strategy, not
|
|
771
|
+
the checkout named by `TRADEJS_SOURCE_REPOSITORY_ROOT`. Freeze the complete
|
|
772
|
+
Project package/checkpoint, compiled CJS/ESM artifact and source/build authority
|
|
773
|
+
for each composition before running a fresh process. Native `gitSha` describes
|
|
774
|
+
Project; `gateFingerprint` hashes selected resolved entry files, not full trees;
|
|
775
|
+
`configIdsFingerprint` hashes IDs, not resolved config. None replaces the
|
|
776
|
+
explicit source, package, full resolved config and execution checkpoint hashes.
|
|
777
|
+
The native current-gate report and a compiled candidate-gate report must use
|
|
778
|
+
their own candidate export and separate exact compositions. Run final full
|
|
779
|
+
history only after rules are frozen; do not use final cohorts for selection.
|
|
780
|
+
|
|
781
|
+
Use `--symbolCohorts <Project-owned.json> --realizedMetrics` to report frozen
|
|
782
|
+
symbol groups. The input format is:
|
|
783
|
+
|
|
784
|
+
```json
|
|
785
|
+
{
|
|
786
|
+
"schema": "tradejs-symbol-cohorts/v1",
|
|
787
|
+
"groups": [
|
|
788
|
+
{ "id": "full-history", "symbols": ["BTCUSDT"] },
|
|
789
|
+
{ "id": "expanded", "symbols": ["NEWUSDT"] }
|
|
790
|
+
]
|
|
791
|
+
}
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
Group IDs and symbols must be nonempty and unique. Symbols must be disjoint
|
|
795
|
+
across groups, and every evaluated source row must belong to one group. The
|
|
796
|
+
input path must resolve inside the Project. Its bytes are checksum-bound in
|
|
797
|
+
`run.symbolCohorts` and each realized report. Membership is diagnostic metadata
|
|
798
|
+
and is never added to decision features or eligible gate predicates.
|
|
799
|
+
|
|
800
|
+
`baseline.realized.symbolCohorts.groups[]` and the same section on each variant
|
|
801
|
+
contain declared and observed symbol counts, source row counts, and a complete
|
|
802
|
+
realized report. The report includes full and requested terminal windows,
|
|
803
|
+
ALL/LONG/SHORT, common calendar train/test boundaries, the three development
|
|
804
|
+
blocks, zero-activity windows, and equity. Approvals and capacity ranking are
|
|
805
|
+
frozen globally before filtering a group. Filtering must not give an overflow
|
|
806
|
+
symbol another chance at admission or move a partition boundary. Round-trip
|
|
807
|
+
cost stress retains the same group sections and approval identities. Without
|
|
808
|
+
the option, existing reports remain unchanged. The option is not supported in
|
|
809
|
+
cross-strategy, moving-average, or raw-materialization mode.
|
|
810
|
+
|
|
811
|
+
The required 120-symbol full-four-year cohort and expanded 456-symbol cohort
|
|
812
|
+
are diagnostic reporting slices for both raw and final gated tables. They are
|
|
813
|
+
not gate features or selection predicates. Existing monthly/cohort diagnostics
|
|
814
|
+
may not supply PF/MaxDD for every common window; report that limitation and use
|
|
815
|
+
a separately reviewed generic reporting extension if needed. Never derive a
|
|
816
|
+
new rule from the final cohort tables.
|