@tradejs/cli 3.1.29-beta.280 → 3.1.29-beta.281

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
@@ -33078,12 +33078,26 @@ var init_runtimeEvidenceCompositions = __esm({
33078
33078
  const register = (snapshot) => {
33079
33079
  const compositionId = snapshot.deployment.deploymentCompositionId;
33080
33080
  const known = snapshots.get(compositionId);
33081
- if (known && (stableSnapshotIdentity(known.deployment) !== stableSnapshotIdentity(snapshot.deployment) || producerIdentity(known.producer) !== producerIdentity(snapshot.producer))) {
33081
+ if (known && stableSnapshotIdentity(known.deployment) !== stableSnapshotIdentity(snapshot.deployment)) {
33082
33082
  throw new Error(
33083
33083
  `Conflicting runtime evidence snapshot for composition ${compositionId}`
33084
33084
  );
33085
33085
  }
33086
- snapshots.set(compositionId, snapshot);
33086
+ const producers = /* @__PURE__ */ new Map();
33087
+ for (const source of [
33088
+ ...known?.producerVariants ?? [],
33089
+ known?.producer,
33090
+ snapshot.producer
33091
+ ]) {
33092
+ if (source) producers.set(producerIdentity(source), source);
33093
+ }
33094
+ const producerVariants = [...producers.values()];
33095
+ snapshots.set(compositionId, {
33096
+ ...known,
33097
+ ...snapshot,
33098
+ producer: producerVariants.length === 1 ? producerVariants[0] : null,
33099
+ ...producerVariants.length > 1 ? { producerVariants } : {}
33100
+ });
33087
33101
  };
33088
33102
  const compositionSnapshots = await discoverRuntimeEvidenceCompositionSnapshots(publishRoot);
33089
33103
  for (const snapshot of compositionSnapshots) {
@@ -33118,7 +33132,7 @@ var init_runtimeEvidenceCompositions = __esm({
33118
33132
  `Current runtime deployment conflicts with stored composition ${currentDeployment.deploymentCompositionId}`
33119
33133
  );
33120
33134
  }
33121
- snapshots.set(currentDeployment.deploymentCompositionId, {
33135
+ register({
33122
33136
  deployment: { ...currentDeployment, tickers: void 0 },
33123
33137
  producer: currentProducer
33124
33138
  });
@@ -33176,6 +33190,14 @@ var init_runtimeEvidenceCompositions = __esm({
33176
33190
  `Runtime evidence has no verified deployment snapshot for composition(s): ${missing.sort().join(", ")}`
33177
33191
  );
33178
33192
  }
33193
+ for (const compositionId of observed) {
33194
+ const variants = snapshots.get(compositionId)?.producerVariants;
33195
+ if (variants && variants.length > 1) {
33196
+ throw new Error(
33197
+ `Ambiguous runtime evidence producer for composition ${compositionId}: ${variants.map((source) => `${source.projectSha}@${source.imageDigest}`).sort().join(", ")}; runtime lineage has no producer image identity`
33198
+ );
33199
+ }
33200
+ }
33179
33201
  return [...observed].filter((compositionId) => snapshots.has(compositionId)).map((compositionId) => snapshots.get(compositionId)).map(({ deployment, producer, fallbackTickers }) => {
33180
33202
  const trades = evidence.trades.filter(
33181
33203
  (row) => belongsToSnapshot(row, deployment)
@@ -143,12 +143,26 @@ var loadRuntimeEvidenceCompositionSnapshots = async ({
143
143
  const register = (snapshot) => {
144
144
  const compositionId = snapshot.deployment.deploymentCompositionId;
145
145
  const known = snapshots.get(compositionId);
146
- if (known && (stableSnapshotIdentity(known.deployment) !== stableSnapshotIdentity(snapshot.deployment) || producerIdentity(known.producer) !== producerIdentity(snapshot.producer))) {
146
+ if (known && stableSnapshotIdentity(known.deployment) !== stableSnapshotIdentity(snapshot.deployment)) {
147
147
  throw new Error(
148
148
  `Conflicting runtime evidence snapshot for composition ${compositionId}`
149
149
  );
150
150
  }
151
- snapshots.set(compositionId, snapshot);
151
+ const producers = /* @__PURE__ */ new Map();
152
+ for (const source of [
153
+ ...known?.producerVariants ?? [],
154
+ known?.producer,
155
+ snapshot.producer
156
+ ]) {
157
+ if (source) producers.set(producerIdentity(source), source);
158
+ }
159
+ const producerVariants = [...producers.values()];
160
+ snapshots.set(compositionId, {
161
+ ...known,
162
+ ...snapshot,
163
+ producer: producerVariants.length === 1 ? producerVariants[0] : null,
164
+ ...producerVariants.length > 1 ? { producerVariants } : {}
165
+ });
152
166
  };
153
167
  const compositionSnapshots = await discoverRuntimeEvidenceCompositionSnapshots(publishRoot);
154
168
  for (const snapshot of compositionSnapshots) {
@@ -183,7 +197,7 @@ var loadRuntimeEvidenceCompositionSnapshots = async ({
183
197
  `Current runtime deployment conflicts with stored composition ${currentDeployment.deploymentCompositionId}`
184
198
  );
185
199
  }
186
- snapshots.set(currentDeployment.deploymentCompositionId, {
200
+ register({
187
201
  deployment: { ...currentDeployment, tickers: void 0 },
188
202
  producer: currentProducer
189
203
  });
@@ -241,6 +255,14 @@ var splitRuntimeEvidenceByComposition = ({
241
255
  `Runtime evidence has no verified deployment snapshot for composition(s): ${missing.sort().join(", ")}`
242
256
  );
243
257
  }
258
+ for (const compositionId of observed) {
259
+ const variants = snapshots.get(compositionId)?.producerVariants;
260
+ if (variants && variants.length > 1) {
261
+ throw new Error(
262
+ `Ambiguous runtime evidence producer for composition ${compositionId}: ${variants.map((source) => `${source.projectSha}@${source.imageDigest}`).sort().join(", ")}; runtime lineage has no producer image identity`
263
+ );
264
+ }
265
+ }
244
266
  return [...observed].filter((compositionId) => snapshots.has(compositionId)).map((compositionId) => snapshots.get(compositionId)).map(({ deployment, producer, fallbackTickers }) => {
245
267
  const trades = evidence.trades.filter(
246
268
  (row) => belongsToSnapshot(row, deployment)
@@ -491,12 +491,26 @@ var loadRuntimeEvidenceCompositionSnapshots = async ({
491
491
  const register = (snapshot) => {
492
492
  const compositionId = snapshot.deployment.deploymentCompositionId;
493
493
  const known = snapshots.get(compositionId);
494
- if (known && (stableSnapshotIdentity(known.deployment) !== stableSnapshotIdentity(snapshot.deployment) || producerIdentity(known.producer) !== producerIdentity(snapshot.producer))) {
494
+ if (known && stableSnapshotIdentity(known.deployment) !== stableSnapshotIdentity(snapshot.deployment)) {
495
495
  throw new Error(
496
496
  `Conflicting runtime evidence snapshot for composition ${compositionId}`
497
497
  );
498
498
  }
499
- snapshots.set(compositionId, snapshot);
499
+ const producers = /* @__PURE__ */ new Map();
500
+ for (const source of [
501
+ ...known?.producerVariants ?? [],
502
+ known?.producer,
503
+ snapshot.producer
504
+ ]) {
505
+ if (source) producers.set(producerIdentity(source), source);
506
+ }
507
+ const producerVariants = [...producers.values()];
508
+ snapshots.set(compositionId, {
509
+ ...known,
510
+ ...snapshot,
511
+ producer: producerVariants.length === 1 ? producerVariants[0] : null,
512
+ ...producerVariants.length > 1 ? { producerVariants } : {}
513
+ });
500
514
  };
501
515
  const compositionSnapshots = await discoverRuntimeEvidenceCompositionSnapshots(publishRoot);
502
516
  for (const snapshot of compositionSnapshots) {
@@ -531,7 +545,7 @@ var loadRuntimeEvidenceCompositionSnapshots = async ({
531
545
  `Current runtime deployment conflicts with stored composition ${currentDeployment.deploymentCompositionId}`
532
546
  );
533
547
  }
534
- snapshots.set(currentDeployment.deploymentCompositionId, {
548
+ register({
535
549
  deployment: { ...currentDeployment, tickers: void 0 },
536
550
  producer: currentProducer
537
551
  });
@@ -589,6 +603,14 @@ var splitRuntimeEvidenceByComposition = ({
589
603
  `Runtime evidence has no verified deployment snapshot for composition(s): ${missing.sort().join(", ")}`
590
604
  );
591
605
  }
606
+ for (const compositionId of observed) {
607
+ const variants = snapshots.get(compositionId)?.producerVariants;
608
+ if (variants && variants.length > 1) {
609
+ throw new Error(
610
+ `Ambiguous runtime evidence producer for composition ${compositionId}: ${variants.map((source) => `${source.projectSha}@${source.imageDigest}`).sort().join(", ")}; runtime lineage has no producer image identity`
611
+ );
612
+ }
613
+ }
592
614
  return [...observed].filter((compositionId) => snapshots.has(compositionId)).map((compositionId) => snapshots.get(compositionId)).map(({ deployment, producer, fallbackTickers }) => {
593
615
  const trades = evidence.trades.filter(
594
616
  (row) => belongsToSnapshot(row, deployment)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tradejs/cli",
3
- "version": "3.1.29-beta.280",
3
+ "version": "3.1.29-beta.281",
4
4
  "description": "Official CLI for the TradeJS TypeScript framework: infra setup, backtests, signals, bots, and ML workflows.",
5
5
  "keywords": [
6
6
  "tradejs",
@@ -37,13 +37,13 @@
37
37
  "tradejs": "dist/cli.js"
38
38
  },
39
39
  "dependencies": {
40
- "@tradejs/connectors": "^3.1.29-beta.280",
41
- "@tradejs/core": "^3.1.29-beta.280",
42
- "@tradejs/indicators": "^3.1.29-beta.280",
43
- "@tradejs/infra": "^3.1.29-beta.280",
44
- "@tradejs/node": "^3.1.29-beta.280",
40
+ "@tradejs/connectors": "^3.1.29-beta.281",
41
+ "@tradejs/core": "^3.1.29-beta.281",
42
+ "@tradejs/indicators": "^3.1.29-beta.281",
43
+ "@tradejs/infra": "^3.1.29-beta.281",
44
+ "@tradejs/node": "^3.1.29-beta.281",
45
45
  "@tradejs/strategy-kit": "3.0.6",
46
- "@tradejs/types": "^3.1.29-beta.280",
46
+ "@tradejs/types": "^3.1.29-beta.281",
47
47
  "args": "^5.0.3",
48
48
  "bcryptjs": "^2.4.3",
49
49
  "chalk": "4.1.2",