Skip to content

feat(ledger): record 15 delivered resolutions, harden operator runbooks, and relax source metadata schema - #2107

Merged
BigSimmo merged 6 commits into
mainfrom
gemini/safe-ledger-resolutions-and-hardening
Aug 18, 2026
Merged

feat(ledger): record 15 delivered resolutions, harden operator runbooks, and relax source metadata schema#2107
BigSimmo merged 6 commits into
mainfrom
gemini/safe-ledger-resolutions-and-hardening

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary of Changes

This PR implements safe, zero-risk tasks across three categories, plus one RAG-surface schema change requiring the governance sections below.

1. Category A: 14 Verified Resolutions Recorded in Ledger Inbox

Queued merge-safe immutable JSON resolution tickets in docs/outstanding-issues-inbox/ for tasks previously verified on main:

Correction from an earlier version of this description: #178 (PR policy clinical/operational risk bundling detection) was listed here but was never actually queued as an inbox ticket by this PR — it doesn't need one, since it's already resolved directly on docs/outstanding-issues.md ("DELIVERED — verified on main 2026-08-14"). Count corrected from 15 to 14 to match what this PR's diff actually contains.

2. Category B: Pure Documentation & Runbook Hardening (Zero Risk)

3. Category C: Safe Helper & Schema Resilience


RAG impact

src/lib/rag/rag-row-contracts.ts matches this repo's RAG-ranking-protected-surface pattern, so here is the required declaration:

RAG impact: no retrieval behaviour change. sourceMetadataSchema widened from .nullable() (value must be present: an object or null) to .nullish() (value may additionally be absent/undefined). Traced the only consumer, normalizeOptionalSourceMetadata in src/lib/source-metadata.ts:98-111: it starts with if (input == null || ...) return null — a loose (==) equality check that treats null and undefined identically, falling back to the same conservative "unknown" governance-field defaults (document_status, clinical_validation_status, extraction_quality) either way. Ranking, scoring, and citation output are therefore provably unaffected by this change — the one real effect is at the validation boundary itself: a retrieval row with the source_metadata key entirely absent (as opposed to present-and-null) now passes retrievalRowSchema instead of throwing RetrievalRowShapeError. Given source_metadata is deliberately the one field this contract pins stricter than the rest specifically to catch RPC drift (per the file's own doc comment, and per the active RPC divergence docs/outstanding-issues.md #316 documents), that tradeoff is worth naming even though it doesn't change clinician-facing output: a genuinely malformed/drifted row missing this key will now be silently accepted rather than rejected. No canary was run since there is no retrieval-output behaviour to measure a difference in.

Clinical Governance Preflight

Complete this section when the change touches ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output.

  • Source-backed claims still require linked source verification before clinical use — unaffected; citation content and linking are untouched by this change.
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval — unaffected; no new data flow, only validation permissiveness at one field.
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy) — unaffected.
  • Service-role keys and private document access remain server-only — unaffected.
  • Demo/synthetic content remains clearly separated from real clinical sources — unaffected.
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative — verified directly: the fallback path for missing/null source_metadata was already "unknown" for every governance field before this change, and remains so after it (see RAG impact above).
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed — no clinical decision-support behavior changed; N/A.

Verification

  • npm run check:outstanding-issues passed.
  • docs/codebase-index.md coverage verified.
  • npm run format 100% clean.
  • RAG impact assessment above traced the actual downstream consumer rather than asserting no-op by default.

@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.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 5 minutes

Limit details: You’ve used all 1 included review currently available under your plan. You completed 101 included PR reviews in the past 7 days; at that activity level, included reviews refill at 1 review per hour.

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: c8972bf6-9f38-4de4-97ed-7c3d38c8c53b

📥 Commits

Reviewing files that changed from the base of the PR and between ddc7e89 and 4aa47ef.

📒 Files selected for processing (18)
  • AGENTS.md
  • docs/branch-review-records/4e262bb80863de82f05070ca638861abbaa290b834c0af51b4166ffa18a15a58.record.md
  • docs/launch-operator-runbook.md
  • docs/outstanding-issues-inbox/0381a544-b800-43bb-a164-2b3cb3905ef2.json
  • docs/outstanding-issues-inbox/0a33bfad-4040-43f8-8c73-eb1dd9b812cc.json
  • docs/outstanding-issues-inbox/3f0341a4-ff83-407d-a101-0869f4f6dcff.json
  • docs/outstanding-issues-inbox/56f6b76a-23f5-42aa-a53f-4a4eda7b3931.json
  • docs/outstanding-issues-inbox/74c53285-5573-467b-8981-3c5fa85d741d.json
  • docs/outstanding-issues-inbox/858e5a57-c596-4f67-ab59-a8796f6ac8e8.json
  • docs/outstanding-issues-inbox/8cb71020-2847-4e10-bb7b-6b9594c26997.json
  • docs/outstanding-issues-inbox/9cd34b77-de50-4414-b1c8-591db58bfd6a.json
  • docs/outstanding-issues-inbox/9f306cfd-a6cb-4c17-93e6-69bd6a242d42.json
  • docs/outstanding-issues-inbox/a7e38702-35d6-453f-9e8f-6856f1c8ae5c.json
  • docs/outstanding-issues-inbox/bb8b27de-6149-4600-b4a5-65dd883f9b47.json
  • docs/outstanding-issues-inbox/bd3673cb-2d9e-445e-a29e-4c59f1b44573.json
  • docs/outstanding-issues-inbox/c9b0667f-1901-4f12-ac68-2c4bb3c6fe81.json
  • docs/outstanding-issues-inbox/eaa2e757-ad60-4fc7-abb5-58a1d381f0b1.json
  • src/lib/rag/rag-row-contracts.ts
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gemini/safe-ledger-resolutions-and-hardening

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

@supabase

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

@github-actions

Copy link
Copy Markdown
Contributor

CI triage

CI failed on this PR. Automated classification of the 2 failed job(s):

  • Static PR checksneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #12004 (cancelled).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

BigSimmo and others added 4 commits August 18, 2026 18:17
Synced origin/main into the branch (behind-but-clean, no conflicts).
PR policy check genuinely fails and is left for a human: the diff
touches the RAG-ranking-protected src/lib/rag/rag-row-contracts.ts
without a required `RAG impact:` line or Clinical Governance
Preflight section. Trust/integrity spot-check: the PR body claims 15
delivered resolutions but only 14 outstanding-issues-inbox tickets
exist in the diff -- #178 is described in prose but was never
actually queued.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@BigSimmo
BigSimmo enabled auto-merge (squash) August 18, 2026 12:46
@BigSimmo
BigSimmo merged commit ce702ba into main Aug 18, 2026
25 checks passed
@BigSimmo
BigSimmo deleted the gemini/safe-ledger-resolutions-and-hardening branch August 18, 2026 12:55
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.

2 participants