Enforce resolved execution context for deterministic actor policy
This commit is contained in:
@@ -11,6 +11,7 @@ export type ManifestPersona = {
|
||||
id: string;
|
||||
displayName: string;
|
||||
systemPromptTemplate: string;
|
||||
modelConstraint?: string;
|
||||
toolClearance: ToolClearancePolicy;
|
||||
};
|
||||
|
||||
@@ -147,10 +148,21 @@ function parsePersona(value: unknown): ManifestPersona {
|
||||
throw new Error("Manifest persona entry must be an object.");
|
||||
}
|
||||
|
||||
const modelConstraintRaw = value.modelConstraint;
|
||||
if (
|
||||
modelConstraintRaw !== undefined &&
|
||||
(typeof modelConstraintRaw !== "string" || modelConstraintRaw.trim().length === 0)
|
||||
) {
|
||||
throw new Error('Manifest persona field "modelConstraint" must be a non-empty string when provided.');
|
||||
}
|
||||
|
||||
return {
|
||||
id: readString(value, "id"),
|
||||
displayName: readString(value, "displayName"),
|
||||
systemPromptTemplate: readString(value, "systemPromptTemplate"),
|
||||
...(typeof modelConstraintRaw === "string"
|
||||
? { modelConstraint: modelConstraintRaw.trim() }
|
||||
: {}),
|
||||
toolClearance: parseToolClearance(value.toolClearance),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user