feat: code quality audit + autoresearch integration + infra hardening (#150)

This commit is contained in:
Alexander Whitestone
2026-03-08 12:50:44 -04:00
committed by GitHub
parent fd0ede0d51
commit ae3bb1cc21
186 changed files with 5129 additions and 3289 deletions

View File

@@ -15,8 +15,8 @@ Intents:
- unknown: Unrecognized intent
"""
import re
import logging
import re
from dataclasses import dataclass
from typing import Optional
@@ -35,47 +35,68 @@ class Intent:
_PATTERNS: list[tuple[str, re.Pattern, float]] = [
# Status queries
("status", re.compile(
r"\b(status|health|how are you|are you (running|online|alive)|check)\b",
re.IGNORECASE,
), 0.9),
(
"status",
re.compile(
r"\b(status|health|how are you|are you (running|online|alive)|check)\b",
re.IGNORECASE,
),
0.9,
),
# Swarm commands
("swarm", re.compile(
r"\b(swarm|spawn|agents?|sub-?agents?|workers?)\b",
re.IGNORECASE,
), 0.85),
(
"swarm",
re.compile(
r"\b(swarm|spawn|agents?|sub-?agents?|workers?)\b",
re.IGNORECASE,
),
0.85,
),
# Task commands
("task", re.compile(
r"\b(task|assign|create task|new task|post task|bid)\b",
re.IGNORECASE,
), 0.85),
(
"task",
re.compile(
r"\b(task|assign|create task|new task|post task|bid)\b",
re.IGNORECASE,
),
0.85,
),
# Help
("help", re.compile(
r"\b(help|commands?|what can you do|capabilities)\b",
re.IGNORECASE,
), 0.9),
(
"help",
re.compile(
r"\b(help|commands?|what can you do|capabilities)\b",
re.IGNORECASE,
),
0.9,
),
# Voice settings
("voice", re.compile(
r"\b(voice|speak|volume|rate|speed|louder|quieter|faster|slower|mute|unmute)\b",
re.IGNORECASE,
), 0.85),
(
"voice",
re.compile(
r"\b(voice|speak|volume|rate|speed|louder|quieter|faster|slower|mute|unmute)\b",
re.IGNORECASE,
),
0.85,
),
# Code modification / self-modify
("code", re.compile(
r"\b(modify|edit|change|update|fix|refactor|implement|patch)\s+(the\s+)?(code|file|function|class|module|source)\b"
r"|\bself[- ]?modify\b"
r"|\b(update|change|edit)\s+(your|the)\s+(code|source)\b",
re.IGNORECASE,
), 0.9),
(
"code",
re.compile(
r"\b(modify|edit|change|update|fix|refactor|implement|patch)\s+(the\s+)?(code|file|function|class|module|source)\b"
r"|\bself[- ]?modify\b"
r"|\b(update|change|edit)\s+(your|the)\s+(code|source)\b",
re.IGNORECASE,
),
0.9,
),
]
# Keywords for entity extraction
_ENTITY_PATTERNS = {
"agent_name": re.compile(r"(?:spawn|start)\s+(?:agent\s+)?(\w+)|(?:agent)\s+(\w+)", re.IGNORECASE),
"agent_name": re.compile(
r"(?:spawn|start)\s+(?:agent\s+)?(\w+)|(?:agent)\s+(\w+)", re.IGNORECASE
),
"task_description": re.compile(r"(?:task|assign)[:;]?\s+(.+)", re.IGNORECASE),
"number": re.compile(r"\b(\d+)\b"),
"target_file": re.compile(r"(?:in|file|modify)\s+(?:the\s+)?([/\w._-]+\.py)", re.IGNORECASE),