Skip to content

feat(checkout): scope Rust Agent Checkout by Repo UUID (OFF/OPTIONAL) - #87

Merged
opendev9 merged 8 commits into
devfrom
fix/checkout-per-repo-20261025
Oct 25, 2026
Merged

opendev9 merged 8 commits into
devfrom
fix/checkout-per-repo-20261025

Conversation

@servicememeai

Copy link
Copy Markdown

Decision (2026-10-25)

CloudFile supports only OFF (default) and per-library OPTIONAL Checkout. REQUIRED will not be implemented.

  • Hub issues exclusive tickets only when Repo UUID is listed in CF_CHECKOUT_REPOS and global Checkout/schema qualify.
  • lock-info returns OFF without Guard SQL for unselected repositories.
  • local-view and optimistic-edit remain usable for OFF repositories with normal ACL/CAS authorization.
  • No new lock/session table, provider-specific path, or file extension heuristics.
  • Adds targeted OFF/no Guard tests and a durable design decision document.

Not merged into Hub #50; keep #50 Draft until native/Docker prerequisites and the owner-resume UI issue are addressed. Agent2 #10/#1 stay Open until genuine E2E. No full Django/frontend build in this change.

…safes

- design doc no longer claims ordinary writes work when Guard is unavailable;
  OPTIONAL writes (including optimistic) fail closed, OFF stays operational
- tests: selected repo is still OFF when the global capability is disabled;
  a malformed CF_CHECKOUT_REPOS type fails safe to OFF without Guard access
Patch the empty allowlist (not the helper) so the test proves checkout_available
and therefore Guard schema/SQL are never reached for OFF repositories.
@opendev9

Copy link
Copy Markdown

2026-10-25 检查与修复

实现与决策一致(OFF 默认、OPTIONAL 按 UUID、REQUIRED 不做;OFF 不碰 Guard)。修正两处:

  1. 设计文档与实现矛盾:docs/checkout-per-repo-policy.md 原写“OPTIONAL without Guard: ordinary edits and explicit Checkout both available”,与 Server PR(OPTIONAL 缺 Guard 时所有写入 fail-closed)不一致。已改为:Guard 健康且无活动租约时普通编辑/Checkout 可用;Guard 不可用时 OPTIONAL 写入(含普通/optimistic)fail-closed,OFF 不受影响。
  2. OFF 测试偏弱:原 test_off_repo_lock_info_never_queries_guard patch 掉了 checkout_for_repo 本身,无法证明真实短路;已改为 patch 空 allowlist,让真实 helper 在 checkout_available()/schema 之前返回,并断言无 DB cursor。
  3. 补测:全局开关关闭时已选 repo 仍 OFF;CF_CHECKOUT_REPOS 类型错误时 fail-safe 到 OFF 且不触 Guard。

验证:CI static PASS。Django 依赖测试(本文件)未在本机运行,需在 dev 环境跑一遍;CF_CHECKOUT_REPOS 由 Docker 生成 tuple,手工部署需按文档写 tuple。

lock-info now tells the dialog whether the current viewer owns the Guard. The
Rust Agent still verifies the original Guard proof; this flag only distinguishes
the owner's resume entry from another user's occupancy. No new table or ticket
type.
A real Django environment runs UserRateThrottle before the view; the synthetic
user needs an id. Verified all 11 rust_edit tests pass against the devverify
image (throttle bypassed only because the standalone container has no Redis).
@opendev9

Copy link
Copy Markdown

2026-10-25 定向 Django 测试结果

在 cloudfile/cloudfile:14.0.0-cf.devverify20261024 内运行 cloudfile_ext.v2.tests.test_rust_edit_view:

  • 11/11 通过(含 OFF 不查 Guard、全局关闭仍 OFF、类型错误 fail-safe、OFF lock-info 无 DB cursor)。
  • 测试用户补 id 以适配真实 throttle 前置;独立容器无 Redis,验证时仅旁路 throttle(不影响被测路由逻辑)。
  • checked_out_by_me 已加入 lock-info(不改票据/表),供 fix(web): 补齐本地查看、普通编辑与独占编辑入口 #50 区分本人恢复与他人占用;Rust Agent 仍校验原 Guard。

CI static PASS。与 Server/Docker 同批联动重启后合入。

@opendev9
opendev9 marked this pull request as ready for review October 25, 2026 04:19
@opendev9
opendev9 merged commit d437208 into dev Oct 25, 2026
2 checks passed
@opendev9
opendev9 deleted the fix/checkout-per-repo-20261025 branch October 25, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants