feat(lab): separate evidence catalogs and record methods

This commit is contained in:
DCCONSTRUCTIONS
2026-07-26 17:56:23 +03:00
parent e9ff29297b
commit 4db00b53f7
17 changed files with 670 additions and 24 deletions
@@ -21,6 +21,10 @@ function result(overrides = {}) {
frame_count: 4489,
timeline_start_seconds: 35.4,
timeline_end_seconds: 484.0,
profile: {
profile_id: "camera-first-local-surface-validation/v1",
},
producer_sha256: "e".repeat(64),
},
metrics: {
frames: {
@@ -57,7 +57,13 @@ function model(overrides = {}) {
timeline_start_seconds: 1,
timeline_end_seconds: 2,
},
surface_model: {},
surface_model: {
kind: "time-varying-rolling-local-plane",
profile: {
profile_id: "k1-vendor-map-dynamic-local-surface/v1",
},
},
producer_sha256: "e".repeat(64),
occupancy_policy: policy(),
metrics: {
frames: {
@@ -197,6 +197,25 @@ test("data recordings keep the compact session dropdown and laboratory results s
assert.match(workspaceSource, /e29-camera-geometry/);
});
test("source and laboratory catalogs are requested as disjoint backend projections", async () => {
const calls = [];
const fetcher = async (input) => {
calls.push(String(input));
return new Response(JSON.stringify({ items: [] }), {
status: 200,
headers: { "Content-Type": "application/json" },
});
};
await fetchObservationSessionCatalog({ limit: 100, scope: "source", fetcher });
await fetchObservationSessionCatalog({ limit: 100, scope: "laboratory", fetcher });
assert.deepEqual(calls, [
"/api/v1/observation-sessions?limit=100&scope=source",
"/api/v1/observation-sessions?limit=100&scope=laboratory",
]);
});
test("session catalog exposes authoritative background preparation state", () => {
const catalog = decodeObservationSessionCatalog({
items: [session({
@@ -45,6 +45,9 @@ test("every laboratory result uses the shared evidence template", async () => {
assert.match(source, /function LaboratoryWorkTemplate\(/);
assert.match(source, /function LaboratoryEvidence\(/);
assert.match(source, /function LaboratoryMethodCard\(/);
assert.match(source, /method:\s*ReactNode/);
assert.match(source, /data-evidence-kind=\{kind\}/);
assert.match(source, /data-viewer-focused=/);
assert.match(css, /height:\s*clamp\(42rem,\s*68vh,\s*58rem\)/);
assert.match(css, /resize:\s*vertical/);