Repository navigation
feat(v2): enforce schedule execution state rules - #215
Merged
Merged
Conversation
This was referenced Oct 29, 2026
ObsisMc
approved these changes
Oct 31, 2026
ObsisMc
left a comment
Collaborator
There was a problem hiding this comment.
审查 head 2ad52b8d380219bd2359878aa1157ef255be4510。只审本 PR 相对 #214(8bccc8d6)的增量:git diff 8bccc8d6 2ad52b8d,7 个文件。
核对
- 增量都在
v2-server/internal/store/和 README,都是交付物;occurrence-states.md是长期的状态说明。 - 状态机和
occurrence-states.md的表一致:begin只从recorded出发,在同一事务里锁配置行、检查同任务未释放占位、配置版本和暂停;已有占位记skipped/previous_unfinished。RecordOccurrence插入时也做同样检查,部分唯一索引v2_schedule_active_occurrence ... WHERE NOT released兜底,手动和自动共用,手动绕不过去。rejected必须带原因、只从starting出发,才释放占位;reconcile/ 超时类结果保留占位。accepted绑定 Ref 后不可替换;not_accepted只在没有 Ref 时允许。- 结果终态要求 Ref 一致,且不释放;只有
released(End 确认)才释放。 recover:recorded→skipped/server_restarted(不补跑),starting/running/cancelling→reconciling,保留 Ref 和占位。expectedVersion挡住迟到回调。
- 同步 owner 结论的提交
2ad52b8d只改了排序相关的查询和测试,和 #214 一致。 - head 上 CI 全绿。本次只做了静态审查,没有在本地重跑测试。
非阻塞建议
schema.sql里升级旧草稿状态的三条UPDATE(admission_unknown、workspace_busy、admission_not_accepted)只针对从没进过 main 的草稿库。#214 和本 PR 合并后,main 上不会有这些值,可以考虑删掉,省得以后被当成真实的历史状态。另外每次启动都DROP/ADD CONSTRAINT,会锁表并全表校验一次,演示规模下没问题。ApplyOccurrenceEvidence和ActiveOccurrences/RecoverableOccurrences都要求创建者当前仍是有效成员。成员在运行中被移出租户时,适配层写不进终态和released,这条记录会一直占位。对演示影响不大,记一下即可。cancelling遇到recover变成reconciling后,取消意图就丢了;之后核对到仍在运行会回到running。如果公共服务重启时一定会把旧轮次结算成interrupted,这里就没问题,建议在状态说明里写一句这个前提。
ObsisMc
approved these changes
Oct 31, 2026
ObsisMc
left a comment
Collaborator
There was a problem hiding this comment.
复审 head 1380b6ebc66bdf95a1c035a2c7b6188f4f5f1d7e。相对上次 Approve 的 2ad52b8d 只多了一个 merge 提交,合进了 main(cloud#237)和 #214 的新 head。我在本地重做了合并:只有 v2-server/README.md 冲突,其余文件和自动合并一致;README 的解法保留了本 PR 对"定时触发记录基础"一节的改写,也保留了 main 的新内容,没有丢东西。CI 全绿,可合并性 CLEAN。
结论不变:可以合并,合并由 owner 决定。
ObsisMc
approved these changes
Oct 31, 2026
ObsisMc
left a comment
Collaborator
There was a problem hiding this comment.
复审 head 08633e76d3a0811df04914f1a1b87b7fac8efa63。相对上次 Approve 的 1380b6eb,只多了一个 merge 提交,合进了最新 main c0e90298(其中含已合并的 #214)。合并后的树和 1380b6eb 完全一致,代码没有变化。现在相对 main 只剩本 PR 自己的 7 个 v2-server 文件,和我审过的增量相同。CI 全绿,可合并性 CLEAN。
结论不变:可以合并。是否等 preflight 依赖,由 owner 决定。
Zpc001
added a commit
to Zpc001/cloud
that referenced
this pull request
Oct 31, 2026
The branch was rebased onto main after ora-space#215 added occurrence_states_test.go against the old Login/Identity API, so that test now signs in through storetest.SignIn with a member as the second person. The squad spec's roster helper also stops claiming the UI cannot add a second human: the owner can invite one now, and only the spec's independence from that form keeps it seeding the row. The e2e conflict in collaboration.spec.ts is resolved to W1's /collaboration route with the email sign-in. Co-Authored-By: Claude Code <noreply@anthropic.com>
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.
Summary
最终状态与核对查询:同任务占位、状态证据、原身份只读查询及旧草稿状态升级;没有执行派发。
本轮同步 #214 的
(recorded_at, id)复合游标与时间倒序查询,并合入最新main(b3b875d7)。状态 Go 实现与 #217/#221 保持一致,schema.sql保留v2_schedule_occurrences_history索引与状态升级逻辑。本 PR 依赖与审查范围: 依赖 #214;审查自身增量可用
git diff 372f65ae 1380b6eb -- v2-server。Evidence
1380b6ebc66bdf95a1c035a2c7b6188f4f5f1d7e。CI:https://github.com/ora-space/cloud/actions/runs/41162039336 (server/frontend/e2e全绿)。go test -race -count=1 ./internal/store及 Linuxgo vet/go build通过。recorded_at DESC, id DESC排列)。Merge Danger
Door: two-way
Blast Radius: v2
v2,不涉及 specs。
Refs ora-space/circus#784