feat: implement TASK-WP1-03 registration notice

This commit is contained in:
suyx
2026-07-28 16:48:49 +08:00
parent 4d81f9c723
commit aec4c83eca
10 changed files with 1049 additions and 33 deletions
+35
View File
@@ -0,0 +1,35 @@
import { createHash } from "node:crypto";
import { describe, expect, it } from "vitest";
import { registrationNotice } from "../../packages/shared-contracts/src/index.js";
describe("TDD-WP1-NOTICE-001-registration-consent", () => {
it("freezes a versioned and hash-verifiable registration notice", () => {
expect(registrationNotice.version).toMatch(/^p0a-registration-notice-v[1-9][0-9]*$/);
expect(registrationNotice.effectiveAt).toMatch(/^20[0-9]{2}-[0-9]{2}-[0-9]{2}$/);
expect(registrationNotice.sections.length).toBeGreaterThanOrEqual(5);
expect(
createHash("sha256").update(registrationNotice.content, "utf8").digest("hex"),
).toBe(registrationNotice.contentSha256);
});
it.each([
"AI 网关",
"Resend",
"高德",
"DYN004",
"Windows",
"文件系统权限",
"应用层加密",
"云备份",
"LocalDataRoot",
"超级管理员",
"账号注销",
"180 天",
"不自动备份",
"不会迁移到正式系统",
])("contains the frozen topic %s", (topic) => {
expect(registrationNotice.content).toContain(topic);
});
});