Skip to content

refactor: honest deriveConfidence naming + drop dead UniversalSearchResponse fields#376

Merged
BigSimmo merged 1 commit into
mainfrom
claude/review-nits-followup
Jul 8, 2026
Merged

refactor: honest deriveConfidence naming + drop dead UniversalSearchResponse fields#376
BigSimmo merged 1 commit into
mainfrom
claude/review-nits-followup

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

Two behaviour-neutral cleanups surfaced by the review of the last 48h of merged PRs.

  • deriveConfidence naming (src/lib/rag.ts)strongestCosine actually holds the strongest non-synthetic hybrid score (scoreValue), not a pure cosine. Renamed to strongestNonSynthetic and corrected the comment so the code no longer overstates the "genuine cosine" guarantee. Same value, same >= 0.82 && >= 2 citations gate → no behaviour change.
  • Dead response-type fields (src/lib/universal-search.ts)runUniversalSearch never sets demoMode/publicAccess; the route attaches them to its untyped JSON response. Removed the unused fields from UniversalSearchResponse.

Not in this PR (tracked separately)

  • Universal-search demo-corpus leak + anon rate-limiting → handled by fix(search): stop /api/search/universal serving demo docs to live public users #373.
  • Owner-scoping fail-open hardening (SQL + owner-scope.ts) → gated on the Supabase Preview drift fix.
  • Supabase Preview migration drift → needs live DB: 20260705220000_reconcile_live_database_drift.sql was renamed to …230000, orphaning the old version on the remote (supabase migration repair --status reverted 20260705220000 --linked).
  • deriveConfidence stricter pure-cosine gate → needs eval:quality validation.
  • WebKit tests/ui-tools.spec.ts:756 hide-on-scroll flake → needs a Playwright/WebKit run.

Verification

tsc --noEmit ✅ · eslint (0 errors) ✅ · full vitest 1289 passed, 1 skipped

🤖 Generated with Claude Code

…esponse fields

Two behaviour-neutral cleanups surfaced by the 48h PR review.

- rag.ts: rename `strongestCosine` -> `strongestNonSynthetic` in deriveConfidence and
  correct the comment. The value is the strongest non-synthetic *hybrid* score (scoreValue),
  not a pure cosine; the old name/comment overstated the guarantee. Same value, same
  `>= 0.82 && >= 2 citations` gate -> no behaviour change.
- universal-search.ts: remove `demoMode`/`publicAccess` from UniversalSearchResponse.
  runUniversalSearch never sets them; the route attaches them to its untyped JSON response,
  so the type fields were dead.

Verified: tsc --noEmit, eslint (0 errors), full vitest (1289 passed, 1 skipped).

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

supabase Bot commented Jul 8, 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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 8, 2026 06:44
@BigSimmo
BigSimmo merged commit bbd0ce8 into main Jul 8, 2026
5 checks passed
@BigSimmo
BigSimmo deleted the claude/review-nits-followup branch July 9, 2026 12:35
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