mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 04:40:45 +08:00
重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
This commit is contained in:
parent
4a23b715a2
commit
dbbe3add6a
14438 changed files with 2693620 additions and 2546 deletions
53
tests/test_workspaces_prompt_contract.py
Normal file
53
tests/test_workspaces_prompt_contract.py
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from oclaw.platform.config.paths import PROJECT_ROOT
|
||||
|
||||
|
||||
def _read(path: Path) -> str:
|
||||
return path.read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def test_main_dynamic_placeholder_only_in_role_system() -> None:
|
||||
root = (PROJECT_ROOT / "oclaw" / "runtime" / "workspaces" / "main").resolve()
|
||||
role_system = _read(root / "ROLE_SYSTEM.md")
|
||||
soul = _read(root / "SOUL.md")
|
||||
assert "{{MANAGER_DYNAMIC_EXPERTS_HINT}}" in role_system
|
||||
assert "{{" not in soul
|
||||
for name in ("AGENTS.md", "IDENTITY.md", "USER.md"):
|
||||
p = root / name
|
||||
if p.exists():
|
||||
assert "{{" not in _read(p)
|
||||
|
||||
|
||||
def test_main_hard_routing_rule_only_in_role_system() -> None:
|
||||
root = (PROJECT_ROOT / "oclaw" / "runtime" / "workspaces" / "main").resolve()
|
||||
role_system = _read(root / "ROLE_SYSTEM.md")
|
||||
assert "回退 `generalist`" in role_system
|
||||
for name in ("AGENTS.md", "IDENTITY.md", "USER.md", "SOUL.md"):
|
||||
p = root / name
|
||||
if p.exists():
|
||||
assert "回退 `generalist`" not in _read(p)
|
||||
|
||||
|
||||
def test_every_workspace_has_role_system() -> None:
|
||||
root = (PROJECT_ROOT / "oclaw" / "runtime" / "workspaces").resolve()
|
||||
for item in root.iterdir():
|
||||
if not item.is_dir():
|
||||
continue
|
||||
if item.name.startswith("__"):
|
||||
continue
|
||||
assert (item / "ROLE_SYSTEM.md").exists(), f"missing ROLE_SYSTEM.md for {item.name}"
|
||||
|
||||
|
||||
def test_workspace_legacy_prompt_files_removed() -> None:
|
||||
root = (PROJECT_ROOT / "oclaw" / "runtime" / "workspaces").resolve()
|
||||
legacy = ("AGENTS.md", "IDENTITY.md", "USER.md")
|
||||
for item in root.iterdir():
|
||||
if not item.is_dir():
|
||||
continue
|
||||
if item.name.startswith("__"):
|
||||
continue
|
||||
for name in legacy:
|
||||
assert not (item / name).exists(), f"legacy prompt file still exists: {item.name}/{name}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue