Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion loopx/control_plane/collaboration/steward_managed_mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { createHash } from "node:crypto";
import type { JsonObject } from "../runtime_decode.ts";
import { requireJsonObject, requireNonEmptyString } from "../runtime_decode.ts";
import { EffectRuntimeRequestError } from "../effect_runtime_errors.ts";
import { ENVELOPED_SHA256_PATTERN } from "../content_digest.ts";

export const STEWARD_MANAGED_ACTOR_SCHEMA = "loopx_steward_managed_actor_v0";
const AGENT_ID = "steward";
Expand Down Expand Up @@ -152,7 +153,7 @@ export function admitStewardManagedTurn(params: JsonObject): JsonObject {
throw new EffectRuntimeRequestError("report execution requires the original live subscription, window and task");
}
if (request.resume_turn_key !== undefined) {
if (typeof request.resume_turn_key !== "string" || !/^sha256:[a-f0-9]{64}$/.test(request.resume_turn_key)) {
if (typeof request.resume_turn_key !== "string" || !ENVELOPED_SHA256_PATTERN.test(request.resume_turn_key)) {
throw new EffectRuntimeRequestError("report recovery requires the original native Turn key");
}
// An already accepted worker retains its ordinary active-Turn fence.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const CANONICAL_CONSUMERS = [
"control_plane/collaboration/result_publication.ts",
"control_plane/collaboration/return_delivery.ts",
"control_plane/collaboration/semantic_request.ts",
"control_plane/collaboration/steward_managed_mode.ts",
"control_plane/collaboration/turn_context.ts",
"control_plane/coordination/authority_archive_read.ts",
"control_plane/coordination/authority_source.ts",
Expand Down
Loading