Skip to content

docs+tooling(eval): ADDENDUM 4 close-out — Phase C record, boundary-case policy, artifact trend tool (Phase D)#1006

Merged
BigSimmo merged 2 commits into
mainfrom
claude/clinical-kb-pwa-review-asi3wb
Jul 20, 2026
Merged

docs+tooling(eval): ADDENDUM 4 close-out — Phase C record, boundary-case policy, artifact trend tool (Phase D)#1006
BigSimmo merged 2 commits into
mainfrom
claude/clinical-kb-pwa-review-asi3wb

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

ADDENDUM 4 close-out (Phase D remainder + records). Three pieces, all offline:

  • Ledger row: the Phase C live verdict — canary Improve data integrity and reliability of ingestion #55 on f96217c failed 3/36 (doc_recall 1.0→0.9167, mrr 0.8921→0.8138), the Revert "feat(rag): per-candidate saturation-tail primaries" pending retrieval review (#1004) #1005 revert stands, root cause identified (spreading comparator keys above the relevance score lets raw ts_rank override boost/title/subject-aware ordering), disposition recorded (no re-land as-is; any retry = below-relevance key + differently-relevant discriminating fixtures + fresh pair).
  • Boundary-case & metric-interpretation policy (docs/observability-slos.md §3.1): top-5 boundary cases are a human decision; fixture↔snapshot lockstep + regeneration procedure; the 2026-07-20 mrr baseline step; irrelevant@10 is a labeling question before a ranking question; the ordering-headroom rules with both refuted approaches on record.
  • Artifact trend tool (scripts/eval-trend.mjs, npm run eval:trend): run-over-run metric table + per-case rr trend from downloaded eval-canary-output artifacts — the durable trend record on top of the existing 30-day artifact retention, no new infrastructure. Smoke-verified against the real canary Harden authentication and protect sensitive tokens #53 artifact.

Verification

  • npm run test -- tests/eval-trend.test.ts — 2/2
  • npm run lint + npm run typecheck — clean
  • npm run check:knip — clean (new script + test wired)
  • Prettier clean
  • Trend tool smoke on the real Harden authentication and protect sensitive tokens #53 artifact (36-case table + lithium case trend render correctly)
  • Docs + offline tooling only; no runtime surface

Risk and rollout

  • Risk: none — documentation and an offline read-only analysis script.
  • Rollback: revert.
  • Provider or production effects: None.

Clinical Governance Preflight

N/A — documentation + offline tooling only; no ingestion, answer generation, search/ranking, source rendering, document access, privacy, production-env, or clinical-output behaviour changed.

Notes

  • The confirmation canary on reverted main is in flight (dispatched ~20:16 UTC); its 36/36 result closes the loop and will be reported in-session.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EXsJcLrbZUXwnBeG91cVo9

Summary by CodeRabbit

  • New Features

    • Added an evaluation trend command that summarizes metrics across canary runs.
    • Added optional per-case trend reporting, including retrieval status and reciprocal rank.
  • Documentation

    • Documented regression-triage rules, metric interpretation, baseline handling, and trend analysis workflows.
    • Recorded the latest canary verdict and its retrieval-quality regressions.
  • Tests

    • Added coverage for aggregate metric trends and per-case results across runs.

@supabase

supabase Bot commented Jul 20, 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 ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds an eval:trend CLI for aggregate and per-case evaluation trends, tests its helpers, documents regression-triage policies, and records a Phase C canary verdict with a no-reland disposition.

Changes

Evaluation observability

Layer / File(s) Summary
Evaluation trend CLI and validation
scripts/eval-trend.mjs, package.json, tests/eval-trend.test.ts
Adds artifact parsing, aggregate and case trend builders, aligned table output, CLI argument handling, npm wiring, and Vitest coverage.
Regression policy and canary record
docs/observability-slos.md, docs/branch-review-ledger.md
Documents regression-triage and metric-interpretation rules, and records the Phase C canary result and no-reland decision.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly reflects the close-out docs and offline tooling changes, though it is a bit long.
Description check ✅ Passed The description matches the template with summary, verification, risk, governance, and notes sections filled in.
✨ 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 claude/clinical-kb-pwa-review-asi3wb

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

@BigSimmo BigSimmo changed the title docs(ledger): record Phase C live refutation and standing revert docs+tooling(eval): ADDENDUM 4 close-out — Phase C record, boundary-case policy, artifact trend tool (Phase D) Jul 20, 2026
…DUM 4 Phase D)

- docs/observability-slos.md §3.1: standing boundary-case and
  metric-interpretation policy — top-5 boundary cases are a human decision;
  fixture/snapshot lockstep + regeneration procedure; the 2026-07-20 mrr
  baseline step; irrelevant@10 is a labeling question before a ranking
  question; ordering-headroom rules with the two refuted approaches recorded
  (weight tuning no-op; comparator-key spread regression) and the constraints
  any third attempt must satisfy
- scripts/eval-trend.mjs + eval:trend script: run-over-run metric table and
  per-case rr trend from downloaded eval-canary-output artifacts (offline,
  read-only) — the durable trend record on top of the artifact retention
- smoke-verified against the real canary #53 artifact

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EXsJcLrbZUXwnBeG91cVo9
@BigSimmo
BigSimmo marked this pull request as ready for review July 20, 2026 20:05
@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.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 20, 2026 20:05
@BigSimmo
BigSimmo merged commit 40a4962 into main Jul 20, 2026
20 of 21 checks passed
@BigSimmo
BigSimmo deleted the claude/clinical-kb-pwa-review-asi3wb branch July 20, 2026 20:08

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/eval-trend.test.ts (1)

37-60: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add a regression test for the CLI invocation without --case.

These tests exercise only buildTrendRows and buildCaseTrend, so they will not catch main() dropping the first artifact in the documented default invocation. Cover one- and two-file CLI calls, including preserved input order.

🤖 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 `@tests/eval-trend.test.ts` around lines 37 - 60, Add regression coverage for
the CLI entry point main() when invoked without --case, verifying one-file and
two-file artifact calls preserve all inputs and their original order. Keep the
existing buildTrendRows and buildCaseTrend tests, and exercise the documented
default CLI invocation rather than only the underlying helpers.
🤖 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 `@scripts/eval-trend.mjs`:
- Around line 64-66: Update the files filter in the argument-parsing flow around
caseFlag and caseId so it removes the argument following --case only when --case
is present; when absent, preserve every artifact argument, including the first
file, while continuing to exclude the --case flag and its associated case
identifier.

---

Nitpick comments:
In `@tests/eval-trend.test.ts`:
- Around line 37-60: Add regression coverage for the CLI entry point main() when
invoked without --case, verifying one-file and two-file artifact calls preserve
all inputs and their original order. Keep the existing buildTrendRows and
buildCaseTrend tests, and exercise the documented default CLI invocation rather
than only the underlying helpers.
🪄 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: d70471d3-6d9e-49b3-a631-10742ea73538

📥 Commits

Reviewing files that changed from the base of the PR and between 0a498e6 and 85c2a31.

📒 Files selected for processing (5)
  • docs/branch-review-ledger.md
  • docs/observability-slos.md
  • package.json
  • scripts/eval-trend.mjs
  • tests/eval-trend.test.ts

Comment thread scripts/eval-trend.mjs
Comment on lines +64 to +66
const caseFlag = argv.indexOf("--case");
const caseId = caseFlag >= 0 ? argv[caseFlag + 1] : undefined;
const files = argv.filter((arg, index) => arg !== "--case" && index !== caseFlag + 1);

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not drop the first artifact when --case is absent.

With no --case, caseFlag is -1, so index !== caseFlag + 1 becomes index !== 0. The documented two-file invocation therefore reports only the second run, while a single-file invocation exits with “no files”.

Proposed fix
   const caseFlag = argv.indexOf("--case");
   const caseId = caseFlag >= 0 ? argv[caseFlag + 1] : undefined;
-  const files = argv.filter((arg, index) => arg !== "--case" && index !== caseFlag + 1);
+  const files =
+    caseFlag >= 0
+      ? argv.filter((_, index) => index !== caseFlag && index !== caseFlag + 1)
+      : argv;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const caseFlag = argv.indexOf("--case");
const caseId = caseFlag >= 0 ? argv[caseFlag + 1] : undefined;
const files = argv.filter((arg, index) => arg !== "--case" && index !== caseFlag + 1);
const caseFlag = argv.indexOf("--case");
const caseId = caseFlag >= 0 ? argv[caseFlag + 1] : undefined;
const files =
caseFlag >= 0
? argv.filter((_, index) => index !== caseFlag && index !== caseFlag + 1)
: argv;
🤖 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 `@scripts/eval-trend.mjs` around lines 64 - 66, Update the files filter in the
argument-parsing flow around caseFlag and caseId so it removes the argument
following --case only when --case is present; when absent, preserve every
artifact argument, including the first file, while continuing to exclude the
--case flag and its associated case identifier.

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