feat(runtime-host): add Gitoxide candidate and accepted-tree read data plane - #3857
feat(runtime-host): add Gitoxide candidate and accepted-tree read data plane#3857zhiiw wants to merge 7 commits into
Conversation
8de92c3 to
699e12d
Compare
|
Thanks for the adversarial review. I reworked the boundary around the findings instead of adding more checks to the previous combined capability model. The updated head is The main changes are:
Regression coverage now includes accepted/candidate separation, stale-base rejection before writes, exact retry, corrupt base-tree storage, typed no-change, owner-bound candidate proof, legacy helper feature rejection before destination claim, and HFS alias rejection. Verification for this head is green:
The PR remains Draft while this authority boundary is reviewed. 中文说明感谢这次对抗性审查。这轮没有继续给原来的混合 capability 叠加校验,而是重新划分了 owner 边界。当前 head 为 主要调整如下:
新增回归覆盖 accepted/candidate 分离、写入前 stale-base 拒绝、exact retry、损坏 base tree、typed no-change、owner-bound candidate proof、旧 helper feature 在 destination claim 前拒绝,以及 HFS alias 拒绝。 当前 head 的验证全部通过:Gitoxide helper 的 Ubuntu/macOS/Windows、Windows recovery,以及完整 CI(build、typecheck、format、Runtime Host、Desktop e2e、Storybook、CLI release candidate)。 PR 继续保持 Draft,等待这次 authority 边界复审。 |
|
Thanks for the adversarial re-review. I addressed the three protocol blockers at their shared evidence-owner boundary in 1. Candidate construction now consumes verified tree bytesThe helper no longer calls
A regression performs the full verified walk, replaces a nested loose tree object under the old OID, and proves candidate editing fails instead of deriving from the replacement bytes. 2. Published and no-change now share one linear outcome authorityBoth success dispositions now create a deterministic receipt commit and CAS the same operation-derived candidate ref. The receipt binds a domain-separated request digest covering accepted ref, base commit/tree, candidate ref, path, and result bytes. This means:
Runtime Host issues one 3. Candidate outcome is bound to the exact accepted lineageThe private capability record now binds:
Consuming an outcome now requires presenting both owner tokens and the original accepted capability. A regression proves an outcome from repository A cannot be consumed with repository B's capability even when both repositories contain identical Git objects. Additional P1/P2 hardening
Durability scopeThe Git receipt commit/ref is durable, while accepted/candidate capabilities remain process-local in this slice. The architecture document now states this explicitly. Cross-Host reissuance remains owned by the later durable workspace-receipt/lifecycle layer, which must reopen the exact repository, revalidate the accepted ref/commit/tree, inspect the operation receipt, and then reissue capability. This PR no longer overstates same-process exact retry as cross-process reopen. Verification
The PR body has also been updated so it no longer claims that no-change omits a commit/ref, and it accurately records the deferred cross-Host reopen boundary. 中文说明感谢这轮对抗性复审。这次没有继续分别补条件,而是把三个协议级问题统一收敛到 candidate evidence owner:
同时完成了:
跨 Host 的 capability 重签发没有假装在本 PR 中完成:Git receipt commit/ref 已耐久,但 capability 仍是进程内 authority;后续 durable workspace receipt/lifecycle owner 需要重开 exact repository、重验 accepted identity、检查 operation receipt 后再签发。文档和 PR body 已明确这个范围。 验证方面,Rust 59 个测试通过;Ubuntu/macOS/Windows 三平台真实 helper gate 与 Windows recovery 均通过。通用 CI 的 build、typecheck、Runtime Host tests 也已通过,当前只剩仓库统一 Desktop e2e 仍在运行。 |
Astro-Han
left a comment
There was a problem hiding this comment.
I reviewed this head and found no blocking issues.
Implements two bounded capacities: immutable candidate result per operation (never touches accepted ref, TOCTOU double-check) and single UTF-8 read from owner-bound accepted tree (8MiB, canonical path). Hosted test/audit/owner/package/windows all SUCCESS.
No P0-P3.
简体中文
该头无阻断。Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
08df97b to
16405e1
Compare
16405e1 to
e7356d9
Compare
|
Thanks for the careful re-review. I addressed the direct-ref blocker and the bounded follow-ups in
Verification on the rebased head:
中文说明感谢这轮细致复审。
重放到最新 |
Summary
Add a Gitoxide candidate/read data plane on top of repository admission and source import from #3561.
This revision intentionally keeps filesystem projection out of the protocol. It provides two bounded capabilities:
Primary invariant
An accepted-repository capability represents one exact accepted SHA-1 commit/tree at the fixed
refs/maka/acceptednamespace. Accepted and candidate refs must be direct refs to verified commit objects; symbolic refs and annotated tags are rejected. Candidate creation may publish only an operation-specific receipt ref and owner-bound outcome capability. A later SQLite acceptance/promotion owner remains the only component allowed to establish a new accepted head.Ownership and atomic boundaries
create_candidateandread_tree_filebefore destination import is claimed.refs/maka/candidates/<sha256(operationId)>.candidate_request_conflictwithout creating new objects.candidate_publication_indeterminate.Fail-closed behavior
The second accepted-ref check and candidate-ref CAS are not one multi-ref transaction. Accepted-head drift in that narrow window may leave stale candidate evidence bound to the old base, but cannot advance accepted truth. The later SQLite acceptance owner must revalidate the canonical head and reject stale evidence.
Durability scope
Candidate receipt commits and refs are durable. Accepted and candidate capabilities are intentionally process-local in this enabling slice. Cross-Host reopen requires the later durable workspace-receipt owner to hold the storage-root lease and revalidate the exact repository, direct accepted/candidate refs, receipt checksum, request digest, base parent, candidate tree, and path/result blob before SQLite acceptance. Candidate retention/GC belongs to that later owner; this PR does not claim cross-Host reopen or GC.
Verification
git diff --checkpassed locally.main@bfba25361.中文说明
概要
本 PR 在 #3561 的 repository admission/source import 基础上,提供 Gitoxide candidate outcome 与 accepted-tree direct read 数据面;filesystem projection 仍留给后续 owner。
主要不变量
accepted-repository capability 只代表固定
refs/maka/accepted下的一个 exact SHA-1 commit/tree。accepted ref 与 candidate ref 都必须直接指向经过校验的 commit;symbolic ref 和 annotated tag 会被拒绝。candidate 只能发布 operation-specific receipt ref 与 owner-bound outcome capability,新的 accepted head 仍只能由后续 SQLite acceptance/promotion owner 建立。本轮收口
candidate_request_conflict;candidate_publication_indeterminate,不再混入笼统错误;耐久范围
candidate receipt commit/ref 跨进程耐久,但 capability 仍是进程内 authority。跨 Host 重开需要后续 durable workspace-receipt owner 持有 storage-root lease,并重验 repository、direct refs、receipt checksum、request digest、base parent、candidate tree 与 path/result blob;candidate GC 也由该 owner负责。本 PR 不虚称已完成 cross-Host reopen 或 GC。
验证
git diff --check通过;main@bfba25361。