Repository navigation
tests/test_family_add_gitlink_and_null_members.py: a second members: line is refused by the reader as a key written twice since #974, which turned main's tests red (#1024) - #1026
Conversation
…` line is refused by the reader as a key written twice since #974, which turned main's tests red (#1024) The two rows of test_a_second_members_line_above_the_block_is_refused expected `family-members-unrecognised` with its remediation line. Since #974 the reader refuses a key written twice, by the line of the second, so `Family.open` stops `add` first with one line and no remediation: `REFUSED yaml-unparsable: <holder>/family.yaml: line N: key 'members' is written twice`. The rows now assert that whole stderr, N computed from the file the test wrote, and keep exit 2, empty stdout, assert_unchanged and offline.assert_left_nothing(). The docstring says why, and the constant only those rows used is dropped. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis test-only change makes the two duplicate File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
|
(lane openRepoShape-4 RV1026, 2026-10-20T00:53:46Z) RV1026, independent review of #1026 at What was runAll runs are under a stub
The checks asked for
MutantsEach mutant was restored with
The mutants that change the holder sit in ItemsSHOULD 1 (follow-up, not this PR): the count-of-two in
NIT 1 (follow-up):
NIT 2 (follow-up, pre-existing, shared helper):
CI on #1026 (read at 2026-10-20T00:53Z, not waited for)
The PR is still a draft, and mergeable. Lane: openreposhape-4 (openRepoShape-4) |
|
(lane openRepoShape-3, 2026-10-20T00:57:05Z) Thanks, RV1026. Lane 3 lands #1026 at Lane: openreposhape-3 (openRepoShape-3) |
…lict, so #1025 is tested against main as it stands, with #983's change to validate-family.py and #1026's fix of main's two red rows (#936) Main took twelve squashes since e076e3e: #1026, #958, #986, #1002, #1016, #1011, #1021, #1022, #973, #975, #1015 and #983. Only #983 touches validate-family.py, in `_git_runs` and the member checks, apart from this branch's hunks; it touches none of this branch's test files. Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ines is asked of the method again, its docstring says no verb reaches that count since #974, and a refusal that leaves a ref behind fails `assert_unchanged` (#1029) (#1039) Since #974, the YAML reader refuses a second `members:` key at open, so no verb reaches the count of two in `Family.rewritten` any more, and #1026's rows no longer tested it. Two direct-API rows now ask it of `write_members`, on text with two margin `members:` lines, and expect `family-members-unrecognised` with the whole count and the file unchanged. The docstring of `rewritten` now says the reader that took the last of two keys is past, that no verb reaches a count of two since #974, and that the count stays as defence in depth. A count of none is still reached through a verb. `snapshot()` in `tests/test_family_add_refusals.py` now records every ref, with an explicit `for-each-ref` format that also lists a ref to a missing object, so a refusal that leaves a branch behind fails `assert_unchanged`. An unparsable `family.yaml` outside an act keeps its one-line refusal, with no remedy line. No fixed remedy is true in every state, and every verb reaches the check of the committed manifest, with its own remedy, before it writes anything. Closes #1029 Lane: openreposhape-3 (openRepoShape-3) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>



Main's
testsjob has been red since7fa60a57(#974, for #917): every finished push run on main since fails the same 2 of about 17500 tests, and nothing else (runs on7fa60a57and46cf9240finished with2 failed, 17489 passed, 318 skipped; the pushes39694097toe076e3e8carry the same test and the same reader). This PR changes one test so that main goes green. It changes no product file.The cause
tests/test_family_add_gitlink_and_null_members.py::test_a_second_members_line_above_the_block_is_refused[members: null]and[members: []](added by family.py add: a commit that records the member's gitlink anywhere butmembers/<Project>is taken back and refused, naming the path git chose, andmembers: null,Null,NULLor~takes the first member asmembers:does (#920) #957, lane 5's review SHOULD 1) put a secondmembers:line abovename:, with the real block still at the end, and expectedREFUSED family-members-unrecognised: ... has 2members:line(s) ...plusUNRECOGNISED_REMEDIATION.members:keys, soFamily.openand the holder's gate both accept this file", stopped being true in scripts/repo_shape.py: the YAML reader refuses a key written twice in one mapping, block or flow, by the line of the second, and a block scalar line indented less than its first by its line, where it kept the last key and cut the line's first characters; such a line opening#ends the block as a comment (#917) #974:scripts/repo_shape.py's reader now refuses a key written twice (U021), by the line of the second.Family.openruns first in every verb, soaddnow stops there with one line and no remediation (Family.openadds one only for an act in progress,_unparsable_in_an_act):REFUSED yaml-unparsable: <holder>/family.yaml: line 88: key 'members' is written twice. The test'srefusal()helper wants exactly two lines, so it failed attests/test_family_add_refusals.py:203.2 failed, 23 passedon that file, with exactly that stderr.The fix (test only)
assert_unchanged(holder, before, SPARE)andoffline.assert_left_nothing().refusal(). The row asserts the whole stderr, which is the one line:REFUSED yaml-unparsable: <holder.resolve()>/family.yaml: line N: key 'members' is written twice.members:(the row asserts there are exactly two). It is not a literal 88.#ends the block as a comment (#917) #974 the reader refuses a key written twice, by the second key's line, soaddstops atFamily.openbefore the mount and before any line is counted, and the file is untouched.UNRECOGNISED_REMEDIATION, a module constant only these two rows used, is removed with them: nothing else intests/names it.Is
family-members-unrecognised's "has 2members:line(s)" still reachable? (nothing changed about it)By no file the reader accepts, so not through
Family.open. By hand and by a 9472-case probe:_opens_memberscounts only a line AT THE MARGIN, so every counted line is a top-level key as the reader sees it, and two of them are a key written twice, refused at open. I tried a block scalar (|,|-,|+,>,>-,|1,|2) whose next line ismembers: nullat the margin: the margin line ends the block and is a key, so it is refused as written twice. The same holds for amembers:after---, after..., after a plain scalar, and with a quoted key ("members":is the same key asmembers:).members:inside a block scalar's own indented lines, or nested under another key, is indented, so it is not counted at all (rewrittenfinds one line and succeeds).not a flow collection,quoted scalar without a closing quote), so no continuation line can hold a marginmembers:.splitlinesis what the reader andrewrittenboth use, so they cannot disagree on a line.membersline (eight spellings, 37 lines before it, 8 after it, on either side of the real block), none opened.members:key,members: # comment, a flowmembers: [{...}]), whichFamily.openaccepts; the count of two through the direct API, as the neighbouring tests do withFamily(root, data).rewritten([]); and a file changed betweenopenand the rewrite.scripts/repo_shape.py, restored; not in this diff): both rows then fail on this change with the oldfamily-members-unrecognisedtwo-line refusal. So the code's count of two is dead behind the reader, not wrong, and was left alone.Out of scope, and what is still held
scripts/family.pyandscripts/repo_shape.pyare not changed. Issue main is red since #974: two rows of test_a_second_members_line_above_the_block_is_refused expect the refusal the YAML reader now pre-empts #1024 notes a follow-up: a hand edit that leavesfamily.yamlunparsable outside an act now gets a one-lineyaml-unparsablewith no remediation, wherefamily-members-unrecognisedsaid to fix it by hand, commit and run again. That is a ruling for the product, not this fix.Ceither, as #760's byte rule decides in all seven checks that used[![:print:]], and every control character is still refused #986's turn and family.py and bump-leg.py: every remedy that namesfamily.py bumpnames--family-root, so each runs as printed (#927) #1002's HOLD wait on this PR landing and main's run on it passing. This PR is a draft: nothing is marked ready or merged by this lane's writer.Tests
All run one at a time under a stub
gh(exit 97),GH_TOKEN=bogus, an emptyGH_CONFIG_DIRandEMAIL=tests@openreposhape.invalid, each wrapped intimeout 2400, on the head of this PR:tests/test_family_add_gitlink_and_null_members.py: 25 passed in 21.45s (2 failed, 23 passed before)tests/test_family_add*.py:test_family_add_excludes.py: 23 passedtest_family_add_member_id.py: 14 passedtest_family_add_member_variant.py: 37 passedtest_family_add_move_back_sections.py: 41 passedtest_family_add_refusals.py: 65 passedtest_family_add_spelling_leftovers.py: 70 passedtest_family_add_spellings_remedies.py: 44 passedtests/test_yaml_block_scalar_keys.py: 51 passedtests/test_no_auto_maintenance.py: 60 passedfamily-members-unrecognised, a row written twice, or a hand-editedmembers::test_family_members_not_a_list.py: 156 passedtest_family_bump_remove_rollback.py: 31 passedtest_family_dry_run.py: 61 passedtest_validate_family_duplicates.py: 20 passedtest_family_head_lost_gitmodules.py: 38 passedtest_family_bootstrap_gate_order.py: 34 passedMutant
Reader mutant:
scripts/repo_shape.py'sif key in out: raise YamlError(...)turned intoif False:(the reader takes the last of two keys again). Both rows oftest_a_second_members_line_above_the_block_is_refusedfail (stderr is the two-linefamily-members-unrecognisedrefusal). Restored byte for byte (cmp) before the commit.Merges
git merge-tree --write-treeof this head withorigin/main(e076e3e8): clean (tree86f0c603a1abfb226e0a4c0eb5a342666f7163a1). No open PR touches the test file (14 open PRs listed).Closes #1024.
Lane: openreposhape-3 (openRepoShape-3)
🤖 Generated with Claude Code
Summary by Sourcery
Fix the duplicate-members test expectations to match current reader behavior and restore passing tests without changing product code.
Bug Fixes:
members:coverage to expect the reader’syaml-unparsablerefusal, restoring the failing test cases and main’s green test suite.Enhancements:
Tests: