Resolve merge conflicts for UCNS backend PR - #109
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfc6c64594
ℹ️ 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 f"AnchorPayload(theta={self.theta}, payload={self.payload!r})" | ||
|
|
||
|
|
||
| class UCNSObject: |
There was a problem hiding this comment.
Re-export UCNS types instead of redefining them
In an installed backend package, importing both ucns and the new compatibility module ucns.ucns_v04 now creates two independent UCNSObject classes because this file redefines the engine instead of re-exporting the package implementation. That makes structurally identical objects fail interoperability checks such as ucns.unit_obj().equivalent(ucns.ucns_v04.unit_obj()), since equivalent() uses isinstance(other, UCNSObject). For a compatibility shim, ucns.ucns_v04 should expose the same objects as ucns, otherwise consumers that use the historical module path cannot safely compare or compose with backend-created UCNS objects.
Useful? React with 👍 / 👎.
|
|
||
| def merge_boundaries(left, right): | ||
| """Compose two boundaries while preserving both delivered and hmmm text.""" | ||
| unresolved = "\n".join(text for text in (left.hmmm.unresolved, right.hmmm.unresolved) if text) |
There was a problem hiding this comment.
Preserve note-only hmmm records when merging
When callers use the exported Hmmm/BoundaryObject API to carry continuation text in note with no unresolved value, this line drops that text during composition and replaces it with a fresh default fallback. For example, merging a boundary containing Hmmm(note="custom carry-forward") produces a merged hmmm whose text is the default kettle note, so merge_boundaries() no longer preserves both hmmm records in this supported input shape.
Useful? React with 👍 / 👎.
…into codex/github-mention-introduce-ucns-only-backend-edcmbone-backen
c55aa04
into
codex/examine-skill-lib-and-create-new-backend-salmqv
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9294c26c2e
ℹ️ 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".
| result = subprocess.run( | ||
| [sys.executable, "-c", code], | ||
| cwd=tmp_path, | ||
| env={**os.environ, "PYTHONPATH": str(Path(__file__).resolve().parents[1] / "src")}, |
There was a problem hiding this comment.
Remove the duplicate env keyword
This new env= argument duplicates the existing env=env just below it, so Python raises SyntaxError: keyword argument repeated: env while importing this test module. In any environment that runs or even collects backend/tests/test_backend_contracts.py, the backend test suite now fails before executing any tests; keep only one env argument.
Useful? React with 👍 / 👎.
Motivation
edcmbone-backendand to retain the prior backend as an archive.Description
backend/src/edcmbone_backend/__init__.pysomake_boundary()coercesunresolvedwith_coerce_text()before choosing the UCNS face bit, andmerge_boundaries()composes a merged unresolved string fromleft.hmmm.unresolvedandright.hmmm.unresolvedonly (avoiding concatenation of fallbackhmmm:strings).backend/tests/test_backend_contracts.py) to assert import-hygiene withset(imports) == {"ucns"}and to run the subprocess isolation test withenv={**os.environ, "PYTHONPATH": ...}so onlyPYTHONPATHis overridden.backend/src/ucns/ucns_v04.py) while keeping the repo-packagedbackend/src/ucnslayout so the wheel can include the UCNS implementation.backend/pyproject.toml/backend/README.md) to reflect the packagededcmbone-backendlayout and the resolved runtime notes.Testing
PYTHONPATH=backend/src python -m pytest backend/tests, which collected and ran 7 tests and all passed (7 passed).python -m pytest backend/testswithout an editable backend onPYTHONPATHfailed at import time because the installable package was not present in the current environment (expected in local checkouts unlessPYTHONPATHor an editable install is used).Codex Task