fix: complete state-contract naming cleanup

This commit is contained in:
2026-10-10 17:48:59 +09:00
parent 3263d50125
commit 6a12b6cc34
109 changed files with 3696 additions and 576 deletions
+15 -3
View File
@@ -93,6 +93,19 @@ Deno.test("profile settings requests use scoped API and strictly validate respon
}
});
Deno.test("profile source byte counts accept nonnegative safe integers and reject missing or malformed values", () => {
for (const sizeBytes of [0, 128, Number.MAX_SAFE_INTEGER]) {
const value = profileSettingsFixture();
(value.sources as Record<string, unknown>[])[0].size_bytes = sizeBytes;
assertEquals(parseProfileSettingsResponse(value).sources[0].size_bytes, sizeBytes);
}
for (const sizeBytes of [undefined, null, -1, 1.5, Number.MAX_SAFE_INTEGER + 1, "128"]) {
const value = profileSettingsFixture();
(value.sources as Record<string, unknown>[])[0].size_bytes = sizeBytes;
assertThrows(() => parseProfileSettingsResponse(value), ProfileApiError);
}
});
Deno.test("workspace metadata requests use generated DTO shapes", async () => {
const originalFetch = globalThis.fetch;
const requests: Array<{ url: string; init?: RequestInit }> = [];
@@ -247,8 +260,7 @@ Deno.test("Workspace signing identity parser validates active and pending public
value.private_material_ref = "must-not-be-accepted";
},
(value: Record<string, unknown>) => {
(value.identity as Record<string, unknown>).revision =
Number.MAX_SAFE_INTEGER + 1;
(value.identity as Record<string, unknown>).unexpected_field = true;
},
(value: Record<string, unknown>) => {
(value.identity as Record<string, unknown>).public_key = "x".repeat(
@@ -287,7 +299,7 @@ Deno.test("workspace metadata parser rejects incomplete or stale response fields
workspace_id: "workspace-test",
display_name: "Workspace",
created_at: "2026-01-01T00:00:00Z",
revision: "sha256:metadata",
updated_at: "2026-01-02T00:00:00Z",
source: "workspace-config",
diagnostics: [],
workspace_path: "/legacy/path",