Saved queries
The six questions this database is built to answer. Each runs unchanged on SQLite and Postgres.
1. Acceptance criteria with no linked commits or no linked tests2. Commits not tied to any task3. Cycle time4. Requirements changed after the code for one of their criteria merged5. Review turnaround by reviewer6. Full trace for one requirement
6. Full trace for one requirement: requirement -> criteria -> tasks -> commits -> PRs -> reviews.
REQ-CLICK-01 REQ-CLICK-02 REQ-CLICK-03 REQ-HTTPX-01 REQ-HTTPX-02 REQ-HTTPX-03 REQ-REQ-01 REQ-REQ-02 REQ-REQ-03 SUB-CLI-01 SUB-HTTP-01 SYS-01
SQL
-- 6. Full trace for one requirement: requirement -> criteria -> tasks -> commits -> PRs -> reviews.
-- LEFT JOINs keep the gaps visible: a criterion with no task shows NULLs to the right.
SELECT r.key AS requirement,
a.key AS criterion,
a.text AS criterion_text,
t.key AS task,
t.status AS task_status,
c.repo,
c.sha,
c.committed_at,
pr.number AS pr_number,
pr.title AS pr_title,
pr.merged_at,
rv.state AS review_state,
rp.display_name AS reviewer,
rv.submitted_at AS reviewed_at
FROM requirements r
JOIN requirement_criteria rc ON rc.requirement_id = r.id
JOIN acceptance_criteria a ON a.id = rc.criterion_id
LEFT JOIN task_criteria tc ON tc.criterion_id = a.id
LEFT JOIN tasks t ON t.id = tc.task_id
LEFT JOIN commit_tasks ct ON ct.task_id = t.id
LEFT JOIN commits c ON c.id = ct.commit_id
LEFT JOIN pull_request_commits prc ON prc.commit_id = c.id
LEFT JOIN pull_requests pr ON pr.id = prc.pull_request_id
LEFT JOIN reviews rv ON rv.pull_request_id = pr.id
LEFT JOIN people rp ON rp.id = rv.reviewer_id
WHERE r.key = ?
ORDER BY a.key, t.key, c.committed_at, rv.submitted_at;
8 rows
| requirement | criterion | criterion_text | task | task_status | repo | sha | committed_at | pr_number | pr_title | merged_at | review_state | reviewer | reviewed_at |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| REQ-REQ-01 | AC-REQ-101-1 | Request bodies that wrap a file through `__getattr__` (without defining `__iter__` themselves) are streamed instead of rejected. | TASK-REQ-1011 | done | psf/requests | 6404f345e562d962abe6700a1c357ec1e7e18232 | 2026-05-12T17:51:01Z | 7433 | Fix `prepare_body` stream detection for `__getattr__`-based file wrappers | 2026-05-12T17:51:01Z | COMMENTED | Nina Kowalski | 2026-05-11T02:17:01Z |
| REQ-REQ-01 | AC-REQ-101-1 | Request bodies that wrap a file through `__getattr__` (without defining `__iter__` themselves) are streamed instead of rejected. | TASK-REQ-1011 | done | psf/requests | 6404f345e562d962abe6700a1c357ec1e7e18232 | 2026-05-12T17:51:01Z | 7433 | Fix `prepare_body` stream detection for `__getattr__`-based file wrappers | 2026-05-12T17:51:01Z | CHANGES_REQUESTED | Sofia Reyes | 2026-05-12T07:52:46Z |
| REQ-REQ-01 | AC-REQ-101-1 | Request bodies that wrap a file through `__getattr__` (without defining `__iter__` themselves) are streamed instead of rejected. | TASK-REQ-1011 | done | psf/requests | 6404f345e562d962abe6700a1c357ec1e7e18232 | 2026-05-12T17:51:01Z | 7433 | Fix `prepare_body` stream detection for `__getattr__`-based file wrappers | 2026-05-12T17:51:01Z | APPROVED | Jamal Wright | 2026-05-12T13:05:06Z |
| REQ-REQ-01 | AC-REQ-101-2 | Multipart uploads accept file objects that only expose `read` through `__getattr__`. | TASK-REQ-1012 | done | psf/requests | 6f205ff422bccd5e4c4fc0b64c5f3e7df5181db6 | 2026-06-08T20:52:51Z | 7502 | Fix `_encode_files` detection for `__getattr__`-based file wrappers | 2026-06-08T20:52:51Z | APPROVED | Sofia Reyes | 2026-06-08T12:24:55Z |
| REQ-REQ-01 | AC-REQ-101-2 | Multipart uploads accept file objects that only expose `read` through `__getattr__`. | TASK-REQ-1013 | done | psf/requests | 6f66281a1d6326b1b9c4ac09ca30de0fc4e6ef43 | 2026-06-09T15:45:59Z | 7505 | Add hasattr checks for remaining protocol isinstance checks | 2026-06-09T15:45:59Z | APPROVED | Jamal Wright | 2026-06-08T18:22:35Z |
| REQ-REQ-01 | AC-REQ-101-2 | Multipart uploads accept file objects that only expose `read` through `__getattr__`. | TASK-REQ-1013 | done | psf/requests | 6f66281a1d6326b1b9c4ac09ca30de0fc4e6ef43 | 2026-06-09T15:45:59Z | 7505 | Add hasattr checks for remaining protocol isinstance checks | 2026-06-09T15:45:59Z | APPROVED | Sofia Reyes | 2026-06-09T08:55:28Z |
| REQ-REQ-01 | AC-REQ-101-3 | All read-capability checks go through one helper function instead of repeated isinstance checks. | TASK-REQ-1013 | done | psf/requests | 6f66281a1d6326b1b9c4ac09ca30de0fc4e6ef43 | 2026-06-09T15:45:59Z | 7505 | Add hasattr checks for remaining protocol isinstance checks | 2026-06-09T15:45:59Z | APPROVED | Jamal Wright | 2026-06-08T18:22:35Z |
| REQ-REQ-01 | AC-REQ-101-3 | All read-capability checks go through one helper function instead of repeated isinstance checks. | TASK-REQ-1013 | done | psf/requests | 6f66281a1d6326b1b9c4ac09ca30de0fc4e6ef43 | 2026-06-09T15:45:59Z | 7505 | Add hasattr checks for remaining protocol isinstance checks | 2026-06-09T15:45:59Z | APPROVED | Sofia Reyes | 2026-06-09T08:55:28Z |