Skip to content

feat(ops): daily ops digest from the deep health probe (dispatch-only)#587

Merged
BigSimmo merged 1 commit into
mainfrom
claude/ops-digest
Jul 13, 2026
Merged

feat(ops): daily ops digest from the deep health probe (dispatch-only)#587
BigSimmo merged 1 commit into
mainfrom
claude/ops-digest

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

What

Wave 2b. Surfaces the live deep /api/health signal (SLO counters, cache hit-rate, answer spend, degraded/truncation rates) proactively via a daily digest, instead of only when someone looks.

  • scripts/ops-digest.mjs — dependency-free renderer that fetches the deep probe (x-health-deep-token) and renders a one-screen Markdown digest. An unreachable or degraded app is the report (always exits 0). Emits status/alerting to $GITHUB_OUTPUT. Pure render + URL helpers exported and tested.
  • .github/workflows/ops-digest.ymlSHIPPED DISABLED (workflow_dispatch only; schedule commented out). Config via repo var PROD_HEALTH_URL + secret HEALTH_DEEP_PROBE_SECRET — nothing hardcoded. Keeps a rolling ops-digest issue updated and comments (notifies) only when status != ok or spend alerts. Pinned actions, ubuntu-24.04, least-privilege permissions, preflight-secrets guard.
  • tests/ops-digest.test.ts — 6 offline tests.

Enabling (operator step)

  1. Add repo variable PROD_HEALTH_URL (e.g. https://<app-host>)
  2. Add repo secret HEALTH_DEEP_PROBE_SECRET (same value as the deployment)
  3. Uncomment the schedule: block, run one workflow_dispatch, confirm the issue looks right.

Verification

6/6 vitest, check:github-actions (pin check), eslint, prettier — all green. No live calls run in CI; the workflow is dispatch-only until you enable it.

🤖 Generated with Claude Code

Wave 2b. Surfaces the live deep /api/health signal (SLO counters, cache
hit-rate, answer spend, degraded/truncation rates) proactively instead of only
when someone looks.

- scripts/ops-digest.mjs: dependency-free renderer that fetches the deep probe
  (x-health-deep-token) and renders a one-screen Markdown digest; an unreachable
  or degraded app IS the report (always exits 0). Emits status/alerting to
  $GITHUB_OUTPUT. Pure render + URL helpers are exported and tested.
- .github/workflows/ops-digest.yml: SHIPPED DISABLED (workflow_dispatch only;
  schedule commented). Config via repo var PROD_HEALTH_URL + secret
  HEALTH_DEEP_PROBE_SECRET (nothing hardcoded). Keeps a rolling "ops-digest"
  issue updated and comments only when status != ok or spend alerts. Pinned
  actions, ubuntu-24.04, least-privilege permissions, preflight-secrets guard.
- tests/ops-digest.test.ts: 6 offline tests (URL resolve, unreachable/healthy
  render, over-threshold + truncated flags).

Enabling the daily cadence is an operator step (add var+secret, uncomment cron,
run one dispatch to confirm). Verified: 6/6 vitest, check:github-actions, eslint,
prettier — all green. No live calls in CI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@supabase

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

@BigSimmo
BigSimmo enabled auto-merge (squash) July 13, 2026 14:08
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@BigSimmo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d447e4f-8f99-419c-b54f-51e724545df4

📥 Commits

Reviewing files that changed from the base of the PR and between b8b4843 and 8355970.

📒 Files selected for processing (3)
  • .github/workflows/ops-digest.yml
  • scripts/ops-digest.mjs
  • tests/ops-digest.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/ops-digest
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/ops-digest

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

@BigSimmo
BigSimmo merged commit ec21163 into main Jul 13, 2026
14 of 15 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8355970c03

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/ops-digest.mjs
if (out) writeFileSync(out, digest);

const status = health?.status ?? "unreachable";
const alerting = Boolean(health?.spend?.alerting);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Alert on SLO counters instead of spend-only

When the deep probe is reachable but the answer SLO counters are bad, /api/health still returns status: "ok" by design; src/lib/health-response.ts only uses reachability/config checks for liveness and currently returns slo/cache, not a spend block. Because this output is set only from health.spend.alerting, a spike in hybridRpcErrorRate, degradedRate, or truncation/timeout fallbacks leaves alerting=false, so the workflow just edits the rolling issue and does not comment or warn on the silent-degradation failure mode this digest is meant to surface. Evaluate thresholds from health.slo/health.cache here, or consume an alert field that the health endpoint actually emits.

Useful? React with 👍 / 👎.

Comment thread scripts/ops-digest.mjs
export function resolveHealthUrl(raw) {
if (!raw) return undefined;
const trimmed = raw.trim().replace(/\/+$/, "");
if (/\/api\/health/.test(trimmed)) return trimmed;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Append deep=1 for health endpoint URLs

If an operator sets PROD_HEALTH_URL to the full endpoint https://host/api/health without the query string, this branch returns it unchanged even though healthResponse only enables the diagnostic blocks when deep=1 is present. That run will authenticate with the token but receive the shallow health payload, so the digest can report ok while silently omitting the SLO/cache signals it was added to publish. Treat /api/health as a URL that still needs deep=1 unless the query already contains it.

Useful? React with 👍 / 👎.

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.

1 participant