Skip to content

feat(console): evidence waivers on keyset paging, no count pills (LST-6) - #7529

Merged
mergify[bot] merged 6 commits into
devfrom
feat/lst-6-evidence-and-waivers-waivers-on-ke
Nov 25, 2026
Merged

mergify[bot] merged 6 commits into
devfrom
feat/lst-6-evidence-and-waivers-waivers-on-ke

Conversation

@bobikenobi12

Copy link
Copy Markdown
Collaborator

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 raw CountPill. Waiver 101 and every later one could not be reached, on a compliance record.

What changed

  • Server. New 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 than limit (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.
  • In-force check moved into SQL. waiverInForce is a CASE over pg_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: the waived status facet, the drawer's per-environment list and activeWaivers.
  • Panel (evidence-waivers.tsx). It now uses useKeysetList(orpc.evidence.waivers) with ListFooter. The pill, the truncation notice and the page numbers are gone. It shows a skeleton while the first page loads, a RegionError if the first page fails, a "Couldn't refresh" notice if a refresh fails while rows are on screen, and the existing empty state.
  • Posture table. The "Environments" SectionHeading no longer shows a count, and the skeleton no longer has a pill placeholder. The table is still unpaged on purpose; that is recorded as a bounded decision.
  • Ledger. evidence-waivers.json is deleted. evidence.json is now a bounded decision that names the server-side bound: the reader's visible environments of the org.

Decisions to review

  • No filter bar or facets on the waivers list. It never had a bar, and the issue does not ask for one. Its facets is null on every page, and universeEmpty comes 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.
  • No route prefetch of the waivers' first page. The panel loads from the browser after the posture table hydrates. Prefetching it with prefetchInfiniteQuery would mean changing tests/app/evidence-page-prefetch.test.tsx, which is outside this issue's scope. It is a small follow-up if wanted.
  • Scope widened (noted on the issue) to two test files:

Tests

  • tests/lib/queries/evidence-page.test.ts (recording db stub) checks:
    • one rows query, limit + 1, and the sort order;
    • a full page whose rows all share one timestamp, where the cursor must be the last kept row's (instant, id);
    • a later page carries the row-value cursor condition;
    • the first page reports universeEmpty and later pages report null; facets is null on every page;
    • the scope conditions are present.
  • tests/components/evidence/evidence-url-and-waivers.test.tsx walks 130 waivers through the real keyset contract, three per instant, so page boundaries fall inside ties. It checks:
    • waiver 101 and the last waiver are reachable, every row appears exactly once and in order, and nothing is shown at the end;
    • there is no pill, notice or page numbers;
    • a failed later page keeps its rows and can be retried;
    • the empty state, and a failed first page showing the region error with a working retry.
  • tests/integration/evidence-waivers-page.test.ts (real Postgres, CI only) checks:
    • walking all pages returns all 131 waivers once, with ties a few microseconds apart inside one millisecond;
    • the SQL in-force verdict for no expiry, a future expiry, a past expiry and an expiry that does not parse;
    • the roll-up holds only in-force waivers;
    • another org's waiver and one on a hidden project are excluded;
    • an empty scope gives the empty first page.
  • Updated evidence-client-states and evidence-table-columns so they serve the panel's own read.

Verification

  • Run locally and passing:
    • vitest --maxWorkers=1 over tests/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.tsx and tests/lib/rpc/route.test.ts: 90 tests;
    • console tsc --noEmit: clean;
    • eslint on the touched files: no errors (the only warnings are ones already in rpc-tenancy.shared.ts);
    • pnpm check:filter-standard and its --self-test;
    • pnpm check:shared-surface.
  • Not run locally: the integration tests (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.

@mergify

mergify Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Merge Protections

🟢 All 2 merge protections satisfied — ready to merge.

Show 2 satisfied protections

🟢 dev required CI

  • check-success=CI required
  • check-success=contribution-legal

🟢 🚦 Auto-queue

When all merge protections are satisfied and these conditions match, this pull request will be queued automatically.

  • #review-threads-unresolved = 0
  • -draft
  • base = dev

@mergify

mergify Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

🚫 Left the queue · queue conditions no longer match

1 h 16 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Tue 24 Nov, 18:55 · rule dev · triggered by merge protections
  • 🚫 Left the queue 20:11 · f5ff33d

Reason

Pull request #7529 has been dequeued

Queue conditions are not satisfied:

  • -draft [📌 queue requirement]
  • all of: [🚦 Auto-merge conditions]
    • -draft
  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue rule dev]
      • -draft

To get back in the queue

  • Push a change if one is needed: the pull request is queued again once its queue conditions match.
  • If no change is needed, tick the box below to queue it again as it is.

Requeue requested — the merge queue status continues in this comment ↓.

Times in UTC · dashboard · how the merge queue works

@bobikenobi12
bobikenobi12 marked this pull request as draft November 24, 2026 20:10
@bobikenobi12

Copy link
Copy Markdown
Collaborator Author

Parked as a draft on purpose (not a problem with this PR): every merge-queue batch fails on dev-side breakage, the required Provisioning E2E (B6, fixed by #7567) and the type-check heap (#7538). Clearing the queue so those two land first. This goes back to ready as soon as they are on dev.

@mergify mergify Bot added dequeued and removed queued labels Nov 24, 2026
@bobikenobi12
bobikenobi12 marked this pull request as ready for review November 24, 2026 22:07
@mergify mergify Bot added the queued label Nov 24, 2026
@mergify

mergify Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

🚫 Left the queue · conflict with base branch

1 h 38 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Tue 24 Nov, 22:11 · rule dev · triggered by merge protections
  • 🚫 Left the queue 23:49 · f5ff33d

Reason

The pull request conflicts with dev

Conflicting files: apps/console/docs/ui-conformance/scoreboard.md, apps/console/ui-conformance-baseline.json

Before this, the pull request was held in the queue behind 2 pull requests ahead of it.

To get back in the queue

  • You should update or rebase your pull request. A pull request in a stack is updated by rebasing the stack onto the branch it conflicts with. A pull request queued by a rule comes back to the queue once updated, as long as the rule still matches.
  • If it was queued with a command, update it, then tick the box below to queue it again.

Requeue requested — the merge queue status continues in this comment ↓.

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot removed the dequeued label Nov 24, 2026
@bobikenobi12
bobikenobi12 force-pushed the feat/lst-6-evidence-and-waivers-waivers-on-ke branch from f5ff33d to 41bbc1a Compare November 24, 2026 23:50
@mergify mergify Bot added queued and removed queued labels Nov 24, 2026
@mergify

mergify Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

🚫 Left the queue · queue conditions no longer match

2 h 26 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Wed 25 Nov, 00:27 · rule dev · triggered by merge protections
  • 🚫 Left the queue 02:54 · 41bbc1a

Reason

Pull request #7529 has been dequeued

Queue conditions are not satisfied:

  • -conflict [📌 queue requirement]

To get back in the queue

  • Push a change if one is needed: the pull request is queued again once its queue conditions match.
  • If no change is needed, tick the box below to queue it again as it is.

Requeue requested — the merge queue status continues in this comment ↓.

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot added dequeued and removed queued labels Nov 25, 2026
@bobikenobi12
bobikenobi12 force-pushed the feat/lst-6-evidence-and-waivers-waivers-on-ke branch from 41bbc1a to 4d79bdb Compare November 25, 2026 04:00
@mergify mergify Bot added queued and removed dequeued labels Nov 25, 2026
@mergify

mergify Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

🚫 Left the queue · queue conditions no longer match

1 h 24 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Wed 25 Nov, 05:19 · rule dev · triggered by merge protections
  • 🚫 Left the queue 06:43 · 4d79bdb

Reason

Pull request #7529 has been dequeued

Queue conditions are not satisfied:

  • -conflict [📌 queue requirement]

To get back in the queue

  • Push a change if one is needed: the pull request is queued again once its queue conditions match.
  • If no change is needed, tick the box below to queue it again as it is.

Requeue requested — the merge queue status continues in this comment ↓.

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot removed the queued label Nov 25, 2026
@mergify mergify Bot added the dequeued label Nov 25, 2026
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
@bobikenobi12
bobikenobi12 force-pushed the feat/lst-6-evidence-and-waivers-waivers-on-ke branch from 4d79bdb to 49745a7 Compare November 25, 2026 06:44
@mergify mergify Bot added queued and removed dequeued labels Nov 25, 2026
@mergify

mergify Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

✅ Merged into dev as 47e55d9 at 10:03 UTC

Merged together with #7613. 2 h 16 min in the queue, 1 h 14 min of it CI.

So far

6 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub repository ruleset rule protect-dev
  • check-success=CI required · required by Merge Protections rule dev required CI
  • check-success=contribution-legal · required by Merge Protections rule dev required CI
  • github-review-approved · required by GitHub repository ruleset rule protect-dev
  • any of · required by GitHub repository ruleset rule protect-dev:
    • check-success = contribution-legal
    • check-neutral = contribution-legal
    • check-skipped = contribution-legal
  • any of · required by GitHub repository ruleset rule protect-dev:
    • check-success = CI required
    • check-neutral = CI required
    • check-skipped = CI required

Times in UTC · dashboard · how the merge queue works

@mergify
mergify Bot merged commit 47e55d9 into dev Nov 25, 2026
42 checks passed
@mergify
mergify Bot deleted the feat/lst-6-evidence-and-waivers-waivers-on-ke branch November 25, 2026 10:03
@mergify mergify Bot removed the queued label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant