STATE-WP-0069: MCP Phase 1 deprecation + open_workplans summary alias
Complete MCP legacy deprecation coverage (resource + docstrings + TOOLS.md). Dual-write open_workplans on /state/summary alongside open_workstreams; get_domain_summary prefers the new key. T06 internal rename started.
This commit is contained in:
parent
9e93b517e4
commit
e6a6af035c
7 changed files with 70 additions and 40 deletions
|
|
@ -26,7 +26,7 @@ def _fake_get(path: str, params: dict | None = None):
|
|||
return [{"id": "topic-1", "domain_slug": "infotech", "title": "Infotech"}]
|
||||
if path == "/state/summary":
|
||||
return {
|
||||
"open_workstreams": [
|
||||
"open_workplans": [
|
||||
{
|
||||
"id": "wp-1",
|
||||
"topic_id": "topic-1",
|
||||
|
|
@ -48,6 +48,20 @@ def _fake_get(path: str, params: dict | None = None):
|
|||
return []
|
||||
|
||||
|
||||
def test_legacy_workstreams_resource_includes_deprecation(monkeypatch) -> None:
|
||||
def fake_get(path: str, params: dict | None = None):
|
||||
if path == "/topics":
|
||||
return [{"id": "topic-1", "slug": "infotech", "domain_slug": "infotech"}]
|
||||
if path == "/workstreams":
|
||||
return [{"id": "wp-1", "title": "Demo", "slug": "demo-wp"}]
|
||||
return []
|
||||
|
||||
monkeypatch.setattr(server, "_get", fake_get)
|
||||
payload = json.loads(server.resource_workstreams("infotech"))
|
||||
assert payload["_deprecation"]["replacement"] == "state://workplans/{topic_slug}"
|
||||
assert payload["workplans"] == payload["workstreams"]
|
||||
|
||||
|
||||
def test_get_domain_summary_goal_guidance_is_workplan_first(monkeypatch) -> None:
|
||||
monkeypatch.setattr(server, "_get", lambda path, params=None: _fake_get(path, params))
|
||||
payload = json.loads(server.get_domain_summary("infotech"))
|
||||
|
|
|
|||
|
|
@ -430,6 +430,8 @@ class TestStateSummary:
|
|||
assert r.status_code == 200
|
||||
body = r.json()
|
||||
assert "open_workstreams" in body
|
||||
assert "open_workplans" in body
|
||||
assert body["open_workplans"] == body["open_workstreams"]
|
||||
assert "blocking_decisions" in body
|
||||
assert "blocked_tasks" in body
|
||||
assert "domains" in body
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue