Skip to content

docs(issues): capture the fuzzy catalogue-search drug-match finding (#310) and the ledger loss-detector (#311) - #1870

Merged
BigSimmo merged 9 commits into
mainfrom
claude/design-issues-triage-wnr7k9
Aug 12, 2026
Merged

docs(issues): capture the fuzzy catalogue-search drug-match finding (#310) and the ledger loss-detector (#311)#1870
BigSimmo merged 9 commits into
mainfrom
claude/design-issues-triage-wnr7k9

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

Verification

  • npm run verify:pr-local -- --files docs/branch-review-ledger.md docs/outstanding-issues.md — passed in the repository workflow environment.
  • npm run check:outstanding-issues — passed.
  • npm run check:branch-review-ledger — passed.
  • git diff --check b850a58166b68fa9cdd9ff6248c5e93e34c87f73...72c8b4d2e3ad4c7766dc8baaf71811b1542bd3e2 — passed.
  • The final PR delta is limited to docs/outstanding-issues.md and docs/branch-review-ledger.md.

Risk and scope

Documentation-only final delta. No source, schema, dependency, or workflow file remains changed. The underlying catalogue-search implementation and regression test belong to draft PR #1851 and remain outside this documentation PR.

No UI, provider-backed, deployment, release, Lighthouse, or production test was run.

…s-detector

#310 — PR #1851's fuzzy catalogue search matches DIFFERENT drugs at edit
distance 2. Measured by running the PR's own algorithm rather than reading it:
fluoxetine -> duloxetine (Damerau counts the lu->ul transposition as one edit,
both are 10 chars, so the >=8 tier's 2-edit budget allows it) and
prednisone -> prednisolone. Intended recovery still works (sertraline,
olanzapine) and the short-term guards hold (SSRI/SNRI, ADHD/ODD). Two real
mitigations recorded so it is not over-read: fuzzy fires only when nothing
matched literally, and sub-5-character terms are excluded. Tested fix is one
line — cap the >=8 tier at 1 edit, which kills both cross-drug hits and keeps
every legitimate typo case. Blast radius is eleven modules including
medications.ts, because catalog-search.ts feeds the whole clinical catalogue.

#311 — promote the derived ledger loss-detector into scripts/. Two main-merges
silently reverted ledger edits this session, including the whole #293
refutation, and the hand-enumerated recovery list could not catch it. The
derived version has now earned its place twice.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017paT42ZVMf8jaLtkjFxdy5
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 46 minutes

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

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

Run ID: 167a7d3d-08ad-444b-b7aa-3062298151f8

📥 Commits

Reviewing files that changed from the base of the PR and between 439f096 and 5114832.

📒 Files selected for processing (2)
  • docs/branch-review-ledger.md
  • docs/outstanding-issues.md

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

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@supabase

supabase Bot commented Aug 12, 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 ↗︎.

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

ℹ️ 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 docs/outstanding-issues.md Outdated

Copy link
Copy Markdown
Owner Author

@codex Please update this PR end-to-end on its current head. Address the unresolved P2 thread in docs/outstanding-issues.md row #310: the fuzzy trigger is evaluated per candidate record, so duloxetine can receive a fuzzy score and appear alongside an exact fluoxetine result. Remove the incorrect mitigation that the queried drug must be absent. State that the risk persists when both drugs are present, and make the next-action regression test explicitly include both the exact and near-match drug records. Update the PR body consistently. Sync the latest main into the PR branch while preserving all current-main ledger entries and this PR's #310/#311 additions. Run npm run verify:pr-local, push the focused fix, and report the exact verification result. Do not merge the PR.

Copy link
Copy Markdown
Owner Author

@codex address that feedback

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Corrected issue #310 to explain that fuzzy scoring is evaluated independently per candidate record, so duloxetine can appear alongside an exact fluoxetine result even when both records exist. docs/outstanding-issues.mdL270
  • Removed the incorrect “queried drug must be absent” mitigation and retained only the valid short-term exclusion. docs/outstanding-issues.mdL270
  • Updated the next action to require a regression fixture containing both exact and near-match drug records, asserting that the exact result remains while the cross-drug fuzzy result is absent. docs/outstanding-issues.mdL270
  • Confirmed origin/main was already fully incorporated at be5c7f5; the existing #310 and #311 ledger additions remain intact. docs/outstanding-issues.mdL270-L271
  • Committed the focused correction locally as 3b4c535 (docs(issues): correct fuzzy-search risk scope).

Testing

  • git fetch origin main
  • git merge --no-edit origin/main — reported Already up to date.
  • git diff --check
  • npm run format
  • npm run verify:pr-local
    • Completed: check:runtime, check:installed-lock-parity, format:changed, sitemap:check, docs:check-index, docs:check-inventory, docs:check-scripts, docs:check-links, check:branch-review-ledger, and check:outstanding-issues.
    • Failed: none.
    • Not reached: none.
    • Outstanding-issues result: 309 rows—114 open and 195 archived—with unique IDs and no IDs deleted from base be5c7f5a082e.
    • Build skipped automatically because no build-affecting source, configuration, package, or container files changed.
  • git status --short --branch — clean working tree after the commit.
  • ⚠️ git push origin HEAD:refs/heads/codex/address-fuzzy-catalogue-feedback — blocked because this environment has no GitHub credentials (could not read Username for 'https://github.com').
  • ⚠️ gh auth status — no authenticated GitHub host is configured. Consequently, I could not push the commit, update the original PR body, or create the required follow-up PR. No PR was merged.

View task →

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Corrected issue #310 to explain that fuzzy scoring occurs independently per candidate record, so duloxetine can appear alongside an exact fluoxetine result even when both records exist. Removed the incorrect “queried drug must be absent” mitigation. docs/outstanding-issues.mdL270
  • Updated the next action to require a regression fixture containing both the exact fluoxetine record and near-match duloxetine record, asserting that only the correct drug is returned. docs/outstanding-issues.mdL270
  • Synced the latest main and preserved the current-main ledger records plus this PR’s #310/#311 additions. docs/branch-review-ledger.mdL919-L926 docs/outstanding-issues.mdL270-L271
  • Committed the focused correction locally as 70c4e6cdf0ea06d483255d5b1e11f3534d7f15d0.
  • The PR was not merged.
  • Push and PR-body update could not be completed because this environment has no GitHub credentials, and the required make_pr tool was not exposed. The local branch is one commit ahead of the remote PR branch.

Testing

  • npm run format
  • npm run verify:pr-local — completed all 19 selected checks with no failures and none not reached:
    • check:runtime
    • check:installed-lock-parity
    • format:changed
    • sitemap:check
    • docs:check-index
    • docs:check-inventory
    • docs:check-scripts
    • docs:check-links
    • check:branch-review-ledger
    • check:outstanding-issues
    • check:github-actions
    • check:ci-scope
    • check:gitleaks-pinned
    • check:ci-triage
    • check:pr-policy
    • check:gate-manifest
    • check:pr-mergeability
    • check:verification-plan
    • test:ci-workflows13 test files passed; 276 tests passed
    • Build was intentionally skipped by the verification router because no build-affecting source, configuration, package, or container changes were detected.
  • git commit -m "docs(issues): correct fuzzy-match trigger analysis"
  • git push origin HEAD:claude/design-issues-triage-wnr7k9 — failed with fatal: could not read Username for 'https://github.com': No such device or address.
  • gh pr list --state open --search 'd3adf6dcdf2add6e46768304f3dce23b4838a3eb' --json number,title,headRefName,url — GitHub CLI reported that authentication is not configured, preventing the requested PR-body update.

View task →

Copilot AI 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.

Pull request overview

Captures two session-only findings into the durable outstanding-issues ledger (new rows #310 and #311) and records the work in the branch review ledger, so these notes aren’t lost when the chat transcript disappears.

Changes:

  • Add ledger rows #310 (fuzzy catalog typo recovery can cross-match different drug names) and #311 (promote the derived ledger loss-detector into scripts/).
  • Advance <!-- issues:next-id --> to 312 and append the corresponding entry to docs/branch-review-ledger.md.
  • Add a branch-specific GitHub Actions workflow intended to auto-edit the ledger (this is problematic for merge).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
docs/outstanding-issues.md Adds #310/#311 rows and updates issues:next-id.
docs/branch-review-ledger.md Appends a ledger entry documenting this capture work and verification.
.github/workflows/pr-1870-ledger-fix.yml Adds a workflow that commits/pushes a docs edit back to the branch (should not be merged as-is).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/pr-1870-ledger-fix.yml Outdated
Comment thread docs/outstanding-issues.md Outdated

Copy link
Copy Markdown
Owner Author

@codex Address all currently unresolved inline review comments on this PR against the current GitHub head. Correct the #310 fuzzy-search ledger wording/regression premise to reflect candidate-local scoring, remove any temporary write-capable branch-fix workflow still present, run proportionate docs/tests checks, and push minimal fixes. Do not merge, close, rebase, force-push, deploy, or alter auto-merge. Please report the exact commit SHA and test results.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Corrected issue #310 to reflect candidate-local fuzzy scoring: the exact fluoxetine record can receive a literal score while duloxetine independently receives a fuzzy score and appears as an additional result. The inaccurate premise that the queried drug must be absent has been removed. docs/outstanding-issues.mdL270
  • Updated the proposed regression fixture to include both the exact fluoxetine record and near-match duloxetine record, asserting that the exact result remains while the incorrect fuzzy result is excluded. docs/outstanding-issues.mdL270
  • Removed the temporary .github/workflows/pr-1870-ledger-fix.yml workflow, including its contents: write permission and workflow-authored commit/push behavior.
  • Committed the focused fixes as exact commit ddef64b9526e5ccd6775fc3dbf45efcf1e9f5773.
  • The working tree is clean. No merge, rebase, force-push, deployment, closure, or auto-merge change was performed.
  • Publication was blocked by missing GitHub credentials. The required make_pr tool is also not available in this environment, so I could not push ddef64b9526e5ccd6775fc3dbf45efcf1e9f5773 or create the required follow-up PR.

Testing

  • git diff --check
  • npm run format
  • npm run verify:pr-local
    • Completed all 19 selected checks.
    • Failed: none.
    • Not reached: none.
    • test:ci-workflows: 13 test files passed; 276 tests passed.
    • Outstanding-issues guard: 309 rows—114 open and 195 archived—with unique IDs and next-id=312.
    • Build correctly skipped because no build-affecting source, configuration, package, or container files changed.
  • test ! -e .github/workflows/pr-1870-ledger-fix.yml
  • git status --short --branch — clean working tree.
  • git commit -m "docs(issues): correct fuzzy-search review findings"
  • ⚠️ git push origin HEAD:refs/heads/codex/address-pr-1870-review-comments — unavailable because the environment has no GitHub HTTPS credentials (could not read Username for 'https://github.com').

View task →

Copy link
Copy Markdown
Owner Author

@claude Fix all currently unresolved review threads on this PR at the current GitHub head. Correct outstanding-issues row #310: fuzzy score===0 is candidate-local, so duloxetine can still fuzzy-match alongside an exact fluoxetine result; the risk does not require the queried drug to be absent. Make the regression premise explicitly include both records and exact fluoxetine excluding duloxetine. Also remove the temporary .github/workflows/pr-1870-ledger-fix.yml write-capable helper if it remains. Keep this docs/workflow-only and minimal, run the repository docs/workflow checks, push only to this PR branch, and report exact SHA/tests. Do not merge, close, rebase, force-push, deploy, or alter auto-merge.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @BigSimmo — thanks for the @claude mention.

Open this in Claude Code on the web to continue here: https://claude.ai/code

Context: BigSimmo/Database · #1870

Automated backlink from the Claude backlink workflow. Claude Code can pick up the mention and push a scoped fix to the branch.

@claude

claude Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

Copy link
Copy Markdown
Owner Author

Final review-and-fix summary

  • Final reviewed head: 72c8b4d2e3ad4c7766dc8baaf71811b1542bd3e2
  • Current base: b850a58166b68fa9cdd9ff6248c5e93e34c87f73
  • Sync / merge-tree: current main was merged once to resolve the ledger conflict. GitHub reports the PR mergeable, with test merge 999019723342f494bdd182722d5240c5a5a0c8c5; final delta is only docs/outstanding-issues.md and docs/branch-review-ledger.md. Auto-merge is not armed.

Fixed / dispositioned

  • Corrected chore(deps-dev): bump tailwindcss from 4.3.1 to 4.3.2 #310: fuzzy matching is evaluated independently per candidate record, so an exact fluoxetine record does not prevent a separate duloxetine near-match from scoring. The regression requirement now explicitly includes both records and asserts the wrong drug is excluded while the exact drug remains.
  • Removed the temporary branch-specific self-mutating GitHub Actions workflow, restoring the intended documentation-only scope.
  • Preserved chore(deps): bump next from 16.2.9 to 16.2.10 #311 and current-main concurrent ledger content. The review ledger contains the superseding review-and-fix record.
  • Updated stale PR-description wording so it no longer repeats the disproven “queried drug must be absent” mitigation.
  • All three actionable review threads were replied to with fixed-head dispositions and resolved. No human-needed P0/P1 thread remains.

Adversarial review

A distinct manual adversarial pass was performed because no separate fresh-context review subagent was available in this connector session. The #310 conclusion was independently checked against PR #1851’s actual catalog-search.ts diff. No additional high-confidence P0–P2 defect was found in PR #1870’s final two-file delta. CodeRabbit’s separate automated review was rate-limited, so that advisory reviewer did not provide an additional completed pass.

Decisive verification

Recorded on the candidate final commit and reflected in the current PR metadata:

  • npm run verify:pr-local -- --files docs/branch-review-ledger.md docs/outstanding-issues.md — passed
  • npm run check:outstanding-issues — passed
  • npm run check:branch-review-ledger — passed
  • git diff --check b850a58166b68fa9cdd9ff6248c5e93e34c87f73...72c8b4d2e3ad4c7766dc8baaf71811b1542bd3e2 — passed
  • Final changed-file assertion — passed: exactly two documentation files

No Lighthouse, UI/browser, live/provider-backed evaluation, deployment, release, or production test was run because the final delta is documentation-only.

Exact-head hosted CI

  • Required CI: still pending/in progress on exact head 72c8b4d2e3ad4c7766dc8baaf71811b1542bd3e2. CI run 31636398555 is in progress. At the latest snapshot, Change scope was still running and the aggregate PR required job had not yet instantiated, so required CI is not green yet.
  • Production UI: not selected/instantiated at the latest snapshot because change-scope classification had not completed. This is not counted as a pass.
  • Advisory/security checks: SAST succeeded; Secret Scan succeeded. The dispatch-only Lighthouse-baseline job was skipped as expected. Supabase preview was ignored because there is no supabase/ change. CodeRabbit review was rate-limited.

Residual blockers / risk

The only current merge blocker identified is unfinished exact-head required CI. GitHub therefore reports mergeable_state: blocked despite a clean/mergeable test merge. No permission blocker remains, and no product-code risk was introduced by the final documentation-only delta.

The PR was not merged. Final merge is left to the user.

@BigSimmo
BigSimmo merged commit 3dc1f37 into main Aug 12, 2026
24 checks passed
@BigSimmo
BigSimmo deleted the claude/design-issues-triage-wnr7k9 branch August 12, 2026 20:28

Copy link
Copy Markdown
Owner Author

Final review-and-fix summary

Final state

  • Final PR head: 51148329ba0501059b43a7522d1bbfa7ff381884
  • Base at merge: 439f09656c87f95d37ec479cae9007c53f6cc80c
  • GitHub test merge: 798cd5c5448a982b601e6e978536dfb6e6b6f353, with parents exactly the base and final head and a clean two-file result tree.
  • Actual merge commit: 3dc1f37337d27b1c1496a224b2748ae315c8348e
  • The final head was 9 commits ahead / 0 behind immediately before merge. GitHub records the PR as merged at 2026-08-12 20:28:20 UTC, with author BigSimmo and committer GitHub.
  • I did not invoke merge, close, rebase, force-push, auto-merge, deployment or release. The PR was merged externally while this final snapshot was being taken.

Issues fixed and dispositioned

  • Corrected #310 so it accurately states that score === 0 is evaluated independently for each candidate record. An exact fluoxetine result therefore does not suppress a separate fuzzy duloxetine result.
  • Strengthened the proposed regression to include both exact and near-match records, require the wrong drug to be excluded, and retain the exact drug.
  • Removed the temporary branch-specific self-mutating workflow. The merged delta contains only:
    • docs/outstanding-issues.md
    • docs/branch-review-ledger.md
  • Preserved #311, advanced issues:next-id to 312, ran ledger deduplication, and appended the review record through the repository ledger tool.
  • The underlying catalogue-search implementation and its executable regression remain correctly outside this documentation PR and belong to draft PR #1851.

Adversarial review and comments

  • Performed a distinct manual adversarial pass over the final delta and relevant fuzzy-search implementation, challenging candidate-local scoring, false positives, regression shape, ledger integrity and workflow attack surface.
  • No additional high-confidence P0–P2 PR-introduced defect was found.
  • The configured external review bot was rate/spending limited, so the independent pass was manual rather than a fresh bot run.
  • All 3 actionable inline review threads are resolved and now outdated against the final tree. No unresolved actionable thread remains.

Decisive verification

Passed on the repaired candidate/final content:

  • npm run verify:pr-local -- --files docs/branch-review-ledger.md,docs/outstanding-issues.md
  • npm run check:outstanding-issues
  • npm run check:branch-review-ledger
  • changed-file formatting and git diff --check
  • final file-set assertion confirming only the two documentation files above

The earlier broad-suite failure was not a PR defect: it was caused by a runner lacking PyMuPDF after the verifier selected an unnecessarily broad historical range. The final supported explicit-file verification passed.

Exact-head required CI

For final head 51148329ba0501059b43a7522d1bbfa7ff381884:

  • CI: success
    • Change scope: success
    • Static PR checks: success
    • PR required aggregator: success
  • SAST: success
  • Secret Scan: success
  • Production UI / Production UI critical: skipped by the documentation-only scope
  • Build, unit coverage, migration replay and container jobs: skipped by scope
  • No required exact-head check is pending, missing or failed.

Advisory checks and residual risk

  • Visual baselines, Advisory UI and Lighthouse budget were skipped by scope. No Lighthouse, live/provider-backed evaluation, production test, deployment or release was run.
  • CodeRabbit’s current review was unavailable because of its organisation review limit/spending cap. The manual adversarial pass is the substitute evidence.
  • Residual risk is limited to the editorial accuracy of the measured fuzzy-match finding. The implementation correction itself remains to be completed and tested in PR #1851.

PR #1870 is merged. This review did not perform or authorise the merge.

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.

3 participants