test(db,contracts): register the 0037 tables and agent_run.await_wake in schema checks

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-28 20:22:45 +08:00
1 parent dd0167fe85
commit efb5d206c1
2 files changed
+14 -3

No files matched your search

+7 -3
View File
@@ -39,8 +39,8 @@ type Obj = z.ZodObject;
const ROWS: Record<string, { row: Obj; dbOnly?: string[]; apiOnly?: string[] }> = {
AcquisitionPlan: { row: C.AcquisitionPlan },
AcquisitionSlot: { row: C.AcquisitionSlot, apiOnly: ["currentAsset"] },
// upstream_id 只在服务端使用(runAgent 选上游),不在 AgentRun 视图里
AgentRun: { row: C.AgentRun, dbOnly: ["upstreamId"] },
// upstream_id 只在服务端使用;await_wake 是挂起等待子会话时的唤醒信号(C1-B),都不进 AgentRun 视图
AgentRun: { row: C.AgentRun, dbOnly: ["upstreamId", "awaitWake"] },
AgentRunEvent: { row: C.AgentRunEventRow },
AgentRunMessage: { row: C.AgentRunMessage },
CapabilityInvocation: { row: C.CapabilityInvocation },
@@ -132,8 +132,12 @@ const INTERNAL_TABLES = [
// W9-I 进程心跳(0034):服务端内部,经 /system/health 的专用 DTO 暴露
"ProcessHeartbeat",
"ProcessHeartbeatSample",
// C1-B 恢复码 / Passkey / WebAuthn 挑战(0037):服务端内部,经 contracts/auth.ts 的专用 DTO 暴露
"AdminRecoveryCode",
"AdminPasskey",
"WebauthnChallenge",
];
const INTERNAL_ENUMS = ["TasksOpLedgerStatus"];
const INTERNAL_ENUMS = ["TasksOpLedgerStatus", "WebauthnChallengePurpose"];
/** DB 枚举类型名 → contracts 枚举 */
const ENUMS: Record<string, z.ZodEnum> = {
+7
View File
@@ -109,6 +109,10 @@ const EXPECTED_TABLES = [
// W9-I 进程心跳(0034)
"process_heartbeat",
"process_heartbeat_sample",
// C1-B 恢复码 / Passkey / WebAuthn 挑战(0037)
"admin_recovery_code",
"admin_passkey",
"webauthn_challenge",
].sort();
/** 不走 entityTable() 的表:追加型/引擎自有表,没有 uuid id + created_at/updated_at 三件套 */
@@ -128,6 +132,9 @@ const NON_ENTITY_TABLES = [
// 进程心跳:instance_id 主键 / 只追加的采样
"process_heartbeat",
"process_heartbeat_sample",
// 一次性凭据:只记创建 / 用掉的时间
"admin_recovery_code",
"webauthn_challenge",
];
describe.skipIf(skip)("schema migrations (real PG)", () => {