Repository navigation
feat(console): evidence waivers on keyset paging, no count pills (LST-6) - #7529
Conversation
Merge Protections🟢 All 2 merge protections satisfied — ready to merge. Show 2 satisfied protections🟢 dev required CI
🟢 🚦 Auto-queueWhen all merge protections are satisfied and these conditions match, this pull request will be queued automatically.
|
b546ef0 to
b90277f
Compare
b90277f to
f5ff33d
Compare
🚫 Left the queue · queue conditions no longer match1 h 16 min in the queue, with no time running CI. So far
Reason Pull request #7529 has been dequeued Queue conditions are not satisfied:
To get back in the queue
Requeue requested — the merge queue status continues in this comment ↓. Times in UTC · dashboard · how the merge queue works |
🚫 Left the queue · conflict with base branch1 h 38 min in the queue, with no time running CI. So far
Reason The pull request conflicts with Conflicting files: Before this, the pull request was held in the queue behind 2 pull requests ahead of it. To get back in the queue
Requeue requested — the merge queue status continues in this comment ↓. Times in UTC · dashboard · how the merge queue works |
f5ff33d to
41bbc1a
Compare
🚫 Left the queue · queue conditions no longer match2 h 26 min in the queue, with no time running CI. So far
Reason Pull request #7529 has been dequeued Queue conditions are not satisfied:
To get back in the queue
Requeue requested — the merge queue status continues in this comment ↓. Times in UTC · dashboard · how the merge queue works |
41bbc1a to
4d79bdb
Compare
🚫 Left the queue · queue conditions no longer match1 h 24 min in the queue, with no time running CI. So far
Reason Pull request #7529 has been dequeued Queue conditions are not satisfied:
To get back in the queue
Requeue requested — the merge queue status continues in this comment ↓. Times in UTC · dashboard · how the merge queue works |
The recorded-waivers log rode inside the evidence roll-up behind `.limit(100)` and was paged in the browser with a client `.slice`, so waiver 101 and later were unreachable on a compliance record. - `queryEvidenceWaiversPage` (lib/queries/evidence.ts): a keyset builder on the shared codec, ordered by the ms-truncated recorded time then the job id, reading limit + 1, no cap. New read procedure `evidence.waivers`. - The in-force verdict is decided in SQL (`waiverInForce`, a CASE over `pg_input_is_valid`, so an unparseable expiry reads as expired, not as an error). The roll-up now reads only the in-force waivers, uncapped, which is all the posture needs (the waived facet, drawer, counter). - evidence-waivers.tsx: `useKeysetList` + `ListFooter`; no CountPill, no "Showing the 100 most recent", no page numbers; region error, refresh notice and empty state. - evidence-client.tsx: the Environments heading loses its count; the skeleton loses the pill placeholder. - Ledger: evidence-waivers.json deleted; evidence.json is the `bounded` decision for the one-row-per-environment roll-up. - Tests: builder unit test (limit + 1, cursor of the last kept row under ties, later-page predicate, universeEmpty), panel walk to row 130 with ties across boundaries, footer failure/retry, empty and first-page error, a real-Postgres integration test, and a tenancy fixture for the new procedure. Closes #7488
4d79bdb to
49745a7
Compare
✅ Merged into
|
Part of epic #7481. Closes #7488
What was wrong
The recorded-waivers log came back inside the evidence roll-up, cut off at
.limit(100). The panel then split those rows into pages in the browser with.slice, under "Page N of M", a "Showing the 100 most recent" notice and a rawCountPill. Waiver 101 and every later one could not be reached, on a compliance record.What changed
queryEvidenceWaiversPage(lib/queries/evidence.ts) on the shared keyset codec. It sorts by the recorded time cut to the millisecond, then by job id, both descending. It reads one row more thanlimit(limit + 1) and has no cap. It is served by a new read procedure,evidence.waivers, which uses the same visibility rule as the roll-up: visible projects, plus org-level waivers.waiverInForceis aCASEoverpg_input_is_valid(…, 'timestamptz'). An expiry that does not parse counts as expired and does not fail the query; the old JS check also treated it as expired. All deployments run Postgres 17. The roll-up now reads only the in-force waivers, with no cap. That covers everything the posture view uses them for: thewaivedstatus facet, the drawer's per-environment list andactiveWaivers.evidence-waivers.tsx). It now usesuseKeysetList(orpc.evidence.waivers)withListFooter. The pill, the truncation notice and the page numbers are gone. It shows a skeleton while the first page loads, aRegionErrorif the first page fails, a "Couldn't refresh" notice if a refresh fails while rows are on screen, and the existing empty state.SectionHeadingno longer shows a count, and the skeleton no longer has a pill placeholder. The table is still unpaged on purpose; that is recorded as aboundeddecision.evidence-waivers.jsonis deleted.evidence.jsonis now aboundeddecision that names the server-side bound: the reader's visible environments of the org.Decisions to review
facetsisnullon every page, anduniverseEmptycomes from the first page itself (no filters means an empty first page is an empty scope). A status filter (active / expired) would be a new filter surface with F1–F7 work and its own issue.prefetchInfiniteQuerywould mean changingtests/app/evidence-page-prefetch.test.tsx, which is outside this issue's scope. It is a small follow-up if wanted.tests/integration/evidence-waivers-page.test.ts.tests/integration/rpc-tenancy.shared.ts. Every router procedure needs a tenancy fixture, and the seededjobX/jobYnow carry an org-level override so the fixture has something to find. feat(console): AGT-L2 server seams — approvals list, decision reason, policy re-check, org:manage_agents, consent grants, token auto-approve (AGT-L2-S) #7512 also edits this file, in other places.Tests
tests/lib/queries/evidence-page.test.ts(recording db stub) checks:limit + 1, and the sort order;universeEmptyand later pages reportnull;facetsis null on every page;tests/components/evidence/evidence-url-and-waivers.test.tsxwalks 130 waivers through the real keyset contract, three per instant, so page boundaries fall inside ties. It checks:tests/integration/evidence-waivers-page.test.ts(real Postgres, CI only) checks:evidence-client-statesandevidence-table-columnsso they serve the panel's own read.Verification
vitest --maxWorkers=1overtests/components/evidence/,tests/lib/queries/evidence-page.test.ts,tests/lib/query/url-search-lands-at-once.test.tsx,tests/app/evidence-page-prefetch.test.tsxandtests/lib/rpc/route.test.ts: 90 tests;tsc --noEmit: clean;rpc-tenancy.shared.ts);pnpm check:filter-standardand its--self-test;pnpm check:shared-surface.evidence-waivers-page, the rpc-tenancy suite,evidence-query,evidence-visibility), because there is no database on this Mac and they run in CI. I have also not seen the panel in a browser; no sandbox env was used.Estimate 1.5 lane-days. Actual: about 0.2 lane-days.