Add tags field to todos and ?tag= filter on GET /todos #16

Open
danny8632 wants to merge 1 commits from agent/issue-14-add-tags-field-to-todos-and-tag-filter-on-get-todo into main
Owner

Resolves #14

Automated PR from agent dev-01.

  • model: sonnet
  • log: /var/agent/logs/issue-14-20260512T072452.log
  • claude rc: 0
Resolves #14 Automated PR from agent dev-01. - model: `sonnet` - log: `/var/agent/logs/issue-14-20260512T072452.log` - claude rc: `0`
danny8632 added 1 commit 2026-05-12 07:26:09 +00:00
Add tags field to todos and ?tag= filter on GET /todos
All checks were successful
Auditor / audit (pull_request) Successful in 51s
e50dc2447e
- Add tags:[] to all seed todo objects
- POST /todos accepts optional tags array (defaults to [])
- GET /todos?tag=<value> filters to todos whose tags include that value (case-sensitive)

Closes #14
Author
Owner

Auditor review — APPROVE

All five Done criteria are clearly satisfied by the diff. POST /todos correctly handles tags with and without the field; GET /todos returns todos with tags arrays; the ?tag= filter uses case-sensitive Array.includes; and nonexistent tags yield an empty array. Seed data includes tags:[] on all initial todos.

Criteria

  • PASS — POST /todos with {"title":"t","tags":["work"]} returns 201 and tags:["work"] Handler does Array.isArray(tags) ? tags : [] so ["work"] is preserved; res.status(201).json(todo) is used.
  • PASS — POST /todos with {"title":"t"} (no tags) returns 201 and tags:[] When tags is undefined, Array.isArray(undefined) is false, so tags defaults to [].
  • PASS — GET /todos with no query params returns 200 and every todo has a tags field that is an array All three seed todos include tags:[] and every new todo is assigned an array; the unfiltered branch returns all todos.
  • PASS — GET /todos?tag=work returns 200 and all returned todos contain "work" in their tags array todos.filter(t => t.tags.includes(tag)) performs exact case-sensitive match; res.json defaults to 200.
  • PASS — GET /todos?tag=nonexistent returns 200 and empty array [] No seed todos have non-empty tags, so the filter produces [] for any non-matching tag.

Other issues found

  • POST /todos does not validate that title is present; a request with no title field stores {title: undefined} which serializes as an object missing the title key. Not a stated criterion but could cause silent data corruption.

model: sonnet · log: /var/agent/logs/audit-pr16-20260512T072618.log

## Auditor review — :white_check_mark: APPROVE All five Done criteria are clearly satisfied by the diff. POST /todos correctly handles tags with and without the field; GET /todos returns todos with tags arrays; the ?tag= filter uses case-sensitive Array.includes; and nonexistent tags yield an empty array. Seed data includes tags:[] on all initial todos. ### Criteria - **PASS** — POST /todos with {"title":"t","tags":["work"]} returns 201 and tags:["work"] _Handler does Array.isArray(tags) ? tags : [] so ["work"] is preserved; res.status(201).json(todo) is used._ - **PASS** — POST /todos with {"title":"t"} (no tags) returns 201 and tags:[] _When tags is undefined, Array.isArray(undefined) is false, so tags defaults to []._ - **PASS** — GET /todos with no query params returns 200 and every todo has a tags field that is an array _All three seed todos include tags:[] and every new todo is assigned an array; the unfiltered branch returns all todos._ - **PASS** — GET /todos?tag=work returns 200 and all returned todos contain "work" in their tags array _todos.filter(t => t.tags.includes(tag)) performs exact case-sensitive match; res.json defaults to 200._ - **PASS** — GET /todos?tag=nonexistent returns 200 and empty array [] _No seed todos have non-empty tags, so the filter produces [] for any non-matching tag._ ### Other issues found - POST /todos does not validate that `title` is present; a request with no title field stores {title: undefined} which serializes as an object missing the title key. Not a stated criterion but could cause silent data corruption. --- _model: sonnet · log: `/var/agent/logs/audit-pr16-20260512T072618.log`_
All checks were successful
Auditor / audit (pull_request) Successful in 51s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin agent/issue-14-add-tags-field-to-todos-and-tag-filter-on-get-todo:agent/issue-14-add-tags-field-to-todos-and-tag-filter-on-get-todo
git checkout agent/issue-14-add-tags-field-to-todos-and-tag-filter-on-get-todo
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: danny8632/todo-app#16