feat(maf-roundtable): add Phase-1 multi-agent roundtable infrastructure

Ship an independent, feature-flag-gated MAF roundtable skeleton with six
isolated tables, atomic single-transaction run launch/cancel, owner-scoped
read/write split, shared config enums, and HTTP/concurrency regression tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
董宏凯andCursor committed 2026-08-01 01:07:05 +08:00
1 parent a0a75a9964
commit e690475e6e
27 files changed
+5369 -101

No files matched your search

@@ -0,0 +1,59 @@
"""P2 deployment-config enum / range validation for MafRoundtableConfig.
Config and API schemas share ``MafMode`` / ``MafWritePolicy`` from
``deerflow.config.maf_roundtable_config`` — invalid deployment values must fail
at load time, not silently become runtime bugs.
"""
from __future__ import annotations
import pytest
from pydantic import ValidationError
from deerflow.config.maf_roundtable_config import MafRoundtableConfig
def test_valid_config_loads():
cfg = MafRoundtableConfig(
enabled=True,
default_mode="group_chat",
default_write_policy="auto",
default_max_rounds=16,
admin_diagnostic_access=False,
)
assert cfg.default_mode == "group_chat"
assert cfg.default_write_policy == "auto"
assert cfg.default_max_rounds == 16
def test_default_config_loads():
cfg = MafRoundtableConfig()
assert cfg.enabled is False
assert cfg.default_mode == "structured"
assert cfg.default_write_policy == "confirm_high_risk"
assert cfg.default_max_rounds == 8
def test_invalid_default_mode_rejected():
with pytest.raises(ValidationError):
MafRoundtableConfig(default_mode="wrong")
def test_invalid_default_write_policy_rejected():
with pytest.raises(ValidationError):
MafRoundtableConfig(default_write_policy="wrong")
def test_default_max_rounds_zero_rejected():
with pytest.raises(ValidationError):
MafRoundtableConfig(default_max_rounds=0)
def test_default_max_rounds_above_cap_rejected():
with pytest.raises(ValidationError):
MafRoundtableConfig(default_max_rounds=65)
def test_allow_mock_events_field_removed():
"""allow_mock_events must not be a config field anymore."""
assert "allow_mock_events" not in MafRoundtableConfig.model_fields