fix: bind orientation prompt to runtime contract
This commit is contained in:
parent
05aeab4817
commit
b4d2660873
2 changed files with 39 additions and 2 deletions
|
|
@ -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和字符串why,id只能从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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue