feat: Add evaluation hooks, skill adaptation and team pipeline config

- Add EvaluationHook for post-execution agent evaluation
- Add SkillAdaptationHook for dynamic skill adaptation
- Add team/ directory with team coordination logic
- Add TEAM_PIPELINE.yaml for smoke_fullstack pipeline config
- Update RuntimeView, TraderView and RuntimeSettingsPanel UI
- Add runtimeApi and websocket services
- Add runtime_state.json to smoke_fullstack state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-19 18:52:12 +08:00
parent f4a2b7f3af
commit 4b5ac86b83
87 changed files with 5042 additions and 744 deletions

View File

@@ -2,6 +2,11 @@
from backend import cli
from backend.agents.skill_metadata import parse_skill_metadata
from backend.agents.skills_manager import SkillsManager
from backend.agents.team_pipeline_config import (
ensure_team_pipeline_config,
load_team_pipeline_config,
update_active_analysts,
)
def test_parse_skill_metadata_extended_frontmatter(tmp_path):
@@ -70,3 +75,45 @@ def test_skills_enable_disable_and_list(monkeypatch, tmp_path):
assert "Enabled" in text_dump
assert "Disabled" in text_dump
assert any(getattr(item, "title", None) == "Skill Catalog" for item in printed)
def test_install_external_skill_for_agent(tmp_path):
manager = SkillsManager(project_root=tmp_path)
skill_dir = tmp_path / "downloaded" / "new_skill"
skill_dir.mkdir(parents=True, exist_ok=True)
(skill_dir / "SKILL.md").write_text(
"---\n"
"name: new_skill\n"
"description: external skill\n"
"---\n\n"
"# New Skill\n",
encoding="utf-8",
)
result = manager.install_external_skill_for_agent(
config_name="demo",
agent_id="risk_manager",
source=str(skill_dir),
activate=True,
)
assert result["skill_name"] == "new_skill"
target = manager.get_agent_local_root("demo", "risk_manager") / "new_skill"
assert target.exists()
def test_team_pipeline_active_analyst_updates(tmp_path):
project_root = tmp_path
ensure_team_pipeline_config(
project_root=project_root,
config_name="demo",
default_analysts=["fundamentals_analyst", "technical_analyst"],
)
update_active_analysts(
project_root=project_root,
config_name="demo",
available_analysts=["fundamentals_analyst", "technical_analyst"],
remove=["technical_analyst"],
)
config = load_team_pipeline_config(project_root, "demo")
assert config["discussion"]["active_analysts"] == ["fundamentals_analyst"]