diff --git a/scripts/lib/ci-node-test-plan.mts b/scripts/lib/ci-node-test-plan.mts index 5839c6d7fc1d..8e914baa57cc 100644 --- a/scripts/lib/ci-node-test-plan.mts +++ b/scripts/lib/ci-node-test-plan.mts @@ -531,7 +531,13 @@ const COMPACT_GITHUB_GROUP_SECONDS_HINTS = new Map([ // Hybrid-specific Blacksmith observations from 31949756966, plus the // gateway-core-3 139.5s spike in 31938297538 that must stay singleton. +// agents-core-models: 56.3s median (n=6, p90 58.6s) across 260 compact jobs on +// 2026-08-16 against a 36s scaled estimate. It was the dominant term in the +// only bin measuring >=1.25x its prediction (compact-large-19, 122s vs 88s). +// Sum a shard's per-config Duration lines before taking a median; pooling them +// reads as a large over-prediction that is not there. const COMPACT_HYBRID_GROUP_SECONDS_HINTS = new Map([ + ["agentic-agents-core-models", 56], ["agentic-commands-doctor", 64], ["agentic-gateway-core-3", 140], ["core-runtime-cron-service", 80], diff --git a/test/scripts/ci-node-test-plan.test.ts b/test/scripts/ci-node-test-plan.test.ts index 743a20602716..6697e140497d 100644 --- a/test/scripts/ci-node-test-plan.test.ts +++ b/test/scripts/ci-node-test-plan.test.ts @@ -382,12 +382,28 @@ describe("scripts/lib/ci-node-test-plan.mts", () => { "agentic-gateway-core-3", ]); expect(hybridLargeTail?.predictedSeconds).toBe(140); - const hybridJobOf = (name: string) => - hybridCompact.findIndex((shard) => shard.groups.some((group) => group.shard_name === name)); - // Synthesized hosted stripes retain divided admission weights, while - // native hybrid groups use Blacksmith stripe hints during rebalance. - expect(hybridJobOf("agentic-agents-core-runtime-hosted-1")).not.toBe( - hybridJobOf("agentic-agents-core-tools"), + // Synthesized hosted stripes carry divided admission weights while native + // hybrid groups carry Blacksmith stripe hints, so both weight sources must + // survive rebalancing rather than one class monopolizing the tall bins. + // Assert that property, not one arrangement: bin membership legitimately + // moves whenever a hint is refit from fresh measurements. + const hybridStripeBins = hybridCompact.filter((shard) => + shard.groups.some((group) => /-hosted-\d+$/u.test(group.shard_name)), + ); + expect(hybridStripeBins.length).toBeGreaterThan(0); + expect( + hybridStripeBins.every((shard) => (shard.predictedSeconds ?? Infinity) <= 150), + "synthesized hosted stripes must respect the hybrid body ceiling", + ).toBe(true); + // agents-core-models measured 56.3s (n=6) against a 36s scaled estimate, so + // packing it beside agents-core-runtime-hosted-1 (60.4s) built the only bin + // running >=1.25x its prediction: 122s of work priced at 88s. The measured + // hybrid hint separates them; without it they pack together again. + const modelsBin = hybridCompact.find((shard) => + shard.groups.some((group) => group.shard_name === "agentic-agents-core-models"), + ); + expect(modelsBin?.groups.map((group) => group.shard_name)).not.toContain( + "agentic-agents-core-runtime-hosted-1", ); expect(compact.every((shard) => Array.isArray(shard.groups))).toBe(true); expect(compact.every((shard) => shard.groups.length <= 10)).toBe(true);