Repository navigation
tests/test_adopt_plan_value_order.py: the module takes double_quoted and with_line from test_adopt_template_values and puts nothing on sys.path itself, and its docstring says _work_root refuses more, among them the file and the shared directory, no longer two things (#1234) - #1307
brettheap wants to merge 12 commits into
Conversation
… right after its three repository names, so a bad one beside an unanswered entry, a moved source, a refused name or another repository is that one refusal in both, and a `pins:` entry that is no pin is said as `_read_as` says it (#1020) #901 made `check` and `execute` name the same first problem among a plan's options. Outside them, the two still named different problems first (#1020, found by lane 1's writer on #901). 1. **One rule, the refusal before what `check` lists.** `check` refuses a bad `org:` or `id:` outright, exit 2, and lists none of its findings. `execute` refuses at the first of them, but it asked the two only after it had refused four things that `check` lists as findings: a plan for another repository (`plan-not-the-source`), a name the naming policy refuses (`naming-unclassified`), an unanswered entry (`plan-unresolved`) and a source that has moved on (`plan-stale`). And `check` asked the two only where the policy took the plan's names (`_manifest_values`), so an unsafe `org:` beside a refused name was a finding about the name, or about another repository. Both commands now ask the two first of the plan's values, right after the three repository names (`plan.names()`, then `_checked_org_and_id`): `execute` in `cmd_execute`, ahead of `_refuse_a_plan_for_another_repository`, and `check` at its head, after the triad advisory. `_checked_plan_values` no longer asks them, since `cmd_execute` has. 2. **#716's L4-48, decided.** An `org:` that `checked_value` refuses, held to a repository, was `unsafe-value` to `check` and `plan-not-the-source` to `execute`. Such an `org:` names no repository, on GitHub or in the manifest, so it is not compared with the source's. It is `unsafe-value` in both commands now, held to a repository or not. Once it is mended, a plan for another repository is still `plan-not-the-source` in both. This reverses three tests in `tests/test_adopt_check_plan_name.py`, which pinned the old answers on purpose: - `test_an_unsafe_org_is_unsafe_in_check_and_compared_by_execute_if_held` expected `plan-not-the-source` from `execute` in its six held rows. As `test_an_unsafe_org_is_unsafe_in_check_and_in_execute_held_or_not`, all twelve expect `unsafe-value` from both, in the same words. - `test_check_compares_an_unsafe_org_where_no_manifest_is_built` expected `check` to compare `org: acme labs` beside the refused name `bad_name`: `plan-not-the-source` and `naming-unclassified`, exit 1. As `test_an_unsafe_org_is_asked_before_the_plans_refused_names`, it expects `unsafe-value`, exit 2, from `check` and from `execute`. - `test_check_asks_an_unsafe_org_first_where_a_kept_submodule_url_is_relative` expected `plan-not-the-source` from `execute`. It now expects `unsafe-value`, in `check`'s words. 3. **A `pins:` entry that is no pin** was spelled with `repr` (`` `pins:` entry 1 is 7 ``, `True`, `None`). #901 made `pins:` itself read as `_read_as` reads it, and an entry reads the same way now: "the number 7", "the boolean true", "null", "a list of 2 item(s)". Docstrings and comments now say this: `_checked_org_and_id`, `_checked_plan_values`, `_manifest_values`, `_held_findings`, `_not_the_source`, `_refuse_a_plan_for_another_repository`, `_read_pins` and the #499 block comment. No finding is added or removed: only which problem is named first changes, and the spelling of an entry. Measured on main at `6da757cb` and on this branch, with a stub `gh`, a bogus token, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false` and `--local-remote-dir`. No run made a leg. | The plan has | `check` on main | `execute` on main | both, here | |---|---|---|---| | a bad id beside an unanswered entry | `plan-bad-id` | `plan-unresolved` | `plan-bad-id` | | a bad id beside a source that has moved on | `plan-bad-id` | `plan-stale` | `plan-bad-id` | | a bad id beside a name the policy refuses | `plan-bad-id` | `naming-unclassified` | `plan-bad-id` | | a bad id beside another organisation, held to a repository | `plan-bad-id` | `plan-not-the-source` | `plan-bad-id` | | no `id:`, and `legs.assembly: north_wind` (a derived id the policy refuses too) | `plan-bad-id` | `naming-unclassified` | `plan-bad-id` | | an unsafe `org:` held to a repository (L4-48) | `unsafe-value` | `plan-not-the-source` | `unsafe-value` | | an unsafe `org:` beside an unanswered entry | `unsafe-value` | `plan-unresolved` | `unsafe-value` | | an unsafe `org:` beside a source that has moved on | `unsafe-value` | `plan-stale` | `unsafe-value` | | an unsafe `org:` beside a refused name | finding `naming-unclassified`, exit 1 | `naming-unclassified` | `unsafe-value` | | the same, held to a repository | finding `plan-not-the-source`, exit 1 | `plan-not-the-source` | `unsafe-value` | Each "here" row is exit 2 from both, word for word. The last two rows agreed on main. They change because `check` now asks the two where the policy refuses the names, as `execute` now does: without that, moving `execute` alone would have made them disagree. Plans with only one of these problems (an unanswered entry, a moved source, a refused name, another repository) are named as on main by both. **Tests.** - `tests/test_adopt_plan_value_order.py` gains 16 rows: - the 10 above, through both commands, comparing the first line; - four `pins:` entries that are no pin: number, boolean, null and list; - two guard rows, `id` and `org`: a leg name `checked_value` refuses (`legs.spec: "-spec"`) beside a bad `id:` or `org:` is that name's `unsafe-value` in both, so the three names are still asked first. - The 14 non-guard rows all fail against `6da757cb`'s `adopt-project.py` and pass here. The two guard rows pass on both, by design. - Existing rows changed for the new behaviour: - `test_adopt_check_plan_name.py`: the three tests above, and its docstring's L4-48 line. - `test_adopt_pins.py`: `a-number`. - `test_adopt_execute_refusals.py`: the three entry rows of `PIN_ENTRIES`. Closes #1020 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… right after the plan's keys and before `_work_root`, so a bad one beside an unwritable `--work-dir` is that one refusal in both (#1020) RV1125's SHOULD-1 on #1125. A bad `id:` or `org:` beside a `--work-dir` this user cannot write in was `plan-bad-id` (or `unsafe-value`) to `check` and `adopt-work-dir-unwritable` to `execute`: `check` lists the directory as a finding (#524), and `execute` refuses it before it opens the source, ahead of the two asks, which #1125 had placed after `_work_root`. The comments in `cmd_execute` and `_checked_org_and_id` said that cannot happen. - `cmd_check` asks `plan.names()` and `_checked_org_and_id(plan)` right after its mistyped-plan question, before `_work_root`, and `cmd_execute` asks them right after `_refuse_a_mistyped_plan`, before `_work_root`. Both read only the plan. `execute` now asks them before `_require_filter_repo()` too. - A side effect, said in the body: `check` printed the Triad advisory, once it had opened the source, before it refused a bad `org:` or `id:`; it prints nothing now, since the refusal comes before the source is opened. - The comments and docstrings that placed the asks "at its head, after the triad advisory" or "right after the names" say where they are now. - tests/test_adopt_plan_value_order.py: `both_on` takes a `--work-dir` for both commands; one row per bad `id:` and bad `org:` beside an unwritable `--work-dir` (skipped where `chmod` cannot keep this user from writing); and, for NIT-2, one row per value that asks `check` alone and holds stdout empty, the position being told by the Triad advisory the unedited plan prints first. - tests/test_adopt_check_plan_name.py: the docstring of the kept-submodule row says it is a regression row since `check` asks `org:` at its head (NIT-1). Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…`--work-dir` that is a file or a shared one, or beside a gone source, is the value's refusal in both `check` and `execute`, so the head ask is pinned against `_work_root`'s other refusals and the source (#1179) Six rows, with the plan unedited beside the same file, directory or path as the control. Test only: no change to adopt-project.py. Stacked on the head of #1125 (9549006). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…eeping this branch's tests/test_adopt_plan_value_order.py #1125's own files are the same in its final head and its squash, so the one conflict (tests/test_adopt_plan_value_order.py) is taken as this branch had it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…` and `with_line` from `test_adopt_template_values` and puts nothing on `sys.path` itself, and its docstring says `_work_root` refuses more, among them the file and the shared directory, no longer two things (#1234) RV1226's two NITs on #1226 (for #1179), tests only. The 46 collected ids and their 46 outcomes are the same before and after. NIT-1: `test_adopt_template_values` already puts `scripts/` on `sys.path` and imports `double_quoted` beside `load_yaml`, so the module's own insert and its `from repo_shape import double_quoted` put `scripts/` there a second time. It imports `double_quoted, with_line` from that module now, and `sys`, `REPO` and the insert are gone: nothing else in the file used them. NIT-2: the docstring called a `--work-dir` that is a file and one every user can write in "two more" refusals of `_work_root`. It also refuses a symlink loop, a symlink to what is no directory, a directory another user owns and a shared directory above the `--work-dir`. It says "more ... among them". Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Reviewer's GuideTestsRead the test-module import cleanup together with its existing helper dependency: it reuses
Read the docstring correction alongside the tests it describes:
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
(lane openRepoShape-3, 2026-11-10T12:31:36Z) RV1234: CHECKPOINT at 3aa9d51 (the review stopped at Brett Heap's account-swap word at 11:14Z; its last item is completed below) Items 1, 2, 3, 4a, 6 and 7 are answered. Item 5, the gate, and the module-passes half of item 4 are not. I stopped the pytest by PID on LAST STEP. It had passed 39 tests with no failure, and the log ends There is nothing against the PR so far. I found no MUST or SHOULD, and one body note (below). I touched nothing on GitHub or in any register. The clone is clean and detached at 1. The diff touches only the one file, and does exactly NIT-1 and NIT-2: YES.
2. NIT-1: YES.
3. NIT-2: YES. I read
4. Same tests: collect-only YES; module passes OPEN.
5. The gate: OPEN, not run to the end. The command, in
6. Merges: all CLEAN. I ran
For each of the first three, the tree with #1226's head in place of this head differs from the head's tree only in 7. The body: YES, with one note.
What is left, in If the gate reads about 482 passed and 3 skipped with Paths:
Item 5, completed by lane 3's main loop after the swap (lane openRepoShape-3). RV1234's own runner So, by the review's own rule above, RV1234's verdict is READY at |
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 4 days and 5 hours by commenting |
Lane: openRepoShape-3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
(lane openRepoShape-3, 2026-11-10T14:22:13Z) Restacked after #1226 landed. #1226 landed at 14:04Z as
It stays READY and 28th in v1.2.1's order. #1289 has landed since ( |



Test only. RV1226's two NITs on #1226 (for #1179), in
tests/test_adopt_plan_value_order.pyalone: the module no longer putsscripts/onsys.patha second time, and its docstring no longer counts_work_root's refusals as two.adopt-project.pyand every other file are untouched.Restacked after #1226 landed
#1226 landed at 14:04Z as
3ffe75bb9(its final headcc6c4153a). Lane 3 restacked this PR onto it with checked merges: first #1226's final head, then its squash (nowmain), taking ours fortests/test_adopt_plan_value_order.py, the one file that conflicted.mainhad not moved past the squash, so no third merge was needed. The head is now522e3584fa6dffe76dca0fb387abaa82ea7e2df3, and this PR's own change is its diff overmain(3ffe75bb9): one file,tests/test_adopt_plan_value_order.py, +5/-9.960f1addb, the treegit merge-tree --write-tree --merge-base 489bc3e87 3ffe75bb9 3aa9d5139predicts by applying this PR's own range ontomain. The script checked the tree after each merge and pushed only on a match.git diff -U0, without the@@andindexlines) over the squash are byte-identical to its lines over tests/test_adopt_plan_value_order.py: a badid:ororg:beside a--work-dirthat is a file or a shared one, or beside a gone source, is the value's refusal in bothcheckandexecute, so the head ask is pinned against_work_root's other refusals and the source (#1179) #1226's head489bc3e87: 17 lines, compared withcmp.git merge-tree --write-tree, exit 0): with adopt-project.py:checklists an unanswered entry with the plan's problems against its source, before the split branch and the entries, so beside an uncovered path, an unsafe path, a bad leg path, the split branch taken or another entry finding its first finding isexecute's refusal,plan-unresolved(#1197) #130528f6f6694it gives4c31bbf20, and with repo_shape.py and adopt-project.py: a plain integer of more digits than this Python reads, or a decimal too large to be finite, isyaml-unparsableby its line, where it was aValueErrortraceback or "the number inf", and_read_assays a float in digits with no exponent, where it said "the number 1e+300" (#1212) #12493e5d1fde1it givesf24867bed. Each tree differs frommainmerged with the same PR alone only in this file, +5/-9.tests/test_adopt_plan_value_order.pywithtests/test_adopt_pins.py,tests/test_adopt_root_symlinks.py,tests/test_adopt_template_values.py,tests/test_no_auto_maintenance.pyandtests/test_update_add_codes_documented.py: 546 passed, 5 skipped in 658.39s, exit 0. The skips are the 3 reftable rows and the 2GIT_CONFIG_GLOBALrows the Gates section names.What a person sees change
Nothing. The 46 test ids the module collects, and their 46 outcomes, are the same before and after. The change is the file's own text.
test_adopt_template_values, which the module already importswith_linefrom, putsscripts/onsys.pathat its own import (line 58 on this head) and importsdouble_quotedbesideload_yaml(line 60). The module'ssys.path.insert(0, str(REPO / "scripts"))and itsfrom repo_shape import double_quotedputscripts/there a second time. It now readsfrom test_adopt_template_values import double_quoted, with_line, and thesysimport, theREPOimport and the insert are gone._work_root"refuses two more things before it makes anything, a--work-dirthat is a file and one every user can write in". It says "refuses more before it makes anything, among them a--work-dirthat is a file and one every user can write in", RV1226's words.Choices, and why
sysandREPOonly if nothing else uses them. Re-read at tests/test_adopt_plan_value_order.py: a badid:ororg:beside a--work-dirthat is a file or a shared one, or beside a gone source, is the value's refusal in bothcheckandexecute, so the head ask is pinned against_work_root's other refusals and the source (#1179) #1226's head489bc3e87(the issue's line numbers are atf61be9f5, which moved):sysis in the file at its import (line 72) and the insert (line 83) only, andREPOat theconftestimport (line 77) and the insert (line 83) only. Nothing else, so both go.os,shutilandPathstay, each still used.test_adopt_template_valuesforwith_line, and its import already runs the insert, so the new import adds no coupling.double_quotedis the name that module takes fromrepo_shape._work_root(adopt-project.py:18498) refuses more than the two at this head, as the issue lists: a symlink loop, a symlink to what is no directory (_unmade_work_dir), a directory another user owns, and a shared directory above the--work-dir(_refuse_a_shared_chain). So "two" was wrong, and RV1226's wording is the smallest true one. The two rows still cover the two they cover.conftest's import was:from conftest import (ADOPT, WINDOWS_SKIP, git, make_source_repo, planned,thenrun_script). Nothing else in the file moves.Measured, before and after
Parent head
489bc3e87against this head3aa9d5139, the module alone, a stubghfirst on PATH,GH_TOKEN=bogus, an emptyGH_CONFIG_DIR,GIT_CONFIG_GLOBAL=/dev/null,git-filter-repoon PATH,LANES_LANEunset:scripts/entries onsys.pathafter the module is imported (a probe that imports the file withtests/on the path)sys,REPOdouble_quoted,with_line--collect-only -q: ids collectede00f6981fbc67d39e00f6981fbc67d39-v: outcomes, sorted93491e60b6f93a4493491e60b6f93a44The 46 are the 40 the module had on #1125's head and #1226's six. The two rows that use the imported names (
test_the_org_or_the_id_is_named_before_a_source_that_is_gone[id]and[org], throughwith_lineanddouble_quoted) pass on both. My count ofscripts/onsys.path(6 to 5) agrees with the earlier probe lane 3 made onf61be9f5and posted on the issue (6 to 5, andsysandREPOgone).Rows and mutants
No new row and no mutant. The change is two lines of import text and a docstring; no behaviour moves, so there is no row to add that would fail at #1226's head. The proof is the identical ids and outcomes above, and the module's own row that reaches
with_lineanddouble_quotedpassing. A wrong import line would fail that row with aNameErrorat its first call, and the module would not import at all iftest_adopt_template_valueslacked either name. (Lane 3's earlier probe onf61be9f5dropped each name from the new import and saw thatNameError; it was not repeated here.)Gates
At the head before the restack,
3aa9d5139: one pytest at a time, never the full suite, in the environment above, basetemps under/tmp:tests/test_adopt_plan_value_order.pywithtests/test_adopt_pins.py,tests/test_adopt_root_symlinks.pyandtests/test_adopt_template_values.py(the modules it imports from) in one runtests/test_repo_hygiene.py,tests/test_cli_reference.py,tests/test_agents_md_codes.py,tests/test_git_output_decoding.py,tests/test_stdout_encoding.py,tests/test_path_guard_hygiene.py,tests/test_no_auto_maintenance.py,tests/test_update_add_codes_documented.pytests/test_adopt_root_symlinks.py(lines 1960, 2015 and 2596), which need git 2.45 or later; the bench has 2.43.tests/test_stdout_encoding.pyand two rows oftests/test_no_auto_maintenance.pythat skip when the session began withGIT_CONFIG_GLOBALset, as the gate's environment sets it.tests/test_shape_doctor.pyandtests/test_scaffold_leg_path_collisions.pyare not run:adopt-project.pyis untouched.tests/test_adopt_check_plan_name.py, the other order file, does not import from this module and is not touched. No other test file imports from this one (git grepoftests/).Merges (
git merge-tree --write-tree, all clean, exit 0)This head
3aa9d5139against each, and #1226's head alone against the same, to show nothing here conflicts that did not already:main(3add78e1c, which holds #1198's squash)6e0e94d8ca70fdcba4482ce751f003c310ff87ae2f5bf33b75e6b496851e9fa5789e84eccdad5027142ca405db7e6540c549c57b3326a15b1fe305cadea2128f14c4148c89e1d1b408f225e1a6b1b72dace4bbcb5791106c2bd12ad74aba326fbf20f1753ad2e5a8e861b74b0db40ae31cdd2e614bcbbb141c677468de302858f63146c3ca5ed2950422b943258cadc6ffefeb2e93eec1118a1124575afb85e3bf25793cf630da4ba54415b5d88tests/test_adopt_plan_value_order.py, +5/-9, this PR's own lines (git diffof the two trees); no conflict, the parent's or mine.tests/test_adopt_plan_value_order.pyortests/test_adopt_template_values.pyare tests/test_adopt_plan_value_order.py: a badid:ororg:beside a--work-dirthat is a file or a shared one, or beside a gone source, is the value's refusal in bothcheckandexecute, so the head ask is pinned against_work_root's other refusals and the source (#1179) #1226, adopt-project.py:checklists an unanswered entry with the plan's problems against its source, before the split branch and the entries, so beside an uncovered path, an unsafe path, a bad leg path, the split branch taken or another entry finding its first finding isexecute's refusal,plan-unresolved(#1197) #1305, adopt-project.py:checkandexecuteread one list of a plan's problems against its source, in the order a person mends them (another repository, a refused name, a moved source, an unanswered entry), socheck's first finding isexecute's refusal for each pair (#1113) #1210 and repo_shape.py and adopt-project.py: a plain integer of more digits than this Python reads, or a decimal too large to be finite, isyaml-unparsableby its line, where it was aValueErrortraceback or "the number inf", and_read_assays a float in digits with no exponent, where it said "the number 1e+300" (#1212) #1249 (gh pr list). In the merged file of this head with adopt-project.py:checklists an unanswered entry with the plan's problems against its source, before the split branch and the entries, so beside an uncovered path, an unsafe path, a bad leg path, the split branch taken or another entry finding its first finding isexecute's refusal,plan-unresolved(#1197) #1305, with adopt-project.py:checkandexecuteread one list of a plan's problems against its source, in the order a person mends them (another repository, a refused name, a moved source, an unanswered entry), socheck's first finding isexecute's refusal for each pair (#1113) #1210 and withmain,sysandREPOappear nowhere anddouble_quotedis used once, at the gone-source row, so none of them needs the dropped names. repo_shape.py and adopt-project.py: a plain integer of more digits than this Python reads, or a decimal too large to be finite, isyaml-unparsableby its line, where it was aValueErrortraceback or "the number inf", and_read_assays a float in digits with no exponent, where it said "the number 1e+300" (#1212) #1249's version of the file does not hold tests/test_adopt_plan_value_order.py: a badid:ororg:beside a--work-dirthat is a file or a shared one, or beside a gone source, is the value's refusal in bothcheckandexecute, so the head ask is pinned against_work_root's other refusals and the source (#1179) #1226's rows at all (it is not stacked on tests/test_adopt_plan_value_order.py: a badid:ororg:beside a--work-dirthat is a file or a shared one, or beside a gone source, is the value's refusal in bothcheckandexecute, so the head ask is pinned against_work_root's other refusals and the source (#1179) #1226)._pin_row_problemsays a pin field whose value is not text as_read_assays what the plan's reader read, "recordscommit:as the number 7", where it spelled it as Python does,commit: 7andTrue, socheckandexecutename it in the words the plan's other refusals use under the sameplan-pin-malformed(#1114) #1198, which touched this file on the earlier list, landed at 11:02:12Z today as3add78e1c; its headb1a87293ais no longer open, andmain's merge above includes it.Closes #1234
Lane: openreposhape-3 (openRepoShape-3)
🤖 Generated with Claude Code
Summary by Sourcery
Enhancements: