fix(activity-mutual): close Phase 16 KEEP-VERIFY/EXTEND — 7 defects + 1 hidden compile defect (reopenEpisode) + 1 test-fidelity; unify dual-impl to confirmActivityInterest; INV-006 fix; +7 tests (481 green)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
-- ============================================================
|
||||
-- V041: V1.1 Phase 16 - 活动互选二阶段同意补全
|
||||
-- ============================================================
|
||||
-- 目的:
|
||||
-- 1) expires_at —— 二阶段同意的截止时间(Phase 16 计划「补 timeout 测试」)。
|
||||
-- 互选确认不能无限期挂起:超时后双方都必须重新确认,避免长期 pending
|
||||
-- 记录被后续某一方单点确认直接推动成 Match(INV-015 要求双方确认)。
|
||||
-- 2) match_id —— 双确认后形成的 Match Episode 溯源字段。
|
||||
-- exactly-once 由「both_confirmed_at 从 NULL 变为非 NULL 的原子 UPDATE」保证,
|
||||
-- match_id 只用于回查与审计,不作为唯一性依据。
|
||||
|
||||
ALTER TABLE activity_mutual_connection_consents
|
||||
ADD COLUMN IF NOT EXISTS expires_at TIMESTAMPTZ;
|
||||
|
||||
ALTER TABLE activity_mutual_connection_consents
|
||||
ADD COLUMN IF NOT EXISTS match_id UUID;
|
||||
|
||||
COMMENT ON COLUMN activity_mutual_connection_consents.expires_at IS
|
||||
'二阶段同意截止时间;为 NULL 表示不限制。超过该时间的 pending/accepted 不得再推动成双确认。';
|
||||
COMMENT ON COLUMN activity_mutual_connection_consents.match_id IS
|
||||
'双确认后形成的 Match Episode id;仅用于溯源,唯一性由 both_confirmed_at 原子更新保证。';
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_mutual_consents_expiry
|
||||
ON activity_mutual_connection_consents(expires_at)
|
||||
WHERE both_confirmed_at IS NULL;
|
||||
Reference in New Issue
Block a user