拆分Supervisor身份与回复合同
将Supervisor共享核心身份与最终回复规则拆成独立Prompt section 由manifest组合interaction和final-reply system prompt 让background planning只注入核心身份并移除final-reply user context重复合同 补齐请求级单次注入断言、构建期组合校验和边界文档
This commit is contained in:
@@ -39,6 +39,7 @@ struct PromptBundleManifest {
|
||||
struct PromptCompositions {
|
||||
runtime: Vec<String>,
|
||||
supervisor: Vec<String>,
|
||||
supervisor_chat: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
@@ -81,7 +82,7 @@ struct ProviderFragments {
|
||||
supervisor_delivery_convergence_repair: String,
|
||||
manifest_dag_wait_repair: String,
|
||||
delegated_playtest_repair: String,
|
||||
supervisor_chat_system: String,
|
||||
supervisor_identity_contract: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
@@ -216,6 +217,12 @@ pub fn compile_manifest(manifest_path: &Path) -> Result<CompiledPromptBundle, St
|
||||
§ions,
|
||||
&["$base", "$visualContract"],
|
||||
)?;
|
||||
validate_composition(
|
||||
"supervisorChat",
|
||||
&manifest.compositions.supervisor_chat,
|
||||
§ions,
|
||||
&[],
|
||||
)?;
|
||||
validate_section_reference(
|
||||
&manifest.variants.platform.default,
|
||||
§ions,
|
||||
@@ -308,6 +315,7 @@ pub fn compile_manifest(manifest_path: &Path) -> Result<CompiledPromptBundle, St
|
||||
.runtime
|
||||
.iter()
|
||||
.chain(manifest.compositions.supervisor.iter())
|
||||
.chain(manifest.compositions.supervisor_chat.iter())
|
||||
.filter(|item| !item.starts_with('$'))
|
||||
.cloned()
|
||||
.collect::<BTreeSet<_>>();
|
||||
@@ -400,9 +408,9 @@ fn provider_fragment_entries(
|
||||
&fragments.delegated_playtest_repair,
|
||||
),
|
||||
(
|
||||
"providerFragments.supervisorChatSystem",
|
||||
"RUNTIME_PROMPT_PROVIDER_SUPERVISOR_CHAT_SYSTEM_SECTION",
|
||||
&fragments.supervisor_chat_system,
|
||||
"providerFragments.supervisorIdentityContract",
|
||||
"RUNTIME_PROMPT_PROVIDER_SUPERVISOR_IDENTITY_CONTRACT_SECTION",
|
||||
&fragments.supervisor_identity_contract,
|
||||
),
|
||||
]
|
||||
}
|
||||
@@ -783,6 +791,10 @@ fn render_rust(manifest: &PromptBundleManifest, sections: &BTreeMap<String, Stri
|
||||
"RUNTIME_PROMPT_SUPERVISOR_COMPOSITION",
|
||||
&manifest.compositions.supervisor,
|
||||
));
|
||||
output.push_str(&render_string_slice_const(
|
||||
"RUNTIME_PROMPT_SUPERVISOR_CHAT_COMPOSITION",
|
||||
&manifest.compositions.supervisor_chat,
|
||||
));
|
||||
output.push_str(&format!(
|
||||
"pub(crate) const RUNTIME_PROMPT_PLATFORM_DEFAULT_SECTION: &str = {};\n",
|
||||
rust_literal(&manifest.variants.platform.default)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "genarrative.agent-runtime",
|
||||
"version": "2026-08-04.3",
|
||||
"version": "2026-08-04.4",
|
||||
"sections": {
|
||||
"common": "common.md",
|
||||
"isolatedTemplateCatalogIntro": "isolated-template-catalog-intro.md",
|
||||
@@ -17,7 +17,8 @@
|
||||
"providerSupervisorDeliveryConvergenceRepair": "provider/supervisor-delivery-convergence-repair.md",
|
||||
"providerManifestDagWaitRepair": "provider/manifest-dag-wait-repair.md",
|
||||
"providerDelegatedPlaytestRepair": "provider/delegated-playtest-repair.md",
|
||||
"providerSupervisorChatSystem": "provider/supervisor-chat-system.md",
|
||||
"providerSupervisorIdentityContract": "provider/supervisor-identity-contract.md",
|
||||
"providerSupervisorFinalReplyContract": "provider/supervisor-final-reply-contract.md",
|
||||
"supervisorIntro": "supervisor/intro.md",
|
||||
"supervisorVisualWithoutEditor": "supervisor/visual-contract-without-editor.md",
|
||||
"supervisorVisualWithEditor": "supervisor/visual-contract-with-editor.md",
|
||||
@@ -41,6 +42,10 @@
|
||||
"supervisorPlaybook",
|
||||
"supervisorClaimGate",
|
||||
"supervisorRepair"
|
||||
],
|
||||
"supervisorChat": [
|
||||
"providerSupervisorIdentityContract",
|
||||
"providerSupervisorFinalReplyContract"
|
||||
]
|
||||
},
|
||||
"variants": {
|
||||
@@ -69,7 +74,7 @@
|
||||
"supervisorDeliveryConvergenceRepair": "providerSupervisorDeliveryConvergenceRepair",
|
||||
"manifestDagWaitRepair": "providerManifestDagWaitRepair",
|
||||
"delegatedPlaytestRepair": "providerDelegatedPlaytestRepair",
|
||||
"supervisorChatSystem": "providerSupervisorChatSystem"
|
||||
"supervisorIdentityContract": "providerSupervisorIdentityContract"
|
||||
},
|
||||
"agentCatalog": {
|
||||
"supervisor": {
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
你是 Genarrative AI 游戏创作桌面 App 的 Project Supervisor,是项目中唯一默认面向用户的总控 Agent,并拥有最终回复权。你要持续围绕用户原始目标工作:需要时先澄清;能直接回答时直接回答;需要项目行动时使用白名单工具;需要专业判断时用验收标准和预期产物把边界清晰的任务委派给合适的专业 Agent,并在所有必需回执完成后统一汇总。缺失事实或产品取舍会实质改变执行结果时,使用 user.input_request 在未完成任务中提出结构化问题并等待回答,不要用最终回复提前结束任务。专业 Agent 的消息和回执只是原目标的证据,不能替换原目标;evidence-ready 只代表客观证据齐全,你仍须逐条完成语义验收;needs-repair 不得忽略,同一原委派最多发起一轮显式返工。稳定跨 Agent 决策写项目黑板,私有协调经验写自己的 Agent 记忆。不要泄露内部工具计划、动态 child 标识、密钥或开发调试细节;不要假装执行未执行的工具;不要输出 JSON;回复保持简洁、具体、中文优先。
|
||||
+1
@@ -0,0 +1 @@
|
||||
你拥有最终回复权。需要时先澄清;能直接回答时直接回答。缺失事实或产品取舍会实质改变执行结果时,使用 user.input_request 在未完成任务中提出结构化问题并等待回答,不要用最终回复提前结束任务。不要泄露内部工具计划、动态 child 标识、密钥或开发调试细节;不要假装执行未执行的工具;不要输出 JSON;回复保持简洁、具体、中文优先。
|
||||
+1
@@ -0,0 +1 @@
|
||||
你是 Genarrative AI 游戏创作桌面 App 的 Project Supervisor,是项目中唯一默认面向用户的总控 Agent。你要持续围绕用户原始目标工作;需要项目行动时使用白名单工具;需要专业判断时用验收标准和预期产物把边界清晰的任务委派给合适的专业 Agent,并在所有必需回执完成后统一汇总。专业 Agent 的消息和回执只是原目标的证据,不能替换原目标;evidence-ready 只代表客观证据齐全,你仍须逐条完成语义验收;needs-repair 不得忽略,同一原委派最多发起一轮显式返工。稳定跨 Agent 决策写项目黑板,私有协调经验写自己的 Agent 记忆。
|
||||
@@ -1,4 +1,5 @@
|
||||
use super::*;
|
||||
use std::sync::OnceLock;
|
||||
|
||||
pub(super) fn render_agent_runtime_prompt_context(
|
||||
root: &Path,
|
||||
@@ -475,7 +476,16 @@ pub(crate) fn game_creator_role_agent_chat_system_prompt() -> &'static str {
|
||||
}
|
||||
|
||||
pub(crate) fn game_creator_project_supervisor_chat_system_prompt() -> &'static str {
|
||||
required_runtime_prompt_section(RUNTIME_PROMPT_PROVIDER_SUPERVISOR_CHAT_SYSTEM_SECTION)
|
||||
static PROMPT: OnceLock<String> = OnceLock::new();
|
||||
PROMPT
|
||||
.get_or_init(|| {
|
||||
render_runtime_prompt_composition(RUNTIME_PROMPT_SUPERVISOR_CHAT_COMPOSITION, |_| None)
|
||||
})
|
||||
.as_str()
|
||||
}
|
||||
|
||||
pub(crate) fn game_creator_project_supervisor_identity_contract_prompt() -> &'static str {
|
||||
required_runtime_prompt_section(RUNTIME_PROMPT_PROVIDER_SUPERVISOR_IDENTITY_CONTRACT_SECTION)
|
||||
}
|
||||
|
||||
fn game_creator_design_foundation_tool_plan_prompt(
|
||||
@@ -672,7 +682,7 @@ mod tests {
|
||||
#[test]
|
||||
fn runtime_prompt_bundle_manifest_covers_all_embedded_sections() {
|
||||
assert_eq!(RUNTIME_PROMPT_BUNDLE_ID, "genarrative.agent-runtime");
|
||||
assert_eq!(RUNTIME_PROMPT_BUNDLE_VERSION, "2026-08-04.3");
|
||||
assert_eq!(RUNTIME_PROMPT_BUNDLE_VERSION, "2026-08-04.4");
|
||||
assert_eq!(
|
||||
RUNTIME_PROMPT_RUNTIME_COMPOSITION,
|
||||
&[
|
||||
@@ -684,6 +694,13 @@ mod tests {
|
||||
"$platform"
|
||||
]
|
||||
);
|
||||
assert_eq!(
|
||||
RUNTIME_PROMPT_SUPERVISOR_CHAT_COMPOSITION,
|
||||
&[
|
||||
"providerSupervisorIdentityContract",
|
||||
"providerSupervisorFinalReplyContract"
|
||||
]
|
||||
);
|
||||
for section_id in [
|
||||
"common",
|
||||
"isolatedTemplateCatalogIntro",
|
||||
@@ -699,7 +716,8 @@ mod tests {
|
||||
"providerSupervisorDeliveryConvergenceRepair",
|
||||
"providerManifestDagWaitRepair",
|
||||
"providerDelegatedPlaytestRepair",
|
||||
"providerSupervisorChatSystem",
|
||||
"providerSupervisorIdentityContract",
|
||||
"providerSupervisorFinalReplyContract",
|
||||
"supervisorIntro",
|
||||
"supervisorVisualWithoutEditor",
|
||||
"supervisorVisualWithEditor",
|
||||
@@ -749,12 +767,16 @@ mod tests {
|
||||
"向 code-prototype 创建一个新的后续修复委派",
|
||||
),
|
||||
(
|
||||
RUNTIME_PROMPT_PROVIDER_SUPERVISOR_CHAT_SYSTEM_SECTION,
|
||||
RUNTIME_PROMPT_PROVIDER_SUPERVISOR_IDENTITY_CONTRACT_SECTION,
|
||||
"唯一默认面向用户的总控 Agent",
|
||||
),
|
||||
] {
|
||||
assert!(required_runtime_prompt_section(section_id).contains(expected));
|
||||
}
|
||||
assert!(
|
||||
required_runtime_prompt_section("providerSupervisorFinalReplyContract")
|
||||
.contains("你拥有最终回复权")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
+68
-10
@@ -3,6 +3,12 @@ use crate::mcp::GAME_CREATOR_MCP_CALL_TOOL;
|
||||
|
||||
const AGENT_RUNTIME_COMPLETION_BLOCKER_TOOL_PLAN_PROTOCOL: &str = "通用完成阻断规则:如果最新 observation 的 tool 为 runtime.autonomous_completion 且 status 为 blocked,本轮禁止调用 respond_to_user;必须先读取该 observation.detail 的 nextRequiredAction,并据此调用合适的读取、修复和验证工具。只有完成要求的动作、取得后续可信 observation 且完成门禁不再阻断后,才能给最终回复;不得反复提交 final response,也不得按项目正文硬编码某一种 blocker 的处理方式。";
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
enum AgentBackgroundContextMode {
|
||||
ToolPlan,
|
||||
FinalReply,
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
fn provider_command_exec_contract() -> &'static str {
|
||||
"command.exec 使用 {\"program\":\"受信任 PATH 中的裸可执行名\",\"args\":[\"逐项 argv\"],\"cwd\":\"可选项目内相对目录\",\"timeoutSeconds\":120};Linux 命令固定运行在 bubblewrap workspace-write、network-disabled 沙箱内,允许 bash -lc、管道、重定向和项目脚本,但不接受环境变量、宿主 executable 路径、mount 或网络策略输入"
|
||||
@@ -75,7 +81,7 @@ pub(in crate::agent) fn build_game_creator_agent_background_tool_plan_request(
|
||||
session_id,
|
||||
run_id,
|
||||
observations,
|
||||
true,
|
||||
AgentBackgroundContextMode::ToolPlan,
|
||||
)?;
|
||||
let observations_json = if prompt_observations.is_empty() {
|
||||
"[]".to_string()
|
||||
@@ -261,7 +267,7 @@ pub(in crate::agent) fn build_game_creator_agent_background_final_reply_request(
|
||||
session_id,
|
||||
run_id,
|
||||
observations,
|
||||
false,
|
||||
AgentBackgroundContextMode::FinalReply,
|
||||
)?;
|
||||
let observations_json = serde_json::to_string_pretty(&prompt_observations)
|
||||
.map_err(|error| format!("序列化 Agent 工具观察失败:{error}"))?;
|
||||
@@ -308,7 +314,7 @@ pub(in crate::agent) fn build_game_creator_background_agent_context(
|
||||
session_id: &str,
|
||||
run_id: &str,
|
||||
observations: &[AgentRuntimeToolObservation],
|
||||
include_runtime_projection: bool,
|
||||
mode: AgentBackgroundContextMode,
|
||||
) -> Result<
|
||||
(
|
||||
GameCreatorLlmConfig,
|
||||
@@ -339,8 +345,10 @@ pub(in crate::agent) fn build_game_creator_background_agent_context(
|
||||
)?;
|
||||
let repository_context = build_repository_startup_context_at(root)?;
|
||||
let repository_prompt = render_repository_startup_context_for_prompt(&repository_context);
|
||||
let identity_instruction = if template_agent_id == GAME_CREATOR_PROJECT_SUPERVISOR_AGENT_ID {
|
||||
game_creator_project_supervisor_chat_system_prompt()
|
||||
let identity_instruction = if matches!(mode, AgentBackgroundContextMode::FinalReply) {
|
||||
""
|
||||
} else if template_agent_id == GAME_CREATOR_PROJECT_SUPERVISOR_AGENT_ID {
|
||||
game_creator_project_supervisor_identity_contract_prompt()
|
||||
} else {
|
||||
"请只以这个专业 Agent 的身份行动。"
|
||||
};
|
||||
@@ -385,7 +393,7 @@ pub(in crate::agent) fn build_game_creator_background_agent_context(
|
||||
role_definition.id,
|
||||
sanitize_agent_runtime_text(run_id, 160)
|
||||
);
|
||||
let runtime_context = if include_runtime_projection {
|
||||
let runtime_context = if matches!(mode, AgentBackgroundContextMode::ToolPlan) {
|
||||
render_agent_runtime_prompt_context_for_session(root, &agent_id, Some(&session_id), false)?
|
||||
} else {
|
||||
String::new()
|
||||
@@ -421,12 +429,15 @@ pub(in crate::agent) fn build_game_creator_background_agent_context(
|
||||
mod tests {
|
||||
use super::{
|
||||
agent_runtime_root_source_at, bind_game_creator_agent_runtime_run_profile_at,
|
||||
build_game_creator_agent_background_final_reply_request,
|
||||
build_game_creator_agent_background_tool_plan_request,
|
||||
game_creator_agent_context_preload_notice, game_creator_agent_runtime_role_overlay_prompt,
|
||||
game_creator_project_supervisor_chat_system_prompt, init_local_game_project_at,
|
||||
game_creator_project_supervisor_chat_system_prompt,
|
||||
game_creator_project_supervisor_identity_contract_prompt, init_local_game_project_at,
|
||||
provider_command_exec_contract, provider_command_start_contract,
|
||||
start_game_creator_agent_runtime_task_at, AgentRuntimeTaskLink, GameCreatorMcpCatalog,
|
||||
GameCreatorMcpCatalogTool, AGENT_RUNTIME_COMPLETION_BLOCKER_TOOL_PLAN_PROTOCOL,
|
||||
start_game_creator_agent_runtime_task_at, AgentRuntimeTaskLink, AgentRuntimeToolPlan,
|
||||
GameCreatorMcpCatalog, GameCreatorMcpCatalogTool,
|
||||
AGENT_RUNTIME_COMPLETION_BLOCKER_TOOL_PLAN_PROTOCOL,
|
||||
AGENT_RUNTIME_RUN_PROFILE_AUTONOMOUS_GAME_BUILD, AGENT_RUNTIME_SUPERVISOR_CLI_SOURCE,
|
||||
AGENT_RUNTIME_SUPERVISOR_GAME_CHAT_SOURCE, AGENT_RUNTIME_SUPERVISOR_GUI_SOURCE,
|
||||
GAME_CREATOR_PROJECT_SUPERVISOR_AGENT_ID,
|
||||
@@ -576,7 +587,8 @@ mod tests {
|
||||
)
|
||||
.expect("build supervisor planning request");
|
||||
let supervisor_prompt = &supervisor_request.messages[1].content;
|
||||
let supervisor_identity_contract = game_creator_project_supervisor_chat_system_prompt();
|
||||
let supervisor_identity_contract =
|
||||
game_creator_project_supervisor_identity_contract_prompt();
|
||||
assert_eq!(
|
||||
supervisor_prompt
|
||||
.matches(supervisor_identity_contract)
|
||||
@@ -584,6 +596,7 @@ mod tests {
|
||||
1
|
||||
);
|
||||
assert!(supervisor_prompt.contains(SUPERVISOR_NOTICE));
|
||||
assert!(!supervisor_prompt.contains("你拥有最终回复权"));
|
||||
assert!(!supervisor_prompt.contains(ORDINARY_NOTICE));
|
||||
assert!(supervisor_prompt.contains(MEMORY_MARKER));
|
||||
assert!(supervisor_prompt.contains("必须调用 respond_to_user 交付最终回复"));
|
||||
@@ -720,6 +733,51 @@ mod tests {
|
||||
assert!(ordinary_prompt.contains(ORDINARY_NOTICE));
|
||||
assert!(!ordinary_prompt.contains(SUPERVISOR_NOTICE));
|
||||
assert!(!ordinary_prompt.contains(MEMORY_MARKER));
|
||||
|
||||
let plan = AgentRuntimeToolPlan {
|
||||
thinking_summary: "汇总已完成协作".to_string(),
|
||||
plan_update: None,
|
||||
plan: Vec::new(),
|
||||
actions: Vec::new(),
|
||||
response: String::new(),
|
||||
};
|
||||
let (_, _, final_request) = build_game_creator_agent_background_final_reply_request(
|
||||
&root,
|
||||
GAME_CREATOR_PROJECT_SUPERVISOR_AGENT_ID,
|
||||
&supervisor_state.session_id,
|
||||
&supervisor_state.run_id,
|
||||
&supervisor_state.current_task,
|
||||
&plan,
|
||||
&[],
|
||||
)
|
||||
.expect("build supervisor final reply request");
|
||||
let final_system_prompt = &final_request.messages[0].content;
|
||||
let final_user_prompt = &final_request.messages[1].content;
|
||||
assert_eq!(
|
||||
final_system_prompt,
|
||||
game_creator_project_supervisor_chat_system_prompt()
|
||||
);
|
||||
assert_eq!(
|
||||
final_request
|
||||
.messages
|
||||
.iter()
|
||||
.map(|message| message.content.as_str())
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n")
|
||||
.matches(supervisor_identity_contract)
|
||||
.count(),
|
||||
1
|
||||
);
|
||||
assert_eq!(
|
||||
final_request
|
||||
.messages
|
||||
.iter()
|
||||
.filter(|message| message.content.contains("你拥有最终回复权"))
|
||||
.count(),
|
||||
1
|
||||
);
|
||||
assert!(!final_user_prompt.contains(supervisor_identity_contract));
|
||||
assert!(!final_user_prompt.contains("你拥有最终回复权"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -62,8 +62,12 @@ const SECTION_FILES: &[(&str, &str)] = &[
|
||||
"provider/delegated-playtest-repair.md",
|
||||
),
|
||||
(
|
||||
"providerSupervisorChatSystem",
|
||||
"provider/supervisor-chat-system.md",
|
||||
"providerSupervisorIdentityContract",
|
||||
"provider/supervisor-identity-contract.md",
|
||||
),
|
||||
(
|
||||
"providerSupervisorFinalReplyContract",
|
||||
"provider/supervisor-final-reply-contract.md",
|
||||
),
|
||||
];
|
||||
|
||||
@@ -135,6 +139,10 @@ fn valid_manifest() -> Value {
|
||||
"supervisorPlaybook",
|
||||
"supervisorClaimGate",
|
||||
"supervisorRepair"
|
||||
],
|
||||
"supervisorChat": [
|
||||
"providerSupervisorIdentityContract",
|
||||
"providerSupervisorFinalReplyContract"
|
||||
]
|
||||
},
|
||||
"variants": {
|
||||
@@ -163,7 +171,7 @@ fn valid_manifest() -> Value {
|
||||
"supervisorDeliveryConvergenceRepair": "providerSupervisorDeliveryConvergenceRepair",
|
||||
"manifestDagWaitRepair": "providerManifestDagWaitRepair",
|
||||
"delegatedPlaytestRepair": "providerDelegatedPlaytestRepair",
|
||||
"supervisorChatSystem": "providerSupervisorChatSystem"
|
||||
"supervisorIdentityContract": "providerSupervisorIdentityContract"
|
||||
},
|
||||
"agentCatalog": {
|
||||
"supervisor": {
|
||||
@@ -234,6 +242,9 @@ fn compiles_manifest_in_declared_order_and_emits_all_dependencies() {
|
||||
assert!(compiled.rust_source.contains(
|
||||
"pub(crate) const RUNTIME_PROMPT_SUPERVISOR_COMPOSITION: &[&str] = &[\"$base\", \"supervisorIntro\", \"$visualContract\", \"supervisorPlaybook\", \"supervisorClaimGate\", \"supervisorRepair\"];"
|
||||
));
|
||||
assert!(compiled.rust_source.contains(
|
||||
"pub(crate) const RUNTIME_PROMPT_SUPERVISOR_CHAT_COMPOSITION: &[&str] = &[\"providerSupervisorIdentityContract\", \"providerSupervisorFinalReplyContract\"];"
|
||||
));
|
||||
assert!(compiled
|
||||
.rust_source
|
||||
.contains("static CODE_AGENT_ROLES: [AgentRoleDefinition; 2]"));
|
||||
@@ -689,6 +700,7 @@ fn production_sources_cannot_restore_parallel_prompt_or_agent_catalog_truths() {
|
||||
"agent.spawn_isolated 使用",
|
||||
"正式 manifest 任务图是唯一首轮专业执行链",
|
||||
"你是项目唯一面向用户的总控 Agent",
|
||||
"你拥有最终回复权",
|
||||
] {
|
||||
assert!(
|
||||
!provider_request_production.contains(forbidden),
|
||||
@@ -705,6 +717,10 @@ fn production_sources_cannot_restore_parallel_prompt_or_agent_catalog_truths() {
|
||||
!prompt_production.contains("唯一默认面向用户的总控 Agent"),
|
||||
"prompt.rs must consume the generated Supervisor chat system fragment"
|
||||
);
|
||||
assert!(
|
||||
!prompt_production.contains("你拥有最终回复权"),
|
||||
"prompt.rs must compose the generated Supervisor final reply fragment"
|
||||
);
|
||||
assert!(
|
||||
!prompt_production.contains("合法 templateAgentId 仅限以下静态模板 taskId"),
|
||||
"prompt.rs must consume the generated isolated template catalog intro"
|
||||
|
||||
@@ -5940,7 +5940,7 @@
|
||||
|
||||
- 决策:把 `prompt.rs` 中依赖长自然语言精确匹配的链式 `.replace()` 拆成仓库内版本化 Prompt Bundle;`build.rs` 读取、校验并生成静态 Rust 定义编译进 Tauri 二进制,生产源码不再直接引用 `prompts/runtime` 的单个 Markdown。
|
||||
- 边界:Supervisor 的角色选择、并行委派、all-join、视觉返工、claim gate 和 repair 自然语言合同,以及 Supervisor / 六组专业 Agent 的编译期静态节点目录进入 Bundle。Bundle 不是完整可执行 graph,也不是生产 Skill;正式 DAG 依赖边、权限、安全门和完成合同继续由 Rust、`shared-contracts` 与校验后的项目协作策略掌控。
|
||||
- 一致性:manifest 是 section、组合顺序、平台 / Editor 变体、role overlay、Provider 协作 fragment 和静态节点目录的单一来源;isolated / all-join、autonomous 首轮、首批协作修复、delivery 收敛、manifest wait、试玩后续委派,以及 Supervisor interaction / background planning / final-reply 身份合同不得在 Provider 或 `prompt.rs` 源码中复制。构建脚本同时监听 Bundle 根目录、manifest 和已登记 section,拒绝未知字段、非法 / 重复 / symlink 路径、孤立 Markdown、未知 / 重叠 selector、节点 / alias / 生成标识符冲突,并强制专业节点 taskId / group / role 与正式 seed DAG 一致。原生工具目录仍从 `agent_runtime_native_executable_tools()` 生成,`mcp.call` 不混入静态原生目录;MCP 工具只从当前请求的动态 catalog 暴露。
|
||||
- 一致性:manifest 是 section、组合顺序、平台 / Editor 变体、role overlay、Provider 协作 fragment 和静态节点目录的单一来源;isolated / all-join、autonomous 首轮、首批协作修复、delivery 收敛、manifest wait、试玩后续委派,以及 Supervisor interaction / background planning / final-reply 身份合同不得在 Provider 或 `prompt.rs` 源码中复制。Supervisor 共享核心身份与最终回复专属规则拆成两个 section:background planning 只注入核心身份,interaction / final-reply 的 system prompt 按 manifest composition 组合两段,final-reply user context 不重复注入。构建脚本同时监听 Bundle 根目录、manifest 和已登记 section,拒绝未知字段、非法 / 重复 / symlink 路径、孤立 Markdown、未知 / 重叠 selector、节点 / alias / 生成标识符冲突,并强制专业节点 taskId / group / role 与正式 seed DAG 一致。原生工具目录仍从 `agent_runtime_native_executable_tools()` 生成,`mcp.call` 不混入静态原生目录;MCP 工具只从当前请求的动态 catalog 暴露。
|
||||
|
||||
## 2026-08-03 AI 游戏生成泥点不足使用确定性中断说明
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
V1.11 的受保护仓库控制目录同时包含 `.git / .agent / .agents / .codex / .hermes`;其中 `.agent` 对项目命令隐藏,其余控制目录只读。
|
||||
|
||||
2026-08-04 起,Runtime 的公共工具规划指令、Supervisor 协作编排 playbook、条件 overlay 和编译期静态 Agent 节点目录统一由版本化 Prompt Bundle 驱动,位于 `apps/ai-game-creator-shell/src-tauri/prompts/runtime/`。`manifest.json` 是 section 路径、组合顺序、平台 / Editor 变体、role overlay、Provider 协作 fragment,以及 Supervisor 与六组专业 Agent 静态目录的单一来源;`build.rs` 同时监听 Bundle 根目录、manifest 和已登记 section,并以失败关闭方式校验 schema、引用、路径 / symlink、孤立 Markdown、selector、节点身份、旧 alias 和生成标识符,再生成 `'static + Copy` Rust 定义并编译进发布二进制。生成的专业节点 taskId / group / role 还必须在构建期与 `shared-contracts::new_game_creation_app_seed_tasks()` 强一致,防止静态目录和正式 seed DAG 漂移。Bundle 承载公共指令、隔离 Agent 合同、平台差异、角色选择、并行委派、all-join、视觉返工、claim gate,Supervisor interaction / background planning / final-reply 身份合同,以及首批协作、delivery 收敛、manifest wait、试玩后续委派等 repair 自然语言合同;`agent_runtime_native_executable_tools()` 仍是原生可执行工具的权威源列表,同时供 Prompt 工具目录与 native capability registry 使用,MCP 工具只从当前请求的动态 catalog 暴露。最终 Provider 请求必须通过生成的 section、composition、overlay 与 provider fragment API 构建,禁止恢复直接 `include_str!("prompts/runtime/...")`、在 Provider 或 `prompt.rs` 源码中复制协作 graph 文案,或依赖自然语言精确 `.replace()` 注入工具合同、平台规则或角色规则。Bundle 不是完整可执行 graph:正式 DAG 依赖边、权限、沙箱、委派容量、持久 all-join 状态机、完成门和身份校验仍由 Rust、`shared-contracts` 与经校验的 `.agent/collaboration-policy.json` 强制执行,不允许通过 Skill、外部配置或任意运行时 Prompt 覆盖绕过。
|
||||
2026-08-04 起,Runtime 的公共工具规划指令、Supervisor 协作编排 playbook、条件 overlay 和编译期静态 Agent 节点目录统一由版本化 Prompt Bundle 驱动,位于 `apps/ai-game-creator-shell/src-tauri/prompts/runtime/`。`manifest.json` 是 section 路径、组合顺序、平台 / Editor 变体、role overlay、Provider 协作 fragment,以及 Supervisor 与六组专业 Agent 静态目录的单一来源;`build.rs` 同时监听 Bundle 根目录、manifest 和已登记 section,并以失败关闭方式校验 schema、引用、路径 / symlink、孤立 Markdown、selector、节点身份、旧 alias 和生成标识符,再生成 `'static + Copy` Rust 定义并编译进发布二进制。生成的专业节点 taskId / group / role 还必须在构建期与 `shared-contracts::new_game_creation_app_seed_tasks()` 强一致,防止静态目录和正式 seed DAG 漂移。Bundle 承载公共指令、隔离 Agent 合同、平台差异、角色选择、并行委派、all-join、视觉返工、claim gate,Supervisor 共享核心身份、interaction / final-reply 专属合同及其组合,以及首批协作、delivery 收敛、manifest wait、试玩后续委派等 repair 自然语言合同;background planning 只注入核心身份,final-reply user context 不重复注入。`agent_runtime_native_executable_tools()` 仍是原生可执行工具的权威源列表,同时供 Prompt 工具目录与 native capability registry 使用,MCP 工具只从当前请求的动态 catalog 暴露。最终 Provider 请求必须通过生成的 section、composition、overlay 与 provider fragment API 构建,禁止恢复直接 `include_str!("prompts/runtime/...")`、在 Provider 或 `prompt.rs` 源码中复制协作 graph 文案,或依赖自然语言精确 `.replace()` 注入工具合同、平台规则或角色规则。Bundle 不是完整可执行 graph:正式 DAG 依赖边、权限、沙箱、委派容量、持久 all-join 状态机、完成门和身份校验仍由 Rust、`shared-contracts` 与经校验的 `.agent/collaboration-policy.json` 强制执行,不允许通过 Skill、外部配置或任意运行时 Prompt 覆盖绕过。
|
||||
|
||||
2026-07-12 起,通用开发能力的 Runtime V1.1 增量以 [`【技术方案】AI游戏创作Agent Runtime V1.1-2026-07-12.md`](./【技术方案】AI游戏创作Agent%20Runtime%20V1.1-2026-07-12.md) 为编码级事实源。它补充仓库启动上下文、同一发布二进制独立 Runner、受限本地预览浏览器验证、动态隔离子 Agent 和真实 Provider 全链路验收;本文件中“进程内 tokio task”“首轮不预加载项目内容”和“不创建动态执行实例”的旧口径由 V1.1 明确替代,未涉及能力继续沿用本文件。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user