Repository navigation
fix(scan): v0.41.1 review findings — Robot names only in case sections, no ignore files above the project root, potent walk tests - #1111
Merged
Conversation
…the project root are not read; walk-policy tests made potent An independent review of v0.41.1 found these gaps in the marker scanner. Robot attribution. find_enclosing_robot_case treated any non-indented line as a test name, so a marker under Settings was named after "Library Collections", one under Variables after a variable line, and a marker before a Settings line took that line through the forward scan. The scan now finds the nearest section header above the marker and names a case only inside Test Cases, Test Case, Tasks, Task, Keywords or Keyword. Headers are matched case-insensitively with any number of leading and optional trailing stars. Elsewhere the marker falls back to file:line. The backward scan stops at a header. Tests cover Settings, Variables, a Settings section between two case sections, and nine header spellings. Negative controls: disabling the section guard failed five of those tests by assertion, and letting the backward scan cross a header failed the new backward-scan test by assertion. Walk policy. New tests cover .ignore and .git/info/exclude (with .git itself still skipped); disabling either flag failed its test. The global ignore file is proven off in a child process of the test binary with its own XDG_CONFIG_HOME, so no environment is shared between parallel tests; turning git_global on failed it. walk_terminates_on_symlink_loop now builds sibling links that only a link-following walk traverses and asserts the exact marker paths; follow_links(true) failed it and the sibling-link test. Scope of ignore files. The ignore crate read .gitignore and .ignore in directories above the scan root, which with require_git(false) can reach a home directory. The walk now starts at the project root, uses parents(false), and is pruned to the path leading to the scan root, so ignore files from the project root down apply with their own anchoring and nothing above it is read. scan_source_files_in_project(project, paths, patterns) carries the root; scan_source_files keeps its signature and treats each scanned directory as its own root. Every call site in rivet-cli passes cli.project. A scan path outside the project, or a symlinked one, is its own root. Tests cover a stray ignore file above the project, a project-root ignore and an anchored pattern applying to a sub-root scan, and an outside scan root. Negative controls: parents(true) failed the first and scanning from the scan root failed the second. The links.rs comment for REQ-406 is now a real marker. REQ-405 and REQ-407 descriptions record the new bounds; the changelog gains a bullet and an upgrade note. Fixes: REQ-405, REQ-407 Verifies: REQ-405, REQ-406, REQ-407 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015HMQUV3u86jN2hmCtXNTc9
📐 Rivet artifact delta
Graphgraph LR
REQ_405["REQ-405"]:::modified
REQ_407["REQ-407"]:::modified
classDef added fill:#d4edda,stroke:#28a745,color:#155724
classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Modified
Posted by |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…scanned PR-diff mutation found that relaxing the scan-root check in scan_directory from and to or survived: the walk from the project root yields files in the directories it passes through, and only that check keeps them out of a sub-root scan. The sub-root test now places a marker at the project root and expects it to be ignored; with the mutant applied the test fails by assertion, restored it passes. Verifies: REQ-405 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015HMQUV3u86jN2hmCtXNTc9
This was referenced Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1108 before tagging v0.41.1 (maintainer decision: fix first, then tag). A fresh-context clean-room review of REQ-405/406/407 confirmed REQ-406 and found:
*** Settings ***/*** Variables ***were attributed toLibrary Collections/${X} 1. Names now come only from Test Cases / Tasks / Keywords sections (any*-header spelling); elsewhere a marker falls back tofile:line.parents(true)), reaching e.g. the home directory without git — a machine dependence. Newscan_source_files_in_project: the walk starts at the project root withparents(false)and prunes to the scan root, so project-root.gitignoreanchoring is correct forsrc//tests/scans and nothing above the project is read. Added tests for.ignore,.git/info/exclude, the global ignore file staying off (child-process test with its own env), and a symlink test that actually fails underfollow_links(true).links.rs's// Verifies: REQ-406becomes a realrivet: verifiesmarker.Every new test was run against a negative control (fix broken → named test fails by assertion, restored). CHANGELOG [0.41.1] gains the fix bullet and an Upgrade note: markers inside gitignored or symlinked directories no longer count; use
.rivetignorenegation and comparerivet coverage --testsacross the upgrade.Gates (1.99.0): fmt, clippy
--all-targets -D warnings, nextest 2635 passed, cli_commands 247, validate PASS, docs check PASS,rivet release status v0.41.1Cuttable, changelog drift clean. Marker count on main 1189 → 1202 (+12 test markers, +1 links.rs).🤖 Generated with Claude Code
https://claude.ai/code/session_015HMQUV3u86jN2hmCtXNTc9