Repository navigation
fix(runtime): separate durable directory identity from mount identity - #6815
Conversation
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
|
@M4n5ter I hit the Root marker schema 2 bump and Since #6632 switched workspace selection to paths, the Host already resolves a canonical path inside
Would it make sense to persist only the canonical workspace 中文版@M4n5ter 今天拉了最新的 #6632 改成按路径选择工作区后,Host 已经在
是不是可以工作区只持久化规范化后的 |
EnglishI agree with this direction. I explicitly asked to retain Host-persisted We’re comfortable making a clean architectural cut here. If a concept can be removed while the supported workflows and meaningful safety guarantees continue to work, it should be removed. Existing consumers alone don’t justify keeping it. For ordinary workspaces, let’s use the canonical path as the persisted location and remove the persistent filesystem identity and Please follow the removal through its consumers, including workspace grouping, authorization, managed worktrees, and recovery. Simplify or delete the assumptions that depend on the old model, and reuse the existing Host binding and permission mechanisms where needed. We don’t need compatibility wrappers for the internal formats; a one-time migration is fine. The same reasoning applies to State Root: retain the lease for exclusive ownership, and assess any additional persistent identity against a concrete correctness requirement. Recovery must not silently redirect an already admitted operation to a replacement directory. If that requires a durable proof in a particular workflow, scope it to that workflow rather than making every workspace depend on a universal persistent directory identity. Please go ahead with the PR along these lines. We’re happy to remove the abstraction and its supporting machinery completely wherever they no longer serve a concrete requirement. 简体中文我同意这个方向。#6632 里是我明确要求保留 Host 持久化的 这里可以做一次彻底的架构删减。如果一个概念删掉以后,受支持的工作流和真正需要的安全保证仍然成立,那它就应该被删除。现有代码里有消费者,本身不足以证明这个概念应该继续存在。 对于普通工作区,我们就用规范化后的路径作为持久化位置,移除持久化的文件系统身份和 请把删除贯彻到相关消费者,包括工作区分组、授权、托管 worktree 和恢复逻辑。依赖旧模型的假设,该简化就简化,该删除就删除;需要时复用现有的 Host binding 和权限机制。内部存储格式不需要保留兼容 wrapper,一次性迁移即可。 State Root 也按同样的原则判断:保留用于独占所有权的 lease,额外的持久化身份则必须有具体的正确性需求支撑。恢复过程不能把已经接纳的操作静默转向同名的新目录。如果某个工作流确实需要持久化证明,就把证明限定在那个工作流里,不必让所有工作区都依赖一套通用的持久目录身份。 可以按这个方向提 PR。只要没有具体需求支撑,我们接受把这层抽象连同它的配套机制一起彻底删除。 |
EnglishFollowing up on my earlier reply, here is a concrete deletion plan after tracing the current workspace, authorization, worktree and State Root consumers. The proposed end state is: Host records own logical identity; paths locate directories; filesystem-object observations serve the lifetime of the operations that need them. We should remove the general assumption that every workspace and State Root needs a permanent physical directory identity.
Suggested sequence: close out the marker and path-binding consumers first, then simplify State Root, then remove the long-lived worktree source fingerprint. Each change should preserve the original operation/recovery boundary. Focused acceptance should cover same-path re-clone with existing conversations; folder selection without filesystem writes; directory replacement during an admitted operation; Root relocation plus competing-Host lease rejection; checkpoint crash recovery and original-receipt lookup; and worktree retirement without recreation. Reuse existing behavior tests and remove tests dedicated to deleted mechanisms. 简体中文接着上面的回复,沿着当前 workspace、授权、worktree 和 State Root 的消费者核对了一遍,可以把删除方案具体化为下面这些改动。 目标模型是:逻辑身份由 Host 记录持有,路径负责定位目录,文件系统对象观察只服务于需要它的操作生命周期。 删除“所有工作区和 State Root 都必须拥有永久物理目录身份”这个通用前提。
建议顺序是先闭合 marker 和路径绑定的消费者,再简化 State Root,最后移除 worktree 的长期 source fingerprint。每刀都保住原 operation/recovery 边界。 定向验收覆盖:同路径重新 clone 后旧会话可用;选择目录不写文件;已接纳操作期间替换目录不会切换目标;Root 迁移后可打开且第二个 Host 仍被 lease 拒绝;checkpoint 崩溃恢复和原回执查询正确;退休 worktree 不会被旧 binding 重建。复用现有行为测试,删除只保护废弃机制的测试。 Prepared with Maka (OpenAI Codex), based on a read-only source audit at 本方案由 Maka(OpenAI Codex)辅助整理,依据上述提交的只读源码审计;本次补充未修改代码,也未新增运行时验证。 |
…-up (#6910) Preserve workspace directory grants when Linux overlayfs copies a lower-layer directory to the writable upper layer so creating `.maka-workspace.json` does not invalidate the grant used by ACP `session/new` and subsequent tools. - Omit `birth` from `DirectoryIdentity` only on `OVERLAYFS_SUPER_MAGIC`, where directory copy-up updates birth time while preserving the origin directory inode. - Keep overlayfs on the `FS_IOC_GETFSUUID` path rather than `f_fsid` so mounts with `uuid=on`/`uuid=auto` bind to their persistent overlay instance UUID and `uuid=off`/`uuid=null` mounts (which expose the shared backing filesystem `f_fsid`) fail closed with `Unsupported`. Refs #6667 and #6815. Generated-by: Google Antigravity Generated-by: OpenAI Codex
Summary
Root admission, directory grants, workspace checkpoints, and directory-backed execution evidence use the same persistent directory identity. A device number is used only to compare handles within the current mount and is never part of the durable proof.
statfsID can mix in the device number on a clone. XFS exposes its on-disk UUID through filesystem geometry because itsstatfsID is a device number. Other Linux filesystems must expose a UUID throughFS_IOC_GETFSUUID.Preview upgrade
The runtime accepts only Root marker schema 2. The previous runtime remount repair and legacy-grant matching paths are removed. Existing Roots must be migrated offline before starting this version. There is no SQLite schema change.
Download the one-time Python migration. Quit Maka and stop the Root's Host. Run
python3 maka-migrate-directory-identity.py --root DIRECTORYto inspect the proposed changes, then add--apply. If the mount device already changed, verify the original directory and pass--confirm-remount ROOT_ID. The script takes the Root lease, verifies saved directory proofs, and makes backups before replacing them. It covers ordinary workspace bindings and their pending completion routes. Managed worktree bindings, missing directories, and other grants whose old proof cannot be verified require explicit re-establishment. Historical run and checkpoint records are preserved.Verification
x86_64-unknown-linux-gnuandaarch64-pc-windows-msvc. Native Linux and Windows CI are pending. The offline script has been exercised on macOS.AI use
Tool(s) and scope: Codex implemented the changes and offline migration and ran the checks above.
Checklist
Does this PR entail a change in behavior?