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:
董宏凯andCursor committed 2026-09-06 17:32:15 +08:00
1 parent 814a44f0b9
commit 5e953c9fcb
123 files changed
+26816 -3505

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -0,0 +1,53 @@
"""Report-collaboration workbench configuration.
Master switch and server-enforced limits for the AgentScope-backed
multi-agent report runtime. Default **off**: APIs, workers and model
calls must not run until an operator opts in.
"""
from __future__ import annotations
from pydantic import BaseModel, Field
class ReportCollaborationConfig(BaseModel):
"""``config.yaml -> report_collaboration`` limits and feature flags."""
enabled: bool = Field(default=False, description="Master switch for /api/report-collaboration")
worker_enabled: bool = Field(
default=False,
description="When true, a dispatcher/worker may claim run leases. Gateway-only processes keep this false.",
)
planner_model: str | None = Field(default=None, description="Model name from AppConfig.models for planning")
coordinator_model: str | None = Field(default=None, description="Model name from AppConfig.models for the constrained coordinator")
research_model: str | None = Field(default=None, description="Model name from AppConfig.models for research members")
writer_model: str | None = Field(default=None, description="Model name from AppConfig.models for writing")
reviewer_model: str | None = Field(default=None, description="Model name from AppConfig.models for independent review")
max_team_members: int = Field(default=8, ge=2, le=16)
max_parallel_tasks: int = Field(default=4, ge=1, le=16)
max_repair_rounds: int = Field(default=3, ge=0, le=8)
max_node_attempts: int = Field(default=3, ge=1, le=8)
max_react_iterations: int = Field(default=8, ge=1, le=32, description="Per-member AgentScope ReAct loop cap")
session_timeout_seconds: int = Field(default=7200, ge=60)
node_timeout_seconds: int = Field(default=900, ge=30)
lease_seconds: int = Field(default=60, ge=10)
heartbeat_seconds: int = Field(default=15, ge=5)
event_retention_days: int = Field(default=30, ge=1)
allowed_tools: list[str] = Field(
default_factory=lambda: ["web_search", "web_fetch", "knowledge_search"],
description="Server allowlist; members may only receive a subset of these names",
)
source_policy: str = Field(default="cite_required", description="Default source policy frozen onto node contracts")
token_budget: int = Field(default=250_000, ge=1000, description="Per-run token budget across all members")
cost_budget: float = Field(default=0.0, ge=0, description="Optional per-run cost cap; 0 means unset")
max_model_calls: int = Field(default=200, ge=1, le=10_000, description="Per-run model-call cap across all members")
max_retrieval_calls: int = Field(default=40, ge=1, le=1000, description="Per-run web/knowledge retrieval call cap")
max_source_bytes: int = Field(default=2_000_000, ge=1000, description="Per-run external source body budget in bytes")
max_concurrent_runs_per_user: int = Field(default=2, ge=1, le=8)
max_clarification_rounds: int = Field(default=3, ge=1, le=8)
intent_confirmation_threshold: float = Field(
default=0.8,
ge=0.5,
le=1.0,
description="Runtime intent confidence below this value requires user confirmation",
)