Skip to content

[Week7 - hjy] Task2: Extend extraction with priority, deadline, and category#58

Open
HyungjoonYang wants to merge 1 commit into
mainfrom
week7-hjy-task2
Open

[Week7 - hjy] Task2: Extend extraction with priority, deadline, and category#58
HyungjoonYang wants to merge 1 commit into
mainfrom
week7-hjy-task2

Conversation

@HyungjoonYang

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), category (bug/review/feature/task)
  • Expanded keyword matching: TODO, ACTION, FIXME, BUG, HACK, TASK, 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/before/deadline patterns)
  • Added category detection (bug/fixme → bug, review/PR → review, feature/implement/add → feature)
  • Added ExtractedItemRead Pydantic schema
  • Added POST /notes/{note_id}/extract endpoint

Test plan

  • Keyword matching: todo, action, fixme, bug, hack, task, follow-up, reminder (10 tests)
  • Priority: high (urgent, critical, asap, [P0]), low (nice to have, eventually, [P2]), default medium (8 tests)
  • Deadline: by/due/before patterns, none case (4 tests)
  • Category: bug, fixme→bug, review, feature, default task (5 tests)
  • Return type, empty text, multiline, combined extraction (4 tests)
  • Endpoint: extract from note, 404 for nonexistent (2 tests)
  • All 35 tests pass

Notable tradeoffs

  • Used dataclass for ExtractedItem (lightweight, no Pydantic overhead for internal logic)
  • Deadline regex captures to end of line which may over-capture in edge cases
  • Priority/category detection is keyword-based regex; NLP would improve accuracy but adds complexity

🤖 Generated with Claude Code

Rewrite extract_action_items to return structured ExtractedItem dataclass
with priority (high/medium/low), deadline, and category detection.
Add FIXME/BUG/HACK/TASK/FOLLOW-UP/REMINDER keyword support.
Add POST /notes/{id}/extract endpoint. 33 new extraction tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <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