CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / integration (push) Successful in 53s
CI & Build / TypeScript typecheck (push) Successful in 55s
CI & Build / Python tests (push) Successful in 1m28s
CI & Build / Build & push image (push) Successful in 31s
Step 3 of milestone 409 "Response shapes". Step 2's reporting-back skill only helps if it fires, and only exists in the Claude Code plugin. - scribe_static_context.md and using-scribe (new reflex 11) say: report back in a shape the operator can read, placed from the `placement` block rather than memory, and point at the reporting-back skill. using-scribe also lists it among the sibling process-skills. - update_task returns a one-line `report_back` cue when a task is closed (done or cancelled). A tool response is the only surface every MCP client sees, at the moment the report is about to be written. - _INSTRUCTIONS takes no line: there is no budget without trading out a session-start reflex. The decision is recorded in server.py's comment block so it is not re-litigated blind. - Guards: test_instruction_surfaces_agree pins the reflex and the placement pointer on both plugin surfaces; a tool test pins the cue on closing statuses and its absence on every other update. Plugin version minted. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
34 lines
1.4 KiB
Python
34 lines
1.4 KiB
Python
"""update_task closes a task with a one-line reminder of what the report needs.
|
|
|
|
The in-band half of milestone 409 step 3: the skill and static context only
|
|
exist in the Claude Code plugin, and a tool response reaches every MCP client
|
|
at the moment a piece of work closes. Pinned on the response, not the wording.
|
|
"""
|
|
from unittest.mock import AsyncMock, MagicMock, patch
|
|
|
|
import pytest
|
|
|
|
pytestmark = pytest.mark.usefixtures("_bind_user")
|
|
|
|
|
|
async def _update(**kwargs):
|
|
from scribe.mcp.tools.tasks import update_task
|
|
|
|
note = MagicMock(id=5, user_id=7, project_id=None)
|
|
note.to_dict.return_value = {"id": 5}
|
|
with patch("scribe.mcp.tools.tasks.notes_svc.update_note", AsyncMock(return_value=note)), \
|
|
patch("scribe.mcp.tools.tasks.systems_tools.attach_systems", AsyncMock()), \
|
|
patch("scribe.mcp.tools.tasks.placement_svc.attach_placement", AsyncMock()):
|
|
return await update_task(task_id=5, **kwargs)
|
|
|
|
|
|
@pytest.mark.parametrize("status", ["done", "cancelled"])
|
|
async def test_closing_a_task_carries_the_cue(status):
|
|
out = await _update(status=status)
|
|
assert "placement" in out["report_back"] and "needs them" in out["report_back"]
|
|
|
|
|
|
@pytest.mark.parametrize("kwargs", [{"status": "in_progress"}, {"status": "todo"}, {"body": "more notes"}])
|
|
async def test_other_updates_do_not(kwargs):
|
|
assert "report_back" not in await _update(**kwargs)
|