create-tradejs 3.1.29-beta.291 → 3.1.29-beta.292

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.
@@ -277,9 +277,10 @@ Mandatory validation sections for gate work:
277
277
  target/benchmark/global, and whether it depends on
278
278
  lookback/window/cache/provider settings.
279
279
  - **Walk-forward validation**: when the export spans enough history, validate
280
- across multiple chronological folds or at least month/quarter buckets. Prefer
281
- pockets that survive changing market regimes over pockets that win only in a
282
- single terminal validation split.
280
+ a recurring refit procedure with the A/B/C protocol in
281
+ [gate-ablation.md](references/gate-ablation.md#compare-refitting-and-ticker-groups).
282
+ Month/quarter buckets of one frozen rule measure stability. Walk-forward
283
+ reselects the rule from earlier mature labels for each evaluation window.
283
284
  - **Acceptance gates**: define minimum validation support, maximum symbol
284
285
  and event concentration, acceptable losing months, max loss streak,
285
286
  PF/drawdown improvement, and cadence/capacity bounds before recommending
@@ -564,7 +565,7 @@ Minimum checks:
564
565
  - classify old pockets as `keep`, `round`, `replace`, `disable`, or
565
566
  `needs-more-data`
566
567
  - include live-env parity and feature provenance tables in the analysis
567
- - run walk-forward or month/quarter stability checks when history allows it
568
+ - apply the validation sections above, including threshold sensitivity
568
569
  - define acceptance gates before treating a pocket as production-ready
569
570
  - use a negative control for unusually strong or highly specific pockets
570
571
  - reject approval rules based on data-count or availability fields such as
@@ -572,7 +573,6 @@ Minimum checks:
572
573
  size; use those only as missing/stale-data guards
573
574
  - reject high-precision pocket thresholds until they have been rounded to a
574
575
  defensible value and replayed again
575
- - run sensitivity checks around each proposed numeric threshold
576
576
  - report train and validation support separately when using `ai-pocket-search`
577
577
  or a custom split, but label any partition used for selection as tuning
578
578
  - group partitions by timestamp and report independent-event support separately
@@ -580,8 +580,8 @@ Minimum checks:
580
580
  - report event clustering and capacity stress for every terminal window
581
581
  - require a target-specific discriminator or portfolio throttle for
582
582
  benchmark/global pockets that can approve many symbols on one timestamp
583
- - include an ablation table: baseline, pocket-only when applicable, and final
584
- gate
583
+ - compare the current gate with the proposed gate. Use the A/B/C protocol
584
+ when the claim concerns the incremental value of ticker groups
585
585
  - require boundary tests and a passive-rollout plan for implemented gate changes
586
586
  - clean up old disabled pockets instead of leaving dead constants or prompt
587
587
  fields behind
@@ -884,3 +884,38 @@ For backtest exports with profiles, use `--ai` with the profile source. A plain
884
884
  `--fast` run without export does not exercise optional profile enrichment. Verify
885
885
  `payload.featureSnapshot` in actual rows before claiming feature availability or
886
886
  measuring its overhead. Profiles do not manufacture a missing baseContext.
887
+
888
+
889
+ ## Compare refitting and ticker groups
890
+
891
+ Use the same core export and freeze the search budget, eligibility, treatment of
892
+ unknowns and calendar before opening outcomes. A is the current gate. B searches
893
+ with the prior feature list. C repeats B with the declared registered ticker
894
+ groups. Report B–A, C–B and C–A. For a single frozen split, use the existing
895
+ variants report and `--compareTo` for the direct B/C difference.
896
+
897
+ For a recurring refit, use the existing search command from Project:
898
+
899
+ ```sh
900
+ yarn exec tradejs ai-pocket-search --file <export.jsonl> -n 0 \
901
+ --scope all --validationSplit 0 --testSince <outer-test-UTC> --sealTest \
902
+ --objective add-to-gate --walkForwardPlan <plan.json> --output <report.json>
903
+ ```
904
+
905
+ The plan has `folds` with numeric UTC milliseconds `trainStart`, `testStart` and
906
+ `testEnd`, `baselineFeatures` with exact eligible feature paths, `tickerGroups`
907
+ with registered paths such as `registered.ticker.moneyGroup`, and
908
+ `minimumEvents` for timestamp support. Optional `sensitivityFraction` reports
909
+ one-at-a-time changes to nonzero numerical thresholds. This is a diagnostic
910
+ around the selected rule. It does not select a replacement threshold.
911
+
912
+ Test windows are disjoint and entirely inside outer development. Each fold
913
+ uses labels closed strictly before its training cutoff and reports evaluation
914
+ labels closed before the evaluation end. Both searches use the same rows.
915
+ If a search finds no stable pocket, the fold records a fallback to A. If
916
+ support is insufficient, the fold is marked and the aggregate covers only
917
+ evaluated folds. Counts by timestamp measure support, while market-episode
918
+ dependence still needs diagnosis. The report uses decision-time approval-set
919
+ economics. Verify shortlisted frozen rules in native execution where admissions
920
+ change position occupancy. A historical fold previously used to choose rules or
921
+ settings is retrospective evidence.
@@ -194,3 +194,9 @@ receipt permanently. Prune stale registrations only after checking that their
194
194
  directories are actually absent, and preserve their branch/commit identities
195
195
  in the cleanup inventory. For Codex-managed worktrees attached to this chat,
196
196
  prefer the app's archive tool, which preserves recoverable state.
197
+
198
+ Shared history bundles must be self-contained: verify and fetch them into an
199
+ empty isolated repository and run object integrity checks before retiring the
200
+ worktree. Verification against the source repository alone accepts incremental
201
+ bundles whose prerequisites happen to exist locally. Reject such a bundle,
202
+ retain the worktree, and do not issue a completed retirement receipt.
@@ -87,7 +87,12 @@ def retire(repository, worktree, out, apply=False, history_root=None):
87
87
  pass
88
88
  finally:
89
89
  os.unlink(temporary)
90
- git(repository, 'bundle', 'verify', str(history))
90
+ # Verify without objects from the source repository: incremental bundles are not backups.
91
+ with tempfile.TemporaryDirectory(prefix='verify-history-') as verification:
92
+ git(verification, 'init', '--bare', '-q')
93
+ git(verification, 'bundle', 'verify', str(history))
94
+ git(verification, 'fetch', '--quiet', str(history), 'HEAD')
95
+ git(verification, 'fsck', '--full', '--strict')
91
96
  if git(repository, 'bundle', 'list-heads', str(history), 'HEAD').decode().strip() != f'{head} HEAD':
92
97
  raise ValueError('Shared history HEAD does not match archived worktree')
93
98
  history_reference = {'path': os.path.relpath(history, out), 'sha256': sha_file(history), 'head': head}
@@ -12,6 +12,31 @@ spec.loader.exec_module(module)
12
12
 
13
13
 
14
14
  class ArchiveTest(unittest.TestCase):
15
+ def test_incremental_bundle_cannot_authorize_removal(self):
16
+ with tempfile.TemporaryDirectory(prefix='research-incremental-') as temporary:
17
+ root = Path(temporary).resolve()
18
+ repo = root / 'repo'
19
+ repo.mkdir()
20
+ module.git(repo, 'init', '-q')
21
+ (repo / 'source').write_text('first')
22
+ module.git(repo, 'add', '.')
23
+ module.git(repo, '-c', 'user.name=Test', '-c', 'user.email=test@example.invalid', 'commit', '-qm', 'first')
24
+ (repo / 'source').write_text('second')
25
+ module.git(repo, 'add', '.')
26
+ module.git(repo, '-c', 'user.name=Test', '-c', 'user.email=test@example.invalid', 'commit', '-qm', 'second')
27
+ head = module.git(repo, 'rev-parse', 'HEAD').decode().strip()
28
+ history = root / 'history'
29
+ history.mkdir()
30
+ module.git(repo, 'bundle', 'create', str(history / f'{head}.bundle'), 'HEAD^..HEAD')
31
+ # This succeeds in the source repo, which already has the prerequisite.
32
+ module.git(repo, 'bundle', 'verify', str(history / f'{head}.bundle'))
33
+ worktree = root / 'worktree'
34
+ module.git(repo, 'worktree', 'add', '--detach', str(worktree), 'HEAD')
35
+ with self.assertRaises(subprocess.CalledProcessError):
36
+ module.retire(repo, worktree, root / 'archive', apply=True, history_root=history)
37
+ self.assertTrue(worktree.exists())
38
+ self.assertFalse((root / 'archive/receipt.json').exists())
39
+
15
40
  def test_shared_history_and_source_recovery(self):
16
41
  with tempfile.TemporaryDirectory(prefix='research-archive-') as temporary:
17
42
  root = Path(temporary).resolve()
@@ -63,6 +63,17 @@ Before preregistration, read
63
63
  It defines candidate-specific gate isolation, common partitions, the final
64
64
  composition ledger, and the mandatory visual artifacts.
65
65
 
66
+ ## Support before outcomes
67
+
68
+ Before evaluating PnL, record the mechanism, event identity, minimum useful
69
+ effect and available support by calendar block, symbol and market episode.
70
+ Compare two rules on the same setup when possible. For different events,
71
+ declare causal comparability fields and inspect overlap before seeing outcomes.
72
+ Exact ticker/week pairing is optional when it leaves too little support.
73
+ For existing outcome-blind traces, use the optional `research:core prepare`
74
+ support check in `CORE_RESEARCH.md`. Distinguish missing evidence, insufficient
75
+ support, mechanism failure and economic rejection.
76
+
66
77
  ## Required contour
67
78
 
68
79
  1. Start a new immutable research lineage. Freeze data bounds, point-in-time
@@ -176,6 +176,17 @@ ranking or charting. Use the same half-open comparison window and terminal
176
176
  zero-trade windows. A gate without sufficient untouched support remains visible
177
177
  as `research-only` or `blocked`; the chart is not evidence of readiness.
178
178
 
179
+ ## Portfolio contribution
180
+
181
+ For a finalist intended for a shared portfolio, compare the incumbent portfolio
182
+ with the same ordered composition replacing one strategy. Use identical
183
+ cached inputs, risk and policies. Run both as one shared replay batch and pass
184
+ the incumbent portfolio JSON to the candidate replay with
185
+ `--portfolioCompareTo`. Compare realized PnL, drawdown, recovery and contributions
186
+ from unchanged strategies. Read marked drawdown and confirmed displacement
187
+ from the shared replay diagnostics. A change in trade count alone is not
188
+ evidence of capacity displacement.
189
+
179
190
  ## Mandatory visual artifacts
180
191
 
181
192
  Create the board from authoritative structured reports with:
@@ -26,7 +26,10 @@ cannot be reproduced.
26
26
  ## Run
27
27
 
28
28
  1. Freeze the new common end time, maximum common start, point-in-time universe,
29
- costs, execution assumptions, and candidate identities before evaluation.
29
+ costs, execution assumptions, candidate identities and acceptance rules before
30
+ evaluation. Record previously inspected calendar windows and mark them
31
+ retrospective. For later observation, bind runtime scorecards and execution
32
+ calibration to the exact frozen composition and candidate lineage.
30
33
  2. Use existing cached history first. If the requested new tail is absent,
31
34
  fetch only that missing tail through the supported TradeJS data path, then
32
35
  fingerprint the resulting coverage; never silently rewrite old history.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema": "tradejs-skill-bundle/v1",
3
3
  "source": "TradeJS-Dev/TradeJS:.codex/skills",
4
- "bundleSha256": "d72cedcf85ed6ae8ac3198758b9713c3b3faa464e8008864d9b802ed604b53ee",
4
+ "bundleSha256": "2134821363848dd2ad0ac24a892c8a45a77250eaecdf275b9dca49f56ea0b192",
5
5
  "skills": [
6
6
  "ai-train-local-research",
7
7
  "backtest-config-redis",
@@ -22,7 +22,7 @@
22
22
  "strategy-release"
23
23
  ],
24
24
  "files": {
25
- ".codex/skills/ai-train-local-research/references/gate-ablation.md": "4565ba0712b21f810029eb8ed20587a4a52dcce3486a6c46ff98cbfdd0e36db3",
25
+ ".codex/skills/ai-train-local-research/references/gate-ablation.md": "546fee090bf1e326c20a6477c8b775cc3acf71c15c9f32ebb235fc56b24a1193",
26
26
  ".codex/skills/ai-train-local-research/references/pocket-feature-exclusion.md": "c7af65fcfcd404d5324f0222678126d5e166fb77c4c27afea96369ef427f4bb0",
27
27
  ".codex/skills/ai-train-local-research/references/reporting.md": "ae0faaab3b3dd0f4bd27142fa2c9aa889c5e7572a10e9fe1ee79ff57ebbd8653",
28
28
  ".codex/skills/ai-train-local-research/scripts/ai-gate-ablation.mjs": "83b8791122a391f9cefa2f4331af23a0f30a83638178b2f282de9d5db802467f",
@@ -43,14 +43,14 @@
43
43
  ".codex/skills/ai-train-local-research/scripts/research-entry-gate-bridge.test.mjs": "a9f5a918cda1d36da62dbaaf1ea3aea6bcb40f06ad9f7c4bfc4da18baa5aa01e",
44
44
  ".codex/skills/ai-train-local-research/scripts/symbol-mix-diagnostics.mjs": "ad70b73ea49060c0a350d2ca2f85788e6900bdbece46434e9a95865965329d89",
45
45
  ".codex/skills/ai-train-local-research/scripts/symbol-mix-diagnostics.test.mjs": "6244c3540f708be6f2f29fa5b871a266e0ecee7a5ba4d588b0e3acb47e1ee445",
46
- ".codex/skills/ai-train-local-research/SKILL.md": "c19c1e7048a5f970725ae52f2fa6d18430fe7ffb79d18b50ee692d8768091b14",
46
+ ".codex/skills/ai-train-local-research/SKILL.md": "d570134151e29ea1f010e48d16ae09687e7b8e53dc5e595251e44b0e61a1dc96",
47
47
  ".codex/skills/backtest-config-redis/scripts/get_backtest_config.sh": "833e950d6348c5b7a4bd3f00d25af60f6394190bff744bd5ab64db9e43d826d5",
48
48
  ".codex/skills/backtest-config-redis/SKILL.md": "ac4f9d685c12f748a87b1882df1f731dd3ae9ec8bd7c11cb652221fe0463febc",
49
49
  ".codex/skills/runtime-parity-mismatch-analysis/SKILL.md": "f9cbc571baaba7a185550415c3ef31f0f55a9503107c8ace2314fac88ba025bd",
50
50
  ".codex/skills/save-strategy-config-from-backtest/agents/openai.yaml": "ba163f9449562241ed954ca2e0f12e22562390740cdcf0d09d7f99f0ef791741",
51
51
  ".codex/skills/save-strategy-config-from-backtest/SKILL.md": "a73cddc29fb8fa741fe6226c051e19b0f9a19747babf96d336e7f165fb1fd298",
52
52
  ".codex/skills/strategy-backtest-research/references/research-notes.md": "d9ccda0ac667079edc97078d1cb96cb461569e1d74b66934e9392a687e507d6f",
53
- ".codex/skills/strategy-backtest-research/references/research-retention.md": "cf7508901b83e95a9dd18c53d2c46fe70f38fab1c259f86d8ee6161a5a0ce427",
53
+ ".codex/skills/strategy-backtest-research/references/research-retention.md": "df4c236d1986b52854a313ba6e179f5be5e09c69c57647f8f9a8ba0fa8f7f796",
54
54
  ".codex/skills/strategy-backtest-research/scripts/backtest-run-metrics.mjs": "dbcc6bb7cab4e0108ed11df503b8a0a337d1a01b77c5b56554ce1264a00f5d57",
55
55
  ".codex/skills/strategy-backtest-research/scripts/backtest-run-metrics.test.mjs": "a00d0ae5fb0037cc554282dbe22109a9e34cb64b93d26a6feab69005a2ba637f",
56
56
  ".codex/skills/strategy-backtest-research/scripts/fast-ai-export-metrics.mjs": "61e8604bba829914315fccd604afc4a13f97409b7ebe2f22d255d0eb57f32921",
@@ -59,15 +59,15 @@
59
59
  ".codex/skills/strategy-backtest-research/scripts/metric-snapshot.test.mjs": "77ef641d1f8590063db13aa9fe12d1db30b28c622f44c774be502d0a9fa487dc",
60
60
  ".codex/skills/strategy-backtest-research/scripts/research-notes-check.mjs": "196f420845f0cc841bdbb1651063a485c90a1140f767e88f4dbf3543adb881de",
61
61
  ".codex/skills/strategy-backtest-research/scripts/research-notes-check.test.mjs": "256618c16d797374078198e6e61c50b518cef5bbbc85c3ceffa891035ae58318",
62
- ".codex/skills/strategy-backtest-research/scripts/retire-worktree.py": "454246e6c38a886a6811e198d464a452948d5ee12cefc8f473fffe4f20f463fc",
63
- ".codex/skills/strategy-backtest-research/scripts/retire-worktree.test.py": "84fa52df7e2ffc8020214dda570c827f0cc3cfe69cac8f911d34d5589a1ec18a",
62
+ ".codex/skills/strategy-backtest-research/scripts/retire-worktree.py": "6870d1c537e32c9626c27c1e0dfd5911e4e2fe917b82de28a15f82193f1e6384",
63
+ ".codex/skills/strategy-backtest-research/scripts/retire-worktree.test.py": "648071b5c6326f5129c3d1893da763212d2bdd92d4ea66226e3823e7189848ef",
64
64
  ".codex/skills/strategy-backtest-research/SKILL.md": "c033ab2e4b552e2a19e69e797413b5dee9ed66987a52d3b201e7bdaa60cfe06c",
65
65
  ".codex/skills/strategy-candidate-compare/SKILL.md": "0213ffab975f7a19cc204260a9ca587e6f59dbd84f2a4cdac19d84418ebf0792",
66
66
  ".codex/skills/strategy-candidate-report/SKILL.md": "2f24b1ac546bd21a0cdcc04cfdce6eeeca25ff89fc42cdd1dc66516b6fe95c11",
67
67
  ".codex/skills/strategy-forward-start/SKILL.md": "a86311aeb4c5b46e43011806ffa0f665c4ec0fddce8d7f8c1232184e4a14bfa7",
68
68
  ".codex/skills/strategy-forward-status/SKILL.md": "7cb021991ff40bb3407eb58e1c9e2bcf597f67b0201059b9e20e4f37fd3320b9",
69
69
  ".codex/skills/strategy-improvement-plan/SKILL.md": "f5f0f390941dd3332890a2f0ffae1248abde4925db2cf49a41c0c0c1b47e7864",
70
- ".codex/skills/strategy-improvement-research/references/final-composition-board.md": "9be39311ab1feb8abbbdd7ee7575ca4b91ff45be13cb7df1e241d7cb1435eacc",
70
+ ".codex/skills/strategy-improvement-research/references/final-composition-board.md": "9c5b9d7ae75a46fbc3bd81109b203590f32faa6f8202cc55926c0f085724e207",
71
71
  ".codex/skills/strategy-improvement-research/scripts/build-final-composition-spec.mjs": "f336bb3b7e0d0040cabeda9f2d0d015301b017ea6e825f3bcdcafeed187ee93b",
72
72
  ".codex/skills/strategy-improvement-research/scripts/build-final-composition-spec.test.mjs": "1985664ce89c00269c5e5b8748aceaaa7377759c84e28dfca7bb3618bfcfbe44",
73
73
  ".codex/skills/strategy-improvement-research/scripts/executed-composition-report.mjs": "0dcae8ceef53974e689ea9c96ef8ab0f44150f98f4b3adc44661207e827b5aa5",
@@ -76,8 +76,8 @@
76
76
  ".codex/skills/strategy-improvement-research/scripts/final-composition-board.test.mjs": "4dae48e797c27a55913639b3c90b66b7c8effe8eb9da3c943d804df301d58aa6",
77
77
  ".codex/skills/strategy-improvement-research/scripts/freeze-gate-variants.mjs": "17b3c868880ddd5b326d309e6e42eaeef1ea22d625a5db947997ac73b221ad6d",
78
78
  ".codex/skills/strategy-improvement-research/scripts/freeze-gate-variants.test.mjs": "963e1c64ab3deef11fd48a96e10f3827af38036dfe2eb28daf7849f19dd414d8",
79
- ".codex/skills/strategy-improvement-research/SKILL.md": "841956c4de5f0dbe29c7fe408f27791cb599968f9a86195c962ad18271b464b8",
80
- ".codex/skills/strategy-period-revalidate/SKILL.md": "b580d09c78c2bf64de26ca25c4394d5e2657e8bc1f8f717391153db894b57ab2",
79
+ ".codex/skills/strategy-improvement-research/SKILL.md": "49dc75ae27d9c57c9109be680bf8cfbdc273addca6625cdc0336a4ba45ffd67c",
80
+ ".codex/skills/strategy-period-revalidate/SKILL.md": "424389c13c238b51247dcdbed3172d3209f47f33cee54cbcdfc0548780b35f5f",
81
81
  ".codex/skills/strategy-release/agents/openai.yaml": "46ddb09119b08ae3be3b9509121b57492342012e774789b615767b24270dba17",
82
82
  ".codex/skills/strategy-release/references/diagnose-live.md": "dc2effa6eba34e3cfcc1eaf4d2fd1c96d6ccdda971a0edec76c9eed1ec293a3d",
83
83
  ".codex/skills/strategy-release/references/direction-policy.md": "e7635e709dfc7301b94f3dbc1421c6a779c7c39ce4f6066b2eece38e4e600bec",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tradejs",
3
- "version": "3.1.29-beta.291",
3
+ "version": "3.1.29-beta.292",
4
4
  "description": "Create a ready-to-run TradeJS project with local infrastructure and the Web UI.",
5
5
  "keywords": [
6
6
  "tradejs",