合并 lane D2 后续:prompt bundle 生成器标签收敛与 rustfmt 修正
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled

- 并入本地分支 chore/agc-warnings-misc @ 09f7a310c(4 文件):build_support/runtime_prompt_bundle.rs 的 provider_fragment_entries 收敛、game_distribution_publish.rs 注释对齐退役事实、image_inspect.rs 与 command_exec.rs 的 rustfmt 修正。
- 与后续丁组(改 render_role_array/render_group_value 的 emit)改同一文件的不同函数,语义互不重叠。
This commit is contained in:
2026-10-06 17:29:30 +08:00
4 changed files with 16 additions and 24 deletions
@@ -337,7 +337,7 @@ pub fn compile_manifest(manifest_path: &Path) -> Result<CompiledPromptBundle, St
)?;
}
let mut provider_fragment_sections = BTreeSet::new();
for (name, _, section_id) in provider_fragment_entries(&manifest.provider_fragments) {
for (name, section_id) in provider_fragment_entries(&manifest.provider_fragments) {
validate_section_reference(section_id, &sections, name)?;
if !provider_fragment_sections.insert(section_id) {
return Err(format!("Provider fragment section 重复引用:{section_id}"));
@@ -370,7 +370,7 @@ pub fn compile_manifest(manifest_path: &Path) -> Result<CompiledPromptBundle, St
used_sections.extend(
provider_fragment_entries(&manifest.provider_fragments)
.into_iter()
.map(|(_, _, section_id)| section_id.clone()),
.map(|(_, section_id)| section_id.clone()),
);
for section_id in sections.keys() {
if !used_sections.contains(section_id) {
@@ -443,7 +443,7 @@ fn validate_section_ownership(manifest: &PromptBundleManifest) -> Result<(), Str
register("roleOverlays", section);
}
}
for (_, _, section) in provider_fragment_entries(&manifest.provider_fragments) {
for (_, section) in provider_fragment_entries(&manifest.provider_fragments) {
register("providerFragments", section);
}
@@ -463,48 +463,40 @@ fn validate_section_ownership(manifest: &PromptBundleManifest) -> Result<(), Str
Ok(())
}
fn provider_fragment_entries(
fragments: &ProviderFragments,
) -> [(&'static str, &'static str, &String); 8] {
/// 返回 `(manifest 路径键, section 键)`:常量名标签随退役 Runtime 的 `RUNTIME_PROMPT_*` 生成逻辑一并停发,
/// 只剩校验与所有权归属两处用途,因此不再携带常量名字符串。
fn provider_fragment_entries(fragments: &ProviderFragments) -> [(&'static str, &String); 8] {
[
(
"providerFragments.isolatedToolContract",
"RUNTIME_PROMPT_PROVIDER_ISOLATED_TOOL_CONTRACT_SECTION",
&fragments.isolated_tool_contract,
),
(
"providerFragments.autonomousRunProfile",
"RUNTIME_PROMPT_PROVIDER_AUTONOMOUS_RUN_PROFILE_SECTION",
&fragments.autonomous_run_profile,
),
(
"providerFragments.autonomousSupervisorManifest",
"RUNTIME_PROMPT_PROVIDER_AUTONOMOUS_SUPERVISOR_MANIFEST_SECTION",
&fragments.autonomous_supervisor_manifest,
),
(
"providerFragments.initialCollaborationRepair",
"RUNTIME_PROMPT_PROVIDER_INITIAL_COLLABORATION_REPAIR_SECTION",
&fragments.initial_collaboration_repair,
),
(
"providerFragments.autonomousInitialCollaborationRepair",
"RUNTIME_PROMPT_PROVIDER_AUTONOMOUS_INITIAL_COLLABORATION_REPAIR_SECTION",
&fragments.autonomous_initial_collaboration_repair,
),
(
"providerFragments.supervisorDeliveryConvergenceRepair",
"RUNTIME_PROMPT_PROVIDER_SUPERVISOR_DELIVERY_CONVERGENCE_REPAIR_SECTION",
&fragments.supervisor_delivery_convergence_repair,
),
(
"providerFragments.manifestDagWaitRepair",
"RUNTIME_PROMPT_PROVIDER_MANIFEST_DAG_WAIT_REPAIR_SECTION",
&fragments.manifest_dag_wait_repair,
),
(
"providerFragments.delegatedPlaytestRepair",
"RUNTIME_PROMPT_PROVIDER_DELEGATED_PLAYTEST_REPAIR_SECTION",
&fragments.delegated_playtest_repair,
),
]
@@ -8,8 +8,8 @@ use tokio::io::AsyncReadExt;
#[cfg(target_os = "linux")]
use crate::command_sandbox::{
command_sandbox_platform_metadata, prepare_command_sandbox_launch, stage_command_sandbox_launch,
CommandSandboxLaunch,
command_sandbox_platform_metadata, prepare_command_sandbox_launch,
stage_command_sandbox_launch, CommandSandboxLaunch,
};
#[cfg(target_os = "linux")]
use crate::command_sandbox_trampoline::{LaunchGate, TargetExecState, TargetTerminalState};
@@ -218,7 +218,8 @@ struct CreatedVersion {
/// 作者名下作品条目(`GET /my-games` 列表项与 `GET /my-games/{gameId}` 的 `game`)。
///
/// 只声明恢复绑定需要的字段:游戏身份、`localProjectId`、最近版本与公开修订号。
/// 只声明恢复绑定需要的字段:游戏身份、最近版本与公开修订号。`localProjectId` 只在测试态编译:
/// 生产按本地 manifest 的 `projectId` 匹配(见 `read_game_distribution_publication`),仅解析用例读它。
#[derive(Clone, Debug, Default, Deserialize)]
#[serde(rename_all = "camelCase")]
struct OwnerGameEntry {
@@ -84,11 +84,8 @@ pub(crate) fn load_local_project_image_preview_with_cancellation(
let absolute = resolve_local_project_path(root, &normalized)?;
validate_agent_runtime_inspection_ancestors(root, &absolute)?;
cancellation.check()?;
let image = read_agent_runtime_inspection_image_with_cancellation(
&absolute,
normalized,
cancellation,
)?;
let image =
read_agent_runtime_inspection_image_with_cancellation(&absolute, normalized, cancellation)?;
cancellation.check()?;
// 头部级 alpha 判据:只读签名与头部标志(PNG 还会按 chunk 头跳过数据体找 `tRNS`),
// 不做熵解码、不做逐像素扫描,成本不随像素数增长,因此大图与「AI 把棋盘格画进图里」
@@ -1001,7 +998,9 @@ mod tests {
root.path().join("assets/linked-parent"),
)
.expect("parent symlink");
assert!(load_local_project_image_preview(root.path(), "assets/linked-parent/image.png")
.is_err());
assert!(
load_local_project_image_preview(root.path(), "assets/linked-parent/image.png")
.is_err()
);
}
}