Skip to content

Commit 69082a3

Browse files
Arena AgentMondayInRussian
authored andcommitted
fix(deps+ci): bump msgpack 1.1.2→1.2.1 (CVE fix) + pyrefly 1.0→1.1.1 + type annotations
Security: - msgpack 1.2.1 fixes GHSA-6v7p-g79w-8964 (HIGH — use-after-free SEGV on Unpacker reuse, CWE-416). Transitive via pip-audit→pip-api→ cachecontrol→msgpack. pip-audit now clean. Deps: - pyrefly >=1.0 → >=1.1.1 in pyproject.toml. Locked 1.1.1 (patch: isinstance narrowing regression fix, pyrefly-org/pyrefly#3867). Pyrefly findings fixed: - test_probe_cli.py: add @OverRide on _FakeTransport.post (missing-override-decorator). - test_container_build_invariants.py: bare dict → dict[str, Any] on _compose() and _volume_by_target() (implicit-any-type-argument, pre-existing but surfaced by pyrefly 1.1.x). Verified: ruff clean, uv lock --check clean, 68 tests pass. AI-Session: arena-agent-2026-06-21-ci-fixes
1 parent c076d8e commit 69082a3

4 files changed

Lines changed: 69 additions & 57 deletions

File tree

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ dev = [
6767
"deptry>=0.21",
6868
# Parallel type checker (Meta, stable 1.0). Advisory-only; does not
6969
# replace mypy. Run via `just typecheck-advisory`.
70-
"pyrefly>=1.0",
70+
"pyrefly>=1.1.1",
7171
# Pylint gap-checks profile (duplicate-code + cyclic-import only; the
7272
# rest is covered by ruff/mypy). Run via `just lint`. Blocking gate.
7373
"pylint>=3.2",

‎tests/test_container_build_invariants.py‎

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import re
1212
from pathlib import Path
13+
from typing import Any
1314

1415
import yaml
1516

@@ -22,7 +23,7 @@
2223
_UPDATE = _ROOT / "scripts" / "fa-update.sh"
2324

2425

25-
def _compose() -> dict:
26+
def _compose() -> dict[str, Any]:
2627
return yaml.safe_load(_COMPOSE.read_text(encoding="utf-8"))
2728

2829

@@ -128,9 +129,9 @@ def test_no_duplicate_pythonpath_on_agent() -> None:
128129
"""B7: PYTHONPATH is owned by the entrypoint; setting it in compose too
129130
produces /workspace/src:/workspace/src."""
130131
agent = _compose()["services"]["first-agent"]
131-
assert not any(
132-
str(e).startswith("PYTHONPATH=") for e in agent.get("environment", [])
133-
), "drop PYTHONPATH from compose; the entrypoint sets it"
132+
assert not any(str(e).startswith("PYTHONPATH=") for e in agent.get("environment", [])), (
133+
"drop PYTHONPATH from compose; the entrypoint sets it"
134+
)
134135

135136

136137
# --- setup script ---------------------------------------------------------
@@ -141,7 +142,7 @@ def test_setup_seeds_provider_secrets_from_fa_env_template() -> None:
141142
text = _SETUP.read_text(encoding="utf-8")
142143
assert "secrets/fa.env.template" in text
143144
assert not re.search(
144-
r'^\s*TEMPLATE=\"\$FA_DIR/repo/First-Agent-dev/\.env\.fa\.template\"',
145+
r"^\s*TEMPLATE=\"\$FA_DIR/repo/First-Agent-dev/\.env\.fa\.template\"",
145146
text,
146147
re.MULTILINE,
147148
)
@@ -154,6 +155,8 @@ def test_post_setup_checks_changeme_only_on_active_secret_lines() -> None:
154155
assert "grep -qiE" in text
155156
assert "^[[:space:]]*[A-Z0-9_]+(API_KEY|_TOKEN|_SECRET)" in text
156157
assert "grep -qi 'CHANGEME'" not in text
158+
159+
157160
def test_setup_chowns_state_to_container_uid() -> None:
158161
"""B3: bind-mounted state/secrets must be owned by the container's uid (1000),
159162
not the host username (which may be a different uid)."""
@@ -212,15 +215,15 @@ def test_clean_rebuild_brings_up_via_compose_not_systemd_start() -> None:
212215
"""fa-clean-rebuild must bring the stack up with `docker compose up -d`
213216
(authoritative), not `systemctl --user start` which can silently no-op."""
214217
text = _CLEAN_REBUILD.read_text(encoding="utf-8")
215-
assert "docker compose -f \"${COMPOSE_FILE}\" up -d" in text
218+
assert 'docker compose -f "${COMPOSE_FILE}" up -d' in text
216219
# It may still `enable` for reboot, but must not depend on `start` to run.
217-
assert "systemctl --user start \"${SERVICE}\"" not in text, (
220+
assert 'systemctl --user start "${SERVICE}"' not in text, (
218221
"clean-rebuild must not rely on systemctl start to run the stack"
219222
)
220223

221224

222225
# --- unified routing file (ADR-12 Option C / R2-2) ----------------------------
223-
def _volume_by_target(service: dict, target: str) -> dict:
226+
def _volume_by_target(service: dict[str, Any], target: str) -> dict[str, Any]:
224227
return next(
225228
vol
226229
for vol in service.get("volumes", [])
@@ -288,7 +291,6 @@ def test_deploy_scripts_do_not_sync_proxy_models_copy() -> None:
288291
assert "Syncing proxy routing config" not in text
289292

290293

291-
292294
def test_fa_update_reexecs_after_git_pull_to_use_new_deploy_logic() -> None:
293295
"""Updating deploy code and compose in one pull must run the updated script.
294296
@@ -308,12 +310,13 @@ def test_clean_rebuild_wipe_state_ignores_legacy_models_when_recreating_routing(
308310
assert 'LEGACY_STATE_MODELS=""' in text
309311
assert 'LEGACY_PROXY_MODELS=""' in text
310312

313+
311314
def test_clean_rebuild_no_cache_and_progress_are_configurable() -> None:
312315
text = _CLEAN_REBUILD.read_text(encoding="utf-8")
313316
assert 'NO_CACHE="${NO_CACHE:-1}"' in text
314317
assert 'COMPOSE_BUILD_PULL="${COMPOSE_BUILD_PULL:-1}"' in text
315318
assert 'BUILD_PROGRESS="${BUILD_PROGRESS:-auto}"' in text
316-
assert 'build_cmd+=(--no-cache)' in text
319+
assert "build_cmd+=(--no-cache)" in text
317320
assert 'build_cmd+=(--progress "${BUILD_PROGRESS}")' in text
318321

319322

‎tests/test_probe_cli.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from collections.abc import Mapping
66
from pathlib import Path
7-
from typing import Any
7+
from typing import Any, override
88

99
from _pytest.capture import CaptureFixture
1010
from _pytest.monkeypatch import MonkeyPatch
@@ -46,6 +46,7 @@ def __init__(self, *, status: int = 200, body: Mapping[str, Any] | None = None)
4646
self._status = status
4747
self._body = body
4848

49+
@override
4950
def post(
5051
self,
5152
url: str,

0 commit comments

Comments
 (0)