fix: bind orientation prompt to runtime contract

This commit is contained in:
冰朔 2026-08-05 11:26:56 +08:00
commit b4d2660873
2 changed files with 39 additions and 2 deletions

View file

@ -43,6 +43,17 @@ function sourceFingerprint() {
return hash.digest("hex").slice(0, 16);
}
function orientationInstruction() {
return [
"只依据当前事件形成TCS事件语义、当前目的和一个或多个允许的signal不得按原文关键词扫描协议。",
"只输出一个JSON对象且必须精确包含schema,cycle_id,event_sha256,instance_id,event_semantics,current_purpose,signals。",
"schema必须等于guanghu.zhuyuan-tcs-event-orientation/v1。",
"cycle_id,event_sha256,instance_id必须原样复制runtime_input中的同名值。",
"signals必须是非空对象数组每一项必须包含字符串id和字符串whyid只能从runtime_input.orientation_contract.allowed_signals中选择。",
"不要把signals写成字符串数组不要省略schema。",
].join("\n");
}
function runRuntime(command, args) {
const result = spawnSync(process.execPath, [runtimePath, command, ...args], {
encoding: "utf8",
@ -196,8 +207,7 @@ export class ControllerEngine {
]);
const oriented = await this.generateValidated({
role: "tcs_event_orientation",
instruction:
"只依据当前事件形成TCS事件语义、当前目的和一个或多个允许的signal_id。不得按原文关键词扫描协议。",
instruction: orientationInstruction(),
input: {
...perceived.cycle.model_input,
cycle_id: perceived.cycle.cycle_id,