Work catalog
Reviews and Approval Queue share one folder browser over review_index. Flags and unread state are personal touch data.
Queries and folders
/reviews passes queue=false; /approval-queue passes
true and requires a supervisor, manager, or PEC. Queue state rules live in
query.ts. Examiners browse FFY/month; other roles also browse examiner. SQL
applies role scope, selected branch, category, sort, and page.
A cold query returns rows, total count, and grouped branches. Later paging can reuse
cached branches with includeBranches=false. Manual and five-minute refreshes
rebuild them. Selection is component state rather than a shareable folder URL. Current
rows include separate UUID, fiscal year, and display review number.
Flags and unread
PATCH /api/catalog/flag accepts { reviewKey, flagged }. Its
INSERT/UPDATE is scoped in SQL. Flag state belongs to the saving staff ID, not all
viewers. A flag-only touch uses the Unix epoch so it does not count as recently worked.
Unread means coalesce(read_version, -1) < review_index.version. Opening or
saving raises the actor’s read version. Another save can make that row unread again.
Neither a flag change nor a normal open creates a snapshot version.
Changing catalog behavior
Keep page and branch filters consistent and test shrinking pages, cached branches, and actor switches. Add a list field to the response deliberately; the catalog does not fetch review bodies. SQL uses the stored fiscal_year column for year grouping after migration 0007.