docs(deck): note owner reassignment on move; add archived-preservation test

Round-2 review polish on PR #885:

- Document in the deck_move_card_to_board tool that the move reassigns the
  card owner to the calling user and resets the done timestamp (both are
  limitations of Deck's move route), so an LLM reading only the tool
  description isn't misled about preserved fields.
- Fix the done integration-test docstring to say "done state (not timestamp)".
- Add test_move_card_to_board_preserves_archived_status to lock in the
  documented archived-preservation behaviour.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-06-10 23:47:15 +02:00
co-authored by Claude Opus 4.8
parent 798a00d89d
commit 7a39767482
2 changed files with 38 additions and 6 deletions
+10 -5
View File
@@ -1268,11 +1268,16 @@ def configure_deck_tools(mcp: FastMCP):
) -> CardOperationResponse:
"""Move a Nextcloud Deck card to a stack on a different board.
The card keeps its identity (same id, comments, attachments). Deck
remaps the card's board-scoped labels to the destination board by
title — reusing a same-titled label there, or cloning it when you have
board-manage permission. Use deck_reorder_card for moves within a
single board.
The card keeps its identity (same id, comments, attachments), along
with its archived state and due date. Deck remaps the card's
board-scoped labels to the destination board by title — reusing a
same-titled label there, or cloning it when you have board-manage
permission. Use deck_reorder_card for moves within a single board.
Two caveats from Deck's move route: the card's owner is reassigned to
the user performing the move (the original owner is not preserved), and
a card marked done keeps its done state but its done timestamp is reset
to the time of the move.
target_stack_id must be a stack on target_board_id; the move is
rejected otherwise.
@@ -154,7 +154,7 @@ async def test_move_card_to_board_remaps_labels(
async def test_move_card_to_board_preserves_done_status(
nc_client: NextcloudClient, two_boards_with_stacks: tuple
):
"""A card marked done keeps its done timestamp across a cross-board move."""
"""A card marked done keeps its done state (not timestamp) across a move."""
source_board_id, source_stack_id, target_board_id, target_stack_id = (
two_boards_with_stacks
)
@@ -185,6 +185,33 @@ async def test_move_card_to_board_preserves_done_status(
assert after.done is not None, "done status was cleared during the move"
async def test_move_card_to_board_preserves_archived_status(
nc_client: NextcloudClient, two_boards_with_stacks: tuple
):
"""An archived card stays archived across a cross-board move."""
source_board_id, source_stack_id, target_board_id, target_stack_id = (
two_boards_with_stacks
)
suffix = uuid.uuid4().hex[:8]
card = await nc_client.deck.create_card(
source_board_id, source_stack_id, f"Archived card {suffix}"
)
await nc_client.deck.archive_card(source_board_id, source_stack_id, card.id)
await nc_client.deck.move_card_to_board(
source_board_id=source_board_id,
source_stack_id=source_stack_id,
card_id=card.id,
target_board_id=target_board_id,
target_stack_id=target_stack_id,
)
after = await nc_client.deck.get_card(target_board_id, target_stack_id, card.id)
assert after.stackId == target_stack_id
assert after.archived is True, "archived state was lost during the move"
async def test_move_card_to_board_rejects_stack_not_on_target_board(
nc_client: NextcloudClient, two_boards_with_stacks: tuple
):