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
1. Acceptance criteria with no linked commits or no linked tests.
SQL
-- 1. Acceptance criteria with no linked commits or no linked tests.
-- A criterion is "covered by code" when a task linked to it has at least one commit.
-- Ordered so criteria with neither code nor tests come first.
WITH crit_commits AS (
SELECT tc.criterion_id, COUNT(DISTINCT ct.commit_id) AS commits
FROM task_criteria tc
JOIN commit_tasks ct ON ct.task_id = tc.task_id
GROUP BY tc.criterion_id
),
crit_tests AS (
SELECT criterion_id, COUNT(*) AS tests
FROM criterion_tests
GROUP BY criterion_id
)
SELECT f.key AS feature,
s.key AS story,
a.key AS criterion,
a.text AS criterion_text,
COALESCE(cc.commits, 0) AS linked_commits,
COALESCE(ct.tests, 0) AS linked_tests,
CASE
WHEN COALESCE(cc.commits, 0) = 0 AND COALESCE(ct.tests, 0) = 0 THEN 'no code, no tests'
WHEN COALESCE(cc.commits, 0) = 0 THEN 'no code'
ELSE 'no tests'
END AS gap
FROM acceptance_criteria a
JOIN stories s ON s.id = a.story_id
JOIN features f ON f.id = s.feature_id
LEFT JOIN crit_commits cc ON cc.criterion_id = a.id
LEFT JOIN crit_tests ct ON ct.criterion_id = a.id
WHERE COALESCE(cc.commits, 0) = 0 OR COALESCE(ct.tests, 0) = 0
ORDER BY CASE WHEN COALESCE(cc.commits, 0) = 0 THEN 0 ELSE 1 END, a.key;
45 rows
| feature | story | criterion | criterion_text | linked_commits | linked_tests | gap |
|---|---|---|---|---|---|---|
| FEAT-CLICK-02 | ST-CLICK-201 | AC-CLICK-201-4 | A codemod script renames deprecated parameter names in user projects automatically. | 0 | 0 | no code, no tests |
| FEAT-HTTPX-02 | ST-HTTPX-203 | AC-HTTPX-203-3 | Brotli decoding handles empty bodies the same way. | 0 | 0 | no code, no tests |
| FEAT-REQ-02 | ST-REQ-203 | AC-REQ-203-4 | A security advisory is published for the no_proxy fix. | 0 | 0 | no code, no tests |
| FEAT-CLICK-01 | ST-CLICK-101 | AC-CLICK-101-4 | Paging a 50 MB output finishes in under 2 seconds on a typical laptop. | 1 | 0 | no tests |
| FEAT-CLICK-01 | ST-CLICK-102 | AC-CLICK-102-4 | `style()` raises an error for an invalid colour name, and the error message lists the valid colour names. | 1 | 0 | no tests |
| FEAT-CLICK-01 | ST-CLICK-103 | AC-CLICK-103-3 | The user guide has a new section with an example of editing a `pathlib.Path` with `click.edit()`. | 1 | 0 | no tests |
| FEAT-CLICK-02 | ST-CLICK-201 | AC-CLICK-201-1 | Declaring a parameter whose name is not a valid Python identifier, or is a Python keyword, emits a DeprecationWarning. | 1 | 0 | no tests |
| FEAT-CLICK-02 | ST-CLICK-201 | AC-CLICK-201-2 | Error messages and deprecation warnings name an option the way the user types it (`--my-option`), not by its internal name (`my_option`). | 1 | 0 | no tests |
| FEAT-CLICK-02 | ST-CLICK-201 | AC-CLICK-201-3 | `Parameter.human_readable_name` keeps working but emits a DeprecationWarning that points to `Parameter.spec`. | 1 | 0 | no tests |
| FEAT-CLICK-02 | ST-CLICK-202 | AC-CLICK-202-1 | `Command.get_help_option_names` returns names in the order they were declared, so help output is identical across runs. | 1 | 0 | no tests |
| FEAT-CLICK-02 | ST-CLICK-202 | AC-CLICK-202-4 | Help output is translated into the user's locale when a translation catalogue is installed. | 1 | 0 | no tests |
| FEAT-CLICK-02 | ST-CLICK-203 | AC-CLICK-203-2 | The shell completion docs list PowerShell alongside bash, zsh and fish, with setup instructions for the PowerShell profile. | 2 | 0 | no tests |
| FEAT-CLICK-02 | ST-CLICK-203 | AC-CLICK-203-3 | PowerShell completion is verified by an automated test that runs a real `pwsh` process in CI. | 2 | 0 | no tests |
| FEAT-CLICK-02 | ST-CLICK-203 | AC-CLICK-203-4 | Completion responds within 100 ms for a CLI with 500 subcommands. | 2 | 0 | no tests |
| FEAT-CLICK-02 | ST-CLICK-204 | AC-CLICK-204-1 | `CliRunner` accepts `capture='fd'`, which also captures output written straight to file descriptors 1 and 2. | 1 | 0 | no tests |
| FEAT-CLICK-02 | ST-CLICK-204 | AC-CLICK-204-3 | `capture='fd'` works on Windows. | 1 | 0 | no tests |
| FEAT-HTTPX-01 | ST-HTTPX-101 | AC-HTTPX-101-1 | `verify` accepts `True`, `False` or an `ssl.SSLContext`, and the separate `ssl_context` parameter is removed. | 1 | 0 | no tests |
| FEAT-HTTPX-01 | ST-HTTPX-101 | AC-HTTPX-101-2 | Passing a string to `verify` raises an error that tells the user to use `ssl.create_default_context(cafile=...)` instead. | 1 | 0 | no tests |
| FEAT-HTTPX-01 | ST-HTTPX-101 | AC-HTTPX-101-3 | Passing a string to `verify` raises `TypeError`. | 1 | 0 | no tests |
| FEAT-HTTPX-01 | ST-HTTPX-101 | AC-HTTPX-101-4 | Importing httpx does not import the `ssl` module until a client actually needs it. | 1 | 0 | no tests |
| FEAT-HTTPX-01 | ST-HTTPX-101 | AC-HTTPX-101-5 | Using `verify=False` together with a client certificate (`cert=...`) still loads the certificate instead of ignoring it. | 1 | 0 | no tests |
| FEAT-HTTPX-01 | ST-HTTPX-101 | AC-HTTPX-101-6 | The documentation describes the `SSL_CERT_FILE` and `SSL_CERT_DIR` environment variables. | 1 | 0 | no tests |
| FEAT-HTTPX-01 | ST-HTTPX-102 | AC-HTTPX-102-1 | `socks5h://` proxy URLs are accepted and routed through the SOCKS transport. | 1 | 0 | no tests |
| FEAT-HTTPX-01 | ST-HTTPX-102 | AC-HTTPX-102-2 | The error for an unsupported proxy scheme includes the scheme the user passed. | 1 | 0 | no tests |
| FEAT-HTTPX-01 | ST-HTTPX-102 | AC-HTTPX-102-3 | Proxy credentials (user and password in the proxy URL) are never written to log output. | 1 | 0 | no tests |
| FEAT-HTTPX-02 | ST-HTTPX-201 | AC-HTTPX-201-1 | Query parameters encode spaces as `+` (form encoding). | 1 | 0 | no tests |
| FEAT-HTTPX-02 | ST-HTTPX-201 | AC-HTTPX-201-2 | A `/` inside a query parameter value is percent-encoded as `%2F`. | 1 | 0 | no tests |
| FEAT-HTTPX-02 | ST-HTTPX-201 | AC-HTTPX-201-3 | The behaviour change is called out in the CHANGELOG under backwards-incompatible changes. | 3 | 0 | no tests |
| FEAT-HTTPX-02 | ST-HTTPX-202 | AC-HTTPX-202-1 | The redirect helpers (`same_origin`, `is_https_redirect`) live in `_client.py` as private functions, and their tests moved next to the client tests. | 1 | 0 | no tests |
| FEAT-HTTPX-02 | ST-HTTPX-202 | AC-HTTPX-202-2 | `httpx/_utils.py` is deleted. | 4 | 0 | no tests |
| FEAT-REQ-01 | ST-REQ-101 | AC-REQ-101-3 | All read-capability checks go through one helper function instead of repeated isinstance checks. | 1 | 0 | no tests |
| FEAT-REQ-01 | ST-REQ-101 | AC-REQ-101-4 | The change is recorded in the HISTORY changelog for the next release. | 3 | 0 | no tests |
| FEAT-REQ-01 | ST-REQ-102 | AC-REQ-102-1 | Header names and values that end in a newline (`\n` or `\r\n`) are rejected as invalid. | 1 | 0 | no tests |
| FEAT-REQ-01 | ST-REQ-102 | AC-REQ-102-2 | A Content-Type header whose parameter has no `=` (for example `text/html; charset`) falls back to the default encoding instead of producing a bogus charset. | 1 | 0 | no tests |
| FEAT-REQ-01 | ST-REQ-102 | AC-REQ-102-3 | Request URLs whose path starts with `//` keep both slashes when sent. | 1 | 0 | no tests |
| FEAT-REQ-01 | ST-REQ-102 | AC-REQ-102-5 | Invalid headers are logged at WARNING level, with the header name, before the request is rejected. | 1 | 0 | no tests |
| FEAT-REQ-02 | ST-REQ-201 | AC-REQ-201-1 | `Request.hooks` has a type annotation. | 1 | 0 | no tests |
| FEAT-REQ-02 | ST-REQ-201 | AC-REQ-201-2 | CI runs a type checker on every pull request. | 1 | 0 | no tests |
| FEAT-REQ-02 | ST-REQ-201 | AC-REQ-201-3 | The package passes Pyright in strict mode with zero errors. | 1 | 0 | no tests |
| FEAT-REQ-02 | ST-REQ-202 | AC-REQ-202-1 | `Request.headers` is typed as a read-only `Mapping[str, str | bytes]`. | 2 | 0 | no tests |
| FEAT-REQ-02 | ST-REQ-202 | AC-REQ-202-2 | `Response.reason` is typed as `str`. | 1 | 0 | no tests |
| FEAT-REQ-02 | ST-REQ-202 | AC-REQ-202-3 | A runtime check raises `TypeError` when headers are passed as a list of tuples. | 1 | 0 | no tests |
| FEAT-REQ-02 | ST-REQ-203 | AC-REQ-203-1 | DigestAuth works on FIPS-enabled systems by passing `usedforsecurity=False` to every hashlib call it makes. | 1 | 0 | no tests |
| FEAT-REQ-02 | ST-REQ-203 | AC-REQ-203-2 | `no_proxy` entries with a leading dot (for example `.example.com`) match the domain itself as well as its subdomains. | 1 | 0 | no tests |
| FEAT-REQ-02 | ST-REQ-203 | AC-REQ-203-3 | DigestAuth supports the SHA-512-256 algorithm. | 1 | 0 | no tests |