fix(lab): keep full route result indexable

This commit is contained in:
DCCONSTRUCTIONS
2026-08-29 13:54:40 +03:00
parent 9dec37a8a9
commit 0a0cde7b0e
5 changed files with 189 additions and 23 deletions
@@ -195,7 +195,13 @@ function fullRouteReview() {
height: 600,
timeline_start_seconds: 39.215263458,
timeline_end_seconds: 757.260263458,
frame_source_times_ns: Array.from({ length: 6830 }, (_, index) => 39_215_263_458 + index * 100_000_000),
timeline: {
path: "video/frame-source-times-ns.bin",
sha256: "5".repeat(64),
byte_length: 6830 * 8,
encoding: "uint64-le-nanoseconds",
frame_count: 6830,
},
ground_truth: false,
decode_repair: {
repaired_frame_count: 1,
@@ -301,17 +307,35 @@ test("vegetation LAB parses the full 004 pass inside the existing result contrac
catalogs: { goose: [], ravnoves: [] },
route_full_review: fullRouteReview(),
};
const timeline = new ArrayBuffer(6830 * 8);
const timelineView = new DataView(timeline);
for (let index = 0; index < 6830; index += 1) {
timelineView.setBigUint64(
index * 8,
BigInt(39_215_263_458 + index * 100_000_000),
true,
);
}
const result = await fetchVegetationShadowResult(resultId, {
fetcher: async () => new Response(JSON.stringify(payload), {
status: 200,
headers: { "Content-Type": "application/json" },
}),
fetcher: async (url) => String(url).endsWith("/route-timeline")
? new Response(timeline, {
status: 200,
headers: {
"Content-Type": "application/octet-stream",
ETag: `"${"5".repeat(64)}"`,
},
})
: new Response(JSON.stringify(payload), {
status: 200,
headers: { "Content-Type": "application/json" },
}),
});
assert.equal(result.routeVideo, null);
assert.equal(result.routeFullReview.frameCount, 6830);
assert.equal(result.routeFullReview.city.taxonomy.length, 16);
assert.equal(result.routeFullReview.vegetation.taxonomy.length, 64);
assert.equal(result.routeFullReview.decodeRepair.sequence, 6092);
assert.equal(result.routeFullReview.frameSourceTimesNs.length, 6830);
assert.equal(
vegetationFullRouteMaskUrl(resultId, "vegetation", 6829),
`/api/v1/laboratory/vegetation-shadow/${resultId}/route-masks/vegetation/6829`,