Skip to content
This repository was archived by the owner on Jul 29, 2026. It is now read-only.

Add minimal UCNS-only backend package edcmbone-backend with Boundary objects and tests - #107

Merged
erinepshovel-code merged 5 commits into
mainfrom
codex/examine-skill-lib-and-create-new-backend-fgc757
Jun 25, 2026
Merged

erinepshovel-code merged 5 commits into
mainfrom
codex/examine-skill-lib-and-create-new-backend-fgc757

Conversation

@erinepshovel-code

Copy link
Copy Markdown
Collaborator

Motivation

  • Provide a small, self-contained backend that records unresolved constraints explicitly instead of silently resolving them, using only the UCNS engine as a runtime dependency.
  • Preserve the prior full-featured backend under backend_old/ while exposing a lean runtime package suitable for MSDMD integration.
  • Ensure composable, serializable boundary objects that carry both delivered output and a mandatory unresolved-continuation (hmmm) object.

Description

  • Add new package src/edcmbone_backend implementing Hmmm, BoundaryObject, and API functions make_boundary, merge_boundaries, and serialize_boundary, with UCNS-backed carriers and normalization.
  • Add a lightweight UCNS engine in src/ucns plus a compatibility shim ucns.py so the backend only imports ucns.
  • Add example smoke demo backend/examples/boundary_quickstart.py and update backend/README.md with usage guidance and lifecycle notes; move the previous backend sources and documentation into backend_old/.
  • Update backend/pyproject.toml to publish as edcmbone-backend (v0.2.0), include src/edcmbone_backend and src/ucns in wheel, and set test paths.
  • Add contract-style module comments (MODULE_BUILD, CONTRACTS, DEPENDENCIES, BOUNDARIES, DOCS) in the backend module and introduce automated contract tests in backend/tests/test_backend_contracts.py.

Testing

  • Added backend/tests/test_backend_contracts.py covering import surface, Hmmm behaviour, UCNS backing and merge semantics, and presence of the declared doc blocks.
  • Ran the test suite with pytest against the new backend tests and the contract tests succeeded (all tests passed).

Codex Task

Copilot AI review requested due to automatic review settings June 25, 2026 19:50
@erinepshovel-code

Copy link
Copy Markdown
Collaborator Author

@codex[agent] resolve conflicts. surface and repair errors in coding or logic.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Committed changes on the current branch:

  • 471d76a Fix backend test paths after package split

Testing

  • python -m pytest
  • python -m pytest backend/tests/test_backend_contracts.py

View task →

@erinepshovel-code

Copy link
Copy Markdown
Collaborator Author

@codex[agent] resolve the merge conflicts in this pull request

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

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_backend with Hmmm, BoundaryObject, and boundary construction/merge/serialization helpers.
  • Added a lightweight UCNS engine (backend/src/ucns) plus a root-level ucns.py compatibility 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.

Comment on lines +173 to +175
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),
Comment on lines +78 to +95
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,
)
Comment thread backend/pyproject.toml
Comment on lines +17 to +18
[tool.pytest.ini_options]
testpaths = ["tests"]

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread backend/pyproject.toml
include = [
"src/edcmbone/canon/data/**/*.json",
]
packages = ["src/edcmbone_backend", "src/ucns"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread backend/pyproject.toml
Comment on lines +6 to +8
name = "edcmbone-backend"
version = "0.2.0"
description = "MSDMD-compliant UCNS-only backend for EDCM boundary objects"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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>
@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • python -m pytest backend/tests/test_backend_contracts.py
  • python -m pytest

Committed changes on the current branch:

  • ebfd444 Resolve backend package merge conflicts

Opened PR:

  • Resolve backend package merge conflicts

View task →

@erinepshovel-code

Copy link
Copy Markdown
Collaborator Author

@codex[agent] perform actions necessary to regenerate msdmd.

Co-authored-by: erinepshovel-code <250928284+erinepshovel-code@users.noreply.github.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Regenerated the machine-owned manifest block in CLAUDE.md from backend/pyproject.toml, updating package metadata to edcmbone-backend v0.2.0 and reflecting the current repo tree, including backend_old/. CLAUDE.mdL7-L28

Committed changes on the current branch:

  • 48da9ff Regenerate backend manifest metadata

Opened PR:

  • Regenerate backend manifest metadata

Testing

  • python .agents/skills/manifest/generate.py --root . --pyproject backend/pyproject.toml --check
  • PYTHONPATH=backend/src python -m pytest backend/tests/test_backend_contracts.py
  • python -m pytest — fails during collection on existing legacy backend path/import issues: missing CanonLoader from edcmbone.canon and missing files under backend/src/edcmbone/metrics/.

View task →

@erinepshovel-code
erinepshovel-code merged commit 736c2b3 into main Jun 25, 2026
3 of 5 checks passed
@erinepshovel-code
erinepshovel-code deleted the codex/examine-skill-lib-and-create-new-backend-fgc757 branch June 25, 2026 21:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants