Repository navigation
Fix misleading test message and a loose license assertion - #2
Conversation
There was a problem hiding this comment.
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 10 hours and 1 minute by commenting @sourcery-ai review. Upgrade to get a review now.
Copilot's automated review on #1 (posted after that PR's validate check had already gone SUCCESS and it had merged) flagged two real issues: - test_required_file_exists's assertion message claimed a missing file is "at the repository root", which is wrong for nested entries like `.github/CODEOWNERS`. - test_license_is_apache_2_0 only checked for the substring "Apache License", never "Version 2.0", so the test's name and its assertion could diverge. Also fixes the same "project.yaml lives here" phrasing issue Copilot caught in the spec leg's sibling test but did not flag here: the comment in test_role_directory_exists cited "project.yaml" as if it were in this repository; it lives in the assembly root (opensoft/openXdox), not here. Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014E8Yr24V2TUSpcD8ixK1HJ
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis follow-up tightens the leg-shape tests by making missing-file diagnostics accurate, requiring both Apache License and Version 2.0 text, and correcting documentation about where the assembly root’s project.yaml is located. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
There was a problem hiding this comment.
🟢 Approval recommended
The changes are small, test-only, and verified to match the repository’s existing LICENSE text and intended layout.
Pull request overview
This PR tightens and clarifies the repository “leg shape” pytest suite so its assertions and comments accurately describe the expected repository layout and license posture for the openXdox code leg.
Changes:
- Fix
test_required_file_existsfailure text so it no longer incorrectly implies files must live at the repo root. - Strengthen
test_license_is_apache_2_0to assert the Apache license is specifically Version 2.0 (not just a generic “Apache License” substring). - Clarify in
test_role_directory_existsthatproject.yamlis in the assembly root (opensoft/openXdox), not in this leg.
File summaries
| File | Description |
|---|---|
tests/test_leg_shape.py |
Updates assertions/messages and comments to better reflect actual repository posture and Apache 2.0 license expectations. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…d), and sweep the claims the old pin left true (#21) Lane: openxfactory-4 (openXfactory-4-openDox_extraction) Refs opensoft/openXfactory#656 (stays OPEN). CLAIM: 5699629088. pyproject.toml:106 pins `opendox` at openDox-code main 0b4e8bbf68fabfcd65d4f0d80e619c20a013e888 (#23, S 3.4 slice S8 leg B, LANDED note 5690615323), following the pin past a99eba03 (#11, S 4.3 lazy proxy, pinned here by #15 on 2026-09-11). Owed twice in openxFactory#656's own record: the S5 LANDED note 5656797299 item 4, and pin lockstep #2's LANDED note 5689609863 residue item 1 - Copilot's suppressed finding on #1054, that a pip install of the pinned openXdox code resolves an older opendox than the lockstep contract names. BOTH OF THIS ACT'S OPEN QUESTIONS ARE RULED. RULED openxFactory#656 comment 5700475319 (Brett Heap, 2026-09-16, by interactive multi-choice): (a) DROP tests/test_doxbench_mutation_boundary.py from validate.yml's list, with the measurement and both grounds in the workflow comment, returning with the BUILD arc beside test_doxbench_turns.py; and (a) KEEP the three skip guards and CORRECT their reasons, because they test the ASSEMBLED openDox and a consumer may pin behind the view contract. Both were already what this act does; the ruling is now cited at each of the four places the decision is stated, so it travels with the file rather than with this message. MEASURED in fresh venvs at each pin, under validate.yml's exact invocation (python 3.12.3 / pytest 8.4.2, direct_url.json asserted): a99eba03 301 passed, 23 skipped 0b4e8bbf, the bump alone 317 passed, 6 skipped 0b4e8bbf, the landed head 360 passed, 6 skipped (the third is the second plus the FORTY-THREE provenance-guard tests the review rounds asked for; no other count moved between them, and both figures are re-derived at every head rather than carried — the pass count 317 -> 323 -> 330 -> 332 -> 333 -> 334 -> 336 -> 343 -> 346 -> 348 -> 349 -> 351 -> 353 -> 355 -> 356 -> 357 -> 359 -> 360, one step per round that added tests, and the test count from `git diff main -- tests/test_gate_loop_probes.py tests/test_gate_loop_views.py | grep -c '^+def test_'`.) THE SKIP DELTA IS TWO HALVES, not seventeen cleared skips — Copilot's round-3 review caught that conflation. SIXTEEN became passes: the three S5 materialization assertions RUN and PASS (test_gate_loop_views.py 32/3 -> 35/0) and the thirteen node probes run (test_gate_loop_probes.py 0/13 -> 13/0). The SEVENTEENTH did not clear: it was test_doxbench_mutation_boundary.py's module-level skip, and that file leaves the list (below), so the skip is no longer RUN rather than cleared. The six that remain are the three seam suites' doc_health pairs, which no pin bump touches. THE REVIEW TOOK TWENTY-EIGHT ROUNDS AND CHANGED WHAT THIS ACT IS, which the description records round by round rather than presenting as one clean diff. The bump is one line; the sweep is prose in six files; everything after that is the guard behind those skips learning to tell the DECLARED pin from somebody else's, because after the bump a skip could hide a regression instead of reporting one. It fails closed for the declared commit and for unreadable provenance under CI, skips for a different commit and for an unreadable side off CI, and 43 tests hold it there — including the PEP 610 parser itself, which one round showed was the way to reach the silent green without going through the decision at all. The last round found the four-row table paraphrased in eight places, each paraphrase missing a row; the table now lives in one place and the rest point at it. The last round split the two FAILURES apart everywhere they had been run together — an equal-commit regression says the declared openDox is wrong, an unreadable side under CI says only that the run cannot tell which openDox it is testing — and drove declared_pin()'s own unreadable-file branch, the last part of the fail-closed rule that had never been produced by the function rather than supplied to it. The round after it retired the line "or None where the pin carries none" from both discovery functions and pointed validate.yml's 2026-09-10 preamble at the S8 un-narrowing block twenty lines below it, so the required check's scope is stated where a reader starts rather than only where the list is. The last round went one level out again, to the three CALL SITES: every test before it either called the guard or monkeypatched the function under it, so swapping any one call for a bare pytest.skip would have left every required test green. THE LAST NINE ROUNDS WERE ONE CLASS, the reading itself: each found the guard admitting or refusing one more real declaration shape — a 40-hex PREFIX of a longer ref, an `@` in an SSH authority, a FALSE environment marker, a name spelled `OpenDox` (PEP 503 says names are case-insensitive), a `;` in a url path, pip's direct-reference fragment — until the reading stopped guessing: tomllib parses the file, packaging.requirements parses the entry, and fullmatch reads the pin. The last two closed the SOURCE on both sides. A pin at another PROJECT is not a declaration this guard can interpret (the declared url), and a distribution built from another project is not provenance it may compare (direct_url.json's url, which installed_commit() had been dropping while comparing shas alone) — a fork or a mirror of openDox-code passing on both sides, RULED 5700475319, and a different project failing closed under CI rather than taking the different-commit skip. The last round closed the other recurring class rather than its latest instance: a count written in prose goes stale one round after it is written, so the two inventories that kept doing it now print the `grep -c` that derives them instead of carrying a number. It also drove the one path the call-site tests could not: the 29 module-scope `OPENDOX_WEB` importers call require() with no argument, where a skip must carry allow_module_level=True, and nothing had ever asserted that the default is forwarded. ONE FILE LEAVES validate.yml's LIST, for the BUILD arc's defect and not this bump's. tests/test_doxbench_mutation_boundary.py was named by S8 on the measurement that it COLLECTS and then skips whole at tests/opendox_bundle.py's module-level skip. With the bundle in the wheel that skip no longer fires, the module runs on to its line 481 `from openxdox import gate_console` -> gate_console.py:63 `from doc_health import corpus`, and collection ERRORS. It is dropped rather than repaired for the reason test_doxbench_turns.py is not named at all - naming it would put the required check red for split-opendox S 3.5/3.6 (RULED Q-L8 (b')) - and because it is an arrived carve row whose edits are declared at openxFactory. THE SWEEP, whole-repository. `git grep -n a99eba03 main` — the tree this act starts from — returns exactly one line, the pin itself at pyproject.toml:106; at the landed head the same grep returns 13 lines in 6 files and NONE in pyproject.toml, every one a provenance quotation this sweep added on purpose (the claim is about the dependency SPEC, not the string — Copilot's review of cb84001 was right that the unqualified sentence is false at the head it is read at). There is no lockfile, requirements or constraints file and no test asserting the pin string. Eleven sites in six files carried sentences stating what IS pinned and are corrected, each quoting its old wording as provenance: validate.yml (three blocks), src/openxdox/view_extensions.py's module docstring, tests/opendox_bundle.py's docstring and _REASON, tests/test_gate_loop_probes.py's docstring / fixture / skip, tests/test_gate_loop_views.py's _view_extension_or_skip, and tests/test_dependency_direction.py's two - one of them stale since #15, which called BUILD slice 2b's merge the commit "this file's pin now names". Left untouched as conditional or historical: ViewContractUnsupported and both GateLoopViews.views() refusals, and the 29 `# noqa: E402 (skips where the pin carries no bundle)` comments across 29 files. NONE of the seven files this PR touches is an arrived carve row - checked against openxFactory's manifest, where 92 rows carry destination openxdox_code and none of the seven is among them, while all 29 noqa files ARE - so no edit here is an undeclared edit. THE RATCHET IS RE-MEASURED, NOT CARRIED FORWARD: _back_import_census() against the newly pinned tree returns exactly OPENDOX_BACK_IMPORTS' five rows - 0 import-time / 19 deferred, unchanged across two openDox slices. WHOLE-TREE, the rehearsal lockstep #2's residue item 2 asks for (pytest tests/ -q --noconftest --continue-on-collection-errors, both venvs): a99eba03 153 failed, 568 passed, 29 skipped, 127 errors 0b4e8bbf 153 failed, 626 passed, 10 skipped, 128 errors (at 9ff630d; 586 plus the 40 provenance-guard tests present at that head; 43 at the landed one) No new failure anywhere in the tree; the one new error is the file named above. SONARCLOUD'S ONE NEW FINDING, ANSWERED BY MEASUREMENT (advisory check): a VULNERABILITY/MAJOR at .github/workflows/validate.yml line 40, "Omitting --only-binary :all: can lead to the execution of setup scripts". That line is `run: python -m pip install -e ".[test]"`, is BYTE-IDENTICAL to main, and lies in no changed hunk of this PR (the first is at +95). Sonar's new-code window for a pull request covers a FILE this PR edits, so a pre-existing line is re-reported; #15 passed because it never touched validate.yml. The rule is also unsatisfiable here: --only-binary :all: forbids source builds, and this step is an editable install plus a PEP 508 direct VCS reference, both source installs by definition. validate, this leg's only required check, is SUCCESS at this head. NOT DONE HERE, by name: no assembly or aggregation pin moves (that is pin lockstep #3, claimed with this act); no arrived carve row is touched; and README.md:40-43's "validate runs only the scaffold's shape assertions" is left as it stands - it went stale at slice S8, not at this pin, and is registered for a later declared act. GATE EVIDENCE, MEASURED AT THE LANDED HEAD 894781e: validate SUCCESS, run 35155979036, the job's own line `360 passed, 6 skipped`; the same invocation in a fresh venv reads the same. Copilot's review 5228891702 at that head — "Needs a closer look - the broad dependency, CI, provenance, and test changes warrant final human review" — with every finding of every round fixed or answered by measurement, and 15 review threads / 0 unresolved. SonarCloud is advisory here and its one issue is answered above. Lane: openxfactory-4 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>



Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox)
Fast-follow on #1. Copilot's automated review landed on #1 after that PR's
validatecheck had already gone SUCCESS and it had merged (Copilot's reviewconsistently trails the required check by a minute or more here), so its two
factual findings are addressed here instead:
test_required_file_existsclaimed a missingfile is "at the repository root", which is wrong for nested entries such
as
.github/CODEOWNERS.test_license_is_apache_2_0only checked for the substring"Apache License", never "Version 2.0", so the test's name and its
assertion could diverge.
Also fixes the same "project.yaml lives here" phrasing issue Copilot caught
in the spec leg's sibling test but did not flag here: the comment in
test_role_directory_existscitedproject.yamlas if it were in thisrepository; it lives in the assembly root (
opensoft/openXdox), not here.Refs opensoft/openXfactory#656
🤖 Generated with Claude Code
https://claude.ai/code/session_014E8Yr24V2TUSpcD8ixK1HJ
Summary by Sourcery
Make leg-shape tests accurately validate required files, the Apache 2.0 license, and repository layout.
Bug Fixes:
Enhancements:
Tests: