This repository was archived by the owner on Jul 29, 2026. It is now read-only.
fix(tests): repoint runner to backend_old/src + stamp the real package's ratios - #111
Merged
Merged
Conversation
The canonical edcmbone package (canon/CanonLoader, metrics/*, parser, compress) was moved to backend_old/src/edcmbone/ during the layer migration, but tests/conftest.py and several test modules still located it at backend/src/edcmbone — now home to the new edcmbone_backend package. With the package absent from backend/src, `import edcmbone` fell through to the incomplete repo-root copy and 4 test modules errored at collection (the failure seen on PR #110's `test` job). Runner repair: point BACKEND_SRC and the per-test path constructions at backend_old/src so the complete package resolves. pytest now collects and passes 78/78 (previously 4 collection errors). Ratios: give the real package the line it should have — stamp the strict single-line `ratios:` bookend on the 16 non-empty files of backend_old/src/edcmbone/ (the tree the first compliance pass excluded as "legacy"). Values computed by skill-lib's ratios_check.py; `ratios_check --strict` reports 0 drift / 0 misplaced. The lone empty package marker canon/data/__init__.py is left unstamped. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016MxbhVVRcSdqBTYuvyDR5L
erinepshovel-code
marked this pull request as ready for review
June 30, 2026 15:33
Copilot stopped reviewing on behalf of
erinepshovel-code due to an error
June 30, 2026 15:33
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the test suite to load the legacy backend_old/src implementation of edcmbone, and introduces auto-generated “ratios” annotations across multiple backend modules.
Changes:
- Repointed test path constants from
backend/srctobackend_old/src. - Updated a docstring reference to match the new backend path.
- Added “# ratios: …” header/footer comments to many
backend_oldPython modules.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_ucns_objects.py | Switches UCNS object tests to import from backend_old/src. |
| tests/test_ucns_g_schema.py | Updates docstring path reference to backend_old/src. |
| tests/test_polarity_balance.py | Points word data fixture path at backend_old/src. |
| tests/test_metrics_layer_designation.py | Switches metrics-layer tests to backend_old/src. |
| tests/test_metric_orthogonality_v02.py | Switches orthogonality tests to backend_old/src. |
| tests/test_apostrophe_normalization_and_tokenization.py | Reads parser source from backend_old/src for regex extraction. |
| tests/test_affix_residual_validation.py | Updates sys.path insertion target to backend_old/src. |
| tests/conftest.py | Updates shared BACKEND_SRC and related comment to backend_old/src. |
| backend_old/src/edcmbone/ucns/ucns_v04.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/ucns/closed_tokens.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/ucns/init.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/parser/turns_rounds.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/parser/init.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/metrics/stats.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/metrics/risk.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/metrics/projection.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/metrics/orthogonality.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/metrics/matrix.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/metrics/compute.py | Adds “ratios” header/footer comments (and adjusts trailing whitespace around return). |
| backend_old/src/edcmbone/metrics/init.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/compress.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/canon/loader.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/canon/init.py | Adds “ratios” header/footer comments. |
| backend_old/src/edcmbone/init.py | Adds “ratios” header/footer comments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ROOT = Path(__file__).resolve().parents[1] | ||
| BACKEND_SRC = ROOT / "backend" / "src" | ||
| BACKEND_SRC = ROOT / "backend_old" / "src" |
| @@ -1,3 +1,4 @@ | |||
| # ratios: loc_comments=200:145 imports_exports=6:4 calls_definitions=89:20 | |||
Comment on lines
+427
to
+428
| return results | ||
| # ratios: loc_comments=200:145 imports_exports=6:4 calls_definitions=89:20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Follow-up to #110. Two linked problems the first ratios pass surfaced:
edcmbonepackage (canon/CanonLoader,metrics/*,parser/,compress.py) was moved tobackend_old/src/edcmbone/during the layer migration, whilebackend/src/now holds the newedcmbone_backendpackage. Buttests/conftest.pyand several test modules still located the package atbackend/src/edcmbone. With it absent there,import edcmbonefell through to the incomplete repo-root copy → 4 modules errored at collection (the redtestjob on chore(ratios): stamp executable source with ratios bookend #110).backend_old/as "legacy", so the package that's actually live got noratios:bookend.What
BACKEND_SRCand the per-test path constructions frombackend/src→backend_old/src(8 test files incl.conftest.py).pytestnow collects and passes 78/78 (was 4 collection errors).ratios:bookend on the 16 non-empty files ofbackend_old/src/edcmbone/. Values computed by skill-lib'sratios_check.py, soratios_check --strictreports 0 drift / 0 misplaced. The emptycanon/data/__init__.pymarker is left unstamped.Verification
python -m pytest -q→ 78 passed (before: 4 collection errors)ratios_check.py --root backend_old/src/edcmbone→ 16 covered, 0 drift, 0 misplacedpy_compileclean across the packageNote / out of scope
This makes the runner find the package where it currently lives; it does not rename
backend_old/back to a non-"old" location or reconcileCLAUDE.md(which still describes the package atbackend/src/edcmbone). Ifbackend_oldis not the intended permanent home, that directory rename is a separate decision.🤖 Generated with Claude Code
https://claude.ai/code/session_016MxbhVVRcSdqBTYuvyDR5L
Generated by Claude Code