fix: preserve sentinel timing through routed report access
This commit is contained in:
@@ -251,6 +251,13 @@ function compactSentinelReportRawPayload(
|
||||
reportJsonSha256: run.report_json_sha256 ?? run.reportJsonSha256 ?? artifact.reportJsonSha256 ?? null,
|
||||
findingCount: run.finding_count ?? run.findingCount ?? findings.length,
|
||||
artifactCount: run.artifact_count ?? run.artifactCount ?? artifact.artifactCount ?? null,
|
||||
durationMinutes: run.durationMinutes ?? run.runDurationMinutes ?? record(run.timing).durationMinutes ?? null,
|
||||
runDurationMinutes: run.runDurationMinutes ?? run.durationMinutes ?? record(run.timing).durationMinutes ?? null,
|
||||
durationSource: run.durationSource ?? record(run.timing).durationSource ?? null,
|
||||
scenarioCadenceMinutes: run.scenarioCadenceMinutes ?? record(run.timing).scenarioCadenceMinutes ?? null,
|
||||
scenarioMaxRunMinutes: run.scenarioMaxRunMinutes ?? record(run.timing).scenarioMaxRunMinutes ?? null,
|
||||
schedulerIntervalMinutes: run.schedulerIntervalMinutes ?? record(run.timing).schedulerIntervalMinutes ?? null,
|
||||
timing: pickFields(record(run.timing), ["startedAt", "finishedAt", "durationMs", "durationMinutes", "durationSource", "scenarioCadence", "scenarioCadenceMinutes", "scenarioMaxRunMinutes", "schedulerIntervalMinutes", "sourceOfTruth", "valuesRedacted"]),
|
||||
updatedAt: run.updated_at ?? run.updatedAt ?? null,
|
||||
valuesRedacted: true,
|
||||
},
|
||||
@@ -1311,7 +1318,7 @@ function compactSentinelServiceBodyJson(value: Record<string, unknown> | null):
|
||||
if (value === null || typeof value.renderedText !== "string") return value;
|
||||
return {
|
||||
...pickFields(value, ["ok", "view", "error", "availableViews", "valuesRedacted"]),
|
||||
run: pickFields(record(value.run), ["id", "scenario_id", "status", "node", "lane", "observer_id", "state_dir", "report_json_sha256", "finding_count", "artifact_count", "maintenance", "created_at", "updated_at"]),
|
||||
run: pickFields(record(value.run), ["id", "runId", "scenario_id", "scenarioId", "status", "node", "lane", "observer_id", "observerId", "state_dir", "stateDir", "report_json_sha256", "reportJsonSha256", "finding_count", "findingCount", "artifact_count", "artifactCount", "maintenance", "created_at", "createdAt", "updated_at", "updatedAt", "startedAt", "finishedAt", "durationMs", "runDurationMs", "durationMinutes", "runDurationMinutes", "durationSource", "scenarioCadence", "scenarioCadenceMinutes", "scenarioMaxRunMinutes", "schedulerIntervalMinutes", "timing"]),
|
||||
summary: pickFields(record(value.summary), ["reason", "status", "valuesRedacted"]),
|
||||
findings: Array.isArray(value.findings) ? value.findings.slice(0, 12) : [],
|
||||
renderedText: value.renderedText,
|
||||
|
||||
@@ -367,7 +367,7 @@ function sentinelRouteMismatch(config: WebProbeSentinelServiceConfig, pathname:
|
||||
const routeSegment = decodeURIComponent(match[1]);
|
||||
const nodePrefix = `${config.node.toLowerCase()}-`;
|
||||
const routeSentinelId = routeSegment.startsWith(nodePrefix) ? routeSegment.slice(nodePrefix.length) : routeSegment;
|
||||
if (routeSentinelId === config.sentinelId) return null;
|
||||
if (routeSegment === config.sentinelId || routeSentinelId === config.sentinelId) return null;
|
||||
return {
|
||||
ok: false,
|
||||
error: "sentinel-route-mismatch",
|
||||
|
||||
Reference in New Issue
Block a user