feat(backend,web): Initiative 生命周期三件套:cancelled + close/cancel guard + window_ends_at worker(#628) - #652
Merged
Conversation
sundevilyang
force-pushed
the
feat/628-initiative-lifecycle
branch
4 times, most recently
from
September 16, 2026 15:10
817b046 to
8887e9c
Compare
…+ window_ends_at worker(#628)
sundevilyang
force-pushed
the
feat/628-initiative-lifecycle
branch
from
September 16, 2026 15:10
8887e9c to
45434af
Compare
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#628 Initiative 生命周期三件套(按裁决顺序)
cancelled(独立:cancelaction,照 Event:cancel范式):cancel允许draft+open进;close仍只从open进;open/ 公开页仍显示 / 规则传播仍写"三条不一致(与 Initiative 锁死规则传播走裸 SQL:缺信号(报名截止执法漂移)/ 缺校验 / 改历史场 / 审计不记值 #587 的status IN ('draft','open')同源,不产生第二个真源);window_ends_at自动关闭 worker:复用event_lifecycle_worker的幂等 CAS 模式,防公开页挂僵尸活动。关键裁决落实
draft/open);已closed/cancelled场一律不动(不回溯改写已收官事实、不触碰终态不可逆的forfeited);event.cancel → ended → 订阅方),未新写批量走查;/initiatives索引页行为不变(slug 是投放契约);closedInitiative 下仍open的挂载场不做一次性 cancel(会产生批量不可逆关闭 + 意外退款),只让可见性门对存量行立即生效;initiative_not_open+ 四清单(用户可动作:先打开或取消该 Initiative),MCP/GraphQL 两面文案一致。验证
三条 guard 各一条负向用例;worker 幂等(重复触发不重复副作用);公开页
cancelledvsclosed文案分叉(三端含 en);迁移可逆(克隆库migrate→rollback --step 1→ 再migrate);mix precommit与pnpm test全绿。