Skip to content

feat(storage): reserve managed workspace mutations at T1 - #8

Closed
zhiiw wants to merge 2 commits into
codex/managed-workspace-git-mutation-candidate-m2-2from
codex/managed-workspace-mutation-reservation-m2-3a
Closed

zhiiw wants to merge 2 commits into
codex/managed-workspace-git-mutation-candidate-m2-2from
codex/managed-workspace-mutation-reservation-m2-3a

Conversation

@zhiiw

@zhiiw zhiiw commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

Make managed mutation ownership durable at T1 so concurrent processes cannot admit two mutations for the same workspace instance.

Primary invariant

From managed T1 until a trusted terminal state, one workspace instance has at most one durable mutation owner.

  • Owner: SQLite managed-mutation reservation authority
  • Atomic boundary: T1 RuntimeEvents and reservation projection in one transaction
  • Failure state: competing admission is rejected; incomplete operation remains reserved for recovery
  • Rollback: only a trusted terminal bundle releases the reservation; projection is rebuildable

What changed

  • extends managed dispatch facts with reservation identity
  • atomically commits T1 and the exclusive workspace-instance reservation
  • enforces uniqueness across processes through SQLite constraints
  • rebuilds reservations from immutable RuntimeEvents
  • adds real process-kill and multiprocess competition coverage

Stack position

This is M2.3a, reviewed as the delta from M2.2.

Base: codex/managed-workspace-git-mutation-candidate-m2-2
Next: codex/managed-workspace-mutation-runtime-admission-m2-3b

Validation

Core/storage builds, T1 kill/reopen, two-process admission competition, prepared-T1 restart blocking, rollback, and projection rebuild tests passed.

Draft limitations

  • this layer owns reservation only; Runtime settlement is the next PR
  • no production Write/Edit consumer yet
  • final delivery must be rebuilt from latest upstream/main
中文说明

概要

本层只证明一个不变量:从 managed T1 落盘到可信终态,同一个 workspace instance 最多只能有一个 durable mutation owner。

  • Owner: SQLite reservation authority
  • 原子边界: T1 RuntimeEvents 与 reservation projection 同事务提交
  • 失败状态: 并发入场被拒绝;未收敛操作保留 reservation 等待恢复
  • 释放方式: 只有可信 terminal bundle 能释放,投影可从 RuntimeEvents 重建

这是 M2.3a;Runtime 的结算与结果发布留给下一层。

@zhiiw
zhiiw force-pushed the codex/managed-workspace-git-mutation-candidate-m2-2 branch from 5c02fd6 to 719cda3 Compare August 19, 2026 02:33
@zhiiw
zhiiw force-pushed the codex/managed-workspace-mutation-reservation-m2-3a branch from b2d0d8b to 584fe09 Compare August 19, 2026 02:33
@zhiiw

zhiiw commented Aug 30, 2026

Copy link
Copy Markdown
Owner Author

Closed as an obsolete extraction/integration slice. The current delivery path is the merged Gitoxide foundation followed by #40 -> #41 -> #42. This PR remains available as design and implementation history.

中文说明

该 PR 属于旧 extraction/integration 栈,现已失去独立合并价值。当前交付路径是已合并的 Gitoxide 基础,然后依次审查 #40 → #41 → #42。这里继续保留设计、实现与审查历史。

@zhiiw zhiiw closed this Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant