Skip to content

Commit a47e905

Browse files
fix: resolve all CI pipeline failures (#191)
- Rename ambiguous variable l to lock in intent_locks.py (ruff E741) - Fix nexus test imports: modules.nexus.* -> nexus.* (hatch source mapping) - Add modules/ to conftest sys.path, remove tests/nexus/__init__.py shadow - Add prometheus-client and websockets to agent-mesh dev deps - Add pytest.importorskip for cross-package test deps (agentmesh, agent_sre) - Fix SCAK test assertions to match actual handle_failure API - Skip Windows-specific path test on Linux CI runners - Set GIT_TERMINAL_PROMPT=0 in security job - Remove -x from pytest for complete failure reporting
1 parent 552a183 commit a47e905

File tree

13 files changed

+187
-178
lines changed

13 files changed

+187
-178
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
2>/dev/null || pip install --no-cache-dir pytest==8.4.1 pytest-asyncio==1.1.0 2>/dev/null || true
5353
- name: Test ${{ matrix.package }}
5454
working-directory: packages/${{ matrix.package }}
55-
run: pytest tests/ -x -q --tb=short
55+
run: pytest tests/ -q --tb=short
5656

5757
security:
5858
runs-on: ubuntu-latest
@@ -67,6 +67,8 @@ jobs:
6767
safety==3.2.1 --hash=sha256:9f53646717ba052e1bf631bd54fb3da0fafa58e85d578b20a8b9affdcf81889e \
6868
2>/dev/null || pip install --no-cache-dir safety==3.2.1
6969
- name: Check dependencies
70+
env:
71+
GIT_TERMINAL_PROMPT: "0"
7072
run: |
7173
for pkg in agent-os agent-mesh agent-hypervisor agent-sre agent-compliance; do
7274
echo "=== $pkg ==="

packages/agent-hypervisor/src/hypervisor/session/intent_locks.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,22 @@ def release_session_locks(self, session_id: str) -> int:
9696

9797
def get_agent_locks(self, agent_did: str, session_id: str) -> list[IntentLock]:
9898
return [
99-
l for l in self._locks.values()
100-
if l.agent_did == agent_did
101-
and l.session_id == session_id
102-
and l.is_active
99+
lock for lock in self._locks.values()
100+
if lock.agent_did == agent_did
101+
and lock.session_id == session_id
102+
and lock.is_active
103103
]
104104

105105
def get_resource_locks(self, resource_path: str) -> list[IntentLock]:
106106
return [
107-
l for l in self._locks.values()
108-
if l.resource_path == resource_path
109-
and l.is_active
107+
lock for lock in self._locks.values()
108+
if lock.resource_path == resource_path
109+
and lock.is_active
110110
]
111111

112112
@property
113113
def active_lock_count(self) -> int:
114-
return sum(1 for l in self._locks.values() if l.is_active)
114+
return sum(1 for lock in self._locks.values() if lock.is_active)
115115

116116
@property
117117
def contention_points(self) -> list[str]:

packages/agent-mesh/pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ dev = [
6464
"ruff>=0.1.0",
6565
"mypy>=1.8.0",
6666
"fakeredis>=2.21.0",
67+
"prometheus-client>=0.19.0",
68+
"websockets>=12.0",
6769
]
6870
redis = [
6971
"redis>=4.0",

packages/agent-os/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
sys.path.insert(0, str(REPO_ROOT / "modules" / "mute-agent" / "src"))
2626
sys.path.insert(0, str(REPO_ROOT / "modules" / "mute-agent"))
2727
sys.path.insert(0, str(REPO_ROOT / "modules" / "observability"))
28-
sys.path.insert(0, str(REPO_ROOT / "modules" / "nexus"))
28+
sys.path.insert(0, str(REPO_ROOT / "modules"))
2929
sys.path.insert(0, str(REPO_ROOT / "modules" / "mcp-kernel-server"))

packages/agent-os/tests/nexus/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/agent-os/tests/nexus/test_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
import pytest
88
from datetime import datetime
99

10-
from modules.nexus.client import NexusClient
11-
from modules.nexus.schemas.manifest import AgentManifest, AgentIdentity, AgentCapabilities, AgentPrivacy
12-
from modules.nexus.dmz import DataHandlingPolicy
13-
from modules.nexus.exceptions import (
10+
from nexus.client import NexusClient
11+
from nexus.schemas.manifest import AgentManifest, AgentIdentity, AgentCapabilities, AgentPrivacy
12+
from nexus.dmz import DataHandlingPolicy
13+
from nexus.exceptions import (
1414
IATPUnverifiedPeerException,
1515
IATPInsufficientTrustException,
1616
)

packages/agent-os/tests/nexus/test_escrow.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import pytest
88
from datetime import datetime
99

10-
from modules.nexus.escrow import EscrowManager, ProofOfOutcome
11-
from modules.nexus.schemas.escrow import EscrowRequest, EscrowStatus
12-
from modules.nexus.exceptions import (
10+
from nexus.escrow import EscrowManager, ProofOfOutcome
11+
from nexus.schemas.escrow import EscrowRequest, EscrowStatus
12+
from nexus.exceptions import (
1313
EscrowNotFoundError,
1414
EscrowAlreadyResolvedError,
1515
InsufficientCreditsError,
@@ -91,7 +91,7 @@ async def test_release_success(self):
9191
receipt = await manager.create_escrow(request, "sig")
9292
await manager.activate_escrow(receipt.escrow_id)
9393

94-
from modules.nexus.schemas.escrow import EscrowRelease
94+
from nexus.schemas.escrow import EscrowRelease
9595
release = EscrowRelease(
9696
escrow_id=receipt.escrow_id,
9797
outcome="success",
@@ -120,7 +120,7 @@ async def test_release_failure(self):
120120
receipt = await manager.create_escrow(request, "sig")
121121
await manager.activate_escrow(receipt.escrow_id)
122122

123-
from modules.nexus.schemas.escrow import EscrowRelease
123+
from nexus.schemas.escrow import EscrowRelease
124124
release = EscrowRelease(
125125
escrow_id=receipt.escrow_id,
126126
outcome="failure",

packages/agent-os/tests/nexus/test_registry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import pytest
88
from datetime import datetime
99

10-
from modules.nexus.registry import AgentRegistry, RegistrationResult, PeerVerification
11-
from modules.nexus.schemas.manifest import AgentManifest, AgentIdentity, AgentCapabilities, AgentPrivacy
12-
from modules.nexus.exceptions import (
10+
from nexus.registry import AgentRegistry, RegistrationResult, PeerVerification
11+
from nexus.schemas.manifest import AgentManifest, AgentIdentity, AgentCapabilities, AgentPrivacy
12+
from nexus.exceptions import (
1313
AgentAlreadyRegisteredError,
1414
AgentNotFoundError,
1515
IATPUnverifiedPeerException,

packages/agent-os/tests/nexus/test_reputation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytest
88
from datetime import datetime
99

10-
from modules.nexus.reputation import (
10+
from nexus.reputation import (
1111
ReputationEngine,
1212
ReputationHistory,
1313
TrustScore,

packages/agent-os/tests/test_e2e_governance_pipeline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727

2828
import pytest
2929

30+
agentmesh = pytest.importorskip("agentmesh", reason="agentmesh not installed")
31+
agent_sre = pytest.importorskip("agent_sre", reason="agent_sre not installed")
32+
3033
from agent_os.policies.schema import (
3134
PolicyAction,
3235
PolicyCondition,

0 commit comments

Comments
 (0)