Repository navigation
Description
(lane openRepoShape-4, 2026-11-08T16:02:41Z)
Found by: RD1141, lane 4's independent delta review of PR #1141 (a draft for #1099) at 0b8fb320, in its report and in its review comment (#1141 (comment)), finding NIT-1, "test gap, follow-up". The review graded #1141 READY with no MUST, no SHOULD and this one NIT, so #1141 lands without it. This is the follow-up RD1141 asked for. It follows #1099 and #1141. The report is a lane 4 reviewer's message and is not posted on GitHub.
Lane 3 places this issue, and it has no milestone here. It is a test follow-up of #1141, and it goes on a branch after #1141 lands.
Nothing was re-run for this issue. The measurements are RD1141's, taken at 0b8fb320 (git 2.43.0, Python 3.12.3, a stub gh first on PATH that logs and refuses every call, git-filter-repo 2.47.0 first on PATH). #1141 is a draft and is not on main, so tests/test_adopt_unreadable_clone_git.py below is #1141's new file. This body is ASCII.
What is missing
Nothing a user can see: the behaviour is right. RD1141: "The behaviour is right and cannot be flipped by a reorder, so this is a guard against a later refactor only." What is missing is a test row. No row in the repository pins a partial clone whose recorded .git this user cannot read. #1141's 9 refused-by-name rows (tests/test_adopt_unreadable_clone_git.py) and tests/test_adopt_partial_clone_source.py each cover one of two rules, source-unreadable and source-partial-clone, and the two rules now share --source's help and the check and execute path.
What was measured, and by whom
Measured by RD1141, by a probe that is not in the repository (tools/run/rd1141/probe/test_rd1141_probe.py in lane 4's scratch: 16 rows and 8 rows, imported from tests/test_adopt_partial_clone_source.py). It makes a partial clone of a small origin (--filter=blob:none, with and without a checkout), records it in the plan as source.local_path, makes the .git a directory or a gitdir: file, sets cloned false or true, and runs check and execute --yes:
| Case | Rows | Result at 0b8fb320 |
|---|---|---|
.git at mode 000, partial clone |
16 (2 clones x 2 kinds x 2 cloned x 2 verbs) |
all 16: exit 2, REFUSED source-unreadable naming <it>/.git, never source-partial-clone; 0 gh calls, 0 upload-pack runs, no remotes/ directory made |
.git readable, the same partial clones |
8 (2 x 2 x 2) | all 8: exit 2, REFUSED source-partial-clone with the git fetch --refetch --no-filter origin cure, not source-unreadable; 0 upload-pack runs |
- On main
b66d8f0ccthe same 16 rows fail: the 8givenrows withgit-failed, and the 8clonedrows withsource-unclonableaftergh repo clonewas asked. - Why a reorder cannot flip the answer: with the
.gitat mode 000 the partial-clone rule's own two questions see nothing. Measured through adopt-project.py: a recorded source whose.gitthis user cannot read is refusedsource-unreadable, naming that.git, socheckandexecuteno longer call a cloneplanmade with its.gitat mode 000 no longer whole and clone it again (#1099) #1141's module on the same clones,_promisor_remotesis['origin']and_objects_lackingis 28 while the.gitis readable, and[]andNonewhile it is at 000, for a directory and a file alike.source-unreadablecomes fromplan.open_source, ahead of the partial-clone rule, in bothcmd_checkandcmd_execute. - Mutants of the probe: with the guard removed (
refused = None), 25 failed, 18 passed and 8 teardown errors: 9 of adopt-project.py: a recorded source whose.gitthis user cannot read is refusedsource-unreadable, naming that.git, socheckandexecuteno longer call a cloneplanmade with its.gitat mode 000 no longer whole and clone it again (#1099) #1141's own 18 rows and all 16 probe rows. With the guard asked after thecloned: falsebranch has read the clone, 12 of 43 failed: the 4givenrows of adopt-project.py: a recorded source whose.gitthis user cannot read is refusedsource-unreadable, naming that.git, socheckandexecuteno longer call a cloneplanmade with its.gitat mode 000 no longer whole and clone it again (#1099) #1141's file and 8 probe rows. So adopt-project.py: a recorded source whose.gitthis user cannot read is refusedsource-unreadable, naming that.git, socheckandexecuteno longer call a cloneplanmade with its.gitat mode 000 no longer whole and clone it again (#1099) #1141's rows catch both of those. The filer's reading of NIT-1 is that what they cannot catch is a change that leaves a partial clone's unreadable.gitto the partial-clone rule, because none of them builds a partial clone.
RD1141's sketch of the row
RD1141's words: "one parametrized row in tests/test_adopt_unreadable_clone_git.py (or in test_adopt_partial_clone_source.py) that makes Source("nocheckout"), puts the .git at mode 000 under needs_a_mode, and asserts REFUSED source-unreadable, no source-partial-clone, and 0 gh and 0 upload-pack runs. My probe ... can be cut down to it." The probe's first test, trimmed by the filer and not run: the file kind, the cloned plan edit, the prints and the gh count are left out. The probe counts gh calls in a log at a fixed path of its stub; a row in the repository would count them as its neighbours do, with recording_gh, which tests/test_adopt_unenterable_source_and_locale.py imports with needs_a_mode:
# parametrized over verb in ("check", "execute") and variant in ("nocheckout", "checkout")
def test_unreadable_git_of_a_partial_clone_is_source_unreadable(
made, variant, verb):
source = made(variant)
with at_mode_000(source.path / ".git"):
result = getattr(source, verb)()
assert result.returncode == 2, result.stderr + result.stdout
assert "REFUSED source-unreadable: " in result.stderr
assert str(source.path / ".git") in result.stderr
assert "source-partial-clone" not in result.stderr + result.stdout
assert "plan ok" not in result.stdout
assert source.runs() == 0 # no upload-pack ran
assert not (source.base / "remotes").exists() # nothing was made
# and: 0 `gh` callsat_mode_000(path) is a context manager that chmods the path to 0, asserts os.access(path, os.R_OK) is false, and gives the mode back in a finally. Source, made and planned_once are in tests/test_adopt_partial_clone_source.py on main (:130, :256, :98).
Beyond the sketch: the .git as a gitdir: file and the recorded clone with cloned: true are in RD1141's probe and can ride on the same row.
Not in this issue: RV1141's four NITs (the 0100 and 0300 row, the HEAD, objects, refs and config rows for #1151, the _git_refused docstring on a symlinked .git, and the two Sonar issues) are separate and untouched. RD1141 did not re-review them.
Done when
- A row (or a parametrized row) makes a partial clone, with and without a checkout, puts its recorded
.gitat mode 000 underneeds_a_mode, and runscheckandexecute. Each exits 2 withREFUSED source-unreadablenaming the.git, with nosource-partial-clonein the output, noghcall, noupload-packrun and no remotes directory made. It skips as root and on Windows, as the repository's other permission rows do. - The row passes at adopt-project.py: a recorded source whose
.gitthis user cannot read is refusedsource-unreadable, naming that.git, socheckandexecuteno longer call a cloneplanmade with its.gitat mode 000 no longer whole and clone it again (#1099) #1141's head and fails on main, as the probe's 16 rows did. - A mutant that removes the guard (RD1141's MR4:
refused = None) fails it, and so does one that asks the guard after thecloned: falsebranch has read the clone. - The rows of adopt-project.py: a recorded source whose
.gitthis user cannot read is refusedsource-unreadable, naming that.git, socheckandexecuteno longer call a cloneplanmade with its.gitat mode 000 no longer whole and clone it again (#1099) #1141's file and oftests/test_adopt_partial_clone_source.pykeep their outcomes.
Lane: openreposhape-4 (openRepoShape-4)
Activity
brettheap commentedon Nov 9, 2026
CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-11-09T21:08:33Z, for #1262
Logged in
lanes/log/openRepoShape-5.mdat8f15bfde86f9d5381d574e11438ce39bea1cb316.The three reads (lane-collision-protocol Rule 1):