feat(runtime): establish managed mutation lifecycle authority - #3741
Conversation
|
The required CI check is now green on cf63fb9. The first run exposed two issues, both fixed at their actual owner boundary:
Verification after the fix:
中文说明required CI 已在 cf63fb9 全绿。 首轮 CI 暴露了两个问题,并且都在真正的 owner 边界修复:
修复后:
|
cf63fb9 to
f5cac84
Compare
|
Thanks for the detailed review. I rebuilt the branch on current Resolved items:
Verification after removing the speculative migration:
中文说明当前 head 为 关于在线全量扫描:我最初加了 schema 15 表达式索引,但复核范围后已撤回。这个 Draft 还没有生产 Write/Edit consumer,在访问形状尚未确定时提前固化永久 migration/index,成本高于实际收益。现在 schema 保持 14;当前实现继续从 immutable RuntimeEvents 校验事实,不会借助可重建 projection 决定事实。等真实 consumer 接入时,再把有界 immutable-event query/index 作为明确的生产门槛实现。 撤回 schema 15 后,Storage build 通过;migration/crash/concurrency 定向套件 125 passed、0 failed、1 个既有 POSIX 条件跳过; |
0746b8c to
464eb0d
Compare
464eb0d to
a5db232
Compare
|
CI has been refreshed on The previous failure was isolated to the existing Runtime Host test Verification after the rebuild:
中文说明已将 7 个 PR 提交重放到最新 上次失败已定位为既有 Runtime Host 测试 重建后本地验证:四个 workspace 构建通过,Core/Runtime 126 个定向测试通过,Storage authority/crash/concurrency 89 个测试通过, |
a5db232 to
da66f6c
Compare
|
I think the core problem of this PR is sound, and it is different from #3857:
The lifecycle here is:
From an Occams razor perspective, I do not think the T1/T2 state machine is accidental complexity. The reservation and the explicit terminal cases are the minimum needed to avoid two writers, partial settlement, and unsafe fallback behavior. A few improvements I would make before wiring this to the staging engine:
So my conclusion is: keep the lifecycle model; simplify and strengthen the contracts at its boundaries. The clean end-to-end composition should be: this PR reserves the mutation at T1, #3857 creates/verifies staged B, and this PR settles the operation at T2. Physical Git ref promotion can remain a later, explicit owner. |
da66f6c to
082cd2f
Compare
|
Thanks for the focused follow-up. I rebuilt the seven PR commits on current main and addressed the three contract issues at their owner boundaries. The new head is 082cd2f.
Verification on the rebuilt branch:
中文说明感谢这轮边界清晰的反馈。我已把 7 个 PR 提交重建到当前 main,并在各自 owner 边界完成前三项修复。新 head 为 082cd2f。
验证结果:Core/Runtime/Storage build 通过;Core authority 26/26,Runtime durable-boundary 42/42,Storage authority + 真实进程 crash + 多进程 concurrency 58/58;Biome 与 git diff check 均通过。 |
likun666661
left a comment
There was a problem hiding this comment.
Approved. The T1/T2 managed-mutation lifecycle boundary is sound: this PR owns durable reservation and atomic settlement, while candidate construction remains outside this authority. The latest update closes the reviewed contract gaps by binding the execution-profile digest to a canonical specification, returning committedSuccessor rather than a misleading current head, and requiring owner-issued opaque no-effect evidence before releasing a reservation. The deferred bounded RuntimeEvent query remains explicitly documented as a production-consumer gate.
…#3741) * feat(storage): establish workspace successor authority * feat(storage): reserve durable managed mutations * feat(runtime): enforce managed mutation settlement * docs(runtime): define managed mutation lifecycle authority * fix(runtime): preserve terminal status across managed settlement * fix(runtime): close managed mutation authority gaps * refactor(storage): defer managed mutation query indexing * fix(runtime): tighten managed mutation evidence
Primary invariant
From a managed Write/Edit T1 until a trusted terminal state, one workspace instance has exactly one durable mutation owner. The T1 path and fixed execution profile are derived from the durable tool call; terminal publication is restricted to an owner-verified successor, a committed no-change result, or a committed no-effect failure. Managed execution never falls back to generic T2.
Ownership and atomic boundaries
Failure and rollback
Scope
This PR establishes the persistence and Runtime lifecycle authority. It deliberately does not implement Git candidate capture, filesystem mutation, Runtime Host composition, or Desktop/CLI enablement.
Because this Draft has no production Write/Edit consumer, it keeps the released SQLite schema at version 14 and does not pre-commit a speculative online-query index. The current immutable full-ledger validation remains correct but is not a production-scale hot-path claim. A bounded RuntimeEvent index/query must be introduced with the real consumer, once its access shape is known, without making a rebuildable projection the source of truth.
The branch was rebuilt on current
upstream/main. It spans schema-owned tables already introduced by this slice and Runtime protocol, but not Host lifecycle or platform filesystem I/O.Verification
@maka/core,@maka/storage, and@maka/runtimebuilds pass.git diff --checkpasses.中文说明
主要不变量
从 managed Write/Edit 的 T1 到可信终态,同一个 workspace instance 只能有一个 durable mutation owner。T1 的路径和固定 execution profile 来自 durable tool call;终态只能是 owner 验证的 successor、已提交的 no-change success,或已证明无副作用的失败。managed execution 禁止回退 generic T2。
Owner 与原子边界
范围与 schema 决策
本 PR 只建立 persistence 与 Runtime lifecycle authority,不包含 Git candidate capture、文件 mutation、Runtime Host composition 或 Desktop/CLI enablement。
当前 Draft 没有生产 Write/Edit consumer,因此 SQLite schema 保持版本 14,不提前增加 speculative schema 15/index。现有 immutable full-ledger 校验在正确性上成立,但不声称已经是生产规模热路径。等真实 consumer 确定访问形状后,再引入不依赖可重建 projection 的有界 RuntimeEvent 索引读取。
三个 workspace build 通过;撤回 schema 15 后,Storage migration/crash/concurrency 套件为 125 passed、0 failed、1 个既有 POSIX 条件跳过;
git diff --check通过。