Switch to VectorEngine gpt-image-2 and edits

Replace uses of the legacy `gpt-image-2-all` model with `gpt-image-2` and standardize image workflows: no-reference generation uses POST /v1/images/generations, any-reference flows use POST /v1/images/edits with multipart `image` parts. Update SKILLs, generation scripts, decision logs, and docs to reflect the contract change and edits-vs-generations guidance. Apply corresponding changes across backend (api-server match3d/puzzle modules, openai image adapter, mappers, telemetry, spacetime client/module), frontend components and services (Match3D, Puzzle, CreativeImageInputPanel, runtime shells), and add new spritesheet/parser files and tests. Also add media/logo.png. These changes align repository code and documentation with the VectorEngine image API contract and update generation/upload handling (green-screen -> alpha processing, spritesheet handling, and related tests).
This commit is contained in:
2026-05-22 03:06:41 +08:00
parent 321e1ea33a
commit ae014ac881
90 changed files with 7078 additions and 3389 deletions

View File

@@ -419,12 +419,12 @@ pub fn resolve_match3d_item_type_count_for_difficulty(clear_count: u32, difficul
8 => 3,
12 => 9,
16 => 15,
20 | 21 => 21,
20 | 21 => 20,
_ => match difficulty {
0..=2 => 3,
3..=4 => 9,
5..=6 => 15,
_ => 21,
_ => 20,
},
};
@@ -432,8 +432,8 @@ pub fn resolve_match3d_item_type_count_for_difficulty(clear_count: u32, difficul
}
pub fn normalize_match3d_runtime_clear_count(clear_count: u32, difficulty: u32) -> u32 {
// 中文注释:旧硬核草稿曾保存 clear_count=20新硬核固定 21 种物品
// 运行态也升到 21 组三消,避免出现 20 组却要求 21 种素材的不可达状态
// 中文注释:旧硬核草稿曾保存 clear_count=20运行态保留硬核 21 组三消节奏
// 但本局物品类型池仍由难度映射到最多 20 种,避免超过 10*10 Sprite 解析素材上限
if clear_count == 20 && difficulty >= 7 {
21
} else {
@@ -885,7 +885,7 @@ mod tests {
}
#[test]
fn legacy_hardcore_clear_count_runs_as_twenty_one_groups() {
fn legacy_hardcore_clear_count_runs_with_twenty_item_types() {
let run = start_run_with_seed_at(
"run-types-legacy-hardcore".to_string(),
"user-1".to_string(),
@@ -903,8 +903,8 @@ mod tests {
assert_eq!(run.clear_count, 21);
assert_eq!(run.total_item_count, 63);
assert_eq!(counts.len(), 21);
assert!(counts.values().all(|count| *count == 3));
assert_eq!(counts.len(), 20);
assert_eq!(counts.values().sum::<u32>(), 63);
}
#[test]
@@ -931,8 +931,8 @@ mod tests {
}
#[test]
fn size_tier_plan_follows_ratio_for_twenty_five_types() {
let plan = resolve_size_tier_plan(25);
fn size_tier_plan_follows_ratio_for_twenty_types() {
let plan = resolve_size_tier_plan(20);
let mut counts = BTreeMap::<&str, usize>::new();
for rule in plan {
*counts.entry(rule.tier).or_default() += 1;
@@ -946,10 +946,10 @@ mod tests {
}
}
assert_eq!(counts.get("XL"), Some(&5));
assert_eq!(counts.get("L"), Some(&8));
assert_eq!(counts.get("M"), Some(&7));
assert_eq!(counts.get("XS"), Some(&4));
assert_eq!(counts.get("XL"), Some(&4));
assert_eq!(counts.get("L"), Some(&6));
assert_eq!(counts.get("M"), Some(&6));
assert_eq!(counts.get("XS"), Some(&3));
assert_eq!(counts.get("S"), Some(&1));
}
@@ -962,7 +962,7 @@ mod tests {
&test_config(30),
42,
1_000,
Some(25),
Some(20),
)
.expect("run should start");
@@ -974,7 +974,7 @@ mod tests {
.push((item.radius * 10_000.0).round() as u32);
}
assert_eq!(radii_by_visual_key.len(), 25);
assert_eq!(radii_by_visual_key.len(), 20);
assert!(
radii_by_visual_key
.values()
@@ -1052,7 +1052,7 @@ mod tests {
.filter(|item| {
let dx = item.x - MATCH3D_BOARD_CENTER;
let dy = item.y - MATCH3D_BOARD_CENTER;
(dx * dx + dy * dy).sqrt() > 0.32
(dx * dx + dy * dy).sqrt() > 0.26
})
.count();
let mut quadrants = BTreeMap::<String, u32>::new();
@@ -1081,15 +1081,15 @@ mod tests {
}
#[test]
fn twenty_five_or_less_does_not_repeat_visual_keys() {
fn twenty_or_less_does_not_repeat_visual_keys() {
let run = start_run_with_seed_at_and_item_type_count(
"run-block-unique".to_string(),
"user-1".to_string(),
"profile-1".to_string(),
&test_config(25),
&test_config(20),
27,
1_000,
Some(25),
Some(20),
)
.expect("run should start");
@@ -1098,7 +1098,7 @@ mod tests {
*counts.entry(item.visual_key.clone()).or_default() += 1;
}
assert_eq!(counts.len(), 25);
assert_eq!(counts.len(), 20);
assert!(counts.values().all(|count| *count == 3));
}