Skip to content

Check submodule files below the repository top and with quotes in names - #35

Merged
razbenaharon merged 2 commits into
mainfrom
fix/git-check-submodule-paths
Nov 23, 2026
Merged

razbenaharon merged 2 commits into
mainfrom
fix/git-check-submodule-paths

Conversation

@razbenaharon

Copy link
Copy Markdown
Owner

Summary

Follow-up to #34. Two cases in the Git ignore check (execution/file_rules.py, _ask_git) withheld every named file as git_check_failed when one of them was inside a submodule. Both failed closed: nothing was sent that should not have been, but the review could not include any file.

  1. Project folder below the repository top. Git names the submodule from the top of the repository (app/vendor), while the names ModelQuad passes are relative to the project folder (vendor/...), so no name matched. The submodule path is now taken relative to the folder, from git rev-parse --show-prefix. That extra Git call runs only when Git reports a file inside a submodule; if it does not answer, the check still withholds everything.
  2. A quote in the submodule's name. The pattern for Git's message stopped at the first quote, so it's was cut to it. The path in submodule now runs to the end of its line.

Git launches moved into one helper, _run_git, which every Git command of the check uses, with the same environment and options as before. Git is still admitted by git_ignored through resolve_executable with the repository exclusions; the launch inventory in tests/test_executable_resolution_boundary.py now names the helper.

No issue was opened for these.

Tests run

  • python scripts/check.py fast
  • python scripts/check.py review (all pass) and python scripts/check.py python: 3284 passed, 1 failed, 39 skipped. The failure was tests/test_execution.py::test_the_envelope_scan_is_linear_on_hostile_text[11], a 2-second timing bound in code this change does not touch; all 16 cases of it passed when run alone.
  • New or changed behaviour has tests: test_a_submodule_is_checked_when_the_folder_is_below_the_repository_top and test_a_submodule_with_a_quote_in_its_name_is_checked, both with real Git and a real submodule. Both failed on main and pass now. tests/test_attached_file_rules.py: 81 passed.

Windows version: Windows 11 Pro 10.0.26300

AI assistance

Claude Code (Claude Opus 5.5) reproduced the two cases, wrote the fix, the tests and the changelog line. The cases were first reported by verifier sessions in an internal experiment.

Checklist

  • Every commit of mine is signed off (git commit -s), as described in CONTRIBUTING.md (DCO 1.1). The maintainer's own commits need none.
  • The change does not weaken the safety invariants in AGENTS.md. A Git that does not answer still withholds every file.
  • A new host or provider was agreed in an issue first, or this change adds none.
  • Documentation is updated, and describes only what the code does today: CHANGELOG "Unreleased".

🤖 Generated with Claude Code

razbenaharon and others added 2 commits November 23, 2026 10:33
Git names a submodule from the top of the repository, while the names
ModelQuad passes are relative to the project folder; a folder below the
top therefore matched no name and every file was withheld. The submodule
path is now taken relative to the folder (git rev-parse --show-prefix).

The pattern for Git's message stopped at the first quote, so a submodule
named with a quote was cut short and every file was withheld. The path in
submodule now runs to the end of its line.

Both cases failed closed; nothing was sent that should not have been.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_run_git now holds the one Git launch of the ignore check; git_ignored still
admits Git with resolve_executable and the repository exclusions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@razbenaharon
razbenaharon merged commit b7528e6 into main Nov 23, 2026
7 checks passed
@razbenaharon razbenaharon mentioned this pull request Nov 24, 2026
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.

1 participant