Repository navigation
Keep managed Chat workspace checker reads portable - #8814
Conversation
Signed-off-by: LoopX Agent <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent / gpt-6.1-sol / OpenAI / runtime_reported / reasoning effort max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
维护 Chat 验收流程的人需要从原工作区准备独立检查,并能定位可移植性测试发现的违规。 基线在发现直接引用 POSIX 专用常量时,先在格式化诊断的位置抛出 ValueError,维护者得不到文件和行号。候选移除了当前违规点。把同类直接引用放入隔离模块后,测试给出了具体文件和行号。
File 和 SQLite 上都从原工作区读取了独立检查源的 digest,只保存了一条待审提案。任意一个旗标或 descriptor-relative 能力缺失时,两端均按原错误拒绝。文件打开和提案保存次数都为零。 本次独立核验在 macOS 执行。平台能力缺失由定向故障注入模拟,原生 Windows 运行尚未验证。
改动思路 / Approach
本 PR 修复检查准备的 POSIX 常量访问和现有可移植性测试的错误诊断。 安全文件读取属于现有 Chat 工作区。生产代码读取一次主机能力,测试直接呈现扫描到的源码位置。 原会话先经已有身份核验,再检查三个 flags 和 descriptor-relative 打开支持。目录使用相同的保护。文件仍须是普通文件,源 digest 进入待审提案。测试可以直接从原始 AST 观察结果取位置。原检查和权限约定
具体改动 / Changes
关键代码讲解
_workspace_file在同一局部读取三项能力,同时核对os.open支持目录描述符。缺一即在打开前拒绝。目录与最后的源文件保持 no-follow,最后还检查普通文件。checker-source-safety 和 original-workspace-pin 已在实际调用确认。工作区安全读取 · 真源检查与提案读回test_no_module_exceeds_its_bare_posix_flag_ceiling直接使用已有的违规文件和行号。ratchet-diagnostic-line 已验证。在两个 checkout 给同一真实 scanner 添加裸引用,基线格式器抛 ValueError,候选报出loopx/probe.py:4和os.O_NOFOLLOW。架构测试及诊断
按 docs/guides/personal-workspace-user-guide.md 核对了原会话、本地范围和独立验收。实际测试也覆盖了符号链接、读取时源改变和错误会话。路径与范围负例
对主干的风险 / Risks
以正确激活的源码环境运行同一选集。基线只有可移植性诊断失败,139 项通过。候选 140 项通过。额外在两边的 File 与 SQLite 分别移除四类安全能力,共各八次拒绝检查。没有任何文件打开或新提案。候选实际覆盖在 macOS。原生 Windows 仍待运行。
语义与 CI 对齐
沿用现有 Chat 准备权限、POSIX 文件保护和架构 ceiling。新增的是可定位的测试诊断,没有新状态或协议词汇。
我的整体评价 / Verdict
本 PR 修复检查准备的 POSIX 常量访问和现有可移植性测试的错误诊断。 对维护者,违规诊断能直接定位文件,而原工作区保护经过真实入口与反例对照。检查了原 Chat 工具调用、源文件读取及架构测试。差异没有渲染代码。 此提交的原生 Windows 和已安装宿主未独立运行。 在 0e6b5c7695ae 给出通过结论。
English verdict: APPROVE at 0e6b5c7. The ratchet reports the actual file and line. Real Chat preparation preserves the original workspace and fails closed when safety primitives are missing. Native Windows was not independently run.
…000 commits (#8759) * Deliver verified images in private Lark answers Signed-off-by: LoopX Agent <[email protected]> * Keep image retries behind new private Lark replies Signed-off-by: LoopX Agent <[email protected]> * Recover missing images from one verified private Lark reply Signed-off-by: LoopX Agent <[email protected]> * Use one wall clock for private Lark image retries Signed-off-by: LoopX Agent <[email protected]> * Recheck the original Lark reply before historical image writes Signed-off-by: LoopX Agent <[email protected]> * Verify private Lark image sources before every redirect Signed-off-by: LoopX Agent <[email protected]> * feat(coordination): add postgresql authority checkpoints and local-to-pg-seed exporter - Add authority_checkpoints table DDL and tenant-scoped RLS policies. - Store incremental delta in authority_commits and bounded checkpoints every 64 commits and on genesis cursor 1, resolving table bloat and the 20,000 commit recovery ceiling. - Implement scanCommitted bounded delta replay from covering checkpoint via AuthorityStateReplay. - Add setupPostgreSqlAuthoritySchemaAndRole for explicit schema installation and least-privilege restricted role assembly. - Add exportLocalToPgGenesisSeed with sanitization (expired leases, local absolute paths, .local/ references, Feishu IDs, private materials) and fail-closed privacy boundary scan. - Add loopx postgres setup and loopx postgres local-to-pg-seed CLI commands. - Add test suites for checkpoints, sanitization, role assembly, and CLI invocation. Signed-off-by: LoopX Agent <[email protected]> * Recheck the historical Lark reply before each media write Signed-off-by: LoopX Agent <[email protected]> * Retry Lark image uploads after an explicit App scope rejection Signed-off-by: LoopX Agent <[email protected]> * Honor original Lark stop and closure before deferred images Signed-off-by: LoopX Agent <[email protected]> * Recheck private answer control after Lark source read Signed-off-by: LoopX Agent <[email protected]> * Read the current Core session after delayed image controls Signed-off-by: LoopX Agent <[email protected]> * Fence private answer media dispatch with original controls Signed-off-by: LoopX Agent <[email protected]> * Keep Lark media checks with private delivery Signed-off-by: LoopX Agent <[email protected]> * Recheck Lark image sources after recording upload intent Signed-off-by: LoopX Agent <[email protected]> * Read both original Feishu messages together before media upload Signed-off-by: LoopX Agent <[email protected]> * Verify Feishu sources at the guarded image dispatch Signed-off-by: LoopX Agent <[email protected]> * Preserve pre-dispatch Feishu source and session validation Signed-off-by: LoopX Agent <[email protected]> * Recover and verify PostgreSQL checkpoint history with append-only privileges Signed-off-by: LoopX Agent <[email protected]> * Verify backup history to its captured cursor beyond 20000 commits Signed-off-by: LoopX Agent <[email protected]> * Generate explicitly synthetic secret fixtures at test time Signed-off-by: LoopX Agent <[email protected]> * Recover private image uploads when the Lark CLI cannot start Signed-off-by: LoopX Agent <[email protected]> * fix(chat): preserve the first Goal's registered conversation (#8798) * fix(chat): preserve the first Goal's registered conversation Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * test(chat): keep original Goal adoption compatible with Python 3.11 Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> --------- Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Avoid rereading delivered Lark settings records and empty queues Signed-off-by: LoopX Agent <[email protected]> * Recover private Lark images after a CLI descriptor limit Signed-off-by: LoopX Agent <[email protected]> * Enable existing checks and the original authorized Task in managed Chat Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Reuse the canonical boundary projection and narrow Task JSON types Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Keep confirmed Goal creation attached to its original Task (#8805) Reuse the existing C1 source observation guard Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Assert the lease source probe returned an observation (#8796) (cherry picked from commit 2c099be) Signed-off-by: LoopX Agent <[email protected]> * Recover an owed replan debit before the next host Turn (#8794) * Recover an owed replan debit before the next host Turn Consider the original Todo binding when an admitted replan has verified writeback. Require the exact spend receipt before another guard grants delivery, even if the Todo lifecycle has changed. Keep explicit selection on the same recovery path and let the existing settlement owner replay the original debit. Signed-off-by: LoopX Agent <[email protected]> * Preserve ordinary completed-Todo successor admission Signed-off-by: LoopX Agent <[email protected]> * Replay one validated Turn debit across concurrent observations Signed-off-by: LoopX Agent <[email protected]> * Validate original Turn spend terms before debit and replay Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * Keep conversation history rendering off the typing path (#8781) Signed-off-by: LoopX Agent <[email protected]> * feat(coordination): complete remote task lifecycle and opt-in gateway access (#8747) (#8765) * feat(coordination): add complete remote task lifecycle and opt-in gateway access (#8747) Align with PR #8747 (multi-loopx-agent-cloud-collaboration-v0) and remote-authority-task-service-v0 (#8508): 1. Extend RemoteAuthorityService with full remote task settlement: - Add 'complete', 'block', 'defer', 'todo_add', and 'snapshot' operations. - Enforce hard-lease fencing and claim-request ownership checks. - Settle completion receipts and deterministic cross-machine snapshot digests. - Maintain default-deny Tenant/Goal/Actor authorization and incarnation pinning. 2. Introduce controlled remote authority gateway in Python control plane: - Default-disabled access: local private Goals never connect to remote authority or leak local credentials. - Opt-in gateway metadata projection for explicitly configured goals and the 'loopx-quality-review' canary. - Fail-closed should-run health check when remote authority is unconfigured or unreachable. 3. Conformance and unit test coverage across TypeScript and Python suites. Signed-off-by: LoopX Agent <[email protected]> * test(coordination): assert subprocess readback before decoding Signed-off-by: LoopX Agent <[email protected]> * fix(coordination): qualify explicit remote task reads and lifecycle receipts Signed-off-by: LoopX Agent <[email protected]> * fix(coordination): preserve existing successors on remote completion Signed-off-by: LoopX Agent <[email protected]> * test(remote-authority): prove ordinary admission stays local Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * test(chat): preserve create-only intent in workspace selection smoke Signed-off-by: LoopX Agent <[email protected]> * Defer material inventory during configuration discovery (#8807) Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Defer report providers during Turn reads Signed-off-by: lusendong.6789 <[email protected]> Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * test(core): require installed provenance before qualification Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Reuse the final source check for staged Turn requests (#8820) Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Defer PR wait provider loading until permission is checked (#8821) Load the optional PR reconciler only after the invocation-time observation permission check, inside the existing provider failure boundary. Preserve original permission, cadence, result and unknown-effect owners, and document the bounded default-closure and timing-window change. Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Load provider options only for the selected capability editor (#8822) Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * docs: describe README session continuity directly (#8823) * Skip automatic usage observers for supported opt-outs (#8824) * Skip automatic usage observers for supported opt-outs Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Record installed Core and C1 observer qualification Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> --------- Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * docs(blog): add EdgeBench controlled Context ON vs OFF 10-task score comparison (#8760) * docs(blog): add EdgeBench controlled Context ON vs OFF 10-task score comparison Signed-off-by: LoopX Agent <[email protected]> * docs(blog): use declarative mechanism-led opening in zh context-delivery score section Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(heartbeat): preserve proven waits before their due time (#8825) Signed-off-by: LoopX Agent <[email protected]> * Fix manager discovery in ordinary installs (#8830) * Package the manager discovery projection Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * Record selected manager discovery distribution qualification Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> --------- Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * test(workspace): verify confirmed Goal creation against the current contract (#8816) Signed-off-by: LoopX Agent <[email protected]> * Fix Windows CLI output probe reader invocation (#8817) Port the probe fixture and native Windows regression coverage from e6eb92d and 8d200aa. Decode the generated PowerShell literals into argv before launching the pinned reader. Signed-off-by: LoopX Agent <[email protected]> * refactor(issue_fix): fold reviewer source trust/freshness vocabularies into one owner (#8826) reviewer_recommendation.py restated the trust and freshness sets that repository_context.py already owns. Import both as aliases of the owner objects so the decision has a single source, and add an architecture guard that pins single ownership by value, by identity, and by wiring through both public builders. REVIEWER_SOURCE_KINDS stays local (deliberately narrower). Signed-off-by: psychologister <[email protected]> Co-authored-by: psychologister <[email protected]> * fix(scheduler): reject superseded heartbeat receipts on the Python follow-up route (#8708) * fix(scheduler): reject superseded heartbeat receipts on the Python follow-up route The Python compatibility route for scheduler-ack-current/scheduler-fail-current checked only that the receipt for --turn-instance-id exists; a receipt already superseded by a newer heartbeat Turn still committed scheduler state, while the native TypeScript transaction rejects it as heartbeat_receipt_stale. Thread the Turn from build_scheduler_followup_payload through record_quota_scheduler_ack / record_quota_scheduler_ack_for_decision / record_quota_scheduler_failure_for_decision into _run_native_followup, which now sends turn_instance_id with require_heartbeat_receipt=true. The TypeScript transaction remains the single owner of the missing/stale/superseded fence (it also rechecks under the scheduler state lock); optional parameters keep the in-process API, which has no Turn, unchanged. Fixes #8605 Signed-off-by: Lihua <[email protected]> * Keep scheduler follow-up hint reads out of legacy migration Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: Lihua <[email protected]> Signed-off-by: LoopX Agent <[email protected]> Co-authored-by: LoopX Agent <[email protected]> * Resume the original quota settlement after lifecycle writeback (#8728) * fix(replan): resume settlement after lifecycle review writeback Signed-off-by: LoopX Agent <[email protected]> * Recover committed replan settlement before rebuilding its review Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(antigravity): keep the project registry in generated wakes (#8768) Signed-off-by: LoopX Agent <[email protected]> * fix(chat): keep workspace checker reads portable (#8814) Signed-off-by: LoopX Agent <[email protected]> * Reject external Turn retries when the captured work changes (#8828) * Recheck captured work before launching an external Turn host Signed-off-by: LoopX Agent <[email protected]> * Keep complete-source metadata assembly outside Turn planning Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * Preserve PostgreSQL runtime access and recover seed output retries Signed-off-by: LoopX Agent <[email protected]> * Validate recovery cursor metadata without a fixed history ceiling Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> Signed-off-by: lusendong.6789 <[email protected]> Signed-off-by: psychologister <[email protected]> Signed-off-by: Lihua <[email protected]> Co-authored-by: Lusen Dong <[email protected]> Co-authored-by: TRAE CLI <[email protected]> Co-authored-by: Lusen Dong <[email protected]> Co-authored-by: psychologister <[email protected]> Co-authored-by: psychologister <[email protected]> Co-authored-by: Lihua <[email protected]>
Goal and delivered outcome
The portability check in the Windows job on #8266 exits while formatting the violations. The current main branch has the same two files. The checker used six direct references to POSIX-only flags, which exceeded its per-module ceiling. Windows job
Read the three flags once and require both those flags and descriptor-relative opens before reading any workspace file. Reuse the validated flags for each open. The check now reports the violating file and line. This targets
main.Author declaration
Written by Codex, OpenAI. Implemented against the existing POSIX flag ceiling and workspace checker source safety contract at
c5ff8fdc32b6a6b806cf91f4c0154d912a381e8e.tests/architecture/test_posix_flag_portability.pytests/control_plane/test_goal_session_check_preparation.pyValidation
Tested revision
0e6b5c7695ae529cc20ca71b544167000f46c641. Local runs finished using synthetic fixtures.uv run --extra test python -m pytest -q tests/architecture/test_posix_flag_portability.py tests/control_plane/test_goal_session_check_preparation.pypassed 140 tests on macOS.Scope and continuation
The fix is complete in this branch. After review and integration on
main, the C1 branch can pick it up through its normal synchronization. The existing Chat action and visual states use the same preparation route. UI impact is none.