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

Add minimal UCNS-only backend edcmbone_backend, archive original backend to backend_old - #105

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

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

Conversation

@erinepshovel-code

Copy link
Copy Markdown
Collaborator

Motivation

  • Provide a much smaller, dependency-light backend whose only runtime import is ucns and which treats unresolved constraints as explicit boundary objects rather than silently resolving them.
  • Surface a concrete unresolved-continuation object (hmmm) so unresolved work is preserved as data and composable via UCNS carriers.
  • Preserve the previous full edcmbone implementation by moving it to backend_old to keep history and larger functionality available.

Description

  • Introduce a new package src/edcmbone_backend implementing BoundaryObject, Hmmm, make_boundary, merge_boundaries, and serialize_boundary, plus helper functions _coerce_text and _anchor, and set __version__ = "0.2.0".
  • Add a small ucns.py compatibility shim that re-exports ucns_v04 symbols used by the backend.
  • Replace the original backend sources with backend_old/ (moving the prior edcmbone package and its data) and update backend/README.md and pyproject.toml to reflect the new package name edcmbone-backend and simplified build/test settings.
  • Add contract tests at backend/tests/test_backend_contracts.py that assert the package only imports ucns, that Hmmm preserves unresolved text and always provides a fallback, and that boundary objects carry normalized UCNSObject carriers and merge correctly.

Testing

  • Ran the new contract test file with pytest backend/tests/test_backend_contracts.py, which exercises import inspection and object behavior, and all tests passed.
  • The test suite contains 4 assertions covering imports, Hmmm preservation/fallback, and UCNS backing/merge, and they succeeded.

Codex Task

Copilot AI review requested due to automatic review settings June 25, 2026 19:24

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 “UCNS-only” backend package (edcmbone-backend / edcmbone_backend) intended to model delivered output plus an explicit unresolved-continuation boundary (Hmmm), while preserving the prior, larger backend implementation under backend_old/.

Changes:

  • Added backend/src/edcmbone_backend implementing BoundaryObject, Hmmm, and boundary creation/merge/serialization helpers.
  • Added contract tests under backend/tests/ asserting UCNS-only imports and key Hmmm/merge behaviors.
  • Archived the prior backend implementation into backend_old/ and simplified backend/README.md + backend/pyproject.toml to reflect the new package.

Reviewed changes

Copilot reviewed 8 out of 29 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ucns.py Adds a top-level UCNS compatibility shim that re-exports ucns_v04 symbols.
backend/tests/test_backend_contracts.py Adds contract tests for import hygiene and boundary/Hmmm behaviors.
backend/src/edcmbone_backend/init.py Implements the new minimal UCNS-backed boundary object API.
backend/README.md Replaces prior README content with minimal backend-focused documentation.
backend/pyproject.toml Renames/simplifies backend packaging config to build edcmbone-backend.
backend_old/src/edcmbone/ucns/ucns_v04.py Archives the prior UCNS v0.4 engine implementation under backend_old/.
backend_old/src/edcmbone/ucns/closed_tokens.py Archives prior closed-token UCNS encoder implementation.
backend_old/src/edcmbone/ucns/init.py Exposes archived UCNS encoder surface from backend_old.
backend_old/src/edcmbone/parser/turns_rounds.py Archives prior transcript parser implementation.
backend_old/src/edcmbone/parser/init.py Exposes archived parser surface from backend_old.
backend_old/src/edcmbone/metrics/stats.py Archives prior metric/stat primitives.
backend_old/src/edcmbone/metrics/risk.py Archives prior risk proxy implementations.
backend_old/src/edcmbone/metrics/projection.py Archives prior Layer 1→3 projection logic.
backend_old/src/edcmbone/metrics/orthogonality.py Archives prior orthogonality/axis model implementation.
backend_old/src/edcmbone/metrics/matrix.py Archives prior A-matrix/projection/alerts registry.
backend_old/src/edcmbone/metrics/compute.py Archives prior metric vector computation module.
backend_old/src/edcmbone/metrics/init.py Exposes archived metrics surface from backend_old.
backend_old/src/edcmbone/compress.py Archives prior codec/compression tooling.
backend_old/src/edcmbone/canon/loader.py Archives prior canon loader.
backend_old/src/edcmbone/canon/data/markers_v1.json Archives prior behavioral markers dataset.
backend_old/src/edcmbone/canon/data/bones_punct_v1.json Archives prior punctuation canon dataset.
backend_old/src/edcmbone/canon/data/bones_affixes_v1.json Archives prior affix canon dataset.
backend_old/src/edcmbone/canon/data/init.py Archives canon data package marker.
backend_old/src/edcmbone/canon/init.py Exposes archived canon surface from backend_old.
backend_old/src/edcmbone/init.py Exposes archived full edcmbone surface from backend_old.
backend_old/README.md Preserves the original README under backend_old/.
backend_old/pyproject.toml Preserves original packaging metadata for the archived backend.
backend_old/LICENSE Preserves MPL-2.0 license text for the archived backend.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/src/edcmbone_backend/__init__.py
Comment thread backend/src/edcmbone_backend/__init__.py
Comment thread backend/pyproject.toml
Comment on lines 11 to 16
requires-python = ">=3.8"
dependencies = []
keywords = ["AI", "measurement", "structural fidelity", "cognitive accessibility", "NLP", "EDCM"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Text Processing :: Linguistic",
]

[project.urls]
Homepage = "https://github.com/The-Interdependency/edcmbone"
Repository = "https://github.com/The-Interdependency/edcmbone"
Issues = "https://github.com/The-Interdependency/edcmbone/issues"

[tool.pytest.ini_options]
testpaths = ["../Tests", "../tests"]

[tool.hatch.build.targets.wheel]
packages = ["src/edcmbone"]
include = [
"src/edcmbone/canon/data/**/*.json",
]
packages = ["src/edcmbone_backend"]

Comment thread backend/tests/test_backend_contracts.py

@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: 8f3f2fdacd

ℹ️ 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
Comment on lines +17 to +18
[tool.pytest.ini_options]
testpaths = ["tests"]

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 Update the root test workflow with the backend move

In the checked CI workflow .github/workflows/ci.yml, the test job still runs pytest from the repo root after pip install -e ./backend, so pytest uses the root pytest.ini (testpaths = tests) rather than this backend-local setting. Those root tests still load backend/src/edcmbone/... directly, for example tests/test_metric_orthogonality_v02.py loads backend/src/edcmbone/metrics/__init__.py, but this commit deletes that tree; running pytest -q now stops during collection with FileNotFoundError/ImportError. Please update the root workflow/tests or keep the old import paths available.

Useful? React with 👍 / 👎.

# call: tests.test_backend_contracts.test_boundary_objects_are_ucns_backed
# === END CONTRACTS ===

import 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 Include the UCNS shim in the packaged backend

When edcmbone-backend is installed or imported outside the repository root, this import cannot resolve: the new ucns.py shim lives at the repo root, while backend/pyproject.toml packages only src/edcmbone_backend and declares no ucns dependency. I reproduced this by importing with only /workspace/edcmbone/backend/src on PYTHONPATH, which raises ModuleNotFoundError: No module named 'ucns'; CI from the repo root masks this because the root directory is on sys.path.

Useful? React with 👍 / 👎.


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))

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 Normalize unresolved text before choosing the UCNS face

When callers pass unresolved input that changes truthiness after _coerce_text (for example whitespace-only text from a form, or 0 that becomes '0'), the Hmmm payload and the UCNS carrier disagree: whitespace is stripped to the fallback hmmm: text but gets face 0, while 0 is preserved as unresolved text but gets face 1. Since the carrier is what makes these boundary objects comparable/mergeable, choose the face from the coerced unresolved text rather than the raw argument.

Useful? React with 👍 / 👎.

Comment thread backend/pyproject.toml
Comment on lines +6 to +7
name = "edcmbone-backend"
version = "0.2.0"

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 after changing package metadata

The checked workflow .github/workflows/manifest-check.yml still runs python .agents/skills/manifest/generate.py --root . --pyproject backend/pyproject.toml --check, and after this package rename/version change the generated block in CLAUDE.md still says package edcmbone version 0.1.0. I ran that exact check and it exits with [manifest] CLAUDE.md manifest block is stale or missing, so this PR will fail the manifest CI until the generated block is refreshed or the workflow is updated.

Useful? React with 👍 / 👎.

def merge_boundaries(left, right):
"""Compose two boundaries while preserving both delivered and hmmm text."""
return BoundaryObject(
"\n".join(part for part in (left.delivered, right.delivered) if part),

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 Keep fallback hmmm text out of merged unresolved data

When two boundaries that have no explicit unresolved constraint are merged, this line treats both Hmmm objects as truthy and passes their fallback str() values into a new Hmmm, so serialize_boundary(merge_boundaries(...))['hmmm']['unresolved'] becomes two copies of the fallback prose instead of staying empty like it does for each input boundary. That makes downstream consumers unable to distinguish a real unresolved constraint from the automatic fallback marker after merges.

Useful? React with 👍 / 👎.

erinepshovel-code and others added 2 commits June 25, 2026 12:45
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@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: f151725502

ℹ️ 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".

return BoundaryObject(
"\n".join(part for part in (left.delivered, right.delivered) if part),
hmmm(unresolved),
ucns.multiply(left.ucns_object, right.ucns_object),

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 Recompute the merged boundary face from unresolved state

When a boundary with unresolved text is merged with a complete boundary, this multiplication XORs faces [0] and [1] into [1], the same face emitted by make_boundary(..., unresolved=None), while merged.hmmm.unresolved is still non-empty. Since serialize_boundary() exposes ucns.faces, callers comparing boundary carriers can no longer tell that the merged object still carries an unresolved constraint; recompute the carrier from the merged unresolved text or otherwise keep the face semantics aligned after merges.

Useful? React with 👍 / 👎.

@erinepshovel-code

Copy link
Copy Markdown
Collaborator Author

@codex[agent] resolve conflicts and repair bad code

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

Copy link
Copy Markdown

Summary

Testing

  • python -m pip install -e ./backend
  • pytest -q backend/tests/test_backend_contracts.py
  • pytest -q backend/tests
  • python .agents/skills/manifest/generate.py --root . --pyproject backend/pyproject.toml --check
  • (cd /tmp && PYTHONPATH=/workspace/edcmbone/backend/src python - <<'PY' ... PY)
  • python -m pip wheel ./backend -w /tmp/edcmbone-wheelhouse
  • python - <<'PY' ... PY wheel zip inspection confirmed ucns/__init__.py is packaged.
  • rg -n '^(<<<<<<<|>>>>>>>|=======$)' . || true

Committed changes on the current branch with commit e19ae77 and created a PR titled “Fix UCNS backend packaging and boundary semantics.”

View task →

@erinepshovel-code
erinepshovel-code merged commit df268c2 into main Jun 25, 2026
3 of 5 checks passed
@erinepshovel-code
erinepshovel-code deleted the codex/examine-skill-lib-and-create-new-backend branch June 25, 2026 21:47
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