docs: reconcile memory ledgers after task review + fix .env.example weak-OR footgun#720
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)❌ Error committing Unit Tests locally.
Comment |
|
Note Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
|
✅ Created PR with unit tests: #722 |
…eak-OR footgun Follow-through on the memory/task review. Cross-checked every tracked ongoing/recommended task against the current tree and updated the ledgers to match reality: - ingestion-concurrency-fix-workorder: mark deep-memory delete-scoping RESOLVED (producer-scoped model — migration 20260713030000 + #569 + deep-memory.ts cleanupStagedArtifacts). This doc now has no open repository items. - operator-backlog: close the drift-codify forward-migration row (step 1h) — the forward-codify work-order is complete (applied 2026-07-13). Add a new "apply repo-ahead migrations to live" verify row for the three committed-but-unapplied migrations (20260713201542, 20260714110000, 20260717120000). - audit-remediation-plan-2026-07-14: add a dated reconciliation block recording which findings are now DONE in code, which remain open (OWNER:CODE), which are in flight (PRs #708/#710), and which are operator-pending. Also fix a config footgun the review surfaced (audit finding F5): .env.example advertised RAG_TEXT_WEAK_OR_RELAXATION=true, but src/lib/env.ts defaults it to false because it is a known-regressive opt-in experiment (buries some correct docs after re-ranking). Align the example with the safe code default. Docs + one config default only; no runtime code or schema changed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Zbpyexer9cLgxhrB61RCU
79596c5 to
d6c26b8
Compare
|
Note Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 @.env.example:
- Around line 102-105: Update the stale golden retrieval threshold comment
associated with RAG_TEXT_WEAK_OR_RELAXATION in src/lib/env.ts to require a 36/36
run, matching .env.example and the runbooks; change only the documented
release-gate value.
In `@docs/operator-backlog.md`:
- Line 24: Update the verify command in the migration backlog row to invoke the
retrieval-quality script as “npm run eval:retrieval:quality” instead of the bare
script name, while preserving the existing drift check and evaluation details.
🪄 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: 6869b7ca-b4fe-49b3-9f2f-d43c17b50f5d
📒 Files selected for processing (4)
.env.exampledocs/audit-remediation-plan-2026-07-14.mddocs/ingestion-concurrency-fix-workorder.mddocs/operator-backlog.md
| # Opt-in experiment ONLY and OFF by default (matches the src/lib/env.ts default): it is known to | ||
| # regress the golden retrieval eval (buries some correct docs after re-ranking). Leave false; | ||
| # re-enable solely behind a fresh 36/36 golden retrieval run. false = relax-only-on-empty. | ||
| RAG_TEXT_WEAK_OR_RELAXATION=false |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -n '34/34|36/36|RAG_TEXT_WEAK_OR_RELAXATION' .env.example src/lib/env.ts docsRepository: BigSimmo/Database
Length of output: 12310
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== .env.example ==\n'
sed -n '98,108p' .env.example
printf '\n== src/lib/env.ts ==\n'
sed -n '118,132p' src/lib/env.ts
printf '\n== docs references ==\n'
rg -n '34/34|36/36|RAG_TEXT_WEAK_OR_RELAXATION' docs src/lib/env.ts .env.exampleRepository: BigSimmo/Database
Length of output: 14075
Make the golden-run threshold consistent. .env.example and the runbooks say 36/36, but src/lib/env.ts:126 still says 34/34. Update the stale comment so operators see one release gate everywhere.
🤖 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 @.env.example around lines 102 - 105, Update the stale golden retrieval
threshold comment associated with RAG_TEXT_WEAK_OR_RELAXATION in src/lib/env.ts
to require a 36/36 run, matching .env.example and the runbooks; change only the
documented release-gate value.
| | -------------------------------------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | | ||
| | Apply July-8 migration batch (a–g) to live | ✅ done | — | `SUPABASE_ENVIRONMENT=production npm run check:july8-live-batch` (2026-07-13: 6 live, apply=no-op) | [operator-apply-july8-batch.md](operator-apply-july8-batch.md) | | ||
| | Apply drift-codify forward migration (step 1h) | ✅ done | — | Applied and drift/readiness verified 2026-07-13; verify only unless new reviewed drift is found | [database-drift-detection.md](database-drift-detection.md) | | ||
| | Apply repo-ahead migrations to live (post-2026-07-13) | 🔎 verify | `20260713201542` · `20260714110000` · `20260717120000` committed, live-apply unconfirmed | `npm run check:drift`; then `eval:retrieval:quality` (36/36) for the corrector | [deploy-corrector-public-titles.md](deploy-corrector-public-titles.md) | |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '--- package.json scripts matching eval:retrieval:quality ---\n'
rg -n '"eval:retrieval:quality"|eval:retrieval:quality' package.json . -g 'package.json' -g '!node_modules' || true
printf '\n--- docs operator-backlog row ---\n'
sed -n '20,28p' docs/operator-backlog.mdRepository: BigSimmo/Database
Length of output: 246
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- package.json scripts matching eval:retrieval:quality ---'
rg -n '"eval:retrieval:quality"|eval:retrieval:quality' package.json . -g 'package.json' -g '!node_modules' || true
echo
echo '--- docs operator-backlog row ---'
sed -n '20,28p' docs/operator-backlog.mdRepository: BigSimmo/Database
Length of output: 3992
Make the retrieval-quality check copy-pasteable. eval:retrieval:quality is an npm script, so the verify command should use npm run eval:retrieval:quality.
🤖 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 `@docs/operator-backlog.md` at line 24, Update the verify command in the
migration backlog row to invoke the retrieval-quality script as “npm run
eval:retrieval:quality” instead of the bare script name, while preserving the
existing drift check and evaluation details.
|
Request timed out after 900000ms (requestId=7b0764ad-d2e9-419e-99c8-cea307c0f3f6) |
Summary
Follow-through on a review of every ongoing/recommended task tracked in the repo's
docs/ledgers, cross-checked against the current tree. The code side has largely caught up since these ledgers were written, so this updates them to match reality and fixes one config footgun the review surfaced.docs/ingestion-concurrency-fix-workorder.md— mark the last open repo item (deep-memory delete-scoping) RESOLVED. It shipped as the producer-scoped replacement model: migration20260713030000_producer_scoped_deep_memory.sql(disjointartifact_generation_id-null vs producer-generation unique indexes onsection_index), a service-role commit RPC that removes only same-producer artifacts, andsrc/lib/deep-memory.tsstaging/deleting strictly scoped byproducer+artifact_generation_id(cleanupStagedArtifacts), reconciled in fix: reconcile live deep-memory commit function #569. This doc now has no open repository items.docs/operator-backlog.md— close the drift-codify forward-migration (step 1h) row; the forward-codify work-order is complete (applied 2026-07-13). Add a new🔎 verifyrow for three committed-but-unapplied migrations (20260713201542,20260714110000,20260717120000_corrector_public_titles).docs/audit-remediation-plan-2026-07-14.md— add a dated reconciliation block: which findings are now DONE in code (C1, D1, D5, E1, E2, F4, G1–G4, H6, F5), which remain open (D2, D3, E3, F1, F3, F6, H1–H5), which are in flight (draft PRs Fix frontend a11y/layout audit findings: toggle-group + duplicate padding #708/Add missing storage-bucket creation to the migration chain (drift fix) #710), and which are operator-pending..env.example(audit finding F5) — advertisedRAG_TEXT_WEAK_OR_RELAXATION=true, butsrc/lib/env.tsdefaults it tofalsebecause it is a known-regressive opt-in experiment (buries some correct docs after re-ranking). Aligned the example + comment with the safe code default.No runtime source or schema changed — docs plus one example config default.
Verification
npm run verify:pr-local— not run; change is docs + a single.env.exampledefault, no runtime/source/schema surface.src/lib/env.tsalready defaults the flag tofalse, so app behavior is unchanged.prettier --writeclean on the three changed markdown files (tables re-aligned).20260713030000_producer_scoped_deep_memory.sqlpresent;src/lib/deep-memory.tscleanupStagedArtifactsscopes deletes byproducer+artifact_generation_id; the three repo-ahead migrations exist insupabase/migrations/.eval:retrieval:quality/verify:ui/ release gates — N/A; no retrieval, ranking, UI, or answer-generation code changed.Clinical Governance Preflight
Change is documentation plus one
.env.exampledefault; it does not alter ingestion, answer generation, retrieval/ranking, source rendering, document access, or clinical output at runtime.Clinical KB Database(sjrfecxgysukkwxsowpy) — unchanged.env.exampledefault now matches the safersrc/lib/env.tsdefault (false); no live env or provider workflow touchedNotes
Generated by Claude Code
Summary by CodeRabbit