Skip to content

fix: restore service detail fixtures and dashboard H1 copy#855

Closed
BigSimmo wants to merge 2 commits into
mainfrom
codex/merge-safe-819-mainfix
Closed

fix: restore service detail fixtures and dashboard H1 copy#855
BigSimmo wants to merge 2 commits into
mainfrom
codex/merge-safe-819-mainfix

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Restore service detail API fixtures and mock service detail lookups for /api/registry/records.
  • Seed catalog-backed service records used by ui tool tests.
  • Update Clinical Dashboard accessible heading copy from Clinical Guide to Clinical KB to match existing product contract assertions.

Why

The branch fixed test drift between API fixture behavior and fixture-based UI coverage, and resolved a dashboard copy mismatch regression.

Verification

  • npm run test:e2e:pr -- tests/ui-tools.spec.ts --project=chromium --grep "service detail" ✅ PASS (5/5)
  • npm run test:e2e:pr -- tests/ui-smoke.spec.ts --project=chromium --grep "Clinical KB UI smoke coverage" ✅ PASS (87/87)
  • npm run test:e2e:pr -- tests/ui-accessibility.spec.ts --project=chromium --grep "Clinical KB" ✅ PASS (7/7)
  • npm run test -- tests/audit-navigation-auth-regressions.test.ts ✅ PASS (5/5)
  • UI verification not run: npm run verify:ui not executed for this local-only correction.

Clinical Governance Preflight

Not applicable for this scope: no ingestion, answer generation, source governance, privacy, or clinical output behavior changes.

Risk and Rollout

  • Risk level: low; changes are limited to tests and one UI heading text.
  • Rollout plan: merge directly to main and monitor regular CI.

Summary by CodeRabbit

  • Accessibility

    • Updated the dashboard’s accessible heading to “Clinical KB.”
    • Improved error-page focus outlines so they appear for keyboard-visible focus.
  • Performance & Reliability

    • Added support for cancelling in-progress searches and data retrieval when requests are aborted.
    • Improved handling and monitoring of shared answer-generation requests.
  • Search & Forms

    • Refined non-answer result presentation and source-link behavior.
    • Improved safeguards around form pathways, evidence, and source confirmations.
  • Testing

    • Updated accessibility, navigation, UI, and database regression coverage for these changes.

@supabase

supabase Bot commented Jul 18, 2026

Copy link
Copy Markdown

Updates to Preview Branch (codex/merge-safe-819-mainfix) ↗︎

Deployments Status Updated
Database Sat, 18 Jul 2026 13:03:31 UTC
Services Sat, 18 Jul 2026 13:03:31 UTC
APIs Sat, 18 Jul 2026 13:03:31 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Sat, 18 Jul 2026 13:03:38 UTC
Migrations Sat, 18 Jul 2026 13:04:52 UTC
Seeding ⏸️ Sat, 18 Jul 2026 13:03:19 UTC
Edge Functions ⏸️ Sat, 18 Jul 2026 13:03:19 UTC

❌ Branch Error • Sat, 18 Jul 2026 13:04:53 UTC

ERROR: Unsafe supabase_admin default privileges; migration blocked. (SQLSTATE 42501)
{"safe": false, "entries": ["function:PUBLIC:execute", "function:anon:execute", "function:authenticated:execute", "function:postgres:execute", "function:service_role:execute", "function:supabase_admin:execute", "sequence:anon:select", "sequence:anon:update", "sequence:anon:usage", "sequence:authenticated:select", "sequence:authenticated:update", "sequence:authenticated:usage", "sequence:postgres:select", "sequence:postgres:update", "sequence:postgres:usage", "sequence:service_role:select", "sequence:service_role:update", "sequence:service_role:usage", "sequence:supabase_admin:usage", "table:anon:delete", "table:anon:insert", "table:anon:maintain", "table:anon:references", "table:anon:select", "table:anon:trigger", "table:anon:truncate", "table:anon:update", "table:authenticated:delete", "table:authenticated:insert", "table:authenticated:maintain", "table:authenticated:references", "table:authenticated:select", "table:authenticated:trigger", "table:authenticated:truncate", "table:authenticated:update", "table:postgres:delete", "table:postgres:insert", "table:postgres:maintain", "table:postgres:references", "table:postgres:select", "table:postgres:trigger", "table:postgres:truncate", "table:postgres:update", "table:service_role:delete", "table:service_role:insert", "table:service_role:maintain", "table:service_role:references", "table:service_role:select", "table:service_role:trigger", "table:service_role:truncate", "table:service_role:update", "table:supabase_admin:delete", "table:supabase_admin:insert", "table:supabase_admin:maintain", "table:supabase_admin:references", "table:supabase_admin:select", "table:supabase_admin:trigger", "table:supabase_admin:truncate", "table:supabase_admin:update"], "role_exists": true, "schema_exists": true}
At statement: 3
do $$
declare
  v_status jsonb;
begin
  if not exists (select 1 from pg_catalog.pg_roles where rolname = 'supabase_admin') then
    raise notice 'role supabase_admin does not exist; default-privilege assertion is not applicable';
    return;
  end if;

  begin
    -- Local/Superuser-capable environments can assume the target role even
    -- when the migration role cannot use ALTER DEFAULT PRIVILEGES FOR ROLE
    -- directly. Hosted environments that cannot assume it fall through to the
    -- catalog assertion and block with operator instructions.
    execute 'set local role supabase_admin';
    -- Revokes must be global: per-schema ACLs cannot subtract privileges from
    -- built-in or previously granted global defaults.
    alter default privileges for role supabase_admin
      revoke all privileges on tables from public, anon, authenticated, service_role;
    alter default privileges for role supabase_admin in schema public
      revoke all privileges on tables from public, anon, authenticated, service_role;
    alter default privileges for role supabase_admin
      revoke all privileges on sequences from public, anon, authenticated, service_role;
    alter default privileges for role supabase_admin in schema public
      revoke all privileges on sequences from public, anon, authenticated, service_role;
    alter default privileges for role supabase_admin
      revoke execute on functions from public, anon, authenticated, service_role;
    alter default privileges for role supabase_admin in schema public
      revoke execute on functions from public, anon, authenticated, service_role;
    alter default privileges for role supabase_admin in schema public
      grant select, insert, update, delete on tables to service_role;
    alter default privileges for role supabase_admin in schema public
      grant usage, select on sequences to service_role;
    alter default privileges for role supabase_admin in schema public
      grant execute on functions to service_role;
    execute 'reset role';
  exception when insufficient_privilege then
    begin execute 'reset role'; exception when others then null; end;
    raise notice 'current role % cannot remediate supabase_admin default privileges; asserting the catalog postcondition', current_user;
  end;

  v_status := public.default_privileges_status('supabase_admin', 'public');
  if not coalesce((v_status->>'safe')::boolean, false) then
    raise exception using
      errcode = '42501',
      message = 'Unsafe supabase_admin default privileges; migration blocked.',
      detail = v_status::text,
      hint = E'Run these six statements as supabase_admin, then retry the migration:\n'
        'DO $remediate$ BEGIN ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin REVOKE ALL PRIVILEGES ON TABLES FROM PUBLIC, anon, authenticated, service_role; ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public REVOKE ALL PRIVILEGES ON TABLES FROM PUBLIC, anon, authenticated, service_role; END $remediate$;\n'
        'DO $remediate$ BEGIN ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin REVOKE ALL PRIVILEGES ON SEQUENCES FROM PUBLIC, anon, authenticated, service_role; ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public REVOKE ALL PRIVILEGES ON SEQUENCES FROM PUBLIC, anon, authenticated, service_role; END $remediate$;\n'
        'DO $remediate$ BEGIN ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC, anon, authenticated, service_role; ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC, anon, authenticated, service_role; END $remediate$;\n'
        'ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO service_role;\n'
        'ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT USAGE, SELECT ON SEQUENCES TO service_role;\n'
        'ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT EXECUTE ON FUNCTIONS TO service_role;';
  end if;
end;
$$

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The changes add abort-aware RAG RPC and classifier handling, answer-coalescing telemetry, dashboard rendering and accessibility updates, broadened query-parameter typing, and synchronized Playwright, schema, audit, and UI regression expectations.

Changes

RAG pipeline

Layer / File(s) Summary
Abortable retrieval RPCs
src/lib/rag-candidate-sources.ts
callVersionedRetrievalRpc accepts an AbortSignal and applies it to supported versioned and legacy Supabase RPC calls.
Classifier cancellation and answer telemetry
src/lib/rag.ts
Classifier waits honor caller cancellation, retrieval forwards signals, and answer coalescing records waiter and origination lifecycle metrics.

Dashboard and UI contracts

Layer / File(s) Summary
Dashboard result and heading rendering
src/app/page.tsx, src/components/ClinicalDashboard.tsx, src/components/route-error-boundary.tsx
Search parameters use a generic record type, the dashboard heading is “Clinical KB,” non-answer matches render in the main conditional, and the error heading uses focus-visible outlines.
Dashboard UI validation
tests/ui-accessibility.spec.ts, tests/ui-smoke.spec.ts, tests/ui-tools.spec.ts
UI tests use the updated heading, constrained service fixtures, absent pathway content checks, and dock transition assertions.

Regression and test configuration

Layer / File(s) Summary
Playwright motion configuration
playwright.config.ts
Suite-wide reduced motion remains enabled while Chromium uses no-preference.
Content and navigation regression contracts
tests/audit-content-services-regressions.test.ts, tests/audit-navigation-auth-regressions.test.ts
Regression assertions reflect reviewed-source states, confirmation wording, source-link markup, private polling guards, and the updated dashboard heading.
Schema and drift regression fixtures
tests/supabase-schema.test.ts, supabase/drift-manifest.json
Schema fixtures and SQL assertions are updated, and drift generation metadata is refreshed.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Retrieval as RAG retrieval
  participant Classifier as Classifier fallback
  participant RPC as Supabase RPC
  participant Metrics as Answer telemetry
  Retrieval->>Classifier: forward caller AbortSignal
  Classifier->>RPC: execute abortable retrieval RPC
  RPC-->>Classifier: result or abort
  Classifier-->>Retrieval: verdict or abort error
  Retrieval->>Metrics: record coalesced waiter
  Retrieval->>Metrics: record origination start and finish
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% 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 accurately summarizes the main changes: restoring service detail fixtures and updating the dashboard H1 copy.
Description check ✅ Passed The description covers Summary, Why, Verification, Risk/Rollout, and governance notes, with only minor template-format omissions.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/merge-safe-819-mainfix

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f99d4cfb31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread playwright.config.ts
grepInvert: mockupTag,
use: {
...devices["Desktop Chrome"],
contextOptions: { reducedMotion: "no-preference" },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep reduced motion enabled by default

When the chromium project runs the production specs, including the ui-smoke and ui-stress files selected by productionSpecPattern, this project-level contextOptions: { reducedMotion: "no-preference" } overrides the suite default that was added to keep CSS transitions from moving click targets mid-test. That puts the main Chromium gate back under real animations and reintroduces the documented flake risk for every production Chromium spec just to support one transition assertion; keep the default reduced motion and opt that specific assertion into no-preference with page.emulateMedia or a dedicated project.

Useful? React with 👍 / 👎.

@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f99d4cfb31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +96 to +97
const pendingWithAbort =
signal && typeof pending.abortSignal === "function" ? pending.abortSignal(signal) : pending;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Pass abort signals into RAG RPC callers

This helper now knows how to attach an AbortSignal to Supabase RPC builders, but the RAG retrieval call sites still never pass args.signal into callVersionedRetrievalRpc (checked the direct searchChunksWithTelemetry calls and the candidate searchers). When an /api/answer or stream request disconnects or hits the route deadline after retrieval has started, routeDeadline.race() rejects while the expensive Supabase RPCs continue running in the background; thread the deadline/request signal through the candidate args and direct RPC calls, and cover it with a test that exercises searchChunksWithTelemetry rather than this helper directly.

Useful? React with 👍 / 👎.

Comment thread playwright.config.ts
grepInvert: mockupTag,
use: {
...devices["Desktop Chrome"],
contextOptions: { reducedMotion: "no-preference" },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep Chromium production tests reduced-motion by default

This project-level contextOptions overrides the top-level contextOptions: { reducedMotion: "reduce" } for the whole Chromium production project, so the CI path that runs ui-smoke, ui-stress, and the other production specs now re-enables animations despite the suite-wide race-prevention comment above. If only the new dock-transition assertion needs real motion, scope reducedMotion: "no-preference" to that test/spec instead of the entire Chromium project.

Useful? React with 👍 / 👎.

@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: 3

🤖 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/lib/rag.ts`:
- Around line 2430-2434: Update both retrieval RPC call sites in the query
analysis flow to pass args.signal as the fifth argument to
callVersionedRetrievalRpc, including the hybrid call near
analyzeQueryWithClassifierFallback and the fallback call around the fallback
retrieval path. Preserve the existing retrieval arguments and ensure caller
cancellation reaches both RPC requests.
- Around line 431-447: Update awaitWithCallerSignal and its surrounding
error-handling flow so any caller-aborted signal bypasses classifier fallback,
regardless of whether signal.reason is an AbortError or a custom Error. Preserve
and propagate the caller’s abort reason instead of swallowing it and returning
analysis.

In `@tests/ui-tools.spec.ts`:
- Around line 21-22: Update the testServiceSlugs declaration and its use in the
testServiceRecords filter so the slug collection accepts a general string, for
example by widening it to a string collection or using Set<string>. Preserve the
existing serviceRecords filtering behavior and matching slug values.
🪄 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: 45aaaa55-68cb-4f47-a469-3f052fa0bcde

📥 Commits

Reviewing files that changed from the base of the PR and between e51c651 and f99d4cf.

📒 Files selected for processing (13)
  • playwright.config.ts
  • src/app/page.tsx
  • src/components/ClinicalDashboard.tsx
  • src/components/route-error-boundary.tsx
  • src/lib/rag-candidate-sources.ts
  • src/lib/rag.ts
  • supabase/drift-manifest.json
  • tests/audit-content-services-regressions.test.ts
  • tests/audit-navigation-auth-regressions.test.ts
  • tests/supabase-schema.test.ts
  • tests/ui-accessibility.spec.ts
  • tests/ui-smoke.spec.ts
  • tests/ui-tools.spec.ts

Comment thread src/lib/rag.ts
Comment on lines +431 to +447
function awaitWithCallerSignal<T>(pending: Promise<T>, signal?: AbortSignal): Promise<T> {
if (!signal) return pending;
if (signal.aborted) throw signal.reason ?? new DOMException("The operation was aborted.", "AbortError");

return new Promise<T>((resolve, reject) => {
const onAbort = () => reject(signal.reason ?? new DOMException("The operation was aborted.", "AbortError"));
signal.addEventListener("abort", onAbort, { once: true });
pending.then(
(value) => {
signal.removeEventListener("abort", onAbort);
resolve(value);
},
(error) => {
signal.removeEventListener("abort", onAbort);
reject(error);
},
);

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 | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
node - <<'NODE'
const controller = new AbortController();
const reason = new Error("caller cancelled");
controller.abort(reason);
if (controller.signal.reason !== reason) process.exit(1);
NODE

Repository: BigSimmo/Database

Length of output: 155


🏁 Script executed:

#!/bin/bash
set -euo pipefail
file="src/lib/rag.ts"
wc -l "$file"
sed -n '410,470p' "$file" | cat -n
printf '\n---\n'
sed -n '1370,1415p' "$file" | cat -n

Repository: BigSimmo/Database

Length of output: 4351


🏁 Script executed:

#!/bin/bash
set -euo pipefail
file="src/lib/rag.ts"
nl -ba "$file" | sed -n '428,450p'
printf '\n---\n'
nl -ba "$file" | sed -n '1388,1405p'

Repository: BigSimmo/Database

Length of output: 195


Preserve caller cancellations here. Any aborted signal should skip the classifier fallback; custom reasons like abort(new Error(...)) are not AbortError, so this catch swallows cancellation and returns analysis instead.

🤖 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` around lines 431 - 447, Update awaitWithCallerSignal and its
surrounding error-handling flow so any caller-aborted signal bypasses classifier
fallback, regardless of whether signal.reason is an AbortError or a custom
Error. Preserve and propagate the caller’s abort reason instead of swallowing it
and returning analysis.

Comment thread src/lib/rag.ts
Comment on lines 2430 to 2434
const queryAnalysis = await analyzeQueryWithClassifierFallback(retrievalQuery, analyzeClinicalQuery(retrievalQuery), {
corpusGrounding: corpusGroundingScope,
ownerId: args.ownerId,
signal: args.signal,
});

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 | ⚡ Quick win

Thread the caller signal into both retrieval RPC calls.

Line 2433 cancels classifier waiting, but the hybrid and fallback calls to callVersionedRetrievalRpc omit args.signal; their new abort support is therefore never used.

Proposed fix
       const { data, error } = await callVersionedRetrievalRpc(
         supabase,
         "match_document_chunks_hybrid_v2",
         "match_document_chunks_hybrid",
         {
           // ...
         },
+        args.signal,
       );

Apply the same fifth argument to the fallback call around Line 2945.

🤖 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` around lines 2430 - 2434, Update both retrieval RPC call
sites in the query analysis flow to pass args.signal as the fifth argument to
callVersionedRetrievalRpc, including the hybrid call near
analyzeQueryWithClassifierFallback and the fallback call around the fallback
retrieval path. Preserve the existing retrieval arguments and ensure caller
cancellation reaches both RPC requests.

Comment thread tests/ui-tools.spec.ts
Comment on lines +21 to +22
const testServiceSlugs = ["13yarn", "city-east-community-mental-health-service"] as const;
const testServiceRecords = serviceRecords.filter((service) => testServiceSlugs.includes(service.slug));

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

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
npm run verify:cheap

Repository: BigSimmo/Database

Length of output: 11787


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

sed -n '1,60p' tests/ui-tools.spec.ts | cat -n

Repository: BigSimmo/Database

Length of output: 3356


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
p = Path('tests/ui-tools.spec.ts')
text = p.read_text()
for i, line in enumerate(text.splitlines(), 1):
    if 'testServiceSlugs' in line or 'testServiceRecords' in line:
        print(f"{i}: {line}")
PY

Repository: BigSimmo/Database

Length of output: 568


Fix the tuple-typed includes check at tests/ui-tools.spec.ts:22.

testServiceSlugs is a readonly literal tuple, so includes(service.slug) rejects the general string type and blocks the TypeScript check. Use a Set<string> or widen the slug collection type.

🧰 Tools
🪛 GitHub Check: Static PR checks

[failure] 22-22:
Argument of type 'string' is not assignable to parameter of type '"13yarn" | "city-east-community-mental-health-service"'.

🤖 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/ui-tools.spec.ts` around lines 21 - 22, Update the testServiceSlugs
declaration and its use in the testServiceRecords filter so the slug collection
accepts a general string, for example by widening it to a string collection or
using Set<string>. Preserve the existing serviceRecords filtering behavior and
matching slug values.

Sources: Coding guidelines, Linters/SAST tools

cursor Bot pushed a commit that referenced this pull request Jul 18, 2026
Note hosted green merge of the clinical-search fix and closure of
duplicate remediations #854/#855 that appeared during babysit.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo deleted the codex/merge-safe-819-mainfix branch July 18, 2026 18:27
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