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;
10 rows
| requirement | criterion | criterion_text | task | task_status | repo | sha | committed_at | pr_number | pr_title | merged_at | review_state | reviewer | reviewed_at |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| REQ-CLICK-02 | AC-CLICK-102-1 | Help text wrapping measures line width in visible characters, so ANSI escape sequences don't count toward the width. | TASK-CLICK-1021 | done | pallets/click | d946074a8fd4bd743dcde12e08e1561f062a2a68 | 2026-05-12T15:50:52Z | 3420 | Make `TextWrapper` ANSI-aware | 2026-05-16T05:04:29Z | COMMENTED | Nina Kowalski | 2026-05-14T06:24:50Z |
| REQ-CLICK-02 | AC-CLICK-102-1 | Help text wrapping measures line width in visible characters, so ANSI escape sequences don't count toward the width. | TASK-CLICK-1021 | done | pallets/click | d946074a8fd4bd743dcde12e08e1561f062a2a68 | 2026-05-12T15:50:52Z | 3420 | Make `TextWrapper` ANSI-aware | 2026-05-16T05:04:29Z | APPROVED | Jamal Wright | 2026-05-15T20:28:05Z |
| REQ-CLICK-02 | AC-CLICK-102-2 | `confirm()` and `prompt()` remove colour codes from the prompt when the output stream doesn't support colour. | TASK-CLICK-1022 | done | pallets/click | 93ba0075f4881b858b61f89a753c7c10e330027e | 2026-07-01T05:18:55Z | 3653 | Strip ANSI from `confirm()` and `prompt()` | 2026-07-02T23:39:09Z | CHANGES_REQUESTED | Jamal Wright | 2026-06-30T22:48:18Z |
| REQ-CLICK-02 | AC-CLICK-102-2 | `confirm()` and `prompt()` remove colour codes from the prompt when the output stream doesn't support colour. | TASK-CLICK-1022 | done | pallets/click | 93ba0075f4881b858b61f89a753c7c10e330027e | 2026-07-01T05:18:55Z | 3653 | Strip ANSI from `confirm()` and `prompt()` | 2026-07-02T23:39:09Z | COMMENTED | Nina Kowalski | 2026-07-01T23:15:12Z |
| REQ-CLICK-02 | AC-CLICK-102-2 | `confirm()` and `prompt()` remove colour codes from the prompt when the output stream doesn't support colour. | TASK-CLICK-1022 | done | pallets/click | 93ba0075f4881b858b61f89a753c7c10e330027e | 2026-07-01T05:18:55Z | 3653 | Strip ANSI from `confirm()` and `prompt()` | 2026-07-02T23:39:09Z | APPROVED | Sofia Reyes | 2026-07-02T18:07:54Z |
| REQ-CLICK-02 | AC-CLICK-102-3 | `unstyle()` removes colon-delimited true-colour sequences such as `\x1b[38:2:255:0:0m`. | TASK-CLICK-1023 | done | pallets/click | 71f2bafa541e7f798834e74076786ff4281ac83e | 2026-07-09T14:00:50Z | 3681 | Strip all ANSI sequences | 2026-07-10T03:14:25Z | APPROVED | Sofia Reyes | 2026-07-09T05:41:38Z |
| REQ-CLICK-02 | AC-CLICK-102-4 | `style()` raises an error for an invalid colour name, and the error message lists the valid colour names. | TASK-CLICK-1024 | done | pallets/click | 07c909f23f0f83b5ca137c167b9a134d66201f67 | 2026-07-08T14:46:39Z | 3677 | Validate `style()` color arguments | 2026-07-08T16:05:23Z | COMMENTED | Jamal Wright | 2026-07-08T13:58:16Z |
| REQ-CLICK-02 | AC-CLICK-102-4 | `style()` raises an error for an invalid colour name, and the error message lists the valid colour names. | TASK-CLICK-1024 | done | pallets/click | 07c909f23f0f83b5ca137c167b9a134d66201f67 | 2026-07-08T14:46:39Z | 3677 | Validate `style()` color arguments | 2026-07-08T16:05:23Z | APPROVED | Sofia Reyes | 2026-07-08T15:36:54Z |
| REQ-CLICK-02 | AC-CLICK-102-5 | Passing `fg=0` to `style()` produces the 256-colour code for black instead of being silently ignored. | TASK-CLICK-1024 | done | pallets/click | 07c909f23f0f83b5ca137c167b9a134d66201f67 | 2026-07-08T14:46:39Z | 3677 | Validate `style()` color arguments | 2026-07-08T16:05:23Z | COMMENTED | Jamal Wright | 2026-07-08T13:58:16Z |
| REQ-CLICK-02 | AC-CLICK-102-5 | Passing `fg=0` to `style()` produces the 256-colour code for black instead of being silently ignored. | TASK-CLICK-1024 | done | pallets/click | 07c909f23f0f83b5ca137c167b9a134d66201f67 | 2026-07-08T14:46:39Z | 3677 | Validate `style()` color arguments | 2026-07-08T16:05:23Z | APPROVED | Sofia Reyes | 2026-07-08T15:36:54Z |