feat(report-collaboration): complete RC-BE-015–018 backend, eval suite, and MySQL sync
Ship report rewrite/version APIs, security budget and audit persistence, AgentScope worker wiring, and the 20-task quality eval harness so the frontend can integrate against a stable contract once enabled in config. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
814a44f0b9
commit
5e953c9fcb
123 files changed
+26816
-3505
No files matched your search
@@ -967,6 +967,16 @@ def validate_local_bash_command_paths(command: str, thread_data: ThreadDataState
|
||||
raise PermissionError(f"Unsafe absolute paths in command: {unsafe}. Use paths under {VIRTUAL_PATH_PREFIX}")
|
||||
|
||||
|
||||
def _sh_safe_host_path(path: str) -> str:
|
||||
"""Normalise a resolved host path for embedding in a local bash command.
|
||||
|
||||
Windows backslash paths break when substituted unquoted into a POSIX sh
|
||||
command — the shell eats the backslashes (``cd: F:react01...``). Windows
|
||||
APIs accept forward slashes, so normalise and quote for shell safety.
|
||||
"""
|
||||
return shlex.quote(path.replace("\\", "/"))
|
||||
|
||||
|
||||
def replace_virtual_paths_in_command(command: str, thread_data: ThreadDataState | None) -> str:
|
||||
"""Replace all virtual paths (/mnt/user-data, /mnt/skills, /mnt/acp-workspace) in a command string.
|
||||
|
||||
@@ -986,7 +996,7 @@ def replace_virtual_paths_in_command(command: str, thread_data: ThreadDataState
|
||||
skills_pattern = re.compile(rf"{re.escape(skills_container)}(/[^\s\"';&|<>()]*)?")
|
||||
|
||||
def replace_skills_match(match: re.Match) -> str:
|
||||
return _resolve_skills_path(match.group(0))
|
||||
return _sh_safe_host_path(_resolve_skills_path(match.group(0)))
|
||||
|
||||
result = skills_pattern.sub(replace_skills_match, result)
|
||||
|
||||
@@ -997,7 +1007,7 @@ def replace_virtual_paths_in_command(command: str, thread_data: ThreadDataState
|
||||
acp_pattern = re.compile(rf"{re.escape(_ACP_WORKSPACE_VIRTUAL_PATH)}(/[^\s\"';&|<>()]*)?")
|
||||
|
||||
def replace_acp_match(match: re.Match, _tid: str | None = _thread_id) -> str:
|
||||
return _resolve_acp_workspace_path(match.group(0), _tid)
|
||||
return _sh_safe_host_path(_resolve_acp_workspace_path(match.group(0), _tid))
|
||||
|
||||
result = acp_pattern.sub(replace_acp_match, result)
|
||||
|
||||
@@ -1008,7 +1018,7 @@ def replace_virtual_paths_in_command(command: str, thread_data: ThreadDataState
|
||||
pattern = re.compile(rf"{re.escape(VIRTUAL_PATH_PREFIX)}(/[^\s\"';&|<>()]*)?")
|
||||
|
||||
def replace_user_data_match(match: re.Match) -> str:
|
||||
return replace_virtual_path(match.group(0), thread_data)
|
||||
return _sh_safe_host_path(replace_virtual_path(match.group(0), thread_data))
|
||||
|
||||
result = pattern.sub(replace_user_data_match, result)
|
||||
|
||||
@@ -1474,7 +1484,7 @@ def grep_tool(
|
||||
|
||||
|
||||
@tool("read_file", parse_docstring=True)
|
||||
def read_file_tool(
|
||||
def read_file_tool(
|
||||
runtime: ToolRuntime[ContextT, ThreadState],
|
||||
description: str,
|
||||
path: str,
|
||||
@@ -1488,21 +1498,21 @@ def read_file_tool(
|
||||
path: The **absolute** path to the file to read.
|
||||
start_line: Optional starting line number (1-indexed, inclusive). Use with end_line to read a specific range.
|
||||
end_line: Optional ending line number (1-indexed, inclusive). Use with start_line to read a specific range.
|
||||
"""
|
||||
try:
|
||||
requested_path = path
|
||||
if _is_skills_path(requested_path):
|
||||
from deerflow.tools.builtins.skill_tools import (
|
||||
_resolve_active_agent_id,
|
||||
is_coordinator_only_skill_path,
|
||||
)
|
||||
|
||||
if is_coordinator_only_skill_path(requested_path) and _resolve_active_agent_id(runtime) != "roundtable-coordinator":
|
||||
# Match skill_view's non-leaking behavior: ordinary agents must not discover whether it exists.
|
||||
return f"Error: File not found: {requested_path}"
|
||||
sandbox = ensure_sandbox_initialized(runtime)
|
||||
ensure_thread_directories_exist(runtime)
|
||||
if is_local_sandbox(runtime):
|
||||
"""
|
||||
try:
|
||||
requested_path = path
|
||||
if _is_skills_path(requested_path):
|
||||
from deerflow.tools.builtins.skill_tools import (
|
||||
_resolve_active_agent_id,
|
||||
is_coordinator_only_skill_path,
|
||||
)
|
||||
|
||||
if is_coordinator_only_skill_path(requested_path) and _resolve_active_agent_id(runtime) != "roundtable-coordinator":
|
||||
# Match skill_view's non-leaking behavior: ordinary agents must not discover whether it exists.
|
||||
return f"Error: File not found: {requested_path}"
|
||||
sandbox = ensure_sandbox_initialized(runtime)
|
||||
ensure_thread_directories_exist(runtime)
|
||||
if is_local_sandbox(runtime):
|
||||
thread_data = get_thread_data(runtime)
|
||||
validate_local_tool_path(path, thread_data, read_only=True)
|
||||
if _is_skills_path(path):
|
||||
|
||||
Reference in new issue
Block a user