Skip to content

Sources test: pin which medicine source links show, not just how many - #3568

Merged
gitar-bot[bot] merged 2 commits into
mainfrom
claude/sign-offs-1vo4zv
Oct 16, 2026
Merged

gitar-bot[bot] merged 2 commits into
mainfrom
claude/sign-offs-1vo4zv

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

  • Before: the source-catalogue test checked only that the medicine pages show three source links. A wrong link could replace a right one and the test would still pass.
  • After: the test names each link. The clozapine page shows the WA clozapine guideline, and the lithium page shows the Australian Prescriber lithium article and its correction.
  • This is the follow-up promised on clinical: complete ready clinical sign-offs across Act sections, sources, specifiers, therapies, and Today rules #3562 (Qodo finding on tests/source-catalogue-providers.test.ts:219). It is test-only, so nothing a reader sees changes.

Areas touched: Clinical reference content

Verification

  • Checks run: npx vitest run tests/source-catalogue-providers.test.ts gave "Tests 13 passed (13)". eslint on the file was clean, and tsc --noEmit reported 0 errors.

Risk and rollout

  • Risk: none to the live site. Test only.
  • Rollback: revert the commit.
  • Provider or production effects: None.

Notes

🤖 Generated with Claude Code

https://claude.ai/code/session_01F8eTG5dvhsjc2x2ZYnY4YT


Generated by Claude Code


Summary by cubic

Pins the source-catalogue test to the exact medicine source links, so a wrong link can no longer replace a right one and still pass.

  • Before, the test only checked that three source links appear on the medicine pages.
  • Now it asserts the WA clozapine guideline on the clozapine page and the Australian Prescriber lithium article plus its correction on the lithium page.
  • Test-only change; nothing a reader sees changes. The merge from main adds no test or content changes.

Written for commit ff94b1d. Summary will update on new commits.

View guided diff Turn on auto-fix


CodeAnt-AI Description

Verify exact medicine source links in catalogue tests

What Changed

  • The source-catalogue test now checks the exact clozapine guideline and the lithium article and correction, rather than only checking the number of links.

Impact

✅ Catches incorrect or swapped medicine source links
✅ Confirms the expected clozapine and lithium references

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

The source-catalogue test only checked that three medicine source links
exist, so a wrong link could swap in for a right one and still pass. It
now names each link: the WA clozapine guideline on the clozapine page,
and the Australian Prescriber lithium article and its correction on the
lithium page.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F8eTG5dvhsjc2x2ZYnY4YT
@supabase

supabase Bot commented Oct 16, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


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

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Next included review available in 54 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 94 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: BigSimmo/PsychSift/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 4bad5c45-8a1a-496d-b45a-ce8c7c1d5337
📥 Commits

Reviewing files that changed from the base of the PR and between 5cbe4ec and ff94b1d.

📒 Files selected for processing: 1
  • tests/source-catalogue-providers.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@codeant-ai

codeant-ai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: ff94b1d3
Scan Time: 2026-10-16 05:27:09 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED No IAC issues

View Full Results

@gitar-bot gitar-bot 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.

Gitar has auto-approved this PR (configure)

@BigSimmo
BigSimmo marked this pull request as ready for review October 16, 2026 05:12

@greptile-apps greptile-apps 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.

BigSimmo has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@codeant-ai

codeant-ai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 26c3862 Oct 16, 2026 · 05:12 05:14

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T05:14:27.833578Z ff94b1d Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codeant-ai

codeant-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@claude

claude Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

@gitar-bot
gitar-bot Bot enabled auto-merge (squash) October 16, 2026 05:12
@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Oct 16, 2026
@gitar-bot

gitar-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor
Code Review ✅ Approved

🟢 Low risk · The change only strengthens a source-catalogue test by pinning expected links; it does not alter runtime behavior or reader-facing content.

Test-only change pins the source-catalogue assertions to specific medicine source links: the WA clozapine guideline on the clozapine page, and the Australian Prescriber lithium article and its correction on the lithium page. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Approved

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Important

Your trial ends in 5 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.

Was this helpful? React with 👍 / 👎 | Gitar

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Pin medicine source links in catalogue provider test

🧪 Tests 🕐 Less than 10 minutes

Grey Divider

AI Description

• Replace the medicine source-link count check with exact medication and URL assertions.
• Catch substitutions of the clozapine guideline or lithium article and correction links.
Diagram

graph TD
  Data["Medicine source links"] --> Provider["Medication provider"] --> References["Source-link references"] --> Assertion["Exact link assertion"]
Loading
High-Level Assessment

Explicit expected medication–URL pairs directly catch substitutions that a count check misses. Deriving expectations from the same source data would weaken that protection.

Files changed (1) +18 / -1

Tests (1) +18 / -1
source-catalogue-providers.test.tsAssert exact medicine source-link references +18/-1

Assert exact medicine source-link references

• Replaces a three-link count assertion with an ordered comparison of medication record IDs and canonical URLs. The expected references cover the WA clozapine guideline and the Australian Prescriber lithium article and correction.

tests/source-catalogue-providers.test.ts

@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo Fixer

No findings are available for this PR yet. Findings appear here once Qodo has reviewed the PR.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Strengthens the source-catalogue test to assert the exact expected medicine source links instead of only checking the count; test-only change with no runtime behavior impact.

View guided diff | Turn on auto-fix | Re-trigger cubic

@qodo-code-review

qodo-code-review Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

No findings for this group


Remediation recommended

No findings for this group


Informational

No findings for this group

Grey Divider


Resolved findings

1. A source-link reorder breaks the test ✗ Dismissed
Description
The new toEqual compares the source-link tuples as an ordered array. Any harmless change to
medication or link-map ordering makes the test fail even when the same three approved URLs are still
shown, coupling the regression check to ordering that the change does not claim to govern.
Code

tests/source-catalogue-providers.test.ts[R220-223]

+      medicationReferences
+        .filter((reference) => reference.usage.field === "sourceLinks")
+        .map((reference) => [reference.usage.recordId, reference.canonicalUrl]),
+    ).toEqual([
Relevance

●●● Strong

The assertion unnecessarily couples link identity coverage to producer order; ordering-related test
robustness findings are accepted.

PR-#2841
PR-#3519

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed assertion uses direct toEqual on an array, making tuple order observable. The producer
returns medication links through nested flatMap calls and preserves input/map order, so a
non-semantic ordering change can fail this test while leaving the set of rendered links unchanged.

tests/source-catalogue-providers.test.ts[220-236]
src/lib/medication-source-links.ts[85-102]
Skill: testing-review

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

Issue description
The source-link regression test compares an array directly, so it treats emission order as part of the contract even though the requirement is only that the approved links appear. Reordering medications or the link map can create a false failure.

Fix Focus Areas
- tests/source-catalogue-providers.test.ts[220-223]
- src/lib/medication-source-links.ts[85-102]

Recommended Fix
Keep the exact expected record ID and URL pairs, but compare them order-independently using a stable normalization such as sorting both arrays by record ID and canonical URL, or using an order-independent matcher while retaining the expected length check.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 9 rules
✅ Cross-repo context — repo relationships
✅ REVIEW.md
Review mode: Auto: 🚀 Fast: Localized test-only assertion with minimal risk and one edit site.

Grey Divider

Tip of the day
💡 Did you know, you can pick a display mode instead of tweaking every Display option by hand

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@codeant-ai

codeant-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge; it strengthens a test to verify the expected source-link records and URLs.

Assessed commit: ff94b1d30ea6

@gitar-bot
gitar-bot Bot merged commit 3bafc51 into main Oct 16, 2026
46 of 48 checks passed
@gitar-bot
gitar-bot Bot deleted the claude/sign-offs-1vo4zv branch October 16, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🕐 Less than 10 minutes size:S This PR changes 10-29 lines, ignoring generated files 🟡 Small blast radius

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants