test(wp7-02): require stable model secure routing
Dada P0-A isolated Windows CI / validate-and-package (push) Canceled after 0s

This commit is contained in:
suyx
2026-08-04 18:53:59 +08:00
parent 604c524298
commit 6bd5364d95
2 changed files with 12 additions and 0 deletions
@@ -142,6 +142,14 @@ internal static class Program
"--execute-controlled-real", "--execute-controlled-real",
}; };
EqualSequence(externalArguments, ControlledExternalValidationLauncher.ValidateArguments(externalArguments), "controlled external argument allowlist"); EqualSequence(externalArguments, ControlledExternalValidationLauncher.ValidateArguments(externalArguments), "controlled external argument allowlist");
var stableGeminiArguments = externalArguments.ToArray();
stableGeminiArguments[3] = "gemini-3.1-flash-image";
EqualSequence(stableGeminiArguments, ControlledExternalValidationLauncher.ValidateArguments(stableGeminiArguments), "stable Gemini external argument allowlist");
var previewGeminiArguments = externalArguments.ToArray();
previewGeminiArguments[3] = "gemini-3.1-flash-image-preview";
Throws<ArgumentException>(
() => ControlledExternalValidationLauncher.ValidateArguments(previewGeminiArguments),
"preview Gemini external argument rejected");
Throws<ArgumentException>( Throws<ArgumentException>(
() => ControlledExternalValidationLauncher.ValidateArguments(externalArguments.Where(value => value != "--confirm-controlled-real").ToArray()), () => ControlledExternalValidationLauncher.ValidateArguments(externalArguments.Where(value => value != "--confirm-controlled-real").ToArray()),
"controlled external confirmation required"); "controlled external confirmation required");
@@ -8,6 +8,7 @@ import {
buildBlockedModelEvidence, buildBlockedModelEvidence,
buildModelContractPlan, buildModelContractPlan,
inspectAiGatewayReadiness, inspectAiGatewayReadiness,
productModelIdForControlledState,
validateCandidateDependency, validateCandidateDependency,
validateIndependentEvidenceSet, validateIndependentEvidenceSet,
} from "../../scripts/lib/wp7-02-external-contract.mjs"; } from "../../scripts/lib/wp7-02-external-contract.mjs";
@@ -31,6 +32,9 @@ test("TDD-WP7-EXT-001 fixes the user-approved replacement model set", () => {
"gemini-3.1-flash-image", "gemini-3.1-flash-image",
"gpt-image-2", "gpt-image-2",
]); ]);
assert.equal(productModelIdForControlledState("gemini-3.1-flash-image"), "gemini-3.1-flash-image-preview");
assert.equal(productModelIdForControlledState("gpt-image-2"), "gpt-image-2");
assert.throws(() => productModelIdForControlledState("gemini-3-pro-image-preview"), /WP7_02_MODEL_NOT_ALLOWED/);
for (const modelId of WP7_02_MODEL_IDS) { for (const modelId of WP7_02_MODEL_IDS) {
const plan = buildModelContractPlan(modelId); const plan = buildModelContractPlan(modelId);
assert.equal(plan.model_id, modelId); assert.equal(plan.model_id, modelId);