Skip to content

fix(fsma-recall): count zero-second completed drills as SLA met - #3592

Merged
PetrefiedThunder merged 1 commit into
mainfrom
pi/recall-sla-zero-duration
Oct 25, 2026
Merged

PetrefiedThunder merged 1 commit into
mainfrom
pi/recall-sla-zero-duration

Conversation

@PetrefiedThunder

@PetrefiedThunder PetrefiedThunder commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

RecallDrill.sla_status in services/graph/app/fsma_recall/models.py used a truthiness check (if self.duration_seconds and ...). That marked a drill completed in 0 seconds as BREACHED. DeepSeek found this. It now checks duration is not None and duration <= sla_limit.

Boundaries under 21 CFR 1.1455(c)(1) (24-hour limit):

  • 0 s: MET (was BREACHED)
  • exactly 24h: MET (unchanged)
  • 24h + 1s: BREACHED (unchanged)
  • in-progress MET / AT_RISK / BREACHED logic: unchanged; sla_limit = 24 * 3600 is kept as-is

Tests

services/graph/tests/test_recall_sla_zero_duration.py: data-free, timestamps only.

Reviewer: any non-pi engine, per Lead.

Known failure: tests/docs/test_ingest_samples_validate.py on main (fixed by #3585).


Note

Low Risk
Localized SLA classification fix for recall drill compliance reporting; no auth or data-path changes, with explicit regression tests.

Overview
Fixes RecallDrill.sla_status so completed drills with 0-second duration are reported as MET instead of BREACHED. The completed-branch check now uses duration is not None and duration <= sla_limit instead of truthiness on duration_seconds, which incorrectly treated 0 as missing.

Adds test_recall_sla_zero_duration.py (timestamp-only) to lock 21 CFR 1.1455(c)(1) boundaries: 0 s and exactly 24 h stay MET, 24 h + 1 s stays BREACHED, and completed drills without completed_at still fall back to elapsed time. In-progress SLA behavior is unchanged.

Reviewed by Cursor Bugbot for commit ffd29de. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
regengine Ready Ready Preview Oct 25, 2026 5:36am UTC

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T05:35:23.673022Z ffd29de PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 2eaad75 and ffd29de.

Files selected for processing: 2
  • services/graph/app/fsma_recall/models.py
  • services/graph/tests/test_recall_sla_zero_duration.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Walkthrough

RecallDrill.sla_status now treats a completed drill with a zero-second duration as MET. A missing duration remains ineligible for MET. New timestamp-only tests cover zero duration, exactly 24 hours, more than 24 hours, and a missing completion timestamp.

Priority: Low

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

Severity of issue fixed: Low

Merge Risk: Minimal · up to ffd29

No actionable merge-blocking risk remains in this change.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: zero-second completed drills now count as meeting the SLA.
Description check Passed The description is detailed and on topic. It explains the bug, the intended SLA boundaries, the test coverage, and the known unrelated failure. It does not include the template's Type of Change, Check…
Docstring Coverage Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files.
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.
Full details: Description check

Explanation

The description is detailed and on topic. It explains the bug, the intended SLA boundaries, the test coverage, and the known unrelated failure. It does not include the template's Type of Change, Checklist, or Related Issues sections, but the available information is sufficient for review.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Vercel preview access note removed (A-2177 secret-hygiene cleanup).
Access is via Vercel login (Deployment Protection).

@github-actions

Copy link
Copy Markdown
Contributor

PR Blocker Checklist

Head SHA: ffd29deebe74b95dbb950aede81bde84a758a34f

Status: Ready

  • All review threads resolved
  • No reviews requesting changes
  • No blocked review engines

@PetrefiedThunder PetrefiedThunder left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEW: PASS deepseek ffd29de

The remerge-diff for this head is empty. I ran the new tests directly against both versions of models.py. On main, only the 0 s test fails. With this fix, all 4 pass. Inside the COMPLETED branch, None can't be reached.

Non-blocking:

  • A negative duration counts as MET both before and after this change. That's pre-existing and untested, so I'd suggest a follow-up.

CI: every real build and test check is green, including Backend CI Status Gate (pass). PR Gate: Backend and CI Status Gate failed because PR Gate: Backend hit its 45-minute timeout ("Timed out waiting for Backend CI Status Gate", job 121087161004) before the real gate finished, which it later did with a pass. That's a gate-only failure, and #3595 fixes it.

@PetrefiedThunder
PetrefiedThunder enabled auto-merge (squash) October 25, 2026 07:01
@PetrefiedThunder
PetrefiedThunder merged commit ab2e59f into main Oct 25, 2026
98 of 105 checks passed
@PetrefiedThunder
PetrefiedThunder deleted the pi/recall-sla-zero-duration branch October 25, 2026 07:22

This branch was successfully deployed

1 active deployment
Preview — ffd29dee Deployed Oct 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant