Skip to content
Closed
11 changes: 8 additions & 3 deletions apps/nexus-dashboard/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ async def lifespan(app: FastAPI):

# Static & Templates
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
app.mount("/static", StaticFiles(directory=os.path.join(BASE_DIR, "static")), name="static")
templates = Jinja2Templates(directory=os.path.join(BASE_DIR, "templates"))
ROOT_DIR = os.path.dirname(BASE_DIR)
app.mount(
"/static", StaticFiles(directory=os.path.join(ROOT_DIR, "static")), name="static"
)
templates = Jinja2Templates(directory=os.path.join(ROOT_DIR, "templates"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The path for the templates directory appears to be incorrect. While the path for static files was correctly updated, this change for templates points to apps/nexus-dashboard/templates/, but the template files are located in apps/nexus-dashboard/app/templates/. This will break the root / endpoint. You should use BASE_DIR here, which correctly points to the app directory.

Suggested change
templates = Jinja2Templates(directory=os.path.join(ROOT_DIR, "templates"))
templates = Jinja2Templates(directory=os.path.join(BASE_DIR, "templates"))


# Include Routes
app.include_router(router)
Expand All @@ -52,4 +55,6 @@ async def read_root(request: Request):


if __name__ == "__main__":
uvicorn.run("app.main:app", host="0.0.0.0", port=8005, reload=True)
uvicorn.run(
"app.main:app", host=os.getenv("HOST", "127.0.0.1"), port=8005, reload=True
)
2 changes: 1 addition & 1 deletion apps/nexus-dashboard/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

cd apps/nexus-dashboard
export PYTHONPATH=$PYTHONPATH:$(pwd)
uvicorn app.main:app --host 0.0.0.0 --port 8005 --reload
uvicorn app.main:app --host ${HOST:-127.0.0.1} --port 8005 --reload
6 changes: 3 additions & 3 deletions packages/vertice-core/src/vertice_core/adk/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ def get_schemas(self) -> List[Dict[str, Any]]:

# Basic type mapping
ptype = "string"
if param.annotation == int:
if param.annotation is int:
ptype = "integer"
elif param.annotation == bool:
elif param.annotation is bool:
ptype = "boolean"
elif param.annotation == float:
elif param.annotation is float:
ptype = "number"

properties[param_name] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import logging
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional, Set, Tuple
from typing import Any, Dict, List, Optional, Set
from enum import Enum

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -242,7 +242,6 @@ def _detect_agent_type(self, description: str) -> str:
"devops": ["deploy", "ci/cd", "pipeline", "infrastructure", "monitor", "docker", "kubernetes"],
"architect": ["design", "architecture", "system design", "scalability", "integration"],
"reviewer": ["code review", "pr review", "audit", "assessment"],
"tester": ["test", "qa", "validate", "verify"], # Depois dos mais específicos
}

for agent, keywords in keyword_map.items():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from ...providers.smart_router_v2 import (
SmartRouterV2,
TaskType,
ProviderType,
)

logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def _estimate_from_logits(

# Convert to probabilities with softmax
max_logit = max(logits)
exp_logits = [math.exp(l - max_logit) for l in logits]
exp_logits = [math.exp(logit - max_logit) for logit in logits]
sum_exp = sum(exp_logits)
probs = [e / sum_exp for e in exp_logits]

Expand Down
2 changes: 1 addition & 1 deletion packages/vertice-core/src/vertice_core/code/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
stacklevel=2,
)

from .validator import *
# from .validator import *
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from __future__ import annotations

from typing import List, Optional
from textual.app import ComposeResult
from textual.containers import Vertical, Horizontal
from textual.widgets import Button, Static, RadioSet, RadioButton, Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ def check_image_support() -> dict:

if TEXTUAL_IMAGE_AVAILABLE:
try:
from textual_image import renderable

# Check available protocols
result["protocols"] = ["unicode"] # Always available
# TGP and Sixel detection would need terminal query
Expand Down
4 changes: 0 additions & 4 deletions packages/vertice-core/src/vertice_core/tui/wisdom.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,3 @@ def validate_wisdom_system():
def get_all_categories(self) -> list[str]:
"""Get all available wisdom categories."""
return list(self.verses.keys())

def get_all_categories(self) -> list[str]:
"""Get all wisdom categories."""
return list(self.verses.keys())
2 changes: 1 addition & 1 deletion packages/vertice-core/src/vertice_core/utils/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
stacklevel=2,
)

from .prompts import *
# from .prompts import *
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ruff
radon
2 changes: 1 addition & 1 deletion scripts/debug_dispatcher_final.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def probe():
try:
repo_root = get_repo_root()
print(f"DEBUG: Dispatcher thought repo_root is: {repo_root}")
except:
except Exception:
print("DEBUG: Dispatcher failed to get repo_root via utils.")

log_dir = repo_root / "logs" / "notifications"
Expand Down
14 changes: 6 additions & 8 deletions scripts/testing/test_nexus_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,23 @@ def section(self, title):
print(f"{self.CYAN} {'=' * len(title)}{self.RESET}")

def progress(self):
percent = float(self.current) / self.total
arrow = "█" * int(round(percent * self.bar_length))
spaces = "░" * (self.bar_length - len(arrow))

c = self.GREEN if percent > 0.8 else (self.YELLOW if percent > 0.4 else self.RED)

pass
# percent = float(self.current) / self.total
# arrow = "█" * int(round(percent * self.bar_length))
# spaces = "░" * (self.bar_length - len(arrow))
# c = self.GREEN if percent > 0.8 else (self.YELLOW if percent > 0.4 else self.RED)
# \r to overwrite line? In a stream, \r might not work well if appended.
# We'll print distinct lines for maximum compatibility with simple streams.
# actually, standard streaming response supports \r if terminal simulates it.
# But let's just print a nice bar on update.
# print(f"\r[{c}{arrow}{spaces}{self.RESET}] {int(percent*100)}%", end="", flush=True)
pass

def info(self, msg):
# Drop-in replacement for logger.info
if "🧪" in msg:
self.current += 1
# Extract test name
test_name = msg.split("]", 1)[-1].strip() if "]" in msg else msg
# test_name = msg.split("]", 1)[-1].strip() if "]" in msg else msg

# Progress calculation
percent = min(1.0, float(self.current) / self.total)
Expand Down
Loading