fix(deck): address PR #759 round-2 review feedback

- Move description_max_length validation to tool layer
  (_validate_description_max_length), matching the existing
  _validate_comment_message pattern; helper now trusts callers per
  CLAUDE.md ("validate at system boundaries only").
- Fix mutation/return inconsistency: deck_get_stacks now uses a list
  comprehension to capture _apply_stack_filters' return, matching
  deck_get_stack / deck_get_archived_stacks.
- Rename include_archived -> include_archived_cards on deck_get_cards
  and _apply_card_filters for consistency with deck_get_stacks.
- Route deck_get_archived_stacks through _apply_stack_filters so
  future filters apply uniformly to active + archived paths.
- Trim _truncate_card_descriptions docstring to one line; add inline
  comment in _apply_stack_filters explaining the breaking-change
  default (mirrors Deck UI archived-card filtering).
- Replace fragile call_args[0][1] with call_args.args[1] in the
  archived-stacks client test.
- Modernize Optional[X] -> X | None throughout deck.py (adjacent
  cleanup called out in the review).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-05-03 00:50:56 +02:00
co-authored by Claude Opus 4.7
parent 7d633a945d
commit b7805c2180
3 changed files with 86 additions and 64 deletions
+1 -1
View File
@@ -283,7 +283,7 @@ async def test_deck_get_archived_stacks(mocker):
assert stacks[0].id == 9
mock_make_request.assert_called_once()
assert "/boards/123/stacks/archived" in mock_make_request.call_args[0][1]
assert "/boards/123/stacks/archived" in mock_make_request.call_args.args[1]
# Card Tests