From c51d7ed41a96068a09127bbc096fee143fce0b22 Mon Sep 17 00:00:00 2001 From: Kayshen-X Date: Tue, 11 Aug 2026 23:38:07 +0800 Subject: [PATCH] fix(ai): raise the deck generation budget 13200 -> 13500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nine new style guides and the projector-board corpus additions grew the deck skill set: a deck prompt now resolves 13293 tokens with `design-principles` (438) included, so at 13200 the Step 3 knapsack dropped `design-principles` while the report still showed headroom — exactly the ordering alarm `no_skill_loses_the_budget_race_while_the_budget_has_room` guards. Per that test's own guidance ("the fix is the phase budget, not this assertion"), raise Generation to 13500, keeping ~200 tokens of margin over the measured 13293. --- crates/op-ai-skills/src/resolve.rs | 2 +- crates/op-ai-skills/src/types.rs | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/crates/op-ai-skills/src/resolve.rs b/crates/op-ai-skills/src/resolve.rs index 9bea6f774..a9a87e5c2 100644 --- a/crates/op-ai-skills/src/resolve.rs +++ b/crates/op-ai-skills/src/resolve.rs @@ -182,7 +182,7 @@ mod tests { "design a login form", &ResolveOptions::default(), ); - assert_eq!(ctx.budget_max, 13200); + assert_eq!(ctx.budget_max, 13500); assert!(ctx.budget_used <= ctx.budget_max); assert!( !ctx.skills.is_empty(), diff --git a/crates/op-ai-skills/src/types.rs b/crates/op-ai-skills/src/types.rs index 03470dcd4..aa3497a18 100644 --- a/crates/op-ai-skills/src/types.rs +++ b/crates/op-ai-skills/src/types.rs @@ -69,6 +69,13 @@ impl Phase { /// cross-tier contract), so the fix is headroom rather than merging them /// back together. /// + /// Generation moved again 13200 → 13500 (2026-08-11): nine new style guides + /// and the projector-board corpus additions grew the deck set, so a deck + /// prompt now resolves 13293 tokens with `design-principles` (438) included. + /// At 13200 the Step 3 knapsack dropped `design-principles` while the report + /// still showed headroom; 13500 keeps ~200 tokens of margin over the + /// measured 13293. + /// /// Planning moved 4000 → 6000 for a related reason (2026-07-28). Its /// three `Base` skills are budget-EXEMPT but still counted against the /// total, and they need ~4500 tokens on their own once @@ -80,7 +87,7 @@ impl Phase { pub fn default_budget(self) -> u32 { match self { Phase::Planning => 6000, - Phase::Generation => 13200, + Phase::Generation => 13500, Phase::Validation => 3000, Phase::Maintenance => 5000, } @@ -90,7 +97,7 @@ impl Phase { /// Per-phase default token budgets — the TS `DEFAULT_BUDGETS` record. pub const DEFAULT_BUDGETS: [(Phase, u32); 4] = [ (Phase::Planning, 6000), - (Phase::Generation, 13200), + (Phase::Generation, 13500), (Phase::Validation, 3000), (Phase::Maintenance, 5000), ]; @@ -343,7 +350,7 @@ mod tests { #[test] fn default_budget_table() { assert_eq!(Phase::Planning.default_budget(), 6000); - assert_eq!(Phase::Generation.default_budget(), 13200); + assert_eq!(Phase::Generation.default_budget(), 13500); assert_eq!(Phase::Validation.default_budget(), 3000); assert_eq!(Phase::Maintenance.default_budget(), 5000); // The const table agrees with the per-variant method.