Skip to content

[Week7 - pky] Task2: Extend extraction with priority, deadline, and assignee#54

Open
kunyoungp wants to merge 1 commit into
mainfrom
week7-pky-task2
Open

[Week7 - pky] Task2: Extend extraction with priority, deadline, and assignee#54
kunyoungp wants to merge 1 commit into
mainfrom
week7-pky-task2

Conversation

@kunyoungp

Copy link
Copy Markdown

Summary

  • Rewrote extract_action_items() to return list[ExtractedItem] dataclass instead of list[str]
  • ExtractedItem fields: text, priority (high/medium/low), deadline (str|None), assignees (list[str])
  • Expanded keyword matching: TODO, ACTION, FIXME, TASK, BUG, FOLLOW-UP, REMINDER (kept "ends with !" rule)
  • Added priority detection via regex (urgent/critical/asap → high, nice to have/eventually → low)
  • Added deadline parsing (by/due patterns)
  • Added assignee extraction (@username pattern)
  • Added ExtractedItemRead Pydantic schema
  • Added POST /notes/{note_id}/extract endpoint

Test plan

  • Keyword matching: test_keyword_todo, test_keyword_action, test_keyword_fixme, test_keyword_task, test_keyword_bug
  • Exclamation rule: test_exclamation_rule
  • Priority: test_priority_high (3 variants), test_priority_low (3 variants), test_priority_medium_default
  • Deadline: test_deadline_by, test_deadline_due, test_deadline_none
  • Assignees: test_assignee_single, test_assignee_multiple, test_no_assignees
  • Edge cases: test_empty_text, test_no_matches
  • Integration: test_combined_extraction, test_returns_extracted_item_dataclass
  • Endpoint: test_extract_from_note_endpoint, test_extract_from_note_not_found
  • All 23 tests pass (make test)

Notable tradeoffs

  • Used dataclass for ExtractedItem (lightweight, no Pydantic overhead for internal logic)
  • Deadline regex captures 2 words after "by"/"due" which may over-capture (e.g., "by Friday @alice" → deadline="Friday @alice") — acceptable for simple extraction
  • Priority detection is case-insensitive regex; more sophisticated NLP could improve accuracy but adds complexity

🤖 Generated with Claude Code

…assignee parsing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant