Repository navigation
Conversation
On Python 3.11-3.13 `Path.exists()` raises PermissionError when a parent cannot be searched (3.14 returns False). Doctor probes `~/.codex/skills/<id>/SKILL.md`, project-scoped skill names under each skill root, the selected registry path, and the Antigravity config skill root; its skill-install readback also probes each required skill with `is_file()`. A host sandbox that denies one of those roots therefore aborted the whole doctor run with a traceback, in the one command meant to diagnose such an environment. Treat an unsearchable path as absent in those probes, as 3.14 already does, so doctor completes and reports the affected checks. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Wang, Xiang-Han <wanghank00@gmail.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
BigDataDZ
left a comment
There was a problem hiding this comment.
独立评审(native Windows)——通过,暂不给正式批准
精确核对 head:a0bcd30b2。修复模式(OSError → False 的 _path_exists / materialized,对齐 Python 3.14 行为)在五个 doctor 探点和 skill readback 一致应用;Windows 上 chmod 不映射 ACL,崩溃场景本身无法复现,验证以代码审查与测试为主:
tests/test_doctor_installation_scope.py→ 32 passed / 1 failed / 2 skipped。失败的test_installation_scope_preserves_required_checks_without_opening_user_state[None]在未修改 main 上同样失败(Windows 环境既有问题,与本 PR 无关);两个新 POSIX 测试按skipif在 Windows 跳过(本机无法执行 chmod 000 场景)。usage_ping导入与os.geteuid的短路(os.name == "nt"先真)都核对过,Windows 收集安全。
一个完整性问题请作者确认:doctor.py 在本 head 仍有约 15 处裸 .exists()/.is_file()。多数明显无关(命令探测、安装脚本、legacy AGY home),但三处贴近被拒面,值得逐一确认"拒绝场景不可达"或一并转换:
doctor.py:562—skill_path.exists():当候选循环因_path_exists全部落空时,回退到primary_root / skill_name / "SKILL.md",若primary_root恰是被拒目录仍会抛出;doctor.py:663, 682-694—goals_dir/runtime_index探针(project.loopx被拒时的可达性);skill_install_readback.py其余裸点(:164/:175/:211/:217/:274)若同样服务 doctor 路径,属同一面。
您的新测试证明已转换的主路径在 chmod 000 下闭环;以上残留点若确认不可达(或在后续 PR 处理),不阻塞本次合并。
CI:该 head 的 Python 分片按两级门控策略跳过,无完整套件结果,按惯例不给正式批准。
Guard skill_has_required_phrases, latest_promotion_readiness_event, and Antigravity config file checks in loopx/doctor.py against OSError on unsearchable or unreadable targets, and have hash_skill_tree in loopx/skill_install_readback.py return its unavailable state instead of raising or silently hashing an unreadable skill directory as empty. Signed-off-by: Wang, Xiang-Han <wanghank00@gmail.com>
cc008a4 to
42a7ce0
Compare
|
Thanks for the thorough review on
Note on |
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
在受限的 POSIX 目录或宿主沙箱中运行 Doctor 的 Python 3.11–3.13 用户。 旧版探测不可搜索的 skill 或 registry 父目录时,可能以 PermissionError 退出,拿不到结构化诊断。 真实 Python 3.13 CLI 对相同权限夹具返回 JSON;不可读的技能树报告 unavailable。 范围限于只读诊断。现有技能目录清理与安装权限仍由原入口执行。
改动思路 / Approach
范围是 Doctor 的路径探测和已有技能 readback。 在原读取入口捕获文件系统错误,从完整遍历决定技能树摘要是否可用,避免返回部分树的有效指纹。 输入仍为本地探测,错误转成已有的缺失或不可用状态,未加入修改权限或写配置。 可读取路径仍按原规则判断和散列。
具体改动 / Changes
_safe_path_check将只读探测的文件系统错误交给原诊断状态。latest_promotion_readiness_event在原索引和运行记录路径不可读时完成探测。hash_skill_tree只有完整、可读取的树才给出摘要。inspect_skill_install_readback对单个受限技能沿用原物化缺失状态,安装端能继续看到其余可读技能。
按 PR #9746 的缺陷描述,基线 250932eee1eafd0c926cd2d498f5a11870c78432,核对 受限路径仍有 Doctor JSON 与 技能树不可用 两项。
对主干的风险 / Risks
同一份四项 pytest 真实权限案例用 CPython 3.13.16 对照基线与受审头,另比较可读和受限子树。 基线四项失败,三个到达真实 CLI。额外一组可读树摘要相同;子树被拒后,基线给出部分摘要,受审头返回 unavailable。75 项 Python 3.13 测试通过,quick premerge 的 6 项直接和 3 项选定检查通过。 权限反例在 macOS 上实际运行。此次独立验证未覆盖原生 Windows ACL。 当前主干的三方合并干净。
我的整体评价 / Verdict
批准。 受限目录不会中断整份报告,无法完整读取时也不会把部分树标成有效。验证已覆盖普通 CLI、AGY 配置根和运行账本。改动只影响 CLI 与只读技能诊断。
英文简短结论
English verdict: APPROVE at 42a7ce0. The real Python 3.13 CLI returns structured diagnostics for the denied-path fixtures, and incomplete skill trees no longer yield usable digests.
|
Hi @mojunzi, the DCO If the log confirms a missing |
…le-paths Signed-off-by: Wang, Xiang-Han <wanghank00@gmail.com>
133421a to
db1aff6
Compare
Goal And Delivered Outcome
CONTRIBUTING.md).Path.exists()andPath.is_file()raisePermissionErrorwhen a parent directory cannot be searched (Python 3.14 returnsFalse).loopx doctorprobes~/.codex/skills/<id>/SKILL.md, project-scoped skill names, the Antigravity config skill root, the selected registry path, and skill-install readback entries; a sandbox denying one of those directories aborted the entiredoctorrun with a traceback.loopx --format json doctor(anddoctor --agent-type agy) aborted with aPermissionErrortraceback when skill roots or project.loopxwerechmod 000on Python 3.13. After: unsearchable paths are treated as absent in those probes (matching Python 3.14 behavior), sodoctorcompletes and outputs its structured JSON report without a traceback (proved bytests/test_doctor_installation_scope.pyrow below).main.Author Declaration
Implemented against
PermissionErrorcrash inloopx doctoron Python 3.11–3.13 is the basisdoctorsurvives unreadable~/.codex/skillsand project.loopxwithout traceback_path_exists,installed_skill_summary,collect_doctor(loopx/doctor.py),inspect_skill_install_readback(loopx/skill_install_readback.py)python -m pytest -q tests/test_doctor_installation_scope.pydoctor --agent-type agysurvives unreadable Antigravity skill root without traceback_path_exists,collect_doctor(loopx/doctor.py)python -m pytest -q tests/test_doctor_installation_scope.pyruff,git diff --check, andloopx canary premerge --from-git-diff --git-diff-base origin/main --tier quick. Verified both new subprocess tests failed withPermissionErrortraceback on unpatched code before passing on the patched checkout. Full-repo pytest matrix is deferred to remote GitHub CI.Scope And Continuation
doctor.pyandskill_install_readback.pyunreadable path probes).Validation
a0bcd30b2d4ea871346667d41999fc99fd63a9d4finishedsyntheticreal_entrypointpasseduv run --offline --extra test python -m pytest -q tests/test_doctor_installation_scope.py— 35 passed (3.74s); includes POSIXchmod 000subprocess tests ofpython -m loopx.entrypoint --format json doctoranddoctor --agent-type agy.staticpasseduv run --offline --extra test python -m ruff check loopx/doctor.py loopx/skill_install_readback.py tests/test_doctor_installation_scope.pyandgit diff --check origin/main..HEAD— exit 0.regression_paritypasseduv run --offline --extra test loopx canary premerge --from-git-diff --git-diff-base origin/main --tier quick—ok=true,merge_gate_passed=true, 0 advisory failures (all direct checks plusinstall-local-smoke.py,codex-cli-packaged-install-smoke.py, andloopx-update-smoke.pypassed).unitnot_runpython-tests.yml). POSIX permission tests are skipped on Windows / root hosts.doctorinstallation-scope checks. Full-suite regression coverage runs in remote CI.See validation disclosure guidance.
Frontend / Visual Evidence
nonenoneType of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
N/A
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).python3 scripts/check_rfc_bilingual.py --base origin/main --head HEADpasses, or no paired RFC changed.none.Signed-off-bytrailer (git commit -s).