Rinomina: crate akode-*, cartelle akode-rs/ e akode-cli/, binario akode, ~/.akode, AKODE_* (A)

Riapplica la fase 5 di aKode (86e7c72e) sulla base ripulita:
- crate codex-* -> akode-*, codex-rs -> akode-rs, codex-cli -> akode-cli, binario e ausiliari akode;
- ~/.codex -> ~/.akode, CODEX_HOME -> AKODE_HOME, variabili CODEX_* -> AKODE_*, .codex/ -> .akode/ di progetto;
  nessun fallback a ~/.codex o a CODEX_*;
- testi per l'utente "Codex" -> "aKode"; testi verso il modello e istruzioni di sistema invariati;
- snapshot insta rinominati (non ancora rigenerati).
I conflitti con la base ripulita sono stati risolti riapplicando la rinomina ai file senza le
funzioni di imeAI (script di mappa dei token per file).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-17 12:37:52 +01:00
parent e37a0deba9
commit 7c1c6dfa8d
10306 changed files with 748026 additions and 748088 deletions

View File

@@ -15,14 +15,14 @@ First install the frozen workspace dependencies and build Codex:
```bash
pnpm install --frozen-lockfile
cargo build --locked --manifest-path codex-rs/Cargo.toml -p codex-cli --bin codex
cargo build --locked --manifest-path akode-rs/Cargo.toml -p akode-cli --bin codex
```
From a published Codex checkout, run:
```bash
python3 scripts/mcp_conformance/run_codex_compliance.py \
codex-rs/target/debug/codex \
akode-rs/target/debug/codex \
--conformance-cli node_modules/@modelcontextprotocol/conformance/dist/index.js \
--baseline-report scripts/mcp_conformance/regression-baseline-v1.json \
--report /tmp/codex-mcp-conformance.json
@@ -109,13 +109,13 @@ env PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
## Run the required SDK integration
The existing required SDK workflow runs the complete Python fixture self-tests.
Its TypeScript job builds the actual Codex executable, sets `CODEX_EXEC_PATH`,
Its TypeScript job builds the actual Codex executable, sets `AKODE_EXEC_PATH`,
installs the pinned upstream conformance runner, and runs both the official
authenticated suite and the separate production reviewer regression matrix.
Neither gate can be skipped. To reproduce the focused integration locally:
```bash
CODEX_EXEC_PATH=/absolute/path/to/codex \
AKODE_EXEC_PATH=/absolute/path/to/codex \
pnpm --filter @openai/codex-sdk test -- \
--runInBand tests/mcpConformance.test.ts
```

View File

@@ -43,7 +43,7 @@ class AdapterFailure(RuntimeError):
CIMD_CLIENT_METADATA_URL = "https://conformance-test.local/client-metadata.json"
PRE_REGISTERED_CLIENT_SECRET_ENV_VAR = "MCP_CONFORMANCE_CLIENT_SECRET"
CLIENT_REGISTRATION_OVERRIDE_ENV_VAR = "CODEX_CONFORMANCE_CLIENT_REGISTRATION"
CLIENT_REGISTRATION_OVERRIDE_ENV_VAR = "AKODE_CONFORMANCE_CLIENT_REGISTRATION"
AUTH_COMPLETION_METHOD = "mcpServer/oauthLogin/completed"
EXPECTED_AUTH_REJECTION_SCENARIOS = frozenset(
{
@@ -700,16 +700,16 @@ def _exercise_scenario(
def run_adapter(server_url: str) -> dict[str, object]:
codex_binary = _required_path("CODEX_CONFORMANCE_BINARY")
codex_home = _required_path("CODEX_CONFORMANCE_HOME")
codex_binary = _required_path("AKODE_CONFORMANCE_BINARY")
codex_home = _required_path("AKODE_CONFORMANCE_HOME")
scenario = _required_env("MCP_CONFORMANCE_SCENARIO")
protocol_version = _required_env("MCP_CONFORMANCE_PROTOCOL_VERSION")
timeout_seconds = float(os.environ.get("CODEX_CONFORMANCE_TIMEOUT", "30"))
timeout_seconds = float(os.environ.get("AKODE_CONFORMANCE_TIMEOUT", "30"))
enable_modern_feature = (
os.environ.get("CODEX_CONFORMANCE_ENABLE_MODERN_FEATURE", "1") != "0"
os.environ.get("AKODE_CONFORMANCE_ENABLE_MODERN_FEATURE", "1") != "0"
)
require_automatic_auth = (
os.environ.get("CODEX_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH", "0") == "1"
os.environ.get("AKODE_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH", "0") == "1"
)
context = _conformance_context()
@@ -971,7 +971,7 @@ def run_adapter(server_url: str) -> dict[str, object]:
def main(argv: Sequence[str] | None = None) -> int:
values = list(sys.argv[1:] if argv is None else argv)
report_path_value = os.environ.get("CODEX_CONFORMANCE_ADAPTER_REPORT")
report_path_value = os.environ.get("AKODE_CONFORMANCE_ADAPTER_REPORT")
report: dict[str, object]
try:
if len(values) != 1:

View File

@@ -252,7 +252,7 @@ def _make_adapter_launcher(
adapter_command = subprocess.list2cmdline([sys.executable, str(adapter_script)])
launcher.write_text(
"@echo off\n"
f'set "CODEX_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH={automatic_auth}"\n'
f'set "AKODE_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH={automatic_auth}"\n'
f"{adapter_command} %*\n",
encoding="utf-8",
)
@@ -260,7 +260,7 @@ def _make_adapter_launcher(
launcher = launcher_dir / "client"
launcher.write_text(
"#!/bin/sh\n"
f"export CODEX_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH={automatic_auth}\n"
f"export AKODE_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH={automatic_auth}\n"
f'exec {shlex.quote(sys.executable)} {shlex.quote(str(adapter_script))} "$@"\n',
encoding="utf-8",
)
@@ -382,15 +382,15 @@ def _run_scenario(
scenario_dir = output_dir / _safe_scenario_name(scenario)
scenario_dir.mkdir(parents=True, exist_ok=True)
adapter_report = scenario_dir / "codex-adapter.json"
adapter_home = scenario_dir / "codex-home"
adapter_home = scenario_dir / "akode-home"
adapter_home.mkdir()
env = dict(base_env)
env.update(
{
"CODEX_CONFORMANCE_BINARY": str(codex_binary),
"CODEX_CONFORMANCE_HOME": str(adapter_home),
"CODEX_CONFORMANCE_ADAPTER_REPORT": str(adapter_report),
"AKODE_CONFORMANCE_BINARY": str(codex_binary),
"AKODE_CONFORMANCE_HOME": str(adapter_home),
"AKODE_CONFORMANCE_ADAPTER_REPORT": str(adapter_report),
}
)
command = [
@@ -493,7 +493,7 @@ def run_official_mode(
) -> list[OfficialScenarioResult]:
launcher = _make_adapter_launcher(
adapter_script,
require_automatic_auth=base_env.get("CODEX_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH")
require_automatic_auth=base_env.get("AKODE_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH")
== "1",
)
try:

View File

@@ -130,7 +130,7 @@ def _review_registration_command(
command.extend(
[
"--env",
f"CODEX_MCP_PROTOCOL_VERSION={protocol_environment}",
f"AKODE_MCP_PROTOCOL_VERSION={protocol_environment}",
"--",
sys.executable,
str(server_script),

View File

@@ -454,9 +454,9 @@ def _result_detail(
def _isolated_environment(codex_home: Path) -> dict[str, str]:
env = dict(os.environ)
env["CODEX_HOME"] = str(codex_home)
env["AKODE_HOME"] = str(codex_home)
# Direct app-server MCP calls do not need a model or credentials.
for name in ("CODEX_API_KEY", "CODEX_ACCESS_TOKEN", "OPENAI_API_KEY"):
for name in ("AKODE_API_KEY", "AKODE_ACCESS_TOKEN", "OPENAI_API_KEY"):
env.pop(name, None)
return env
@@ -495,7 +495,7 @@ def _registration_command(
command = [str(codex_binary), "mcp", "add", TEST_SERVER_NAME]
if transport == "stdio":
if mode == MODERN_VERSION:
command.extend(["--env", f"CODEX_MCP_PROTOCOL_VERSION={MODERN_VERSION}"])
command.extend(["--env", f"AKODE_MCP_PROTOCOL_VERSION={MODERN_VERSION}"])
return [
*command,
"--",
@@ -531,7 +531,7 @@ def _validate_registration(
env = value.get("env")
modern_opt_in = (
isinstance(env, dict)
and env.get("CODEX_MCP_PROTOCOL_VERSION") == MODERN_VERSION
and env.get("AKODE_MCP_PROTOCOL_VERSION") == MODERN_VERSION
)
if mode == MODERN_VERSION and not modern_opt_in:
return False, "modern stdio registration omitted its protocol opt-in"
@@ -1155,11 +1155,11 @@ def _run_official_case(
case = CaseResult(transport="official-http", mode=mode)
case_home.mkdir(parents=True)
env = _isolated_environment(case_home)
env["CODEX_CONFORMANCE_TIMEOUT"] = str(timeout_seconds)
env["CODEX_CONFORMANCE_ENABLE_MODERN_FEATURE"] = (
env["AKODE_CONFORMANCE_TIMEOUT"] = str(timeout_seconds)
env["AKODE_CONFORMANCE_ENABLE_MODERN_FEATURE"] = (
"1" if enable_modern_feature else "0"
)
env["CODEX_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH"] = (
env["AKODE_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH"] = (
"1" if require_automatic_auth else "0"
)
results = run_official_mode(
@@ -1266,13 +1266,13 @@ def _cimd_registration_checks(
("forced_cimd", "cimd"),
):
env = _isolated_environment(case_home / check_name)
env["CODEX_CONFORMANCE_TIMEOUT"] = str(timeout_seconds)
env["CODEX_CONFORMANCE_ENABLE_MODERN_FEATURE"] = (
env["AKODE_CONFORMANCE_TIMEOUT"] = str(timeout_seconds)
env["AKODE_CONFORMANCE_ENABLE_MODERN_FEATURE"] = (
"1" if enable_modern_feature else "0"
)
env["CODEX_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH"] = "1"
env["AKODE_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH"] = "1"
if client_registration is not None:
env["CODEX_CONFORMANCE_CLIENT_REGISTRATION"] = client_registration
env["AKODE_CONFORMANCE_CLIENT_REGISTRATION"] = client_registration
results = run_official_mode(
conformance_command=conformance_command,
adapter_script=adapter_script,

View File

@@ -705,7 +705,7 @@ class ProtocolServer:
"structuredContent": structured,
}
elif name == "review_protocol_env":
structured = {"value": os.environ.get("CODEX_MCP_PROTOCOL_VERSION")}
structured = {"value": os.environ.get("AKODE_MCP_PROTOCOL_VERSION")}
fields = {
"content": [{"type": "text", "text": json.dumps(structured)}],
"structuredContent": structured,

View File

@@ -64,7 +64,7 @@ def test_registration_commands_select_stdio_then_http_shapes() -> None:
"add",
TEST_SERVER_NAME,
"--env",
f"CODEX_MCP_PROTOCOL_VERSION={MODERN_VERSION}",
f"AKODE_MCP_PROTOCOL_VERSION={MODERN_VERSION}",
"--",
sys.executable,
"/src/server.py",
@@ -120,7 +120,7 @@ def test_registration_validation_checks_transport_and_mode() -> None:
"--transport",
"stdio",
],
"env": {"CODEX_MCP_PROTOCOL_VERSION": MODERN_VERSION},
"env": {"AKODE_MCP_PROTOCOL_VERSION": MODERN_VERSION},
},
},
transport="stdio",
@@ -207,15 +207,15 @@ def test_isolated_environment_drops_model_credentials(
tmp_path: Path,
monkeypatch,
) -> None:
monkeypatch.setenv("CODEX_API_KEY", "secret")
monkeypatch.setenv("CODEX_ACCESS_TOKEN", "secret")
monkeypatch.setenv("AKODE_API_KEY", "secret")
monkeypatch.setenv("AKODE_ACCESS_TOKEN", "secret")
monkeypatch.setenv("OPENAI_API_KEY", "secret")
env = _isolated_environment(tmp_path)
assert env["CODEX_HOME"] == str(tmp_path)
assert "CODEX_API_KEY" not in env
assert "CODEX_ACCESS_TOKEN" not in env
assert env["AKODE_HOME"] == str(tmp_path)
assert "AKODE_API_KEY" not in env
assert "AKODE_ACCESS_TOKEN" not in env
assert "OPENAI_API_KEY" not in env
assert env.get("PATH") == os.environ.get("PATH")
@@ -574,8 +574,8 @@ def test_official_case_keeps_cimd_registration_checks_in_regression_gated_http_c
forced_env = calls[2]["base_env"]
assert isinstance(auto_env, dict)
assert isinstance(forced_env, dict)
assert auto_env.get("CODEX_CONFORMANCE_CLIENT_REGISTRATION") is None
assert forced_env["CODEX_CONFORMANCE_CLIENT_REGISTRATION"] == "cimd"
assert auto_env.get("AKODE_CONFORMANCE_CLIENT_REGISTRATION") is None
assert forced_env["AKODE_CONFORMANCE_CLIENT_REGISTRATION"] == "cimd"
def _regression_report() -> dict[str, object]:

View File

@@ -121,7 +121,7 @@ def test_official_adapter_launcher_preserves_strict_production_auth_mode(
) -> None:
adapter = tmp_path / "show_automatic_auth.py"
adapter.write_text(
'import os\nprint(os.environ.get("CODEX_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH", ""))\n',
'import os\nprint(os.environ.get("AKODE_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH", ""))\n',
encoding="utf-8",
)
launcher = _make_adapter_launcher(adapter, require_automatic_auth=True)
@@ -165,7 +165,7 @@ def test_windows_official_adapter_launcher_quotes_checkout_paths(
assert launcher.name == "client.cmd"
assert contents.startswith("@echo off\n")
assert (
f'set "CODEX_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH={expected_auth}"\n' in contents
f'set "AKODE_CONFORMANCE_REQUIRE_AUTOMATIC_AUTH={expected_auth}"\n' in contents
)
assert subprocess.list2cmdline([sys.executable, str(adapter)]) + " %*\n" in contents
@@ -428,7 +428,7 @@ def test_official_diagnostics_redact_oauth_secrets() -> None:
def test_retained_artifacts_remove_oauth_credential_store(tmp_path: Path) -> None:
codex_home = tmp_path / "codex-home"
codex_home = tmp_path / "akode-home"
codex_home.mkdir()
credentials = codex_home / ".credentials.json"
credentials.write_text('{"client_secret":"do-not-retain"}', encoding="utf-8")
@@ -584,7 +584,7 @@ result_dir.mkdir(parents=True)
"status": "SUCCESS",
},
]))
pathlib.Path(os.environ["CODEX_CONFORMANCE_ADAPTER_REPORT"]).write_text(
pathlib.Path(os.environ["AKODE_CONFORMANCE_ADAPTER_REPORT"]).write_text(
json.dumps({"success": True, "steps": []})
)
""".lstrip(),
@@ -664,7 +664,7 @@ import pathlib
import time
time.sleep(0.1)
pathlib.Path(os.environ["CODEX_CONFORMANCE_ADAPTER_REPORT"]).write_text(
pathlib.Path(os.environ["AKODE_CONFORMANCE_ADAPTER_REPORT"]).write_text(
json.dumps({"success": True, "steps": []})
)
'''

View File

@@ -233,7 +233,7 @@ def test_shipping_legacy_registration_preserves_the_reserved_protocol_environmen
"add",
"mcp_spec_fixture",
"--env",
f"CODEX_MCP_PROTOCOL_VERSION={LEGACY_ENVIRONMENT_SENTINEL}",
f"AKODE_MCP_PROTOCOL_VERSION={LEGACY_ENVIRONMENT_SENTINEL}",
"--",
sys.executable,
"/src/server.py",
@@ -256,7 +256,7 @@ def test_modern_registration_explicitly_opts_into_the_modern_protocol() -> None:
http_url=None,
)
assert f"CODEX_MCP_PROTOCOL_VERSION={MODERN_VERSION}" in command
assert f"AKODE_MCP_PROTOCOL_VERSION={MODERN_VERSION}" in command
def test_http_review_registration_requires_a_real_fixture_url() -> None:

View File

@@ -891,7 +891,7 @@ def test_review_protocol_env_is_available_to_a_legacy_client() -> None:
assert any(tool["name"] == "review_protocol_env" for tool in tools["tools"])
with patch.dict(
"os.environ", {"CODEX_MCP_PROTOCOL_VERSION": "legacy-review-sentinel"}
"os.environ", {"AKODE_MCP_PROTOCOL_VERSION": "legacy-review-sentinel"}
):
plan = server.handle(
request(
@@ -913,7 +913,7 @@ def test_review_protocol_env_is_available_to_the_shipping_legacy_client() -> Non
assert any(tool["name"] == "review_protocol_env" for tool in tools["tools"])
with patch.dict(
"os.environ", {"CODEX_MCP_PROTOCOL_VERSION": "shipping-legacy-sentinel"}
"os.environ", {"AKODE_MCP_PROTOCOL_VERSION": "shipping-legacy-sentinel"}
):
plan = server.handle(
request(
@@ -929,7 +929,7 @@ def test_review_protocol_env_is_available_to_the_shipping_legacy_client() -> Non
def test_review_protocol_env_is_available_to_a_modern_client() -> None:
server = ProtocolServer(MODERN_VERSION, profile=REVIEW_PROFILE)
with patch.dict("os.environ", {"CODEX_MCP_PROTOCOL_VERSION": MODERN_VERSION}):
with patch.dict("os.environ", {"AKODE_MCP_PROTOCOL_VERSION": MODERN_VERSION}):
plan = server.handle(
request(
"tools/call",