Ten queries that answer "what needs attention", and an expiry nobody was told about

Contribution Date
Contribution Project
Contribution Details
Ten queries that answer "what needs attention", and an expiry nobody was told about The worklists are the cheapest real value left on Q.20: every one is SQL over data damrs already holds, so there is no table, no queue and no state to fall out of date. An asset leaves a list the moment somebody fixes the thing. Read, not Manage. The person who files an uncategorised asset is whoever can edit it, and gating the finding behind a permission the fixing does not need is how a backlog becomes one person's job. Not in the query IR, deliberately. Six of the ten could be search clauses and it would be the wrong place: "a required field of this asset's resolved metadata type is absent" is a three-way join with a fallback chain, and putting it in the IR would put it in saved searches, asset-group predicates and the MCP surface too. Administration stays administration. Every count runs through the caller's predicate, so two readers legitimately see different numbers. That is §7's disclosure rule arriving as a usability bug: a to-do list that counts work its reader cannot see sends them to an asset that 404s. Ten scalar subqueries in one statement, so the numbers describe one instant — "12 uncategorised" beside "12 missing metadata" otherwise invites the reading that they are the same twelve, and two snapshots would make that unknowable. Running it against the real library found the thing no test would have. The grid badged three assets "Expiring" while the worklist named after expiry reported zero. RightsState::Expiring comes from licence term dates with a per-licence notice window — sixty days by default, longer where a contract says so — and assets.expires_at is a retention date somebody set on the file. Two different questions, and the one I had built ignored the contracts. Fixed by reading assets.rights_state, the same column the badge renders, so the two cannot disagree; rights-denied joins it for the same reason. Both expiry lists now say which column they read. no-licence is not urgent, and that is also from the real library: it read 180 of 182 and outlined the whole page in red. Every asset arrives unlicensed, so a badge firing on every row from day one is background rather than a signal. Urgent marks a change — a contract running out, a use that became forbidden — not an absence that was always there. The tests caught one more: an archived asset still appeared as filing work, which is two answers to "has this been dealt with". Every list is now scoped to status = 'active' in one place, so an eleventh cannot forget it. assets::page grows a shared page_narrowed rather than a third pager, because the summary shape is exactly what a screen breaks on when two copies drift — and these two had drifted once already. 12 db cases, 6 API cases, 10 browser cases including axe. Verified against the running stack: every count cross-checked by hand against SQL, and the three "Licence coverage ending" assets each carry the matching badge in the grid the list opens into.
Contribution Author
Bassam Ismail
Files count
0
Patches count
1