Skip to content

test(nova): address Nexus review of QA.4 PII → decision-log spec (GOV-593)#15

Merged
Shaivpidadi merged 2 commits intodevfrom
feat/nova-gov-593-pii-spec-review-fixes
Apr 24, 2026
Merged

test(nova): address Nexus review of QA.4 PII → decision-log spec (GOV-593)#15
Shaivpidadi merged 2 commits intodevfrom
feat/nova-gov-593-pii-spec-review-fixes

Conversation

@Shaivpidadi
Copy link
Copy Markdown
Member

Summary

Addresses the three blocking items in Nexus's review of GOV-593:

  1. Tautological correlation-id assertionpii-decision-log.spec.ts now fails loudly if /api/chat doesn't carry x-correlation-id/x-request-id, and the find predicate matches strictly on that id. No more "any redact/transform row in the log" fallback.
  2. Copy-paste duplication — removed the QA.4-2 second test in governed-chat.spec.ts that asserted the same PII → dashboard-decision flow. pii-decision-log.spec.ts is now the sole owner; the QA.4-2 describe keeps only the chat-UI assertion (Redact badge + Redacted tile).
  3. Warmup attempts — bumped the .github/workflows/e2e.yml warmup loop from 10 to 20 attempts (300s cap per service) so Render free-tier cold-start worst case fits.

Also handled the two non-blocking notes:

  • Wrapped /api/v1/decisions lookup in expect.poll to tolerate async ingestion lag.
  • Scoped the dashboard decision-row assertion to getByRole('row') so it doesn't match filter labels / legend chips.

Test plan

  • pnpm tsc --noEmit clean (done locally)
  • E2E workflow dispatched on this branch passes warmup for chat / keycloak / precheck
  • pii-decision-log.spec.ts runs and asserts the dashboard row by correlation id
  • Green run link pasted into GOV-593 before flipping to approved

Refs: GOV-593, GOV-592 (warmup change builds on PR #12)

…-593)

Three fixes from the Nexus review on GOV-593:

1. Require x-correlation-id on the chat response and match strictly on it
   (`pii-decision-log.spec.ts`). The previous `hasCorr = correlationId ?
   ... : true` made the match predicate reduce to "any redact/transform
   decision in the log" when no correlation id was present — a stale
   row from a prior run would satisfy it. Now the test fails loudly if
   the header is missing, and the find predicate requires an exact
   match on correlationId.

2. Remove the duplicate QA.4-2 dashboard-assertion test from
   `governed-chat.spec.ts`. The PII prompt → /api/v1/decisions flow is
   now owned only by `pii-decision-log.spec.ts`; the QA.4-2 describe
   block keeps just the chat-UI side (Redact badge + Redacted tile) so
   the two specs don't duplicate the same assertion.

3. Bump the warmup loop in `.github/workflows/e2e.yml` from 10 to 20
   attempts (20 × 15s = 300s), so the Render free-tier chat / keycloak
   / precheck services have more headroom to exit cold-start before
   Playwright starts. Recent dev runs were failing with
   "chat failed to wake up after 10 attempts" well before the spec
   itself ran.

Also addressed the two non-blocking notes while touching the file:

- Use `expect.poll` on `/api/v1/decisions` so the assertion tolerates
  ingestion lag (decision may not be in the read model yet when the
  chat response returns).
- Scope the dashboard decision-row assertion to `getByRole('row')` so
  it can't match filter labels or legend text.

GOV-593
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat-agent-example Ready Ready Preview, Comment Apr 24, 2026 5:46am

20 × 15s = 300s was still failing on dev runs — the failure mode was
not cold-start latency but curl -f flagging a non-2xx/3xx response
from the chat app. Using -f made warmup flap whenever the container
was warm but /login returned, say, 4xx (e.g. middleware redirect back
to an error state) or the Render edge served a branded error page.

Switch to capturing the HTTP status with curl -w "%{http_code}" and
treating anything except connection failure (000) or 5xx (502/503/504,
Render's cold-start error codes) as "service is awake". This matches
what we actually care about in warmup — container has exited cold-start
— and defers "is the app serving the expected page?" to the Playwright
suite, which has the right assertions for it.

Also switch chat warmup to "/" (always served by the app root) instead
of "/login" so a route-level regression in the login page doesn't fail
warmup.

Refs: GOV-593 review (Nexus). Prior run 24874040921 failed with 20x
"chat waiting..." against /login; this unblocks the spec from actually
running against staging.
@Shaivpidadi Shaivpidadi merged commit 1bbf398 into dev Apr 24, 2026
4 of 5 checks passed
@Shaivpidadi Shaivpidadi deleted the feat/nova-gov-593-pii-spec-review-fixes branch April 24, 2026 06:08
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