-
Notifications
You must be signed in to change notification settings - Fork 0
Introduce UCNS-only backend edcmbone-backend, archive prior backend as backend_old, and add new-retain-old skill
#108
Changes from all commits
5008b26
dde366f
7332ef9
dfc6c64
9294c26
c55aa04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| --- | ||
| name: new-retain-old | ||
| description: Preserve the prior implementation while creating a replacement implementation with explicit rollback, archive, metadata, tests, docs, and hmmm boundaries. Use when a user asks to replace, rewrite, rebuild, redesign, rename current to *_old, archive old backend/frontend/module/service, create new while retaining old, or when friction shows the old behavior must remain available during a new implementation. | ||
| --- | ||
|
|
||
| # new-retain-old — create new while retaining old | ||
|
|
||
| ## Purpose | ||
|
|
||
| Use this skill when the change is not a simple edit: it creates a new active | ||
| surface while keeping the prior surface available as an explicit rollback and | ||
| reference object. | ||
|
|
||
| The goal is to prevent three failures: | ||
|
|
||
| 1. deleting useful old behavior before the replacement is proven; | ||
| 2. hiding uncertainty about what moved, changed, or stayed unresolved; | ||
| 3. making the new path technically correct but hard to run, test, or review. | ||
|
|
||
| ## Workflow | ||
|
|
||
| 1. **Name the active and retained surfaces.** | ||
| - Active path: the new implementation users should use now. | ||
| - Retained path: the old implementation, usually `<name>_old`, `legacy/`, or | ||
| `archive/<date>-<name>`. | ||
| - If the user named the retained path, use that exact name. | ||
|
|
||
| 2. **Inventory before moving.** | ||
| - Inspect package metadata, imports, tests, docs, examples, data files, and | ||
| entry points. | ||
| - Identify what must remain runnable from the retained path. | ||
| - Record unknowns as `hmmm`; do not invent certainty. | ||
|
|
||
| 3. **Move old first, then build new.** | ||
| - Preserve the old tree with history-friendly renames where possible. | ||
| - Do not leave the active path half-old and half-new unless the user asked | ||
| for an incremental migration. | ||
| - Keep licenses and data files with the retained implementation unless there | ||
| is a clear reason not to. | ||
|
|
||
| 4. **Declare the new module beside the code.** | ||
| - Add `MODULE_BUILD` for the new active module. | ||
| - Add `CONTRACTS` for tests the module promises. | ||
| - Add `DEPENDENCIES` when imports/calls matter. | ||
| - Add `BOUNDARIES` when runtime effects, data, permissions, storage, | ||
| network, or admin behavior matter. | ||
| - Add `DOCS` when public usage guidance exists or should exist. | ||
|
|
||
| 5. **Make the new path few-click usable.** | ||
| - Provide a copy-paste install/run path. | ||
| - Include a smoke example or minimal demo. | ||
| - Test the new path from outside the repo root when packaging matters. | ||
| - Avoid relying on ambient `PYTHONPATH` unless explicitly documented as a | ||
| temporary hmmm boundary. | ||
|
|
||
| 6. **Test both the promise and the transition.** | ||
| - Test core new behavior. | ||
| - Test import/dependency boundaries that motivated the rewrite. | ||
| - Test that the retained path exists. | ||
| - Test docs/examples when they are the user entry point. | ||
|
|
||
| 7. **Report with a boundary object.** | ||
| - Delivered: what is now active, retained, tested, and documented. | ||
| - hmmm: unresolved constraints, compatibility gaps, migration risks, or next | ||
| continuation steps. | ||
|
|
||
| ## Required checks before commit | ||
|
|
||
| - `git status --short` shows only intentional active/new/retained changes. | ||
| - New active path has usage guidance. | ||
| - Retained path is named clearly and mentioned in docs or PR text. | ||
| - Tests cover at least one behavior of the new path and one transition invariant | ||
| such as import hygiene, package self-containment, or retained-path presence. | ||
| - Any unresolved behavior is written as `hmmm`, not omitted. | ||
|
|
||
| ## PR body checklist | ||
|
|
||
| Include: | ||
|
|
||
| ```text | ||
| active_path: <path> | ||
| retained_path: <path> | ||
| rollback: restore retained_path or switch import/entry point back | ||
| few_click_path: <commands or hmmm> | ||
| tests: <commands> | ||
| hmmm: <unresolved constraints or non-empty continuation note> | ||
| ``` | ||
|
|
||
| ## Anti-patterns | ||
|
|
||
| - Calling the old path “backup” without documenting how to restore it. | ||
| - Replacing package metadata but not testing installation. | ||
| - Adding examples that only work because the agent shell has special paths. | ||
| - Flattening `hmmm` into prose that cannot be tested or carried forward. | ||
| - Treating archived old code as dead if users still need it for comparison, | ||
| rollback, or migration. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| interface: | ||
| display_name: "New While Retaining Old" | ||
| short_description: "Safe replacement with retained old path" | ||
| default_prompt: "Use this skill to replace an implementation while preserving the old one, documenting rollback, and testing the transition." |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| """ | ||
| ucns_v04 — UCNS Engine (turn-fraction angle convention) | ||
| ======================================================== | ||
| Angles are stored as Fraction objects representing fractions of a full turn: | ||
| 0 = 0 deg, 1/4 = 90 deg, 1/2 = 180 deg, 2 = 720 deg = 0 on doubled cover. | ||
|
|
||
|
|
@@ -203,8 +204,3 @@ def multiply(A: UCNSObject, B: UCNSObject) -> UCNSObject: | |
| anchors_pos=tuple(new_anchors), | ||
| faces_pos=tuple(new_faces), | ||
| ) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because this package still ships Useful? React with 👍 / 👎. |
||
| """Compatibility name for the UCNS v0.4 engine.""" | ||
|
|
||
| from .ucns_v04 import AnchorPayload, UCNSObject, is_unit_payload, multiply, unit_obj | ||
|
|
||
| __all__ = ["AnchorPayload", "UCNSObject", "is_unit_payload", "multiply", "unit_obj"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,6 +77,7 @@ def test_boundaries_record_no_hidden_side_effects(): | |
|
|
||
|
|
||
| def test_backend_src_path_is_self_contained(tmp_path): | ||
| import os | ||
| import subprocess | ||
| import sys | ||
|
|
||
|
|
@@ -86,10 +87,13 @@ def test_backend_src_path_is_self_contained(tmp_path): | |
| assert boundary.ucns_object.n_min == 1 | ||
| assert backend.serialize_boundary(boundary)['hmmm']['text'] == 'unresolved' | ||
| """ | ||
| env = os.environ.copy() | ||
| env["PYTHONPATH"] = str(Path(__file__).resolve().parents[1] / "src") | ||
| result = subprocess.run( | ||
| [sys.executable, "-c", code], | ||
| cwd=tmp_path, | ||
| env={"PYTHONPATH": str(Path(__file__).resolve().parents[1] / "src")}, | ||
| env={**os.environ, "PYTHONPATH": str(Path(__file__).resolve().parents[1] / "src")}, | ||
| env=env, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. |
||
| text=True, | ||
| capture_output=True, | ||
| check=False, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The root README still tells users to
pip install -e ./backendand then importedcmbone.canon,edcmbone.parser,edcmbone.metrics, andedcmbone.compress, but this wheel now packages onlyedcmbone_backendanducns. A fresh install following that documented quickstart can no longer provide the advertised F-loss API, so either keep a compatibilityedcmbonepackage in this distribution or update the public docs and migration path in the same change.Useful? React with 👍 / 👎.