From 7a39767482f9fead0a921f8805ba66698ffe28ba Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Wed, 10 Jun 2026 23:47:15 +0200 Subject: [PATCH] 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) --- nextcloud_mcp_server/server/deck.py | 15 ++++++---- .../test_deck_move_card_to_board.py | 29 ++++++++++++++++++- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/nextcloud_mcp_server/server/deck.py b/nextcloud_mcp_server/server/deck.py index 9455cdcf..9fa8069b 100644 --- a/nextcloud_mcp_server/server/deck.py +++ b/nextcloud_mcp_server/server/deck.py @@ -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. diff --git a/tests/integration/test_deck_move_card_to_board.py b/tests/integration/test_deck_move_card_to_board.py index a2e85c55..6ea524eb 100644 --- a/tests/integration/test_deck_move_card_to_board.py +++ b/tests/integration/test_deck_move_card_to_board.py @@ -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 ):