Repository navigation
fix(windows): let W1 Glob skip nested junctions - #3955
Conversation
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
cf968e3 to
31f2292
Compare
Validated build, lint, formatting, typecheck, scoped regression suites, ASF headers and protocol guard against main. The merge brings unchanged upstream files that the HEAD-relative pre-commit hook rejects; no upstream formatting or protocol declarations were rewritten. Generated-by: OpenAI Codex
me2seeks
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent operated by me2seeks make. It is not an independent human review and does not replace one.
Summary
Lets W1 Glob skip nested junctions on Windows: acl_ledger.rs gains a non_following_read_root grant kind — it must name a declared recursive readRoot and requires a read-only launch (rejected if any write roots exist), with hard bounds (MAX_NON_FOLLOWING_READ_GRANTS=4096, ENTRIES=100k, DEPTH=256) and a partition_non_following_read_root helper feeding upsert_ledger_root. Protocol tests, broker-authorization tests, windows-launcher tests, the RFC docs (en+zh), the experiments README, and the filesystem-worker client/Windows-smoke tests move in step; packages/runtime/package.json records the boundary. The direct-peer addon builds pass on all four platforms.
Findings
- [P2] Third open PR for this fix — #3952 (
fix(windows): let Glob skip nested junctions) and already-reviewed #4683 implement the same change in the same files. Maintain at most one; this one'snon_following_read_rootis the cleanest formulation of the three (named grant kind with explicit bounds and a read-only requirement), but the trio must be reconciled before any merges. - [P3] Only the addon-build lanes ran on this head — for a sandbox-grant change, the runtime
testlane andwindows_recoverymust run green.
Verdict
needs-discussion — the strongest of the three implementations, but it must be reconciled with #3952/#4683 and get a real Windows test run.
|
This pull request has had no new commits for 30 days and has been marked stale. It will be closed in 7 days unless a new commit is pushed. Comments do not reset this timer: only a new commit does. If the pull request is intentionally long-lived, a maintainer can apply the |
Merge upstream main at 222a06f. Preserve the read-only Glob policy and native ACL settlement rules while adopting the files/truncated contract, probing one extra distinct match, and propagating admitted traversal failures. Add portable regressions and extend the real Windows smoke and packaged checks. Generated-by: Codex
me2seeks
left a comment
There was a problem hiding this comment.
Automated review notice: This review was performed by an automated agent operated by me2seeks. It is not an independent human review and does not replace one.
Reviewed current head 51a9bb2daf29de50c2d7962edcd5facd8245e827. Two reproducible matching regressions remain in the new Windows walker; see inline findings.
Validation on Linux / Node 24.22.1: 95 focused source-level filesystem-worker / Windows-policy tests passed, 50 Windows harness / package-closure / inventory tests passed, Rust formatting passed, and cargo check --locked --tests --target x86_64-pc-windows-msvc passed. The source-level tests reuse the installed dependency tree (glob 13.0.6 and minimatch 10.2.5). An additional 2,042-pattern comparison against production globFiles found 32 differing memberships, reduced to the two cases below. These are portable operation reproductions, not independently executed native Windows/AppContainer tests.
Hosted Windows packaging and recovery checks passed; the main CI test job was cancelled. The older duplicate PRs #3952 and #4683 are closed.
Match terminal dot components at the current directory, including the zero-component globstar transition. Keep explicit hidden matches separate from recursive globstar state and remove the extra leading-dot successor transition. Add membership and exact-cap regressions plus native broker smoke cases, without changing admission or ACL cleanup. Generated-by: Codex
me2seeks
left a comment
There was a problem hiding this comment.
The two Glob matching regressions are fixed and covered by portable and Windows smoke regressions. Focused source tests, a 2,042-pattern parity comparison, formatting, Windows recovery/protocol, packaging, and the complete hosted CI checks pass. Reviewed at f1eabe8c0c0a508fc71455bcf43a67dd68c1627b.
Summary
Windows W1 read-only recursive
Globcurrently rejects an entire search root when it contains a nested NTFS junction. This PR lets it return ordinary entries beside the junction while omitting the junction and its descendants.nonFollowingReadRootflag to the broker manifest digest and partition the approved root into bounded physical-directory ACL grants.globFilesimplementation.mainat222a06fe316f12df3129eff1c16ab3bfaf85c479and adopt itsfiles/truncatedcontract. Probe one additional distinct match, so exactly reaching the cap does not mean truncation.truncated: true.Refs #3938.
Permission and cleanup boundary
The matcher uses a direct
minimatch@10.2.5dependency already present in main's dependency closure. This revision does not downgrade dependencies or carry the old dependency-only notice changes.Verification
Current revision:
f1eabe8c0c0a508fc71455bcf43a67dd68c1627b(2026-10-25).Review follow-up: terminal
.components now match the current directory, including after**. Explicit hidden matches do not carry recursive globstar state into the hidden directory, preserving membership and exact-cap completeness. The follow-up changes only matcher transitions and tests; admission and native ACL cleanup are unchanged.Local macOS / Node 24 checks on this revision:
npm run lint,npm run format:check, fullnpm run build, and fullnpm run typecheck: passed.apps/desktopandpackages/ui: passed.51a9bb2and pass with this fix.globFilesfound 0 differences in match membership and small-cap completeness.Checks previously passed at parent
51a9bb2in unchanged areas: 50 Windows harness/package-closure/inventory tests, the skip inventory check, 97 ASF source checks, Desktop/CLI third-party notice checks, Rust formatting, and locked Windows MSVC launcher/test cross-checking. These are baseline results, not fresh native Windows execution of this follow-up.Native Windows verification (contributor-provided)
The contributor reports the following results on the previous Windows-validated revision,
51a9bb2daf29de50c2d7962edcd5facd8245e827, from a clean checkout atC:\maka-pr3955-test, branchcodex/fix-windows-glob-junctions, matching the remote.Environment: Node
24.18.1, npm11.19.0, Cargo1.98.0, PowerShell7.6.6, Electron43.5.0.npm ci, build, and typecheck: passed.truncatedresults were correct.verify:windows-x64: passed, including cancellation recovery, parent-process exit cleanup, 64-launch concurrency, the adversarial matrix, node-pty, renderer, and Broker verification.Reported artifacts:
Maka-0.2.2-win-x64.exe5983cca21ae10c2575fab2888475a353c5f8a1aae02e905014803c2b95cba8bcMaka-0.2.2-win-x64.zip1c334b74d76b3f7eb0ddf45402071b4a697db7dd6a34dca20ece4935758ba0d1Artifacts are under
C:\maka-pr3955-test\apps\desktop\release; full logs are retained locally atC:\maka-pr3955-evidence. This update records the contributor's Windows report; those local logs and artifact hashes have not been independently inspected from the macOS workspace.Additional Windows validation limits:
smoke:windows:distpassed its CLI checks, but native-window visibility remains unconfirmed (visible=false). The mixed full Runtime run reported 9 failures, with reported causes including symlink privileges and Linux/Unix-specific assumptions; a full Windows Runtime pass is not claimed. The new dot/hidden-directory Broker smoke cases inf1eabe8c0still need a real Windows run; the Windows results above apply to parent51a9bb2.AI use
Select exactly one:
Tool(s) and scope: OpenAI Codex analyzed and implemented the original scoped policy/traversal change and this current-main compatibility update, added regression tests, ran the local checks above, and updated documentation. The material update commit includes a
Generated-by: Codextrailer. Native Windows results were supplied separately by the contributor. Human review is required before merge.Checklist
Does this PR entail a change in behavior?
简体中文
摘要
Windows W1 的只读递归
Glob目前会因目录树中的嵌套 NTFS junction 拒绝整个搜索。本 PR 允许返回旁边的普通条目,同时跳过 junction 及其后代。nonFollowingReadRoot标记绑定到 Broker manifest 摘要,并把批准的根拆成有界的物理目录 ACL 授权。globFiles为对照。222a06fe316f12df3129eff1c16ab3bfaf85c479,适配现有files/truncated契约:额外探测一个不同匹配,区分恰好达到上限和实际截断。truncated: true。关联 #3938。
权限与清理边界
只有显式标记的只读 W1 Glob 采用新的准入方式。默认递归准入、Read/Write/Bash/Grep 权限和原有 ACL 清理规则保持不变。根必须是已声明的递归只读物理目录;写授权、reparse 根、多硬链接文件、无效策略或摘要不匹配仍然安全拒绝。
ACL 规划和枚举都跳过嵌套 reparse entry;目标通过物理路径独立获得的权限不受影响。规划仍限制为 4,096 条物理授权、100,000 个条目和根目录以下 256 层。此次同步没有修改原生 ledger 与 settlement 实现:确认 Job 结束后清理授权,无法确认时保留并隔离恢复证据。
直接声明的
minimatch@10.2.5已在 main 的依赖闭包中;本轮没有降级依赖或携带旧版仅更新依赖的许可证清单差异。本轮验证
当前提交:
f1eabe8c0c0a508fc71455bcf43a67dd68c1627b,2026-10-25。本轮修复两条 P2:终止位置的
.(含**/.)正确匹配当前目录;显式隐藏条目匹配后不再携带递归 globstar 状态,避免多返回结果及误报截断。只改匹配状态和测试,未改准入或原生 ACL 清理。51a9bb2上全部失败,在本轮修复后通过。globFiles对比,匹配集合和小上限完整性判断 0 差异。未改动部分的基线检查在父提交
51a9bb2已通过:50 项 Windows 验证脚本测试及跳过清单检查、97 项 ASF 源码检查、Desktop/CLI 许可证清单校验、Rust 格式和 Windows MSVC 交叉检查。它们是基线记录,不代表本轮新增用例已在真实 Windows 执行。Windows 原生验证(贡献者提供)
贡献者已在干净且与远端一致的
C:\maka-pr3955-test上验证此前提交51a9bb2daf29de50c2d7962edcd5facd8245e827,分支为codex/fix-windows-glob-junctions。环境为 Node24.18.1、npm11.19.0、Cargo1.98.0、PowerShell7.6.6、Electron43.5.0。npm ci、构建和类型检查通过。verify:windows-x64通过,包含取消恢复、父进程退出清理、64 次并发、对抗矩阵、node-pty、渲染器和 Broker 验证。产物及 SHA-256 见上方英文表格。完整日志保留在 Windows 本地
C:\maka-pr3955-evidence,本次记录依据贡献者的验证报告,未在 macOS 工作区独立检查这些本地日志或重新计算产物哈希。补充验证限制:
smoke:windows:dist的 CLI 检查通过,原生窗口可见性仍未确认(visible=false)。混合完整 Runtime 测试报告 9 项失败,报告原因包括 symlink 权限及 Linux/Unix 专属假设;未宣称完整 Windows Runtime 全量通过。 上述 Windows 结果对应父提交51a9bb2;本轮f1eabe8c0新增的点组件和隐藏目录 Broker smoke 仍需真实 Windows 复测。