feat(P0-A): 整合第一版并冻结最终发布 #1

Merged
tuyixuan merged 115 commits from codex/wp7-07 into codex/wp0-09 2026-08-05 10:29:22 +08:00
Showing only changes of commit 3093c4470a - Show all commits
@@ -216,6 +216,15 @@ test("TDD-WP7-EXT-001 retries one timeout once and records every real attempt",
});
test("TDD-WP7-EXT-001 describes only protocol structure and stops repeated contract-shape calls", async () => {
const uriShape = describeProviderResponseShape({ candidates: [{ content: { parts: [{ text: "https://first.invalid/generated" }] } }] });
const equivalentUriShape = describeProviderResponseShape({ candidates: [{ content: { parts: [{ text: "https://other.invalid/result" }] } }] });
assert.deepEqual(uriShape, equivalentUriShape);
assert.match(JSON.stringify(uriShape), /"representation":"uri"/);
assert.doesNotMatch(JSON.stringify(uriShape), /first\.invalid|other\.invalid/);
assert.match(JSON.stringify(describeProviderResponseShape({ candidates: [{ content: { parts: [{ text: "![result](https:\/\/example.invalid\/generated)" }] } }] })), /"representation":"markdown_uri"/);
assert.match(JSON.stringify(describeProviderResponseShape({ candidates: [{ content: { parts: [{ text: "data:image\/png;base64,AAAA" }] } }] })), /"representation":"inline_media"/);
assert.match(JSON.stringify(describeProviderResponseShape({ candidates: [{ content: { parts: [{ text: "ordinary explanation" }] } }] })), /"representation":"plain_text"/);
let fetchCalls = 0;
const execution = await runControlledRealScenarios({
fetchImpl: async () => {