Add minimal UCNS-only backend package edcmbone-backend with Boundary objects and tests - #107
Conversation
|
@codex[agent] resolve conflicts. surface and repair errors in coding or logic. |
Summary
Committed changes on the current branch:
Testing
|
|
@codex[agent] resolve the merge conflicts in this pull request |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new minimal Python backend distribution (edcmbone-backend) that models “boundary objects” backed by a UCNS carrier and always preserves an explicit unresolved-continuation (hmmm) record, while moving the prior full backend implementation into backend_old/.
Changes:
- Added
edcmbone_backendwithHmmm,BoundaryObject, and boundary construction/merge/serialization helpers. - Added a lightweight UCNS engine (
backend/src/ucns) plus a root-levelucns.pycompatibility shim. - Added backend-specific contract-style tests and updated backend packaging/README + example quickstart.
Reviewed changes
Copilot reviewed 10 out of 31 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
ucns.py |
Adds a top-level compatibility shim exposing the UCNS v0.4 API under import ucns. |
backend/src/ucns/__init__.py |
Introduces the minimal UCNS engine used by the new backend. |
backend/src/edcmbone_backend/__init__.py |
Implements the new UCNS-only backend boundary objects and APIs. |
backend/tests/test_backend_contracts.py |
Adds contract-style tests validating import surface, Hmmm behavior, and UCNS-backed merge semantics. |
backend/examples/boundary_quickstart.py |
Adds a runnable smoke demo for boundary creation/merge/serialization. |
backend/README.md |
Refocuses backend docs on the new minimal package and lifecycle. |
backend/pyproject.toml |
Renames/publishes backend as edcmbone-backend and configures wheel packaging/testpaths. |
backend_old/** |
Preserves the previous full backend implementation under backend_old/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def make_boundary(delivered, unresolved=None): | ||
| """Create a UCNS-backed boundary object from delivered and unresolved text.""" | ||
| return BoundaryObject(delivered, hmmm(unresolved), _anchor(0 if unresolved else 1)) |
| """Compose two boundaries while preserving both delivered and hmmm text.""" | ||
| return BoundaryObject( | ||
| "\n".join(part for part in (left.delivered, right.delivered) if part), | ||
| "\n".join(str(part) for part in (left.hmmm, right.hmmm) if part), |
| def test_backend_src_path_is_self_contained(tmp_path): | ||
| import subprocess | ||
| import sys | ||
|
|
||
| code = """ | ||
| import edcmbone_backend as backend | ||
| boundary = backend.make_boundary('delivered', 'unresolved') | ||
| assert boundary.ucns_object.n_min == 1 | ||
| assert backend.serialize_boundary(boundary)['hmmm']['text'] == 'unresolved' | ||
| """ | ||
| result = subprocess.run( | ||
| [sys.executable, "-c", code], | ||
| cwd=tmp_path, | ||
| env={"PYTHONPATH": str(Path(__file__).resolve().parents[1] / "src")}, | ||
| text=True, | ||
| capture_output=True, | ||
| check=False, | ||
| ) |
| [tool.pytest.ini_options] | ||
| testpaths = ["tests"] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42c3cc41a5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| include = [ | ||
| "src/edcmbone/canon/data/**/*.json", | ||
| ] | ||
| packages = ["src/edcmbone_backend", "src/ucns"] |
There was a problem hiding this comment.
Keep the canonical edcmbone package available
In the checked .github/workflows/ci.yml, CI installs ./backend and then runs the repo-root pytest; tests/conftest.py and several tests still explicitly load backend/src/edcmbone for CanonLoader and metrics. With this package list and the move of backend/src/edcmbone to backend_old, collection now fails with ImportError: cannot import name 'CanonLoader' and FileNotFoundError for backend/src/edcmbone/metrics/*.py, so the existing test suite cannot run until the canonical package/tests are migrated together or the package remains available.
Useful? React with 👍 / 👎.
| name = "edcmbone-backend" | ||
| version = "0.2.0" | ||
| description = "MSDMD-compliant UCNS-only backend for EDCM boundary objects" |
There was a problem hiding this comment.
Refresh the generated manifest with pyproject changes
The manifest workflow checks CLAUDE.md against backend/pyproject.toml, but after this package rename/version change the generated block still says package edcmbone version 0.1.0. I ran the same check from .github/workflows/manifest-check.yml and it exits nonzero with “CLAUDE.md manifest block is stale or missing,” so this commit will fail that required CI job unless the manifest block is regenerated alongside the pyproject metadata.
Useful? React with 👍 / 👎.
| @@ -0,0 +1,96 @@ | |||
| from pathlib import Path | |||
There was a problem hiding this comment.
Wire the new backend contract tests into CI
The checked CI workflow still invokes pytest from the repo root, where the root pytest.ini restricts collection to tests, so this new backend/tests module is outside the default test run. I verified default collection from the repo root does not include these 7 backend contract tests; once the existing suite is migrated back to green, these package-specific contracts still won't protect the new backend unless CI or testpaths includes backend/tests.
Useful? React with 👍 / 👎.
…-fgc757 Co-authored-by: erinepshovel-code <250928284+erinepshovel-code@users.noreply.github.com>
Summary
Testing
Committed changes on the current branch:
Opened PR:
|
|
@codex[agent] perform actions necessary to regenerate msdmd. |
Co-authored-by: erinepshovel-code <250928284+erinepshovel-code@users.noreply.github.com>
Summary
Committed changes on the current branch:
Opened PR:
Testing
|
Motivation
backend_old/while exposing a lean runtime package suitable for MSDMD integration.hmmm) object.Description
src/edcmbone_backendimplementingHmmm,BoundaryObject, and API functionsmake_boundary,merge_boundaries, andserialize_boundary, with UCNS-backed carriers and normalization.src/ucnsplus a compatibility shimucns.pyso the backend only importsucns.backend/examples/boundary_quickstart.pyand updatebackend/README.mdwith usage guidance and lifecycle notes; move the previous backend sources and documentation intobackend_old/.backend/pyproject.tomlto publish asedcmbone-backend(v0.2.0), includesrc/edcmbone_backendandsrc/ucnsin wheel, and set test paths.backend/tests/test_backend_contracts.py.Testing
backend/tests/test_backend_contracts.pycovering import surface,Hmmmbehaviour, UCNS backing and merge semantics, and presence of the declared doc blocks.pytestagainst the new backend tests and the contract tests succeeded (all tests passed).Codex Task