feat(lab): present chronological perception evidence
This commit is contained in:
@@ -0,0 +1,122 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import test, { after, before } from "node:test";
|
||||
import { createServer } from "vite";
|
||||
|
||||
let server;
|
||||
let fetchE46DTemporalFailureAudit;
|
||||
|
||||
before(async () => {
|
||||
server = await createServer({
|
||||
server: { middlewareMode: true },
|
||||
appType: "custom",
|
||||
logLevel: "silent",
|
||||
});
|
||||
({ fetchE46DTemporalFailureAudit } = await server.ssrLoadModule(
|
||||
"/src/core/laboratory/e46dTemporalFailureAudit.ts",
|
||||
));
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await server?.close();
|
||||
});
|
||||
|
||||
test("E46D decodes ranked temporal clips without filesystem paths", async () => {
|
||||
const e46dId = `e46d-temporal-failure-audit-${"a".repeat(64)}`;
|
||||
const e46cId = `e46c-full-replay-world-tracks-${"b".repeat(64)}`;
|
||||
const e26Id = `e10-integrated-perception-${"c".repeat(64)}`;
|
||||
const clip = {
|
||||
schema_version: "missioncore.e46d-temporal-review-clip/v1",
|
||||
clip_id: `e46d-clip-01-${"d".repeat(20)}`,
|
||||
rank: 1,
|
||||
priority: "critical",
|
||||
kind: "layer-blackout",
|
||||
signal_id: `e46d-signal-${"d".repeat(20)}`,
|
||||
start_seconds: 472.7,
|
||||
event_start_seconds: 474.7,
|
||||
event_end_seconds: 475.6,
|
||||
end_seconds: 477.6,
|
||||
start_frame: 4396,
|
||||
end_frame: 4405,
|
||||
route_track_ids: [1584, 1615],
|
||||
world_track_ids: [],
|
||||
evidence: {
|
||||
before_object_count: 10,
|
||||
minimum_object_count: 0,
|
||||
after_object_count: 9,
|
||||
duration_seconds: 1,
|
||||
zero_frame_count: 10,
|
||||
},
|
||||
};
|
||||
const metrics = {
|
||||
route_frame_count: 4489,
|
||||
route_span_seconds: 448.623,
|
||||
object_observation_count: 20513,
|
||||
route_track_count: 1461,
|
||||
zero_object_frame_count: 600,
|
||||
zero_object_frame_fraction: 0.133660058,
|
||||
camera_held_observation_count: 5371,
|
||||
camera_held_observation_fraction: 0.261833959,
|
||||
detector_hold_episode_count: 785,
|
||||
layer_blackout_episode_count: 71,
|
||||
route_layer_gap_episode_count: 964,
|
||||
route_id_rebirth_candidate_count: 11,
|
||||
bbox_jump_episode_count: 3,
|
||||
motion_state_flap_episode_count: 88,
|
||||
world_binding_flap_episode_count: 238,
|
||||
short_route_track_count: 572,
|
||||
short_route_track_fraction: 0.391512663,
|
||||
short_track_burst_episode_count: 48,
|
||||
failure_signal_count: 2208,
|
||||
review_clip_count: 1,
|
||||
temporal_continuity_passed: false,
|
||||
};
|
||||
const fetcher = async () => new Response(JSON.stringify({
|
||||
schema_version: "missioncore.e46d-temporal-failure-audit-catalog/v1",
|
||||
items: [{
|
||||
schema_version: "missioncore.e46d-temporal-failure-audit-view/v1",
|
||||
result_id: e46dId,
|
||||
created_at_utc: "2026-08-04T08:00:00Z",
|
||||
source_e46c_result_id: e46cId,
|
||||
source_e26_result_id: e26Id,
|
||||
metrics,
|
||||
acceptance: {
|
||||
full_route_accounted: true,
|
||||
temporal_continuity_passed: false,
|
||||
independent_truth_available: false,
|
||||
navigation_or_safety_accepted: false,
|
||||
},
|
||||
decision: {
|
||||
temporal_regression_confirmed: true,
|
||||
detector_gap_visible: true,
|
||||
route_fragmentation_visible: true,
|
||||
world_binding_instability_visible: true,
|
||||
next_action: "rerun A/B",
|
||||
},
|
||||
limitations: ["diagnostic, not truth"],
|
||||
review_clips: [clip],
|
||||
ground_truth: false,
|
||||
}],
|
||||
}), { status: 200, headers: { "Content-Type": "application/json" } });
|
||||
|
||||
const result = await fetchE46DTemporalFailureAudit({ fetcher });
|
||||
assert.equal(result.resultId, e46dId);
|
||||
assert.equal(result.metrics.layerBlackoutEpisodeCount, 71);
|
||||
assert.equal(result.reviewClips[0].kind, "layer-blackout");
|
||||
assert.equal(result.reviewClips[0].evidence.before_object_count, 10);
|
||||
assert.doesNotMatch(JSON.stringify(result), /Users|runtime|\\/);
|
||||
});
|
||||
|
||||
test("E46D reuses the admitted E46C video viewer and canonical LAB template", async () => {
|
||||
const [resultView, videoView] = await Promise.all([
|
||||
readFile(new URL("../src/workspaces/laboratory/E46DTemporalFailureAuditResult.tsx", import.meta.url), "utf8"),
|
||||
readFile(new URL("../src/workspaces/laboratory/E46CFullReplayWorldTracksVisual.tsx", import.meta.url), "utf8"),
|
||||
]);
|
||||
assert.match(resultView, /LaboratorySummary/);
|
||||
assert.match(resultView, /LaboratoryEvidence/);
|
||||
assert.match(resultView, /LaboratoryResultSummary/);
|
||||
assert.match(resultView, /E46CFullReplayWorldTracksVisual/);
|
||||
assert.match(resultView, /auditWindows=/);
|
||||
assert.match(videoView, /автоматически найденному эпизоду E46D/);
|
||||
assert.match(videoView, /RecordedVideoScene/);
|
||||
});
|
||||
Reference in New Issue
Block a user