diff --git a/AGENTS.md b/AGENTS.md index 6a2872b1..e77c3ed3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,8 @@ ## Project -`ucode` is a Python CLI that configures and launches coding agents through Databricks AI Gateway. +Unity Gateway (`ug`) is a Python CLI that configures and launches coding agents through Databricks +AI Gateway. Its internal Python package remains named `ucode` for backward compatibility. The package code lives in `src/ucode/`. Tests live in `tests/`. @@ -13,14 +14,14 @@ Tests live in `tests/`. - Run focused tests with `uv run pytest tests/.py`. - Run e2e tests with `UCODE_TEST_WORKSPACE= uv run pytest tests/test_e2e.py -v`. - Run lint with `uv run ruff check .`. -- Run the CLI from the current checkout with `uv run ucode ...`. -- Reinstall the local checkout as the `ucode` tool with `uv tool install --reinstall .`. +- Run the CLI from the current checkout with `uv run ug ...`. +- Reinstall the local checkout as the Unity Gateway tool with `uv tool install --reinstall .`. ## Development - Use Python 3.12+. - Keep changes scoped to the requested behavior. -- Follow the existing module boundaries: CLI orchestration in `cli.py`, agent-specific behavior in `agents/.py`, shared agent dispatch in `agents/__init__.py`, Databricks calls in `databricks.py`, skill download (UC fetch client + on-disk writer + download orchestration) in `skills_download.py`, MCP-connection state glue in `mcp.py`, and presentation helpers in `ui.py`. Skill download persists no disk state — it writes files to `--path` (or the home dir) and registers only the schema-less skills MCP connection. `ucode configure skills` with no `--location` (or `--mcp` with no `--location`) registers that schema-less connection without downloading anything. +- Follow the existing module boundaries: CLI orchestration in `cli.py`, agent-specific behavior in `agents/.py`, shared agent dispatch in `agents/__init__.py`, Databricks calls in `databricks.py`, skill download (UC fetch client + on-disk writer + download orchestration) in `skills_download.py`, MCP-connection state glue in `mcp.py`, and presentation helpers in `ui.py`. Skill download persists no disk state — it writes files to `--path` (or the home dir) and registers only the schema-less skills MCP connection. `ug configure skills` with no `--location` (or `--mcp` with no `--location`) registers that schema-less connection without downloading anything. - Prefer existing helpers for config file writes, state persistence, UI messages, and Databricks authentication. - Add or update focused tests for behavior changes. - Do not modify generated or lock files unless the dependency graph intentionally changes. diff --git a/README.md b/README.md index 7dbea331..d51a9b03 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ GitHub Copilot CLI, and Pi through Databricks. ## Installation ```bash -uv tool install git+https://github.com/databricks/ucode +uv tool install git+https://github.com/databricks/unity-gateway ``` Check your version with `ug --version`. Between releases this looks like @@ -433,8 +433,8 @@ Contributions are welcome. ### Getting started ```bash -git clone https://github.com/databricks/ucode -cd ucode +git clone https://github.com/databricks/unity-gateway +cd unity-gateway uv sync ``` diff --git a/src/ucode/cli.py b/src/ucode/cli.py index 1f217b0c..f4a12ada 100644 --- a/src/ucode/cli.py +++ b/src/ucode/cli.py @@ -3401,7 +3401,7 @@ def upgrade_cmd() -> None: """Upgrade ug to the latest version from GitHub.""" legacy_distribution = "ucode" current_distribution = "unity-gateway" - git_url = "git+https://github.com/databricks/ucode" + git_url = "git+https://github.com/databricks/unity-gateway" installed_distribution = _installed_cli_distribution() upgrade_requirement = f"{installed_distribution} @ {git_url}" migrated = False @@ -3478,7 +3478,7 @@ def _installed_cli_distribution() -> str: continue return distribution_name # Source checkouts and unusual installers may expose neither distribution. - # The repository is still named ucode when this bridge ships, so use the + # The distribution remains named ucode until the Phase 3 cutover, so use the # non-destructive legacy upgrade path and let uv report an actionable error. return "ucode" diff --git a/src/ucode/doctor.py b/src/ucode/doctor.py index 31d8bc39..342749b8 100644 --- a/src/ucode/doctor.py +++ b/src/ucode/doctor.py @@ -50,7 +50,7 @@ # warns when its own token and one of these are both set, so we surface them. _CLAUDE_TOKEN_ENV_VARS = ("ANTHROPIC_AUTH_TOKEN", "ANTHROPIC_API_KEY") -UCODE_GIT_URL = "git+https://github.com/databricks/ucode" +UCODE_GIT_URL = "git+https://github.com/databricks/unity-gateway" # status -> (glyph, status_badge kind). "info" is a healthy line that still # carries an optional suggestion (e.g. the ucode self-upgrade). diff --git a/tests/test_cli.py b/tests/test_cli.py index 9e3e05df..69a7494e 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -138,7 +138,7 @@ def _which(command: str) -> str: @staticmethod def _requirement(distribution: str) -> str: - return f"{distribution} @ git+https://github.com/databricks/ucode" + return f"{distribution} @ git+https://github.com/databricks/unity-gateway" def test_before_cutover_upgrades_ucode_normally_without_verification(self): with ( @@ -159,7 +159,7 @@ def test_before_cutover_upgrades_ucode_normally_without_verification(self): assert "ucode upgraded" in result.output def test_cutover_migrates_legacy_distribution_and_verifies_commands(self): - git_url = "git+https://github.com/databricks/ucode" + git_url = "git+https://github.com/databricks/unity-gateway" rename_failure = subprocess.CompletedProcess( [], 1, @@ -269,7 +269,7 @@ def test_cutover_install_failure_has_recovery_command(self): assert result.exit_code == 1 assert "legacy `ucode` tool was removed" in result.output - assert "uv tool install --force git+https://github.com/databricks/ucode" in re.sub( + assert "uv tool install --force git+https://github.com/databricks/unity-gateway" in re.sub( r"\s+", " ", result.output ) diff --git a/tests/test_doctor.py b/tests/test_doctor.py index 9aea20ce..3ed0c3c9 100644 --- a/tests/test_doctor.py +++ b/tests/test_doctor.py @@ -231,6 +231,26 @@ def test_warn_and_install_suggestion_when_missing(self): assert check.suggestion is not None +class TestUcodeCheck: + def test_upgrade_uses_renamed_repository(self): + with ( + patch.object(doctor_mod.shutil, "which", return_value="/usr/bin/uv"), + patch.object(doctor_mod.subprocess, "run") as run, + ): + assert doctor_mod._upgrade_ucode() + + run.assert_called_once_with( + [ + "uv", + "tool", + "install", + "--reinstall", + "git+https://github.com/databricks/unity-gateway", + ], + check=True, + ) + + class TestDoctorFlow: def _only(self, checks: list[Check]): """Run doctor() with a fixed set of checks and a stubbed prompter."""