@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.
- package/README.md +47 -8
- package/dist/cli.js +990 -1448
- package/dist/lib/aiPocketSearch.js +16 -0
- package/dist/lib/aiPocketSearchCli.js +3 -3
- package/dist/lib/jevMicroReferences.js +73 -0
- package/dist/lib/jevResearch.js +11 -0
- package/dist/lib/runtimeEvidenceArtifacts.js +3 -416
- package/dist/lib/runtimeEvidenceCompositionSnapshots.js +42 -211
- package/dist/lib/runtimeEvidenceCompositions.js +33 -310
- package/dist/lib/runtimeEvidenceDeployment.js +3 -315
- package/dist/lib/runtimeEvidenceProducer.js +3 -77
- package/dist/lib/runtimeEvidenceSync.js +32 -299
- package/dist/lib/runtimeFeedbackArtifacts.js +3 -545
- package/dist/lib/runtimeFeedbackNotification.js +7 -195
- package/dist/lib/runtimeFeedbackReplay.js +26 -525
- package/dist/lib/runtimeFeedbackSync.js +26 -219
- package/dist/lib/runtimeScorecard.js +5 -163
- package/dist/scripts/aiPocketSearch.js +101 -23
- package/dist/scripts/backtest.js +10 -1
- package/dist/scripts/jev.js +11 -0
- package/dist/scripts/mcpWorker.js +273 -0
- package/dist/scripts/replay.js +14 -250
- package/dist/scripts/replayRunner.js +14 -250
- package/dist/scripts/runtimeEvidence.js +47 -597
- package/dist/scripts/runtimeEvidenceSync.js +29 -296
- package/dist/scripts/runtimeFeedbackNotify.js +10 -188
- package/dist/scripts/runtimeFeedbackReplay.js +29 -528
- package/dist/scripts/runtimeFeedbackSync.js +28 -221
- package/dist/scripts/runtimeScorecard.js +88 -503
- package/dist/scripts/signals.js +55 -224
- package/dist/scripts/signalsDaemon.js +55 -224
- package/package.json +9 -8
|
@@ -17,6 +17,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
21
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
22
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
23
|
// file that has been converted to a CommonJS file using a Babel-
|
|
@@ -34,291 +35,23 @@ __export(runtimeEvidenceSync_exports, {
|
|
|
34
35
|
runtimeEvidenceSync: () => runtimeEvidenceSync
|
|
35
36
|
});
|
|
36
37
|
module.exports = __toCommonJS(runtimeEvidenceSync_exports);
|
|
37
|
-
var
|
|
38
|
+
var import_node_path2 = __toESM(require("path"));
|
|
38
39
|
var import_args = __toESM(require("args"));
|
|
39
40
|
var import_chalk = __toESM(require("chalk"));
|
|
40
41
|
|
|
41
42
|
// src/lib/runtimeEvidenceSync.ts
|
|
42
43
|
var import_node_child_process = require("child_process");
|
|
43
|
-
var
|
|
44
|
-
var
|
|
44
|
+
var import_promises = __toESM(require("fs/promises"));
|
|
45
|
+
var import_node_path = __toESM(require("path"));
|
|
45
46
|
var import_node_util = require("util");
|
|
46
47
|
|
|
47
48
|
// src/lib/runtimeEvidenceArtifacts.ts
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
var import_node_path = __toESM(require("path"));
|
|
49
|
+
var runtimeEvidenceArtifacts_exports = {};
|
|
50
|
+
__reExport(runtimeEvidenceArtifacts_exports, require("@tradejs/node/diagnostics"));
|
|
51
51
|
|
|
52
52
|
// src/lib/runtimeEvidenceDeployment.ts
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
var isNonEmptyString = (value) => typeof value === "string" && value.trim().length > 0;
|
|
56
|
-
var isPackageVersionMap = (value) => isRecord(value) && Object.keys(value).length > 0 && Object.entries(value).every(
|
|
57
|
-
([name, version]) => name.startsWith("@tradejs/") && isNonEmptyString(version)
|
|
58
|
-
);
|
|
59
|
-
var INTERVALS = /* @__PURE__ */ new Set([
|
|
60
|
-
"1",
|
|
61
|
-
"3",
|
|
62
|
-
"5",
|
|
63
|
-
"15",
|
|
64
|
-
"30",
|
|
65
|
-
"60",
|
|
66
|
-
"120",
|
|
67
|
-
"240",
|
|
68
|
-
"360",
|
|
69
|
-
"720",
|
|
70
|
-
"D",
|
|
71
|
-
"W",
|
|
72
|
-
"M"
|
|
73
|
-
]);
|
|
74
|
-
var UNIVERSES = /* @__PURE__ */ new Set(["crypto", "tradfi"]);
|
|
75
|
-
var isRuntimeStrategySelection = (value) => value === void 0 || isRecord(value) && Object.keys(value).length === 1 && Object.keys(value).every((key) => key === "tickers") && Array.isArray(value.tickers) && value.tickers.length > 0 && value.tickers.every((ticker) => isNonEmptyString(ticker));
|
|
76
|
-
var samePackageVersions = (left, right) => {
|
|
77
|
-
if (!left || !right) return false;
|
|
78
|
-
const leftEntries = Object.entries(left).sort(
|
|
79
|
-
([a], [b]) => a.localeCompare(b)
|
|
80
|
-
);
|
|
81
|
-
const rightEntries = Object.entries(right).sort(
|
|
82
|
-
([a], [b]) => a.localeCompare(b)
|
|
83
|
-
);
|
|
84
|
-
return JSON.stringify(leftEntries) === JSON.stringify(rightEntries);
|
|
85
|
-
};
|
|
86
|
-
var runtimeLineageMatchesStrategySnapshot = ({
|
|
87
|
-
lineage,
|
|
88
|
-
deployment,
|
|
89
|
-
strategy
|
|
90
|
-
}) => lineage?.schemaVersion === 3 && lineage.strategyRevision === strategy.strategyRevision && lineage.deploymentCompositionId === deployment.deploymentCompositionId && lineage.strategyPackageVersion === strategy.strategyPackageVersion && lineage.runtimePackageVersion === strategy.runtimePackageVersion && samePackageVersions(
|
|
91
|
-
lineage.strategyDependencyVersions,
|
|
92
|
-
strategy.strategyDependencyVersions
|
|
93
|
-
);
|
|
94
|
-
var parseRuntimeEvidenceDeploymentSnapshot = (value) => {
|
|
95
|
-
if (!isRecord(value) || value.schemaVersion !== 2 || !isNonEmptyString(value.id) || !isNonEmptyString(value.deploymentCompositionId) || !/^dc1:[a-f0-9]{16}$/.test(value.deploymentCompositionId) || !isNonEmptyString(value.label) || !isNonEmptyString(value.connectorName) || !isNonEmptyString(value.provider) || !isNonEmptyString(value.accountId) || typeof value.enabled !== "boolean" || !Array.isArray(value.strategies)) {
|
|
96
|
-
throw new Error(
|
|
97
|
-
"Runtime evidence deployment snapshot is missing or invalid"
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
const strategies = value.strategies.map((candidate) => {
|
|
101
|
-
if (!isRecord(candidate) || !isNonEmptyString(candidate.strategyName) || !isNonEmptyString(candidate.strategyRevision) || !/^sr1:[a-f0-9]{16}$/.test(candidate.strategyRevision) || typeof candidate.enabled !== "boolean" || !["active", "entries_paused"].includes(String(candidate.controlState)) || !INTERVALS.has(String(candidate.interval)) || !UNIVERSES.has(String(candidate.universe)) || !isNonEmptyString(candidate.strategyPackage) || !isNonEmptyString(candidate.strategyPackageVersion) || !isPackageVersionMap(candidate.strategyDependencyVersions) || !isNonEmptyString(candidate.runtimePackageVersion) || !isRecord(candidate.strategyConfig) || !isRuntimeStrategySelection(candidate.selection)) {
|
|
102
|
-
throw new Error(
|
|
103
|
-
"Runtime evidence deployment strategy snapshot is invalid"
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
if (String(candidate.strategyConfig.INTERVAL) !== String(candidate.interval) || String(candidate.strategyConfig.UNIVERSE) !== String(candidate.universe)) {
|
|
107
|
-
throw new Error(
|
|
108
|
-
`Runtime evidence strategy config does not match its scope: ${candidate.strategyName}`
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
if (candidate.accountId != null && (!isNonEmptyString(candidate.accountId) || candidate.accountId !== value.accountId)) {
|
|
112
|
-
throw new Error(
|
|
113
|
-
`Runtime evidence strategy account does not match deployment: ${candidate.strategyName}`
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
return candidate;
|
|
117
|
-
});
|
|
118
|
-
const identities = /* @__PURE__ */ new Set();
|
|
119
|
-
for (const strategy of strategies) {
|
|
120
|
-
if (identities.has(strategy.strategyName)) {
|
|
121
|
-
throw new Error(
|
|
122
|
-
`Duplicate runtime evidence strategy: ${strategy.strategyName}`
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
identities.add(strategy.strategyName);
|
|
126
|
-
}
|
|
127
|
-
return {
|
|
128
|
-
...value,
|
|
129
|
-
strategies
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
var activeRuntimeEvidenceStrategies = (deployment) => deployment.enabled ? deployment.strategies.filter((strategy) => strategy.enabled) : [];
|
|
133
|
-
var unwrapRuntimeEvidenceRows = (value, field) => (Array.isArray(value) ? value : []).map((candidate) => {
|
|
134
|
-
const record = isRecord(candidate) ? candidate : null;
|
|
135
|
-
const nested = record && isRecord(record[field]) ? record[field] : null;
|
|
136
|
-
return nested ?? record;
|
|
137
|
-
}).filter((record) => record != null);
|
|
138
|
-
var assertCurrentRuntimeEvidenceArtifact = (artifact) => {
|
|
139
|
-
if (!isRecord(artifact) || artifact.reportType !== "runtime-evidence") {
|
|
140
|
-
throw new Error("Invalid runtime evidence artifact");
|
|
141
|
-
}
|
|
142
|
-
const deployment = parseRuntimeEvidenceDeploymentSnapshot(
|
|
143
|
-
artifact.deployment
|
|
144
|
-
);
|
|
145
|
-
const activeStrategies = activeRuntimeEvidenceStrategies(deployment);
|
|
146
|
-
if (activeStrategies.length === 0) {
|
|
147
|
-
throw new Error("Runtime evidence deployment has no enabled strategies");
|
|
148
|
-
}
|
|
149
|
-
const runtime = isRecord(artifact.runtime) ? artifact.runtime : null;
|
|
150
|
-
if (!runtime) {
|
|
151
|
-
throw new Error("Runtime evidence payload is missing");
|
|
152
|
-
}
|
|
153
|
-
if ("strategyConfigs" in runtime) {
|
|
154
|
-
throw new Error(
|
|
155
|
-
"Runtime evidence payload contains removed strategyConfigs data"
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
if ("evaluationStatsBuckets" in runtime) {
|
|
159
|
-
throw new Error(
|
|
160
|
-
"Runtime evidence payload contains removed lineage-less evaluationStatsBuckets data"
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
const rowFields = [
|
|
164
|
-
"trades",
|
|
165
|
-
"signals",
|
|
166
|
-
"evaluations",
|
|
167
|
-
"lineageScopes"
|
|
168
|
-
];
|
|
169
|
-
for (const field of rowFields) {
|
|
170
|
-
if (!Array.isArray(runtime[field])) {
|
|
171
|
-
throw new Error(`Runtime evidence payload ${field} must be an array`);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
const snapshots = new Map(
|
|
175
|
-
activeStrategies.map((strategy) => [strategy.strategyName, strategy])
|
|
176
|
-
);
|
|
177
|
-
const assertRows = (label, rows, lineageField) => {
|
|
178
|
-
for (const row of rows) {
|
|
179
|
-
const strategyName = String(row.strategy ?? "").trim();
|
|
180
|
-
const strategy = snapshots.get(strategyName);
|
|
181
|
-
if (!strategy || row.deploymentId !== deployment.id || row.accountId !== deployment.accountId || !runtimeLineageMatchesStrategySnapshot({
|
|
182
|
-
lineage: isRecord(row[lineageField]) ? row[lineageField] : void 0,
|
|
183
|
-
deployment,
|
|
184
|
-
strategy
|
|
185
|
-
})) {
|
|
186
|
-
throw new Error(
|
|
187
|
-
`Runtime evidence ${label} row is outside the current embedded deployment lineage`
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
assertRows(
|
|
193
|
-
"trade",
|
|
194
|
-
unwrapRuntimeEvidenceRows(runtime.trades, "trade"),
|
|
195
|
-
"runtimeLineage"
|
|
196
|
-
);
|
|
197
|
-
assertRows(
|
|
198
|
-
"signal",
|
|
199
|
-
unwrapRuntimeEvidenceRows(runtime.signals, "signal"),
|
|
200
|
-
"runtimeLineage"
|
|
201
|
-
);
|
|
202
|
-
assertRows(
|
|
203
|
-
"evaluation",
|
|
204
|
-
unwrapRuntimeEvidenceRows(runtime.evaluations, "evaluation"),
|
|
205
|
-
"runtimeLineage"
|
|
206
|
-
);
|
|
207
|
-
assertRows(
|
|
208
|
-
"lineage scope",
|
|
209
|
-
unwrapRuntimeEvidenceRows(runtime.lineageScopes, "lineageScope"),
|
|
210
|
-
"lineage"
|
|
211
|
-
);
|
|
212
|
-
return deployment;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
// src/lib/runtimeEvidenceArtifacts.ts
|
|
216
|
-
var RUNTIME_EVIDENCE_MANIFEST_FILE = "manifest.json";
|
|
217
|
-
var RUNTIME_EVIDENCE_PAYLOAD_FILE = "runtime-evidence.json";
|
|
218
|
-
var RUNTIME_EVIDENCE_COMPLETE_FILE = ".complete";
|
|
219
|
-
var asRecord = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
220
|
-
var sha256 = (value) => (0, import_node_crypto.createHash)("sha256").update(value).digest("hex");
|
|
221
|
-
var assertFiniteTimestamp = (value, label) => {
|
|
222
|
-
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
223
|
-
throw new Error(`Invalid runtime evidence ${label}`);
|
|
224
|
-
}
|
|
225
|
-
return value;
|
|
226
|
-
};
|
|
227
|
-
var parseManifest = (value) => {
|
|
228
|
-
const manifest = asRecord(value);
|
|
229
|
-
const window = asRecord(manifest?.window);
|
|
230
|
-
const payload = asRecord(manifest?.payload);
|
|
231
|
-
const counts = asRecord(manifest?.counts);
|
|
232
|
-
if (manifest?.schemaVersion !== 1 || manifest.reportType !== "runtime-evidence" || typeof manifest.artifactId !== "string" || typeof manifest.deploymentId !== "string" || typeof manifest.userName !== "string" || typeof manifest.createdAt !== "number" || payload?.file !== RUNTIME_EVIDENCE_PAYLOAD_FILE || typeof payload.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(payload.sha256) || typeof payload.bytes !== "number" || !Array.isArray(manifest.lineageKeys)) {
|
|
233
|
-
throw new Error("Invalid runtime evidence manifest");
|
|
234
|
-
}
|
|
235
|
-
return {
|
|
236
|
-
schemaVersion: 1,
|
|
237
|
-
artifactId: manifest.artifactId,
|
|
238
|
-
reportType: "runtime-evidence",
|
|
239
|
-
deploymentId: manifest.deploymentId,
|
|
240
|
-
userName: manifest.userName,
|
|
241
|
-
createdAt: manifest.createdAt,
|
|
242
|
-
window: {
|
|
243
|
-
startTime: assertFiniteTimestamp(window?.startTime, "window.startTime"),
|
|
244
|
-
endTime: assertFiniteTimestamp(window?.endTime, "window.endTime")
|
|
245
|
-
},
|
|
246
|
-
payload: {
|
|
247
|
-
file: RUNTIME_EVIDENCE_PAYLOAD_FILE,
|
|
248
|
-
sha256: payload.sha256,
|
|
249
|
-
bytes: payload.bytes
|
|
250
|
-
},
|
|
251
|
-
counts: Object.fromEntries(
|
|
252
|
-
Object.entries(counts ?? {}).filter(
|
|
253
|
-
(entry) => typeof entry[1] === "number" && Number.isFinite(entry[1])
|
|
254
|
-
)
|
|
255
|
-
),
|
|
256
|
-
lineageKeys: manifest.lineageKeys.filter(
|
|
257
|
-
(value2) => typeof value2 === "string" && value2.length > 0
|
|
258
|
-
)
|
|
259
|
-
};
|
|
260
|
-
};
|
|
261
|
-
var verifyRuntimeEvidenceBundle = async (bundleDir) => {
|
|
262
|
-
const manifestPath = import_node_path.default.join(bundleDir, RUNTIME_EVIDENCE_MANIFEST_FILE);
|
|
263
|
-
const payloadPath = import_node_path.default.join(bundleDir, RUNTIME_EVIDENCE_PAYLOAD_FILE);
|
|
264
|
-
const completePath = import_node_path.default.join(bundleDir, RUNTIME_EVIDENCE_COMPLETE_FILE);
|
|
265
|
-
const [manifestText, payload, completeText] = await Promise.all([
|
|
266
|
-
import_promises.default.readFile(manifestPath, "utf8"),
|
|
267
|
-
import_promises.default.readFile(payloadPath),
|
|
268
|
-
import_promises.default.readFile(completePath, "utf8")
|
|
269
|
-
]);
|
|
270
|
-
const manifest = parseManifest(JSON.parse(manifestText));
|
|
271
|
-
if (completeText.trim() !== manifest.artifactId) {
|
|
272
|
-
throw new Error(`Invalid completion marker in ${bundleDir}`);
|
|
273
|
-
}
|
|
274
|
-
if (payload.byteLength !== manifest.payload.bytes) {
|
|
275
|
-
throw new Error(`Runtime evidence size mismatch in ${bundleDir}`);
|
|
276
|
-
}
|
|
277
|
-
if (sha256(payload) !== manifest.payload.sha256) {
|
|
278
|
-
throw new Error(`Runtime evidence checksum mismatch in ${bundleDir}`);
|
|
279
|
-
}
|
|
280
|
-
const artifact = asRecord(JSON.parse(payload.toString("utf8")));
|
|
281
|
-
const artifactWindow = asRecord(artifact?.window);
|
|
282
|
-
if (artifact?.reportType !== "runtime-evidence" || artifactWindow?.startTime !== manifest.window.startTime || artifactWindow.endTime !== manifest.window.endTime) {
|
|
283
|
-
throw new Error(`Runtime evidence payload mismatch in ${bundleDir}`);
|
|
284
|
-
}
|
|
285
|
-
const deployment = assertCurrentRuntimeEvidenceArtifact(artifact);
|
|
286
|
-
if (deployment.id !== manifest.deploymentId) {
|
|
287
|
-
throw new Error(`Runtime evidence deployment mismatch in ${bundleDir}`);
|
|
288
|
-
}
|
|
289
|
-
return {
|
|
290
|
-
bundleDir,
|
|
291
|
-
manifestPath,
|
|
292
|
-
payloadPath,
|
|
293
|
-
manifest,
|
|
294
|
-
artifact
|
|
295
|
-
};
|
|
296
|
-
};
|
|
297
|
-
var discoverRuntimeEvidenceBundles = async (rootDir) => {
|
|
298
|
-
const bundles = [];
|
|
299
|
-
const visit = async (directory, depth) => {
|
|
300
|
-
if (depth > 8) return;
|
|
301
|
-
let entries;
|
|
302
|
-
try {
|
|
303
|
-
entries = await import_promises.default.readdir(directory, { withFileTypes: true });
|
|
304
|
-
} catch (error) {
|
|
305
|
-
if (error.code === "ENOENT") return;
|
|
306
|
-
throw error;
|
|
307
|
-
}
|
|
308
|
-
const names = new Set(entries.map((entry) => entry.name));
|
|
309
|
-
if (names.has(RUNTIME_EVIDENCE_MANIFEST_FILE) && names.has(RUNTIME_EVIDENCE_PAYLOAD_FILE) && names.has(RUNTIME_EVIDENCE_COMPLETE_FILE)) {
|
|
310
|
-
bundles.push(directory);
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
await Promise.all(
|
|
314
|
-
entries.filter(
|
|
315
|
-
(entry) => entry.isDirectory() && !entry.name.startsWith(".") && !entry.name.includes(".tmp-")
|
|
316
|
-
).map((entry) => visit(import_node_path.default.join(directory, entry.name), depth + 1))
|
|
317
|
-
);
|
|
318
|
-
};
|
|
319
|
-
await visit(rootDir, 0);
|
|
320
|
-
return bundles.sort();
|
|
321
|
-
};
|
|
53
|
+
var runtimeEvidenceDeployment_exports = {};
|
|
54
|
+
__reExport(runtimeEvidenceDeployment_exports, require("@tradejs/node/diagnostics"));
|
|
322
55
|
|
|
323
56
|
// src/lib/runtimeEvidenceSync.ts
|
|
324
57
|
var execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
|
|
@@ -351,23 +84,23 @@ var buildRuntimeEvidenceRsyncArgs = ({
|
|
|
351
84
|
withTrailingSlash(source),
|
|
352
85
|
withTrailingSlash(destination)
|
|
353
86
|
];
|
|
354
|
-
var receiptPath = (receiptsRoot, artifactId) =>
|
|
87
|
+
var receiptPath = (receiptsRoot, artifactId) => import_node_path.default.join(receiptsRoot, `${safeSegment(artifactId, "artifact")}.json`);
|
|
355
88
|
var compareBundles = (left, right) => left.manifest.window.endTime - right.manifest.window.endTime || left.manifest.createdAt - right.manifest.createdAt;
|
|
356
89
|
var listPendingRuntimeEvidenceBundles = async ({
|
|
357
90
|
evidenceRoot,
|
|
358
91
|
deploymentId
|
|
359
92
|
}) => {
|
|
360
93
|
const safeDeploymentId = safeSegment(deploymentId, "production");
|
|
361
|
-
const artifactsRoot =
|
|
362
|
-
const receiptsRoot =
|
|
363
|
-
const bundles = await discoverRuntimeEvidenceBundles(artifactsRoot);
|
|
94
|
+
const artifactsRoot = import_node_path.default.join(evidenceRoot, "artifacts", safeDeploymentId);
|
|
95
|
+
const receiptsRoot = import_node_path.default.join(evidenceRoot, "receipts", safeDeploymentId);
|
|
96
|
+
const bundles = await (0, runtimeEvidenceArtifacts_exports.discoverRuntimeEvidenceBundles)(artifactsRoot);
|
|
364
97
|
const pending = [];
|
|
365
98
|
for (const bundleDir of bundles) {
|
|
366
|
-
const verified = await verifyRuntimeEvidenceBundle(bundleDir);
|
|
99
|
+
const verified = await (0, runtimeEvidenceArtifacts_exports.verifyRuntimeEvidenceBundle)(bundleDir);
|
|
367
100
|
if (verified.manifest.deploymentId !== safeDeploymentId) continue;
|
|
368
|
-
assertCurrentRuntimeEvidenceArtifact(verified.artifact);
|
|
101
|
+
(0, runtimeEvidenceDeployment_exports.assertCurrentRuntimeEvidenceArtifact)(verified.artifact);
|
|
369
102
|
try {
|
|
370
|
-
await
|
|
103
|
+
await import_promises.default.access(receiptPath(receiptsRoot, verified.manifest.artifactId));
|
|
371
104
|
continue;
|
|
372
105
|
} catch (error) {
|
|
373
106
|
if (error.code !== "ENOENT") throw error;
|
|
@@ -388,46 +121,46 @@ var syncRuntimeEvidenceBundles = async ({
|
|
|
388
121
|
}
|
|
389
122
|
}) => {
|
|
390
123
|
const safeDeploymentId = safeSegment(deploymentId, "production");
|
|
391
|
-
const inboxRoot =
|
|
392
|
-
const artifactsRoot =
|
|
124
|
+
const inboxRoot = import_node_path.default.join(evidenceRoot, "inbox", safeDeploymentId);
|
|
125
|
+
const artifactsRoot = import_node_path.default.join(evidenceRoot, "artifacts", safeDeploymentId);
|
|
393
126
|
await Promise.all([
|
|
394
|
-
|
|
395
|
-
|
|
127
|
+
import_promises.default.mkdir(inboxRoot, { recursive: true }),
|
|
128
|
+
import_promises.default.mkdir(artifactsRoot, { recursive: true })
|
|
396
129
|
]);
|
|
397
130
|
const rsyncArgs = buildRuntimeEvidenceRsyncArgs({
|
|
398
131
|
source,
|
|
399
132
|
destination: inboxRoot
|
|
400
133
|
});
|
|
401
134
|
const transfer = await runRsync(rsyncArgs);
|
|
402
|
-
const discovered = await discoverRuntimeEvidenceBundles(inboxRoot);
|
|
135
|
+
const discovered = await (0, runtimeEvidenceArtifacts_exports.discoverRuntimeEvidenceBundles)(inboxRoot);
|
|
403
136
|
const received = [];
|
|
404
137
|
for (const bundleDir of discovered) {
|
|
405
|
-
const verified = await verifyRuntimeEvidenceBundle(bundleDir);
|
|
138
|
+
const verified = await (0, runtimeEvidenceArtifacts_exports.verifyRuntimeEvidenceBundle)(bundleDir);
|
|
406
139
|
if (verified.manifest.deploymentId !== safeDeploymentId) {
|
|
407
140
|
throw new Error(
|
|
408
141
|
`Artifact deployment mismatch: expected ${safeDeploymentId}, received ${verified.manifest.deploymentId}`
|
|
409
142
|
);
|
|
410
143
|
}
|
|
411
|
-
assertCurrentRuntimeEvidenceArtifact(verified.artifact);
|
|
412
|
-
const destinationDir =
|
|
144
|
+
(0, runtimeEvidenceDeployment_exports.assertCurrentRuntimeEvidenceArtifact)(verified.artifact);
|
|
145
|
+
const destinationDir = import_node_path.default.join(
|
|
413
146
|
artifactsRoot,
|
|
414
147
|
...dateParts(verified.manifest.window.endTime),
|
|
415
148
|
safeSegment(verified.manifest.artifactId, "artifact")
|
|
416
149
|
);
|
|
417
|
-
await
|
|
150
|
+
await import_promises.default.mkdir(import_node_path.default.dirname(destinationDir), { recursive: true });
|
|
418
151
|
try {
|
|
419
|
-
await
|
|
152
|
+
await import_promises.default.rename(bundleDir, destinationDir);
|
|
420
153
|
} catch (error) {
|
|
421
154
|
if (!isExistingDestinationError(error)) throw error;
|
|
422
|
-
const existing = await verifyRuntimeEvidenceBundle(destinationDir);
|
|
155
|
+
const existing = await (0, runtimeEvidenceArtifacts_exports.verifyRuntimeEvidenceBundle)(destinationDir);
|
|
423
156
|
if (existing.manifest.payload.sha256 !== verified.manifest.payload.sha256) {
|
|
424
157
|
throw new Error(
|
|
425
158
|
`Conflicting runtime evidence artifact ${verified.manifest.artifactId}`
|
|
426
159
|
);
|
|
427
160
|
}
|
|
428
|
-
await
|
|
161
|
+
await import_promises.default.rm(bundleDir, { recursive: true, force: true });
|
|
429
162
|
}
|
|
430
|
-
received.push(await verifyRuntimeEvidenceBundle(destinationDir));
|
|
163
|
+
received.push(await (0, runtimeEvidenceArtifacts_exports.verifyRuntimeEvidenceBundle)(destinationDir));
|
|
431
164
|
}
|
|
432
165
|
const pending = await listPendingRuntimeEvidenceBundles({
|
|
433
166
|
evidenceRoot,
|
|
@@ -467,7 +200,7 @@ var runtimeEvidenceSync = async () => {
|
|
|
467
200
|
"Provide --source or RUNTIME_EVIDENCE_RSYNC_SOURCE for runtime evidence sync."
|
|
468
201
|
);
|
|
469
202
|
}
|
|
470
|
-
const evidenceRoot =
|
|
203
|
+
const evidenceRoot = import_node_path2.default.resolve(projectRoot, String(flags.dir));
|
|
471
204
|
const result = await syncRuntimeEvidenceBundles({
|
|
472
205
|
source,
|
|
473
206
|
evidenceRoot,
|
|
@@ -17,6 +17,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
21
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
22
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
23
|
// file that has been converted to a CommonJS file using a Babel-
|
|
@@ -34,192 +35,13 @@ __export(runtimeFeedbackNotify_exports, {
|
|
|
34
35
|
runtimeFeedbackNotify: () => runtimeFeedbackNotify
|
|
35
36
|
});
|
|
36
37
|
module.exports = __toCommonJS(runtimeFeedbackNotify_exports);
|
|
37
|
-
var
|
|
38
|
+
var import_node_path = __toESM(require("path"));
|
|
38
39
|
var import_args = __toESM(require("args"));
|
|
39
40
|
var import_chalk = __toESM(require("chalk"));
|
|
40
41
|
|
|
41
42
|
// src/lib/runtimeFeedbackArtifacts.ts
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
var import_node_path3 = __toESM(require("path"));
|
|
45
|
-
|
|
46
|
-
// src/lib/runtimeEvidenceDeployment.ts
|
|
47
|
-
var import_runtimeStrategies = require("@tradejs/node/runtimeStrategies");
|
|
48
|
-
var isRecord = (value) => value != null && typeof value === "object" && !Array.isArray(value);
|
|
49
|
-
var isNonEmptyString = (value) => typeof value === "string" && value.trim().length > 0;
|
|
50
|
-
var isPackageVersionMap = (value) => isRecord(value) && Object.keys(value).length > 0 && Object.entries(value).every(
|
|
51
|
-
([name, version]) => name.startsWith("@tradejs/") && isNonEmptyString(version)
|
|
52
|
-
);
|
|
53
|
-
var INTERVALS = /* @__PURE__ */ new Set([
|
|
54
|
-
"1",
|
|
55
|
-
"3",
|
|
56
|
-
"5",
|
|
57
|
-
"15",
|
|
58
|
-
"30",
|
|
59
|
-
"60",
|
|
60
|
-
"120",
|
|
61
|
-
"240",
|
|
62
|
-
"360",
|
|
63
|
-
"720",
|
|
64
|
-
"D",
|
|
65
|
-
"W",
|
|
66
|
-
"M"
|
|
67
|
-
]);
|
|
68
|
-
var UNIVERSES = /* @__PURE__ */ new Set(["crypto", "tradfi"]);
|
|
69
|
-
var isRuntimeStrategySelection = (value) => value === void 0 || isRecord(value) && Object.keys(value).length === 1 && Object.keys(value).every((key) => key === "tickers") && Array.isArray(value.tickers) && value.tickers.length > 0 && value.tickers.every((ticker) => isNonEmptyString(ticker));
|
|
70
|
-
var parseRuntimeEvidenceDeploymentSnapshot = (value) => {
|
|
71
|
-
if (!isRecord(value) || value.schemaVersion !== 2 || !isNonEmptyString(value.id) || !isNonEmptyString(value.deploymentCompositionId) || !/^dc1:[a-f0-9]{16}$/.test(value.deploymentCompositionId) || !isNonEmptyString(value.label) || !isNonEmptyString(value.connectorName) || !isNonEmptyString(value.provider) || !isNonEmptyString(value.accountId) || typeof value.enabled !== "boolean" || !Array.isArray(value.strategies)) {
|
|
72
|
-
throw new Error(
|
|
73
|
-
"Runtime evidence deployment snapshot is missing or invalid"
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
const strategies = value.strategies.map((candidate) => {
|
|
77
|
-
if (!isRecord(candidate) || !isNonEmptyString(candidate.strategyName) || !isNonEmptyString(candidate.strategyRevision) || !/^sr1:[a-f0-9]{16}$/.test(candidate.strategyRevision) || typeof candidate.enabled !== "boolean" || !["active", "entries_paused"].includes(String(candidate.controlState)) || !INTERVALS.has(String(candidate.interval)) || !UNIVERSES.has(String(candidate.universe)) || !isNonEmptyString(candidate.strategyPackage) || !isNonEmptyString(candidate.strategyPackageVersion) || !isPackageVersionMap(candidate.strategyDependencyVersions) || !isNonEmptyString(candidate.runtimePackageVersion) || !isRecord(candidate.strategyConfig) || !isRuntimeStrategySelection(candidate.selection)) {
|
|
78
|
-
throw new Error(
|
|
79
|
-
"Runtime evidence deployment strategy snapshot is invalid"
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
if (String(candidate.strategyConfig.INTERVAL) !== String(candidate.interval) || String(candidate.strategyConfig.UNIVERSE) !== String(candidate.universe)) {
|
|
83
|
-
throw new Error(
|
|
84
|
-
`Runtime evidence strategy config does not match its scope: ${candidate.strategyName}`
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
if (candidate.accountId != null && (!isNonEmptyString(candidate.accountId) || candidate.accountId !== value.accountId)) {
|
|
88
|
-
throw new Error(
|
|
89
|
-
`Runtime evidence strategy account does not match deployment: ${candidate.strategyName}`
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
return candidate;
|
|
93
|
-
});
|
|
94
|
-
const identities = /* @__PURE__ */ new Set();
|
|
95
|
-
for (const strategy of strategies) {
|
|
96
|
-
if (identities.has(strategy.strategyName)) {
|
|
97
|
-
throw new Error(
|
|
98
|
-
`Duplicate runtime evidence strategy: ${strategy.strategyName}`
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
identities.add(strategy.strategyName);
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
...value,
|
|
105
|
-
strategies
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
var activeRuntimeEvidenceStrategies = (deployment) => deployment.enabled ? deployment.strategies.filter((strategy) => strategy.enabled) : [];
|
|
109
|
-
|
|
110
|
-
// src/lib/runtimeEvidenceArtifacts.ts
|
|
111
|
-
var import_node_crypto = require("crypto");
|
|
112
|
-
var import_promises = __toESM(require("fs/promises"));
|
|
113
|
-
var import_node_path = __toESM(require("path"));
|
|
114
|
-
|
|
115
|
-
// src/lib/runtimeEvidenceProducer.ts
|
|
116
|
-
var import_node_crypto2 = require("crypto");
|
|
117
|
-
var import_promises2 = __toESM(require("fs/promises"));
|
|
118
|
-
var import_node_path2 = __toESM(require("path"));
|
|
119
|
-
var isRecord2 = (value) => value != null && typeof value === "object" && !Array.isArray(value);
|
|
120
|
-
var parseRuntimeEvidenceProducer = (value) => {
|
|
121
|
-
const producer = isRecord2(value) ? value : null;
|
|
122
|
-
const runtimePackageManifest = isRecord2(producer?.runtimePackageManifest) ? producer.runtimePackageManifest : null;
|
|
123
|
-
if (producer?.schemaVersion !== 1 || typeof producer.projectSha !== "string" || !/^[a-f0-9]{40}$/.test(producer.projectSha) || typeof producer.imageDigest !== "string" || !/^sha256:[a-f0-9]{64}$/.test(producer.imageDigest) || runtimePackageManifest?.file !== "runtime-package-manifest.json" || typeof runtimePackageManifest.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(runtimePackageManifest.sha256)) {
|
|
124
|
-
throw new Error("Runtime evidence producer image identity is invalid");
|
|
125
|
-
}
|
|
126
|
-
return producer;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
// src/lib/runtimeFeedbackArtifacts.ts
|
|
130
|
-
var RUNTIME_FEEDBACK_MANIFEST_FILE = "manifest.json";
|
|
131
|
-
var RUNTIME_FEEDBACK_REPLAY_FILE = "replay-runtime-evidence.json";
|
|
132
|
-
var RUNTIME_FEEDBACK_LOG_FILE = "replay.log";
|
|
133
|
-
var RUNTIME_FEEDBACK_COMPLETE_FILE = ".complete";
|
|
134
|
-
var isRecord3 = (value) => value != null && typeof value === "object" && !Array.isArray(value);
|
|
135
|
-
var sha256 = (value) => (0, import_node_crypto3.createHash)("sha256").update(value).digest("hex");
|
|
136
|
-
var parsePayload = (value, expectedFile) => {
|
|
137
|
-
const payload = isRecord3(value) ? value : null;
|
|
138
|
-
if (payload?.file !== expectedFile || typeof payload.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(payload.sha256) || typeof payload.bytes !== "number" || !Number.isFinite(payload.bytes) || payload.bytes < 0) {
|
|
139
|
-
throw new Error(`Invalid runtime feedback payload: ${expectedFile}`);
|
|
140
|
-
}
|
|
141
|
-
return payload;
|
|
142
|
-
};
|
|
143
|
-
var parseManifest = (value) => {
|
|
144
|
-
const manifest = isRecord3(value) ? value : null;
|
|
145
|
-
const window = isRecord3(manifest?.window) ? manifest.window : null;
|
|
146
|
-
const runtimeEvidence = isRecord3(manifest?.runtimeEvidence) ? manifest.runtimeEvidence : null;
|
|
147
|
-
const safety = isRecord3(manifest?.safety) ? manifest.safety : null;
|
|
148
|
-
const payloads = isRecord3(manifest?.payloads) ? manifest.payloads : null;
|
|
149
|
-
if (manifest?.schemaVersion !== 1 || manifest.reportType !== "runtime-feedback-replay" || typeof manifest.artifactId !== "string" || !manifest.artifactId.trim() || typeof manifest.runId !== "string" || !manifest.runId.trim() || typeof manifest.deploymentId !== "string" || !manifest.deploymentId.trim() || typeof manifest.deploymentCompositionId !== "string" || !/^dc1:[a-f0-9]{16}$/.test(manifest.deploymentCompositionId) || typeof manifest.userName !== "string" || !manifest.userName.trim() || typeof manifest.createdAt !== "number" || typeof window?.startTime !== "number" || typeof window.endTime !== "number" || typeof runtimeEvidence?.artifactId !== "string" || typeof runtimeEvidence.payloadSha256 !== "string" || !/^[a-f0-9]{64}$/.test(runtimeEvidence.payloadSha256) || !Array.isArray(manifest.activeStrategies) || manifest.activeStrategies.length === 0 || !manifest.activeStrategies.every(
|
|
150
|
-
(strategy) => typeof strategy === "string" && strategy.trim()
|
|
151
|
-
) || typeof manifest.cycleCount !== "number" || !Number.isFinite(manifest.cycleCount) || manifest.cycleCount <= 0 || safety?.cacheOnly !== true || safety.externalOrderPlacement !== false || safety.redis !== "isolated" || safety.timescale !== "read_only") {
|
|
152
|
-
throw new Error("Invalid runtime feedback replay manifest");
|
|
153
|
-
}
|
|
154
|
-
const replayEvidence = parsePayload(
|
|
155
|
-
payloads?.replayEvidence,
|
|
156
|
-
RUNTIME_FEEDBACK_REPLAY_FILE
|
|
157
|
-
);
|
|
158
|
-
const log = parsePayload(payloads?.log, RUNTIME_FEEDBACK_LOG_FILE);
|
|
159
|
-
return {
|
|
160
|
-
...manifest,
|
|
161
|
-
producer: parseRuntimeEvidenceProducer(manifest.producer),
|
|
162
|
-
payloads: {
|
|
163
|
-
replayEvidence: {
|
|
164
|
-
...replayEvidence,
|
|
165
|
-
file: RUNTIME_FEEDBACK_REPLAY_FILE
|
|
166
|
-
},
|
|
167
|
-
log: { ...log, file: RUNTIME_FEEDBACK_LOG_FILE }
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
var verifyRuntimeFeedbackReplayBundle = async (bundleDir) => {
|
|
172
|
-
const manifestPath = import_node_path3.default.join(bundleDir, RUNTIME_FEEDBACK_MANIFEST_FILE);
|
|
173
|
-
const replayEvidencePath = import_node_path3.default.join(bundleDir, RUNTIME_FEEDBACK_REPLAY_FILE);
|
|
174
|
-
const logPath = import_node_path3.default.join(bundleDir, RUNTIME_FEEDBACK_LOG_FILE);
|
|
175
|
-
const completePath = import_node_path3.default.join(bundleDir, RUNTIME_FEEDBACK_COMPLETE_FILE);
|
|
176
|
-
const [manifestText, replayPayload, logPayload, completeText] = await Promise.all([
|
|
177
|
-
import_promises3.default.readFile(manifestPath, "utf8"),
|
|
178
|
-
import_promises3.default.readFile(replayEvidencePath),
|
|
179
|
-
import_promises3.default.readFile(logPath),
|
|
180
|
-
import_promises3.default.readFile(completePath, "utf8")
|
|
181
|
-
]);
|
|
182
|
-
const manifest = parseManifest(JSON.parse(manifestText));
|
|
183
|
-
if (completeText.trim() !== manifest.artifactId) {
|
|
184
|
-
throw new Error(`Invalid runtime feedback completion marker: ${bundleDir}`);
|
|
185
|
-
}
|
|
186
|
-
for (const [payload, descriptor] of [
|
|
187
|
-
[replayPayload, manifest.payloads.replayEvidence],
|
|
188
|
-
[logPayload, manifest.payloads.log]
|
|
189
|
-
]) {
|
|
190
|
-
if (payload.byteLength !== descriptor.bytes) {
|
|
191
|
-
throw new Error(
|
|
192
|
-
`Runtime feedback payload size mismatch: ${descriptor.file}`
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
if (sha256(payload) !== descriptor.sha256) {
|
|
196
|
-
throw new Error(
|
|
197
|
-
`Runtime feedback payload checksum mismatch: ${descriptor.file}`
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
const replayEvidence = JSON.parse(replayPayload.toString("utf8"));
|
|
202
|
-
if (replayEvidence.reportType !== "replay-runtime-evidence") {
|
|
203
|
-
throw new Error("Invalid runtime feedback replay evidence payload");
|
|
204
|
-
}
|
|
205
|
-
const replayWindow = isRecord3(replayEvidence.window) ? replayEvidence.window : null;
|
|
206
|
-
const replay = isRecord3(replayEvidence.replay) ? replayEvidence.replay : null;
|
|
207
|
-
const replayDeployment = parseRuntimeEvidenceDeploymentSnapshot(
|
|
208
|
-
replayEvidence.deployment
|
|
209
|
-
);
|
|
210
|
-
const replayStrategies = activeRuntimeEvidenceStrategies(replayDeployment).map(({ strategyName }) => strategyName).sort();
|
|
211
|
-
if (replayEvidence.userName !== manifest.userName || replayWindow?.startTime !== manifest.window.startTime || replayWindow.endTime !== manifest.window.endTime || replayDeployment.id !== manifest.deploymentId || replayDeployment.deploymentCompositionId !== manifest.deploymentCompositionId || Number(replay?.cycleCount) !== manifest.cycleCount || JSON.stringify(replayStrategies) !== JSON.stringify([...manifest.activeStrategies].sort())) {
|
|
212
|
-
throw new Error("Runtime feedback replay payload does not match manifest");
|
|
213
|
-
}
|
|
214
|
-
return {
|
|
215
|
-
bundleDir,
|
|
216
|
-
manifestPath,
|
|
217
|
-
replayEvidencePath,
|
|
218
|
-
logPath,
|
|
219
|
-
manifest,
|
|
220
|
-
replayEvidence
|
|
221
|
-
};
|
|
222
|
-
};
|
|
43
|
+
var runtimeFeedbackArtifacts_exports = {};
|
|
44
|
+
__reExport(runtimeFeedbackArtifacts_exports, require("@tradejs/node/diagnostics"));
|
|
223
45
|
|
|
224
46
|
// src/lib/telegramReports.ts
|
|
225
47
|
var import_cli = require("@tradejs/node/cli");
|
|
@@ -291,8 +113,8 @@ ${chunk}`, {
|
|
|
291
113
|
};
|
|
292
114
|
|
|
293
115
|
// src/lib/runtimeFeedbackNotification.ts
|
|
294
|
-
var
|
|
295
|
-
var asRecord = (value) =>
|
|
116
|
+
var isRecord = (value) => value != null && typeof value === "object" && !Array.isArray(value);
|
|
117
|
+
var asRecord = (value) => isRecord(value) ? value : {};
|
|
296
118
|
var asArray = (value) => Array.isArray(value) ? value.map(asRecord) : [];
|
|
297
119
|
var finiteNumber = (value, fallback = 0) => {
|
|
298
120
|
const number = Number(value);
|
|
@@ -329,7 +151,7 @@ var buildRuntimeFeedbackTelegramMessage = (replayEvidence) => {
|
|
|
329
151
|
const endTime = requiredTimestamp(window.endTime, "window.endTime");
|
|
330
152
|
const deployment = asRecord(replayEvidence.deployment);
|
|
331
153
|
const replay = asRecord(replayEvidence.replay);
|
|
332
|
-
if (!
|
|
154
|
+
if (!isRecord(replay.runtimeComparison) || !isRecord(replay.runtimeComparison.counts) || !Array.isArray(replay.runtimeComparison.rows) || !isRecord(replay.runtimeComparison.lineage)) {
|
|
333
155
|
throw new Error("Runtime feedback replay comparison is missing");
|
|
334
156
|
}
|
|
335
157
|
const comparison = asRecord(replay.runtimeComparison);
|
|
@@ -399,7 +221,7 @@ var notifyRuntimeFeedbackBundle = async ({
|
|
|
399
221
|
bundleDir,
|
|
400
222
|
send = sendTelegramReport
|
|
401
223
|
}) => {
|
|
402
|
-
const verified = await verifyRuntimeFeedbackReplayBundle(bundleDir);
|
|
224
|
+
const verified = await (0, runtimeFeedbackArtifacts_exports.verifyRuntimeFeedbackReplayBundle)(bundleDir);
|
|
403
225
|
const message = buildRuntimeFeedbackTelegramMessage(verified.replayEvidence);
|
|
404
226
|
await send(message, { userName: verified.manifest.userName });
|
|
405
227
|
return {
|
|
@@ -419,9 +241,9 @@ var runtimeFeedbackNotify = async () => {
|
|
|
419
241
|
if (!bundle) {
|
|
420
242
|
throw new Error("Provide --bundle for runtime feedback notification.");
|
|
421
243
|
}
|
|
422
|
-
const bundleDir =
|
|
244
|
+
const bundleDir = import_node_path.default.resolve(projectRoot, bundle);
|
|
423
245
|
if (flags.dryRun) {
|
|
424
|
-
const verified = await verifyRuntimeFeedbackReplayBundle(bundleDir);
|
|
246
|
+
const verified = await (0, runtimeFeedbackArtifacts_exports.verifyRuntimeFeedbackReplayBundle)(bundleDir);
|
|
425
247
|
console.log(buildRuntimeFeedbackTelegramMessage(verified.replayEvidence));
|
|
426
248
|
return;
|
|
427
249
|
}
|