Skip to content

fix(ci): run the answer-targeting instrument even when the gate subset fails (E-2 baseline record)#1016

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

fix(ci): run the answer-targeting instrument even when the gate subset fails (E-2 baseline record)#1016
BigSimmo merged 1 commit into
mainfrom
claude/clinical-kb-pwa-review-asi3wb

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

The Phase E-2 baseline dispatch (#57, run 29786560936, answer_case_limit=44) worked exactly as intended — and exposed one instrument defect this PR fixes.

Baseline findings (banked in the ledger row): golden retrieval held 36/36 in-run; eval:quality over the full 44 cases went red on exactly two gates — citation_failure_rate 0.0227 (one case whose expected document never surfaced, leaving a 1-citation extractive fallback) and route_ceiling_failure_count 2 (one 13.3s pure-retrieval blowout of a 12s extractive budget; one 54ms miss after a provider timeout consumed 22.6s). Grounding, refusal correctness (including both prompt-injection probes), numeric faithfulness, and governance-danger gates all green. Systemic finding: ~9 of 19 generation attempts were discarded by the quality gate with the extractive fallback winning — the primary E-3 target.

The fix: the new answer-targeting step was skipped in that run because GitHub skips subsequent steps once one fails, and its if: didn't override that. A baseline/paired-run instrument must observe red gates, so the condition now includes !cancelled(). Still dispatch-only, default-off, informational (exit 0): scheduled runs remain byte-identical, and a failing gate subset still fails the run — this step can only ever add data, never verdicts.

RAG impact: no retrieval behaviour change — workflow step-condition + ledger documentation only.

Verification

  • npm run check:github-actions — pass
  • npm run check:ci-scope — pass
  • npm run check:gate-manifest — pass
  • npx prettier --check on both files — clean
  • Baseline evidence read directly from the run 29786560936 job log (Answer Metrics table + all five failing-case diagnostics)

Risk and rollout

  • Risk: low — a one-condition change on a default-off, dispatch-only, informational step. Failure of the gate subset still fails the run.
  • Rollback: revert.
  • Provider or production effects: none from this diff. Next planned dispatch after merge: default answer_case_limit (8) + answer_quality_eval=true to bank the skipped 30-case targeting baseline (~$1–2 of the approved ≤$20 Phase E envelope).

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use — no behaviour change
  • No patient-identifiable document workflow was introduced or expanded
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy) — no env changes
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked: no clinical decision-support behaviour changed — measurement only

🤖 Generated with Claude Code

https://claude.ai/code/session_01EXsJcLrbZUXwnBeG91cVo9


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved evaluation workflow behavior so optional answer-quality evaluations do not run after cancellation.
    • Updated related workflow guidance to reflect the corrected execution behavior.
  • Documentation

    • Added a review record documenting evaluation results, identified issues, corrective actions, estimated spend, and next steps.

…t fails

Dispatch #57 (the Phase E-2 baseline) proved the gap: eval:quality went red on
two real gates (citation_failure_rate, route_ceiling_failure_count), and
GitHub's failure-skip semantics then skipped the informational targeting step -
exactly the run where its data was most needed. The step's if: now includes
!cancelled() so baseline and paired runs observe red gates too. Ledger row
banks the full E-2 baseline numbers from run 29786560936.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EXsJcLrbZUXwnBeG91cVo9
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The canary workflow now prevents answer-quality targeting evaluations from running after cancellation. The review ledger records the Phase E-2 baseline dispatch, gate outcomes, instrumentation fix, spend, and next steps.

Changes

Canary evaluation tracking

Layer / File(s) Summary
Canary gating and baseline record
.github/workflows/eval-canary.yml, docs/branch-review-ledger.md
The answer-quality targeting step now requires !cancelled(), and the review ledger adds the corresponding Phase E-2 baseline results and follow-up details.

Estimated code review effort: 2 (Simple) | ~5 minutes

Possibly related PRs

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: enabling the answer-targeting instrument when the gate subset fails.
Description check ✅ Passed The description follows the template well, with summary, verification, risk/rollback, and governance preflight sections filled in.
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.
✨ Finishing Touches
🧪 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 marked this pull request as ready for review July 20, 2026 23:46
@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 ↗︎.

@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 23:46
@BigSimmo
BigSimmo merged commit 87815f4 into main Jul 20, 2026
18 of 19 checks passed
@BigSimmo
BigSimmo deleted the claude/clinical-kb-pwa-review-asi3wb branch July 20, 2026 23:48

@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

🤖 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 @.github/workflows/eval-canary.yml:
- Line 175: Update the conditional guarding the optional targeting run to
require successful completion of the preflight, setup_node, install, and
project_guard setup steps, while retaining the workflow_dispatch and
answer_quality_eval checks. Replace the broad !cancelled() condition so the live
targeting step cannot run after any required setup failure.
🪄 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: 039e2c6f-0b78-47ca-a799-97393bd3b31f

📥 Commits

Reviewing files that changed from the base of the PR and between 5b4098d and 3d1cac1.

📒 Files selected for processing (2)
  • .github/workflows/eval-canary.yml
  • docs/branch-review-ledger.md

- name: Answer-quality targeting eval (optional, dispatch-only)
id: answer_targeting
if: github.event_name == 'workflow_dispatch' && github.event.inputs.answer_quality_eval == 'true'
if: ${{ !cancelled() && github.event_name == 'workflow_dispatch' && github.event.inputs.answer_quality_eval == 'true' }}

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the relevant workflow section with line numbers.
sed -n '130,220p' .github/workflows/eval-canary.yml | cat -n

# Map the workflow structure to locate the step names and surrounding conditions.
python3 - <<'PY'
from pathlib import Path
p = Path('.github/workflows/eval-canary.yml')
text = p.read_text()
for needle in [
    'answer_quality_eval',
    'golden_retrieval',
    'answer_quality',
    'preflight',
    'install',
    'project_guard',
    'cancelled()',
]:
    print(f"\n## {needle}")
    for i, line in enumerate(text.splitlines(), 1):
        if needle in line:
            print(f"{i}: {line}")
PY

Repository: BigSimmo/Database

Length of output: 7041


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show the full workflow section around the relevant steps.
sed -n '100,190p' .github/workflows/eval-canary.yml | cat -n

# Show the job-level conditions and any references to the step outcomes later in the file.
sed -n '190,280p' .github/workflows/eval-canary.yml | cat -n

Repository: BigSimmo/Database

Length of output: 9589


Gate the optional targeting run on the setup steps.

!cancelled() lets this dispatch-only eval run after earlier setup failures too, not just after answer_quality fails. Require preflight, setup_node, install, and project_guard to succeed before launching the live targeting step.

🤖 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 @.github/workflows/eval-canary.yml at line 175, Update the conditional
guarding the optional targeting run to require successful completion of the
preflight, setup_node, install, and project_guard setup steps, while retaining
the workflow_dispatch and answer_quality_eval checks. Replace the broad
!cancelled() condition so the live targeting step cannot run after any required
setup failure.

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