Skip to content

feat(rag): deferred injection hardening + answer telemetry#407

Merged
BigSimmo merged 2 commits into
mainfrom
claude/deferred-rag-improvements-c2f7fe
Jul 8, 2026
Merged

feat(rag): deferred injection hardening + answer telemetry#407
BigSimmo merged 2 commits into
mainfrom
claude/deferred-rag-improvements-c2f7fe

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Conservatively widen neutralizePromptInstructions for AI-addressed injection idioms (NOTE TO AI, scoped from now on … recommend/say/…) without hitting legitimate clinical prose.
  • Flag cross-document haematology withholding-threshold conflicts in detectConflictsOrGaps (ANC/WBC/platelet cease/withhold/stop tied to disagreeing cutoffs).
  • Persist per-answer route/model/token usage on /api/answer and /api/answer/stream into existing rag_retrieval_logs.metadata.answer (zero-migration observability).

Still deferred by design: per-sentence numeric scoping (#9), seeded-chunk generation eval harness (#11), and architectural #12–14.

Test plan

  • npx vitest run tests/answer-telemetry.test.ts tests/evidence.test.ts tests/rag-injection.test.ts (35 passed)
  • CI verify + ui-smoke on the PR
  • Spot-check a live answer writes a rag_retrieval_logs row with metadata.answer.log_source = "answer"

…metry

Widen the prompt-instruction neutralizer for AI-addressed phrases, flag cross-document ANC/WBC withholding-threshold conflicts, and log per-answer route/model/token usage into rag_retrieval_logs without a schema migration.

Co-authored-by: Cursor <cursoragent@cursor.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 July 8, 2026 15:59
Co-authored-by: Cursor <cursoragent@cursor.com>
@BigSimmo
BigSimmo merged commit a4bd32e into main Jul 8, 2026
6 checks passed
@BigSimmo
BigSimmo deleted the claude/deferred-rag-improvements-c2f7fe branch July 8, 2026 16: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