Skip to content

chore: merge design-audit remediation to main#789

Closed
BigSimmo wants to merge 6 commits into
mainfrom
codex/design-audit-safe-to-main
Closed

chore: merge design-audit remediation to main#789
BigSimmo wants to merge 6 commits into
mainfrom
codex/design-audit-safe-to-main

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Completes the repository-wide design and accessibility remediation follow-up and updates route-aware site-map generation for current app behavior.
  • Restores Playwright reduced-motion override compatibility with this project’s Playwright version.

Verification

  • npm run lint
  • npm run test -- tests/site-map.test.ts tests/supabase-schema.test.ts
  • Verification not run: npm run typecheck failed in this environment due V8 heap OOM unless Node memory is increased for local execution.
  • Build failure noted: npm run build hits a Next.js ERR_INVALID_ARG_TYPE in this local checkout and should be validated through CI.
  • UI verification not run: provider/browser harness not launched in this environment.

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed

Risk and rollout

  • Risk: medium. This PR affects UI surface behavior, route-query handling, and clinical retrieval/query tests; regressions may impact user interaction or schema expectations.
  • Rollback: revert this PR and restore the previous main if any functional regressions are observed.

Summary by CodeRabbit

  • New Features
    • Added expandable service comparison, checklist, and source-confidence details.
    • Added clearer Forms home source-status guidance and updated registry session messaging.
    • Improved clinical search spelling correction and registry-document cleanup/indexing.
  • Bug Fixes
    • Improved mode-menu dismissal and selection behavior.
    • Updated dashboard labeling to “Clinical KB.”
    • Refined mobile search dock behavior and service-detail interactions.
  • Documentation
    • Expanded API route, site-map, and database schema documentation.

@supabase

supabase Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy due to reaching the limit of concurrent preview branches.
Go to Project Integrations Settings ↗︎ if you wish to update this limit.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@BigSimmo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 010fc6e8-61e4-4beb-88ce-8674a0a457dd

📥 Commits

Reviewing files that changed from the base of the PR and between 349b46c and 67c3ab1.

📒 Files selected for processing (26)
  • docs/codebase-index.md
  • docs/site-map.md
  • playwright.config.ts
  • scripts/check-github-action-pins.mjs
  • scripts/generate-site-map.ts
  • src/app/layout.tsx
  • src/components/clinical-dashboard/master-search-header.tsx
  • src/components/forms/forms-home-page.tsx
  • src/components/services/services-navigator-page.tsx
  • src/lib/rag-candidate-sources.ts
  • src/lib/rag.ts
  • supabase/drift-manifest.json
  • supabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sql
  • supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql
  • supabase/migrations/20260717010000_harden_rag_scalability_patch.sql
  • supabase/schema.sql
  • tests/audit-content-services-regressions.test.ts
  • tests/audit-navigation-auth-regressions.test.ts
  • tests/rag-abort-signal.test.ts
  • tests/rag-classifier-memo.test.ts
  • tests/rag-variant-early-exit.test.ts
  • tests/site-map.test.ts
  • tests/supabase-schema.test.ts
  • tests/ui-accessibility.spec.ts
  • tests/ui-smoke.spec.ts
  • tests/ui-tools.spec.ts
📝 Walkthrough

Walkthrough

The changes expand sitemap discovery and documentation, remove abort-signal propagation from RAG retrieval, add Supabase cleanup and query-correction indexing, update service/forms UI behavior, and revise regression, accessibility, Playwright, and workflow-discovery tests.

Changes

Route discovery and documentation

Layer / File(s) Summary
Route discovery and sitemap rendering
scripts/generate-site-map.ts
Separates page, public handler, and API routes and updates generated sitemap sections and redirects.
Route and schema documentation
docs/codebase-index.md, docs/site-map.md, tests/site-map.test.ts
Expands route and schema inventories and validates public-handler placement and redirect targets.

RAG retrieval and database hardening

Layer / File(s) Summary
RAG retrieval contracts and orchestration
src/lib/rag-candidate-sources.ts, src/lib/rag.ts
Removes abort-signal query plumbing, updates classifier options, and changes visual-evidence attachment.
RAG schema and migrations
supabase/migrations/*, supabase/schema.sql
Adds registry cleanup, title-word synchronization, clinical query correction, and trigram indexes.
Schema validation
supabase/drift-manifest.json, tests/supabase-schema.test.ts
Updates drift metadata and validates migration lifecycle, security, correction, and index behavior.
RAG test contracts
tests/rag-abort-signal.test.ts, tests/rag-classifier-memo.test.ts
Updates tests for direct RPC calls, pre-aborted signals, and shared classifier requests.

Dashboard and mode UI

Layer / File(s) Summary
Service selection and RightRail interaction
src/components/services/services-navigator-page.tsx
Adds expandable checklist, confidence, and comparison panels with updated selection handling and accessibility attributes.
Dashboard mode and forms presentation
src/app/layout.tsx, src/components/clinical-dashboard/master-search-header.tsx, src/components/forms/forms-home-page.tsx
Updates menu dismissal, forms task cards, registry notice content, and layout imports.
UI regression and accessibility coverage
tests/audit-*-regressions.test.ts, tests/ui-*.spec.ts
Revises source-status, heading, forms, dock, polling, and service-detail assertions.

Test and repository tooling

Layer / File(s) Summary
Playwright and workflow discovery
playwright.config.ts, scripts/check-github-action-pins.mjs
Overrides Chromium motion preferences and safely discovers workflow YAML files.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.13% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately reflects the PR as a broad remediation merge to main.
Description check ✅ Passed The description follows the required template with summary, verification, risk, and governance details; only the Notes section is omitted.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/design-audit-safe-to-main

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

CI triage

CI failed on this PR. Automated classification of the 3 failed job(s):

  • Unit coverageneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • Production UIneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #3107 (cancelled).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

@BigSimmo
BigSimmo force-pushed the codex/design-audit-safe-to-main branch 2 times, most recently from b501653 to e4a9256 Compare July 17, 2026 20:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
supabase/drift-manifest.json (1)

6331-6334: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Restore documents_sync_title_words in the replayed schema.

The manifest omits this trigger despite the migration/schema contract requiring it. Without it, title or indexing-status changes leave document_title_words stale. Fix the replay and assert trigger presence in the manifest, rather than only checking SQL text.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@supabase/drift-manifest.json` around lines 6331 - 6334, Restore the
documents_sync_title_words trigger in the replayed schema manifest alongside
documents_updated_at, using the migration-defined trigger configuration for
public.documents. Update manifest validation to assert this trigger’s presence
by name, not merely by matching SQL text, so title and indexing-status updates
continue synchronizing document_title_words.
src/lib/rag.ts (1)

2593-2593: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Remove the stale chunkLoadCache references.

The request-local cache initialization was removed, but these three calls still reference the now-undeclared variable, causing typecheck failure.

Proposed fix
       telemetry,
-      cache: chunkLoadCache,
@@
         telemetry,
-        cache: chunkLoadCache,
@@
         telemetry,
-        cache: chunkLoadCache,

Also applies to: 2780-2780, 2796-2796

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/rag.ts` at line 2593, Remove the stale chunkLoadCache argument
references from the three affected calls in the relevant RAG flow, including the
calls near the visible cache option and the two additional locations. Keep the
remaining call arguments and behavior unchanged, and ensure no undeclared
chunkLoadCache references remain.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/services/services-navigator-page.tsx`:
- Around line 496-501: Update the “Open” Link in the services navigator card
rendering so its accessible name includes the associated service name, while
preserving the visible “Open” text and existing service-specific href. Use the
service object’s existing identifying name/title field in the link’s aria-label
or equivalent accessible-name attribute.

In `@src/lib/rag.ts`:
- Line 2410: Preserve cancellation signals across retrieval fan-out: in
src/lib/rag.ts lines 1547-1554 and 2410-2410, pass args.signal to
fetchRelatedDocumentMetadata and fetchEnabledRagAliases; in
src/lib/rag-candidate-sources.ts lines 79-92, add a signal parameter to
callVersionedRetrievalRpc and forward it to every rpc call.

In `@tests/audit-content-services-regressions.test.ts`:
- Around line 209-217: Update the source-link assertions in the form-detail
regression test to match the actual implementation in form-detail-page.tsx, or
implement the expected conditional status there. Ensure the test validates the
rendered source-link structure and the correct available/unavailable behavior
without requiring a ternary that is absent from the implementation.

In `@tests/audit-navigation-auth-regressions.test.ts`:
- Around line 126-128: Update the rendered H1 in ClinicalDashboard so the root
dashboard exposes the accessible “Clinical KB” heading, then align
tests/audit-navigation-auth-regressions.test.ts:126-128,
tests/ui-accessibility.spec.ts:51, tests/ui-smoke.spec.ts:870, and
tests/ui-smoke.spec.ts:1265 with that production markup; retain the online and
offline heading expectations after the component fix.

In `@tests/site-map.test.ts`:
- Line 61: Remove the loop iterating over data.appRouteHandlers in the site-map
test, since SiteMapData no longer exposes that property and publicRouteHandlers
is already covered.
- Around line 94-95: Move the three handler assertions from the product/API
section checks to assertions against the Redirects section in the site-map test.
Update the expectations around productSection and apiSection so these routes are
validated as present in redirects, while preserving the existing route-specific
assertions.

---

Outside diff comments:
In `@src/lib/rag.ts`:
- Line 2593: Remove the stale chunkLoadCache argument references from the three
affected calls in the relevant RAG flow, including the calls near the visible
cache option and the two additional locations. Keep the remaining call arguments
and behavior unchanged, and ensure no undeclared chunkLoadCache references
remain.

In `@supabase/drift-manifest.json`:
- Around line 6331-6334: Restore the documents_sync_title_words trigger in the
replayed schema manifest alongside documents_updated_at, using the
migration-defined trigger configuration for public.documents. Update manifest
validation to assert this trigger’s presence by name, not merely by matching SQL
text, so title and indexing-status updates continue synchronizing
document_title_words.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cbfcde42-b767-4502-8a5e-47a168a5008b

📥 Commits

Reviewing files that changed from the base of the PR and between 3fe441a and 9aa0f6d.

📒 Files selected for processing (24)
  • docs/codebase-index.md
  • docs/site-map.md
  • playwright.config.ts
  • scripts/check-github-action-pins.mjs
  • scripts/generate-site-map.ts
  • src/app/layout.tsx
  • src/app/page.tsx
  • src/components/clinical-dashboard/master-search-header.tsx
  • src/components/forms/forms-home-page.tsx
  • src/components/services/services-navigator-page.tsx
  • src/lib/rag-candidate-sources.ts
  • src/lib/rag.ts
  • supabase/drift-manifest.json
  • supabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sql
  • supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql
  • supabase/migrations/20260717010000_harden_rag_scalability_patch.sql
  • supabase/schema.sql
  • tests/audit-content-services-regressions.test.ts
  • tests/audit-navigation-auth-regressions.test.ts
  • tests/site-map.test.ts
  • tests/supabase-schema.test.ts
  • tests/ui-accessibility.spec.ts
  • tests/ui-smoke.spec.ts
  • tests/ui-tools.spec.ts
💤 Files with no reviewable changes (2)
  • src/app/layout.tsx
  • src/app/page.tsx

Comment thread src/components/services/services-navigator-page.tsx
Comment thread src/lib/rag.ts
if (queryAnalysis.corpusGrounding) telemetry.corpus_grounding = queryAnalysis.corpusGrounding;

const ragAliases = await fetchEnabledRagAliases(supabase, args.ownerId, args.accessScope, args.signal);
const ragAliases = await fetchEnabledRagAliases(supabase, args.ownerId, args.accessScope);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

rg -n -C3 '\.abortSignal\(' --type ts src
rg -n -C3 'fetchEnabledRagAliases\(|fetchRelatedDocumentMetadata\(|callVersionedRetrievalRpc\(' \
  src/lib/rag.ts src/lib/rag-candidate-sources.ts \
  src/lib/rag-retrieval-variants.ts src/lib/document-enrichment.ts

Repository: BigSimmo/Database

Length of output: 18549


🏁 Script executed:

#!/bin/bash
set -eu

sed -n '110,170p' src/lib/rag-retrieval-variants.ts
printf '\n----\n'
sed -n '730,820p' src/lib/document-enrichment.ts
printf '\n----\n'
sed -n '74,115p' src/lib/rag-candidate-sources.ts
printf '\n----\n'
sed -n '1528,1565p' src/lib/rag.ts
printf '\n----\n'
sed -n '2398,2420p' src/lib/rag.ts

Repository: BigSimmo/Database

Length of output: 10605


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from pathlib import Path
for path, start, end in [
    ("src/lib/rag-retrieval-variants.ts", 110, 170),
    ("src/lib/document-enrichment.ts", 730, 820),
    ("src/lib/rag-candidate-sources.ts", 74, 115),
    ("src/lib/rag.ts", 1528, 1565),
    ("src/lib/rag.ts", 2398, 2420),
]:
    print(f"\n==== {path}:{start}-{end} ====")
    lines = Path(path).read_text().splitlines()
    for i in range(start, min(end, len(lines)) + 1):
        print(f"{i:>5}: {lines[i-1]}")
PY

Repository: BigSimmo/Database

Length of output: 12592


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from pathlib import Path

targets = {
    "src/lib/rag-retrieval-variants.ts": ["fetchEnabledRagAliases", "signal", "abortSignal"],
    "src/lib/document-enrichment.ts": ["fetchRelatedDocumentMetadata", "signal", "abortSignal"],
    "src/lib/rag-candidate-sources.ts": ["callVersionedRetrievalRpc", "signal", "abortSignal"],
}
for path, needles in targets.items():
    print(f"\n==== {path} ====")
    text = Path(path).read_text().splitlines()
    for needle in needles:
        hits = [i+1 for i,l in enumerate(text) if needle in l]
        print(f"{needle}: {hits[:20]}")
PY

Repository: BigSimmo/Database

Length of output: 649


🏁 Script executed:

#!/bin/bash
set -eu

grep -nE 'export async function fetchEnabledRagAliases|export async function fetchRelatedDocumentMetadata|function callVersionedRetrievalRpc|signal\\?: AbortSignal|abortSignal\\(' \
  src/lib/rag-retrieval-variants.ts src/lib/document-enrichment.ts src/lib/rag-candidate-sources.ts src/lib/rag.ts

Repository: BigSimmo/Database

Length of output: 179


🏁 Script executed:

#!/bin/bash
set -eu

sed -n '116,150p' src/lib/rag-retrieval-variants.ts
printf '\n----\n'
sed -n '733,770p' src/lib/document-enrichment.ts

Repository: BigSimmo/Database

Length of output: 3275


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from pathlib import Path

path = Path("src/lib/rag-candidate-sources.ts")
lines = path.read_text().splitlines()

# Print chunks around representative call sites and surrounding function signatures.
anchors = [185, 381, 509, 939, 1006, 1071]
for anchor in anchors:
    start = max(1, anchor - 20)
    end = min(len(lines), anchor + 25)
    print(f"\n==== {path}:{start}-{end} (around line {anchor}) ====")
    for i in range(start, end + 1):
        print(f"{i:>5}: {lines[i-1]}")
PY

Repository: BigSimmo/Database

Length of output: 13814


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from pathlib import Path
import re

path = Path("src/lib/rag-candidate-sources.ts")
text = path.read_text().splitlines()
for name in [
    "fetchCandidateDocumentChunks",
    "fetchCandidateDocuments",
    "fetchCandidateTableFacts",
    "fetchCandidateEmbeddingFieldsHybrid",
    "fetchCandidateIndexUnitsHybrid",
]:
    hits = [i+1 for i, line in enumerate(text) if re.search(rf'\b{name}\b', line)]
    print(name, hits[:10])
PY

Repository: BigSimmo/Database

Length of output: 315


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from pathlib import Path
import re

path = Path("src/lib/rag-candidate-sources.ts")
text = path.read_text().splitlines()

for name in [
    "fetchCandidateDocumentChunks",
    "fetchCandidateDocuments",
    "fetchCandidateTableFacts",
    "fetchCandidateEmbeddingFieldsHybrid",
    "fetchCandidateIndexUnitsHybrid",
]:
    hits = [i+1 for i, line in enumerate(text) if re.search(rf'\b{name}\b', line)]
    print(name, hits[:10])
PY

Repository: BigSimmo/Database

Length of output: 315


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from pathlib import Path
import re

path = Path("src/lib/rag-candidate-sources.ts")
lines = path.read_text().splitlines()

for i, line in enumerate(lines, start=1):
    if re.match(r'export async function (fetchCandidate|loadCandidate|searchCandidate|getCandidate)', line):
        print(f"{i}: {line}")
PY

Repository: BigSimmo/Database

Length of output: 155


🏁 Script executed:

#!/bin/bash
set -eu

ast-grep outline src/lib/rag-candidate-sources.ts --view expanded

Repository: BigSimmo/Database

Length of output: 2453


🏁 Script executed:

#!/bin/bash
set -eu

rg -n 'signal\?: AbortSignal|signal:' src/lib/rag-candidate-sources.ts

Repository: BigSimmo/Database

Length of output: 155


Preserve abort signals in retrieval fan-out.
fetchEnabledRagAliases and fetchRelatedDocumentMetadata already accept AbortSignal, but src/lib/rag.ts drops args.signal when calling them. The shared RPC wrapper in src/lib/rag-candidate-sources.ts also has no abort path, so the downstream versioned/legacy Supabase RPCs keep running after cancellation.

  • src/lib/rag.ts#L1549: pass args.signal to fetchRelatedDocumentMetadata(...).
  • src/lib/rag.ts#L2412: pass args.signal to fetchEnabledRagAliases(...).
  • src/lib/rag-candidate-sources.ts#L79: add signal to callVersionedRetrievalRpc(...) and forward it to each rpc(...) call.
📍 Affects 2 files
  • src/lib/rag.ts#L2410-L2410 (this comment)
  • src/lib/rag.ts#L1547-L1554
  • src/lib/rag-candidate-sources.ts#L79-L92
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/rag.ts` at line 2410, Preserve cancellation signals across retrieval
fan-out: in src/lib/rag.ts lines 1547-1554 and 2410-2410, pass args.signal to
fetchRelatedDocumentMetadata and fetchEnabledRagAliases; in
src/lib/rag-candidate-sources.ts lines 79-92, add a signal parameter to
callVersionedRetrievalRpc and forward it to every rpc call.

Comment thread tests/audit-content-services-regressions.test.ts
Comment thread tests/audit-navigation-auth-regressions.test.ts
Comment thread tests/site-map.test.ts
for (const pageRoute of data.pageRoutes) expectDocumentedRoute(pageRoute.route);
for (const routeHandler of data.publicRouteHandlers) expectDocumentedRoute(routeHandler.route);
for (const apiRoute of data.apiRoutes) expectDocumentedRoute(apiRoute.route);
for (const handler of data.appRouteHandlers) expectDocumentedRoute(handler.route);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Remove the stale appRouteHandlers access.

SiteMapData no longer defines appRouteHandlers, so this test no longer type-checks. publicRouteHandlers is already covered on Line 59.

Proposed fix
-    for (const handler of data.appRouteHandlers) expectDocumentedRoute(handler.route);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for (const handler of data.appRouteHandlers) expectDocumentedRoute(handler.route);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/site-map.test.ts` at line 61, Remove the loop iterating over
data.appRouteHandlers in the site-map test, since SiteMapData no longer exposes
that property and publicRouteHandlers is already covered.

Comment thread tests/site-map.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/generate-site-map.ts (1)

186-196: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Redirect regex misses multi-argument redirect() calls.

The regex /\bredirect\(\s*["']([^"']+)["']\s*\)/ requires ) immediately after the string argument. Next.js redirect() can accept a second RedirectType argument (e.g., redirect("/path", RedirectType.replace)), which would not be matched. The documentedRedirectTargets map covers the three product handler redirects, but page-level redirects relying on the regex fallback could be silently missed if they ever use the two-argument form.

Consider relaxing the regex to stop matching after the string literal:

♻️ Optional refactor
-      const target =
-        documentedRedirectTargets[route.route] ?? source.match(/\bredirect\(\s*["']([^"']+)["']\s*\)/)?.[1];
+      const target =
+        documentedRedirectTargets[route.route] ?? source.match(/\bredirect\(\s*["']([^"']+)["']/)?.[1];
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/generate-site-map.ts` around lines 186 - 196, Update the fallback
redirect pattern in discoverRedirects so it captures the first string argument
to redirect() without requiring the closing parenthesis immediately afterward,
allowing optional additional arguments such as RedirectType.replace while
preserving the existing target extraction and documentedRedirectTargets
precedence.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/audit-navigation-auth-regressions.test.ts`:
- Around line 98-109: The source-contract assertions in the test must match the
current ClinicalDashboard implementation. Update the extracted ranges and
expectations around privateCapabilityContract and pollingContract to reflect the
local-mode exceptions and includeAdministrationData-based polling, or update the
corresponding production logic so those asserted contracts are restored.

---

Nitpick comments:
In `@scripts/generate-site-map.ts`:
- Around line 186-196: Update the fallback redirect pattern in discoverRedirects
so it captures the first string argument to redirect() without requiring the
closing parenthesis immediately afterward, allowing optional additional
arguments such as RedirectType.replace while preserving the existing target
extraction and documentedRedirectTargets precedence.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6b49e86e-62a0-4165-b025-3ea7a867196b

📥 Commits

Reviewing files that changed from the base of the PR and between 9aa0f6d and e4a9256.

📒 Files selected for processing (23)
  • docs/codebase-index.md
  • docs/site-map.md
  • playwright.config.ts
  • scripts/check-github-action-pins.mjs
  • scripts/generate-site-map.ts
  • src/app/layout.tsx
  • src/components/clinical-dashboard/master-search-header.tsx
  • src/components/forms/forms-home-page.tsx
  • src/components/services/services-navigator-page.tsx
  • src/lib/rag-candidate-sources.ts
  • src/lib/rag.ts
  • supabase/drift-manifest.json
  • supabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sql
  • supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql
  • supabase/migrations/20260717010000_harden_rag_scalability_patch.sql
  • supabase/schema.sql
  • tests/audit-content-services-regressions.test.ts
  • tests/audit-navigation-auth-regressions.test.ts
  • tests/site-map.test.ts
  • tests/supabase-schema.test.ts
  • tests/ui-accessibility.spec.ts
  • tests/ui-smoke.spec.ts
  • tests/ui-tools.spec.ts
🚧 Files skipped from review as they are similar to previous changes (11)
  • tests/ui-accessibility.spec.ts
  • src/app/layout.tsx
  • tests/site-map.test.ts
  • scripts/check-github-action-pins.mjs
  • tests/ui-smoke.spec.ts
  • src/components/forms/forms-home-page.tsx
  • src/components/clinical-dashboard/master-search-header.tsx
  • supabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sql
  • src/components/services/services-navigator-page.tsx
  • tests/ui-tools.spec.ts
  • supabase/schema.sql

Comment thread tests/audit-navigation-auth-regressions.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@playwright.config.ts`:
- Line 58: Move reducedMotion from the use configuration into the Chromium
override’s contextOptions object in the Playwright configuration. Preserve the
"no-preference" value and leave unrelated browser settings unchanged so the
configuration conforms to Playwright’s supported types.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 58278ed8-db45-4a3b-963a-99145c4014f5

📥 Commits

Reviewing files that changed from the base of the PR and between e4a9256 and 349b46c.

📒 Files selected for processing (3)
  • playwright.config.ts
  • tests/rag-abort-signal.test.ts
  • tests/rag-classifier-memo.test.ts

Comment thread playwright.config.ts Outdated
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