Skip to content

fix(files): restore .rgignore precedence and re-attach test modules unreferenced since #6713 - #6994

Merged
M4n5ter merged 4 commits into
rust-previewfrom
test/reattach-orphaned-test-modules
Nov 18, 2026
Merged

M4n5ter merged 4 commits into
rust-previewfrom
test/reattach-orphaned-test-modules

Conversation

@liugddx

@liugddx liugddx commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

a75113d8b (#6713) removed 93 mod tests; declarations and deleted 367 test files. For 13 files it removed the declaration but left the file, so their tests have not been compiled or run since 11-10. The commit says it was merged before the full CI run completed.

Restoring them paid off immediately: one of the restored tests catches a regression that landed after #6713. This PR restores the tests and fixes that regression, so the change closes on its own.

1. Fix: .rgignore and .ignore no longer override .gitignore (fix(files))

4d4a45099 (#6974, 11-17) merged the per-source ignore matchers in workspace-files into one GitignoreBuilder and added them as .rgignore, .ignore, .gitignore. In the ignore crate the last matching rule wins, so the priority was reversed. Before #6974 they were separate matchers and .rgignore won. Now !keep.cache in .rgignore can no longer rescue a file excluded by *.cache in .gitignore, so file-reference search misses it.

Candidate search checks .rgignore, .ignore, .gitignore and .git/info/exclude in that order across the active directory chain. Within each source, the closest matching file wins.

2. Restore unreferenced test modules (test)

Module Tests Note
capabilities filesystem/read/scoped 3
computer-use browser/downloads/tests 4 needs native-desktop
computer-use browser/filechooser/tests 2 needs native-desktop
host-runtime http/tests 2
tool-catalog catalog/tests 5
decisions-api decision/tests 4
decisions-api settings/patch/concurrency 1
workspace-files scoped/tests 1
workspace-files files/tests 5 covers the fix above
maka-cli application/product/baseline/tests 3 also restores the test-only template() and flat() helpers that #6713 removed with it

Also deleted: products/maka/cli/src/acp/tests/{protocol,provider}.rs. Their tests.rs, support.rs and public_client.rs no longer exist, so nothing can include them.

Not included

plugins/workspace/workspace-computer/native/src/evaluate/browser_handoff_test.rs stays as it is. It no longer compiles: it imports browser_access::tests::Fixture, an 855-line inline test module that #6713 deleted. It is a hardware smoke test (#[ignore], needs a real browser and a connected ChatGPT extension) driven by scripts/rust/browser-handoff-smoke.py, and CI never ran it. I cannot verify a port without that hardware, so I did not attempt one. Consequence to know about: that script cannot run until the test is ported.

Verification

Local, macOS aarch64, stable 1.99.1:

  • cargo nextest run on maka-fs-tools and maka-cli (lib and bins): 95 passed, 0 failed.
  • cargo nextest run --lib on maka-capabilities, maka-computer-use (native-desktop), maka-host-runtime, maka-tool-catalog, maka-decisions-api, maka-fs-tools: 226 passed, 0 failed, 4 skipped (before the baseline and files additions).
  • Reverting only candidates.rs makes listing_keeps_hidden_raw_names_... fail again (4 passed, 1 failed); with the fix 5 of 5 pass.
  • cargo check --locked --workspace --all-targets: finished, 24 warnings, same as before.
  • rustfmt --check on touched files: clean.

Not run locally: Windows and Linux builds, the full integration suites.

Review focus

  • The cross-directory regression uses a root .rgignore containing !keep.cache and src/.gitignore containing *.cache. Before the fix, the search returned no matches. Afterward, only src/keep.cache is visible. All 32 maka-fs-tools library tests passed on macOS at the updated head.
  • Baseline CI is currently red for reasons unrelated to this PR: audit (npm picomatch advisory), nsh (3 nsh-base rich-editor tests), root-tests rest-1 slice 1/2 (models_settings_unifies_sources_without_inline_layout_jumps), and native-macos/native-windows (desktop_composer_previews_markdown_and_sends_its_source). Each fails identically on recent rust-preview push builds.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code found the unreferenced files from git history, restored the declarations, ran the tests, traced the failure to #6974 and wrote the fix. Commits carry Generated-by: Claude Code. Maka added and verified the cross-directory fix and regression test.

Checklist

  • Tests cover the change and fail without it — the ignore-order fix is covered by a restored test that fails without it.
  • Format, typecheck and the affected suites pass locally (affected crates only; see Verification)

Does this PR entail a change in behavior?

  • Yes — described under Summary above (ignore-file precedence in file-reference search)
中文

概要:#6713 摘掉了 93 条 mod tests; 并删了 367 个测试文件,其中 13 个文件只摘了声明、文件留了下来,所以它们的测试自 11-10 起没有被编译或运行过。恢复它们后立刻发现了一个后来引入的回归,所以本 PR 把"恢复测试"和"修它暴露的回归"放在一起,自成闭环。

1. 修复:#6974(11-17)把 workspace-files 里各忽略文件的匹配器合并进同一个 GitignoreBuilder,加入顺序是 .rgignore、.ignore、.gitignore。ignore crate 里后加入的规则优先,优先级被反转,.rgignore 里的 !keep.cache 不再能救回 .gitignore 里 *.cache 排除的文件。修复后,搜索依次检查 .rgignore、.ignore、.gitignore、.git/info/exclude。同一来源内,较深目录的匹配规则优先。

2. 恢复 10 个测试模块(共 30 个测试,见上表),并删除 acp/tests/{protocol,provider}.rs 两个残骸。

未包含:browser_handoff_test.rs 不动。它依赖被 #6713 删除的 855 行内联夹具,是需要真实浏览器和 ChatGPT 扩展的硬件冒烟测试(#[ignore],CI 从不运行),由 scripts/rust/browser-handoff-smoke.py 手动驱动。没有硬件我无法验证移植,所以没有尝试;代价是该脚本在测试被移植前无法运行。

验证:maka-fs-tools 和 maka-cli 测试 95 个通过;仅撤回 candidates.rs 修复时测试重新失败(4 通过 1 失败),修复后 5/5 通过;全 workspace --all-targets 编译通过,警告数 24 与改动前一致;格式检查通过。未在本地跑 Windows/Linux 和完整集成测试。

评审重点:

  • 跨目录回归覆盖根 .rgignore 的 !keep.cache 和 src/.gitignore 的 *.cache。修复前搜索结果为空,修复后只返回 src/keep.cache。更新后在 macOS 上运行 maka-fs-tools 的 32 个库测试,全部通过。
  • 基线 CI 现在有 4 组与本 PR 无关的红灯:audit、nsh(3 个编辑器测试)、root-tests rest-1(1 个 workbench 布局测试)、native-macos/native-windows(同一个 desktop markdown 预览测试)。它们在近期 rust-preview 的 push 构建上同样失败。

🤖 Generated with Claude Code

liugddx and others added 2 commits November 18, 2026 17:42
a75113d removed the `mod tests;` declarations for these files without
removing the files, so none of their tests have been compiled or run since.
Restore the declarations. Each module compiles against current code and all
22 of its tests pass. Also delete products/maka/cli/src/acp/tests/{protocol,
provider}.rs, whose parent tests.rs and sibling modules no longer exist.

Not restored: workspace-files files/tests.rs (one test fails on current
code, see the pull request), workspace-computer browser_handoff_test.rs and
cli baseline/tests.rs (no longer compile).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Generated-by: Claude Code
4d4a450 (#6974) merged the per-source ignore matchers into one
GitignoreBuilder and added them as .rgignore, .ignore, .gitignore. The
ignore crate lets the last matching rule win, so the priority was reversed:
.gitignore overrode .rgignore, and `!keep.cache` in .rgignore no longer
rescued a file excluded by `*.cache` in .gitignore. Add the sources weakest
first: .git/info/exclude, .gitignore, .ignore, .rgignore.

The regression went unnoticed because files/tests.rs had been unreferenced
since #6713. Re-attach it; the test that covers this now passes and fails
without the fix. Also restore the test-only template()/flat() helpers that
#6713 removed together with baseline/tests.rs, and re-attach that module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Generated-by: Claude Code
@liugddx liugddx changed the title test: re-attach eight test modules left unreferenced since #6713 fix(files): restore .rgignore precedence and re-attach test modules unreferenced since #6713 Nov 18, 2026
@M4n5ter
M4n5ter merged commit 4b03eb2 into rust-preview Nov 18, 2026
@M4n5ter
M4n5ter deleted the test/reattach-orphaned-test-modules branch November 18, 2026 12: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