Skip to content
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
erinepshovel-code merged 1 commit into
mainfrom
claude/msdmd-compliance-audit-fvua9b
Jun 30, 2026
Merged

erinepshovel-code merged 1 commit into
mainfrom
claude/msdmd-compliance-audit-fvua9b

Conversation

@erinepshovel-code

Copy link
Copy Markdown
Collaborator

Why

Follow-up to #110. Two linked problems the first ratios pass surfaced:

  1. The test runner pointed at the wrong path. The canonical edcmbone package (canon/CanonLoader, metrics/*, parser/, compress.py) was moved to backend_old/src/edcmbone/ during the layer migration, while backend/src/ now holds the new edcmbone_backend package. But tests/conftest.py and several test modules still located the package at backend/src/edcmbone. With it absent there, import edcmbone fell through to the incomplete repo-root copy → 4 modules errored at collection (the red test job on chore(ratios): stamp executable source with ratios bookend #110).
  2. The real package was never ratios-stamped. chore(ratios): stamp executable source with ratios bookend #110 excluded backend_old/ as "legacy", so the package that's actually live got no ratios: bookend.

What

  • Runner repair: repoint BACKEND_SRC and the per-test path constructions from backend/srcbackend_old/src (8 test files incl. conftest.py). pytest now collects and passes 78/78 (was 4 collection errors).
  • Ratios: stamp the strict single-line ratios: bookend on the 16 non-empty files of backend_old/src/edcmbone/. Values computed by skill-lib's ratios_check.py, so ratios_check --strict reports 0 drift / 0 misplaced. The empty canon/data/__init__.py marker is left unstamped.

Verification

  • python -m pytest -q78 passed (before: 4 collection errors)
  • ratios_check.py --root backend_old/src/edcmbone → 16 covered, 0 drift, 0 misplaced
  • py_compile clean across the package

Note / 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 reconcile CLAUDE.md (which still describes the package at backend/src/edcmbone). If backend_old is 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

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
erinepshovel-code marked this pull request as ready for review June 30, 2026 15:33
Copilot AI review requested due to automatic review settings June 30, 2026 15:33
@erinepshovel-code
erinepshovel-code merged commit 05eee6d into main Jun 30, 2026
6 checks passed
@erinepshovel-code
erinepshovel-code deleted the claude/msdmd-compliance-audit-fvua9b branch June 30, 2026 15:33
Copilot stopped reviewing on behalf of erinepshovel-code due to an error June 30, 2026 15:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/src to backend_old/src.
  • Updated a docstring reference to match the new backend path.
  • Added “# ratios: …” header/footer comments to many backend_old Python 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants