Rename Castle -> Wild PC across the repo

Repo-side rename only (Phases 1-3 of the migration plan); the live box
(~/.castle, systemd units, /data/castle, domains) is a separate cutover.

- Slug `castle` -> `wildpc`: CLI command, module names (wildpc_core/cli/api),
  dist names, entry point `wildpc = wildpc_cli.main:main`.
- Identifiers: CastleConfig/NATSClient/DirError/MDNS -> Wildpc*.
- Env/constants: CASTLE_* -> WILDPC_*; ~/.castle -> ~/.wildpc, castle.yaml ->
  wildpc.yaml, /data/castle -> /data/wildpc.
- Systemd UNIT_PREFIX castle- -> wildpc-; own programs castle-api/gateway/etc.
- Display prose "Castle" -> "Wild PC" in docs, agent-guide files, README, frontend.
- Package dirs and bootstrap yaml renamed via git mv; lockfiles regenerated;
  redundant nested uv.lock files dropped (workspace root lock is authoritative).

Tests: core 273, cli 47, wildpc-api 120 all pass. Frontend type-checks + builds.
Fixed a stale test fixture (secret_env_path kind arg) broken pre-rename.
This commit is contained in:
2026-07-18 22:55:08 -07:00
parent 25d7a522cc
commit 05b28cb584
190 changed files with 2428 additions and 3337 deletions

View File

@@ -1,4 +1,4 @@
"""Tests for castle list command."""
"""Tests for wildpc list command."""
from __future__ import annotations
@@ -7,18 +7,18 @@ from argparse import Namespace
from pathlib import Path
from unittest.mock import patch
from castle_cli.commands.list_cmd import run_list
from wildpc_cli.commands.list_cmd import run_list
class TestListCommand:
"""Tests for the list command."""
def test_list_all(self, castle_root: Path, capsys: object) -> None:
def test_list_all(self, wildpc_root: Path, capsys: object) -> None:
"""List all components."""
with patch("castle_cli.commands.list_cmd.load_config") as mock_load:
from castle_cli.config import load_config
with patch("wildpc_cli.commands.list_cmd.load_config") as mock_load:
from wildpc_cli.config import load_config
mock_load.return_value = load_config(castle_root)
mock_load.return_value = load_config(wildpc_root)
args = Namespace(kind=None, stack=None, json=False)
result = run_list(args)
@@ -27,12 +27,12 @@ class TestListCommand:
assert "test-svc" in captured.out
assert "test-tool" in captured.out
def test_list_filter_daemon(self, castle_root: Path, capsys: object) -> None:
def test_list_filter_daemon(self, wildpc_root: Path, capsys: object) -> None:
"""--behavior filters the program catalog by its real behavior field."""
with patch("castle_cli.commands.list_cmd.load_config") as mock_load:
from castle_cli.config import load_config
with patch("wildpc_cli.commands.list_cmd.load_config") as mock_load:
from wildpc_cli.config import load_config
mock_load.return_value = load_config(castle_root)
mock_load.return_value = load_config(wildpc_root)
args = Namespace(kind="service", stack=None, json=False)
result = run_list(args)
@@ -43,12 +43,12 @@ class TestListCommand:
# Services/jobs are deployment views, not behaviors — hidden under a filter.
assert "test-svc" not in captured.out
def test_list_filter_tool(self, castle_root: Path, capsys: object) -> None:
def test_list_filter_tool(self, wildpc_root: Path, capsys: object) -> None:
"""List filtered to tools."""
with patch("castle_cli.commands.list_cmd.load_config") as mock_load:
from castle_cli.config import load_config
with patch("wildpc_cli.commands.list_cmd.load_config") as mock_load:
from wildpc_cli.config import load_config
mock_load.return_value = load_config(castle_root)
mock_load.return_value = load_config(wildpc_root)
args = Namespace(kind="tool", stack=None, json=False)
result = run_list(args)
@@ -57,12 +57,12 @@ class TestListCommand:
assert "test-tool" in captured.out
assert "test-svc" not in captured.out
def test_list_jobs_are_deployments(self, castle_root: Path, capsys: object) -> None:
def test_list_jobs_are_deployments(self, wildpc_root: Path, capsys: object) -> None:
"""Jobs are a deployment view: shown unfiltered, hidden under a behavior filter."""
with patch("castle_cli.commands.list_cmd.load_config") as mock_load:
from castle_cli.config import load_config
with patch("wildpc_cli.commands.list_cmd.load_config") as mock_load:
from wildpc_cli.config import load_config
mock_load.return_value = load_config(castle_root)
mock_load.return_value = load_config(wildpc_root)
# Unfiltered: the job appears.
run_list(Namespace(kind=None, stack=None, json=False))
assert "test-job" in capsys.readouterr().out # type: ignore[attr-defined]
@@ -73,12 +73,12 @@ class TestListCommand:
assert "test-svc" not in out
assert "test-tool" in out
def test_list_json(self, castle_root: Path, capsys: object) -> None:
def test_list_json(self, wildpc_root: Path, capsys: object) -> None:
"""JSON output tags each entry with its derived kind."""
with patch("castle_cli.commands.list_cmd.load_config") as mock_load:
from castle_cli.config import load_config
with patch("wildpc_cli.commands.list_cmd.load_config") as mock_load:
from wildpc_cli.config import load_config
mock_load.return_value = load_config(castle_root)
mock_load.return_value = load_config(wildpc_root)
args = Namespace(kind=None, stack=None, json=True)
result = run_list(args)