fix(lab): preserve replay view and restore SLAM semantics
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { LaboratoryFetch } from "./advancedResults";
|
||||
|
||||
const RESULT_ID = /^m49-tgs-full-shadow-[a-f0-9]{64}$/;
|
||||
const SEMANTIC_RESULT_ID = /^e47-semantic-slam-[a-f0-9]{64}$/;
|
||||
|
||||
export type M49TgsFullShadowStateCode = 0 | 1 | 2 | 3;
|
||||
|
||||
@@ -10,6 +11,7 @@ export interface M49TgsFullShadowResult {
|
||||
source: {
|
||||
sourcePackSha256: string;
|
||||
linkedVisualResultId: string;
|
||||
linkedSemanticResultId: string;
|
||||
};
|
||||
configuration: {
|
||||
configSha256: string;
|
||||
@@ -158,12 +160,20 @@ export async function fetchM49TgsFullShadowResult(
|
||||
const performance = objectValue(payload.performance, "M49 full performance");
|
||||
const acceptance = objectValue(payload.acceptance, "M49 full acceptance");
|
||||
const decision = objectValue(payload.decision, "M49 full decision");
|
||||
const linkedSemanticResultId = text(
|
||||
source.linked_semantic_result_id,
|
||||
"M49 full semantic result",
|
||||
);
|
||||
if (!SEMANTIC_RESULT_ID.test(linkedSemanticResultId)) {
|
||||
throw new M49TgsFullShadowContractError("M49 full semantic result: нарушена идентичность.");
|
||||
}
|
||||
return {
|
||||
resultId: text(payload.result_id, "M49 full result"),
|
||||
createdAtUtc: text(payload.created_at_utc, "M49 full created"),
|
||||
source: {
|
||||
sourcePackSha256: text(source.source_pack_sha256, "M49 full source pack"),
|
||||
linkedVisualResultId: text(source.linked_visual_result_id, "M49 full visual result"),
|
||||
linkedSemanticResultId,
|
||||
},
|
||||
configuration: {
|
||||
configSha256: text(configuration.config_sha256, "M49 full config"),
|
||||
|
||||
Reference in New Issue
Block a user