Skip to content

Skip discarded dependency probes on the public health route - #317

Merged
PetrefiedThunder merged 14 commits into
mainfrom
claude/health-public-probes
Nov 29, 2026
Merged

PetrefiedThunder merged 14 commits into
mainfrom
claude/health-public-probes

Conversation

@PetrefiedThunder

@PetrefiedThunder PetrefiedThunder commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

With proof surfaces unmounted, GET /health/dependencies ran all eight dependency probes and then projected four of them (mqtt, stripe, llm, sentinel) out of the payload. An anonymous caller could make the gateway call Stripe and Sentinel (plus the LLM provider and the MQTT broker) for verdicts that were never returned.

gather_dependency_report() now takes an optional only set and starts just those probes. The unmounted posture passes PUBLIC_DEPENDENCY_KEYS, so the discarded probes never start. With proof surfaces mounted, and for every other caller, all probes run as before.

Why this instead of caching the verdict for a few seconds: not starting the probes removes the outbound calls entirely, in about 15 changed lines, with no new state, expiry or per-process cache to reason about. A cache would still let the first caller in each window trigger the calls and would add shared mutable state to a health path.

The route's rate limiting is untouched, so it is not an exemption. What an authenticated or proof-surface caller sees is unchanged.

Related issues

Refs #316

Area and license

  • I identified the repository area changed by this PR: gateway/.
  • I understand that spec/, verifier/, sdk/python/, sdk/typescript/, integrations/, and examples/ are Apache-2.0.
  • I understand that gateway/ contributions are under FSL-1.1-ALv2 (Fair Source).
  • This PR does not include proprietary hosted-service code or secrets.

Spec changes

  • This PR does not change normative spec behavior.
  • If it changes normative spec behavior, I opened or linked an RFC issue.

Validation

  • Tests: tests/test_health_public_probes.py (5 cases) plus test_health_public_projection.py, test_runtime_degradation.py, test_runtime_mode.py, test_onboarding_contract.py, test_human_accessibility.py, test_commit_sha_precedence.py, test_build_provenance.py, test_stale_commit_sha_prevention.py, test_human_preflight.py and test_discover_phase9.py pass (82 passed across the touched and neighbouring health modules).
  • Fail on main, pass on the fix: test_anonymous_public_request_starts_no_stripe_or_sentinel_probe. On unfixed main code it fails with {'stripe': 1, 'sentinel': 1} == {'stripe': 0, 'sentinel': 0}. It sets a Stripe key and a reachable Sentinel target with human approval not simulated, and counts calls by patching the stripe.Balance class and the httpx.AsyncClient class (no singleton instance is patched).
  • Also fail on main: test_only_limits_the_probes_started_and_the_entries_reported (the only argument does not exist there).
  • Regression pins that already pass on main: the public body equals the projection of the full report (latency excluded), and mounted proof surfaces still run every probe including Stripe and Sentinel.
  • Other checks: ruff 0.17.3 check and format --check clean in gateway; mypy 2.4.1 on app/ clean; no em dashes, en dashes or spaced hyphens in added lines. Test keys are generated at run time with secrets.token_urlsafe; nothing key-shaped is committed.

Risk and compatibility

gather_dependency_report() keeps its no-argument behavior. The public payload is unchanged (same keys, order and values). The only change is that four probes are no longer started on the unmounted posture, so the route does less work and makes fewer outbound calls.

Contributor checklist

  • I added or updated tests for behavior changes, or explained why tests are not applicable.
  • I updated relevant documentation and examples (the gather_dependency_report docstring; no user docs describe the probe set).
  • Every commit in this PR is signed off under the Developer Certificate of Origin.
  • I agree to submit this contribution under the license applicable to the files I changed.

Generated by Claude Code


Note

Low Risk
Public JSON is unchanged; the route does less work and fewer outbound calls when proof surfaces are off. No auth or data-path changes.

Overview
Fixes a probe-abuse gap on the unauthenticated /health/dependencies route when proof surfaces are unmounted: the handler still ran all eight dependency checks, then dropped mqtt, stripe, llm, and sentinel from the JSON—so anonymous traffic could force outbound Stripe and Sentinel (and other) probes for results that were never returned.

gather_dependency_report() now accepts an optional only frozenset and only starts those probes in parallel; excluded names never run and make no outbound call. In production posture, the route calls gather_dependency_report(only=PUBLIC_DEPENDENCY_KEYS) before build_public_dependency_report, so only wedge deps (postgres, redis, signing_key, upstream_mcp) are probed. With ENABLE_PROOF_SURFACES=true, behavior is unchanged: full report, all probes.

New tests in test_health_public_probes.py assert zero Stripe/Sentinel calls on the public route, payload parity with the projected full report, and that only and proof-surface modes behave as expected.

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

With proof surfaces unmounted, GET /health/dependencies ran all eight
dependency probes and then projected four of them (mqtt, stripe, llm,
sentinel) out of the payload. An anonymous caller could therefore make the
gateway call Stripe and Sentinel, plus the LLM provider and MQTT broker, for
verdicts that were never returned.

gather_dependency_report() takes an optional `only` set and starts just those
probes. The unmounted posture passes PUBLIC_DEPENDENCY_KEYS, so the discarded
probes never start. The public body is unchanged, and the mounted posture and
every other caller still run every probe.

Refs #316

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GyhDYFb4TkoQywfuiXtQQ5
Signed-off-by: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
agent-middleware-web Ready Ready Preview Nov 29, 2026 7:14am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2d65597 and 8914551.

Files selected for processing: 3

  • gateway/app/core/health.py
  • gateway/app/main.py
  • gateway/tests/test_health_public_probes.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

tests/test_clean_database_adoption.py requires any test module that imports
the shared app to take clean_database, and the new module did not, so the
gateway jobs failed on that guard. The client fixture now takes the fixture.

Refs #316

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GyhDYFb4TkoQywfuiXtQQ5
Signed-off-by: Claude <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 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-11-05T13:31:57.019276Z 0eb3254 Draft marked ready
ℹ️ 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.

Copy link
Copy Markdown
Collaborator Author

READY FOR QA 0eb3254

Refs #316. The unauthenticated /health/dependencies route started every dependency probe (Stripe, the LLM provider, the MQTT broker, Sentinel) and then discarded most of the results. gather_dependency_report(only=...) now starts only the named probes, and the route passes PUBLIC_DEPENDENCY_KEYS when proof surfaces are unmounted, so an anonymous caller makes zero Stripe and zero Sentinel calls. The mounted-surface output and the rate limiting are unchanged, and build_public_dependency_report already recomputes the overall status from the public keys only, so the public status cannot change.

Evidence: five tests in gateway/tests/test_health_public_probes.py. On main's code the zero-calls test fails with {'stripe': 1, 'sentinel': 1} and the only unit test fails; three pins (public body equals the projection of the full report, mounted surfaces still run every probe, the no-argument call runs all probes) pass on both. The tests count calls by patching the stripe.Balance and httpx.AsyncClient classes, not instances, and the module takes clean_database like the other shared-app tests. Checked locally: 71 passed across the new and existing health tests and the clean-database guard; ruff clean; no dash or spaced-hyphen hits.

State: 3 files, +173/-33. The branch is 10 commits behind main, a trial merge of main is textually clean, and none of those commits touches gateway/app/core/health.py, gateway/app/main.py or the new test file. CI result, License result, gitleaks, the gateway Python 3.11 to 3.14 legs and both Postgres legs are green. The merger will merge main in; I will re-name the head if it moves.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Maintainer yes recorded by the coordinating session, on the maintainer's instruction to it on 2026-11-19, verbatim: "yes to #317".

This is the maintainer's yes for merging #317. It applies to this PR's own patch as it stands: 3 files, +173/-33 (gateway/app/core/health.py, gateway/app/main.py, gateway/tests/test_health_public_probes.py) at head 0eb3254ea5e48a9e5b0fc329414dc2aa6dc8287e. It does not cover later changes to that patch.

It does not waive the QA gate. There is no REVIEW: PASS or REVIEW: FAIL on this PR (READY FOR QA 0eb3254 was posted on 2026-11-05; the Codex connector review of that head completed with no findings, which is not a QA verdict; CI on that head was green). Merging still needs a REVIEW: PASS on the exact head being merged; if main is merged in first, the new head needs its own.

Checked today by the coordinating session, read-only:

The coordinating session merges nothing and posts no QA verdict.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

READY FOR QA 137d131

This is a readiness marker, not a QA verdict. I post no REVIEW: PASS or REVIEW: FAIL.

Head: 137d1310be16c0d043165dda5823df16a45b2a3f (main 4c8f3cf merged into the branch on 2026-11-24 at the maintainer's request). Verified: the merge commit has an empty git show --remerge-diff and the PR's three files do not overlap the files main changed.

CI on this head: CI result success. Gateway py3.11 to py3.14, Postgres proofs, Postgres concurrency, Trust release gate, M1 external judge, lint, CodeQL, gitleaks, Cursor Bugbot: all success. CodeRabbit reported neutral.

Local run before CI, on this head: 79 passed.

Maintainer yes: recorded in an earlier comment for this PR's own patch, bound to the head named there. It covers the patch only. It does not waive the QA gate. A new head needs its own REVIEW: PASS, and QA decides.

Main moved again: main is now 3d7ca7c (#335, docs only, gateway/docs/failure-lab.md). This branch is one docs-only commit behind. I did not merge it in, because that would reset CI and any verdict for a change that touches none of this PR's files. Whoever merges will need to update the branch first, which creates a head that needs its own REVIEW: PASS.

I merge nothing.


Generated by Claude Code

@cursor

cursor Bot commented Nov 24, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 208607bc-b870-41d8-acad-50846144eef2)

Copy link
Copy Markdown
Collaborator Author

READY FOR QA 7a6d72d

This is a readiness marker, not a QA verdict. I post no REVIEW: PASS or REVIEW: FAIL. It replaces my earlier marker on 137d131, which names a head that is no longer current.

Head: 7a6d72d9006b46be1590efbc5e2bb5475a31f86d, which is 137d131 plus a merge of main 3d7ca7c (docs only, gateway/docs/failure-lab.md) made on 2026-11-24 at the maintainer's request through GitHub's update-branch API. Verified: two parents (137d131, 3d7ca7c), the only file that differs from 137d131 is gateway/docs/failure-lab.md, and git show --remerge-diff is empty. The PR patch is unchanged. API merge commits carry no sign-off trailer.

CI on this head: CI result success. Gateway py3.11 to py3.14, Postgres proofs, Postgres concurrency, Trust release gate, M1 external judge, lint, CodeQL, Analyze (python, javascript-typescript, actions), gitleaks, licence check: all success. I did not run the tests locally on this head; the delta from the previous head is one docs file.

Not reviewed by bots on this head: Cursor Bugbot did not run (usage limit reached, check conclusion neutral). CodeRabbit hit its review limit (check conclusion neutral). No bot has reviewed this head.

Main has moved again: main is now cb5bd1a (#214, refund amount proof in receipt evidence; gateway/app/trust/evidence.py, gateway/scripts/trust_coverage_gate.sh, two test files). This branch is one commit behind. My local trial merge (git merge-tree) of cb5bd1a into this head is clean, and none of #214's files is touched by this PR. I did not push a merge, because each update resets CI and any verdict. Whoever merges will need to update the branch first, which creates a head that needs its own REVIEW: PASS.

Maintainer yes: recorded in an earlier comment for this PR's own patch, bound to the head named there. It covers the patch only. It does not waive the QA gate, and QA decides.

I merge nothing.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

READY FOR QA 1fb673d

This is a readiness marker, not a QA verdict. I post no REVIEW: PASS or REVIEW: FAIL. It replaces my earlier marker on 7a6d72d, which names a head that is no longer current.

Head: 1fb673dca080754e87fb97238a24aacf5ac06b51, which is 7a6d72d plus a merge of main cb5bd1a (#214, refund amount proof in receipt evidence) made on 2026-11-25 at the maintainer's request through GitHub's update-branch API. Verified: two parents (7a6d72d, cb5bd1a), the files that differ from 7a6d72d are exactly #214's four files (gateway/app/trust/evidence.py, gateway/scripts/trust_coverage_gate.sh, gateway/tests/test_receipts.py, gateway/tests/test_refund_amount_evidence.py), none of which this PR touches, and git show --remerge-diff is empty. The PR patch is unchanged. This head contains current main, so the branch is up to date. API merge commits carry no sign-off trailer.

CI on this head: CI result success. Gateway py3.11 to py3.14, Postgres proofs, Postgres concurrency, Trust release gate, M1 external judge, lint, CodeQL, Analyze (python, javascript-typescript, actions), gitleaks, licence check: all success. I did not run the tests locally on this head.

Bots on this head: Cursor Bugbot ran (check conclusion success) and left no review thread. CodeRabbit hit its review limit (check conclusion neutral), so it did not review this head. This PR has no review threads.

Maintainer yes: recorded in an earlier comment for this PR's own patch, bound to the head named there. It covers the patch only. It does not waive the QA gate, and QA decides.

I merge nothing.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

READY FOR QA c9e3ae1

This is a readiness marker, not a QA verdict. I post no REVIEW: PASS or REVIEW: FAIL. It replaces my earlier marker on 1fb673d, which names a head that is no longer current.

Head: c9e3ae16adfe8395a771850ad768cddf8bd03c10, which is 1fb673d plus a merge of main d4f330e (#397, a Python dependency bump) made on 2026-11-25 at the maintainer's request through GitHub's update-branch API. Verified: two parents (1fb673d, d4f330e), the files that differ from 1fb673d are exactly #397's seven files (.github/workflows/ci.yml, .github/workflows/lint.yml, .pre-commit-config.yaml, CONTRIBUTING.md, gateway/pyproject.toml, gateway/requirements-dev.txt, gateway/requirements.txt), none of which this PR touches, git show --remerge-diff is empty, and the tree is identical to a local trial merge I built before the update. The PR patch is unchanged. This head contains current main, so the branch is up to date. API merge commits carry no sign-off trailer.

CI on this head: 27 check runs complete: 23 success, 3 skipped, 1 neutral (CodeRabbit, review limit). CI result, License result and gitleaks are success.

Local check on the identical tree: 69 passed, 0 failed, 0 skipped across the five tests/test_health*.py files, including test_health_public_probes.py. ruff check, ruff format --check (0.17.6) and mypy (2.4.1, 215 files) are clean; my local lint ran under the host's default Python 3.13, while CI's lint runs under 3.12 and is green. The run resolved sqlmodel 0.0.50, pytest-asyncio 1.5.0, mcp 1.30.0 and pytest 9.2.0. Not run locally: the Postgres legs, the production-trust leg and the other Python versions (CI ran them). Nothing from that run was pushed.

Bots and review threads on this head: Cursor Bugbot ran (check conclusion success) and left no review thread. CodeRabbit hit its review limit, so it did not review this head. The PR has no review threads.

Maintainer yes: recorded in an earlier comment for this PR's own patch, bound to the head named there. The patch is unchanged since; only merges of main were added. It covers the patch only. It does not waive the QA gate, and QA decides.

I merge nothing.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

MAINTAINER YES RECORDED for this PR's patch, at head c9e3ae16adfe8395a771850ad768cddf8bd03c10.

The maintainer wrote, in the coordinating session on 2026-11-25, verbatim: "yes to #279, #315 and #317 on the new heads". I am recording it here as given. The same words are recorded on #279 and #315. It follows the earlier yes for this PR's patch at 0eb3254, recorded in #317 (comment).

What the yes covers: this PR's own patch at this head: 3 files, +173/-33 (gateway/app/core/health.py, gateway/app/main.py, gateway/tests/test_health_public_probes.py). I compared the three files with 0eb3254, the head named in the earlier yes: they are byte-identical. The head moved only by merges of main, the last being d4f330e (#397, a Python dependency bump), which touches none of this PR's files.

What it does not cover:

  • It is not a QA waiver. A merge still needs a REVIEW: PASS that names the exact head, green CI result, License result and gitleaks, a branch up to date with main, and all review threads resolved. A merge of main creates a new head that needs its own PASS. The yes stays with the patch.

Order: this PR changes health.py and main.py, which the signing-key stack (#329, #330, #331) also changes. Whichever lands second needs main merged into its branch first, which creates a new head that needs its own REVIEW: PASS. I have not re-run a trial merge of the two on these heads.

State at the time of the yes: CI is complete on c9e3ae1: 27 check runs, 23 success, 3 skipped, 1 neutral (CodeRabbit, review limit); CI result, License result and gitleaks are success. The branch contains current main d4f330e. The PR has no review threads. The READY FOR QA marker for this head is #317 (comment). No REVIEW: PASS or REVIEW: FAIL exists on this PR.

The coordinating session merges nothing and posts no QA verdict.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

READY FOR QA faca927

This is a readiness marker, not a QA verdict. I post no verdict. It replaces my earlier marker on c9e3ae1, which names a head that is no longer current.

Head: faca92734f4b00f38123cada6832c22c31fd8df6, which is c9e3ae1 plus three merges of main. All three were made at the maintainer's request through GitHub's update-branch API:

Verified for all three merges: two parents (the previous head, then main), the files that differ from the previous head are exactly main's files, git show --remerge-diff is empty, and the tree is identical to a local trial merge I built before the update. API merge commits carry no sign-off trailer.

This PR's patch: unchanged. The same 2 non-merge commits, and the diff against main is the same patch as on c9e3ae1 (same git patch-id --stable; 3 files, +173/-33). None of the 25 files main changed in the three merges is a file this PR changes.

Main has moved since this head: as read at 12:23 UTC on 2026-11-26, main is 642c28a. This head contains main 48001ad and is 6 commits behind main, so the branch is not up to date. Newer on main, by merge commit time on 2026-11-26: #366 (11:27 UTC; 4 files); #367 (11:33 UTC; 2 files); #383 (11:40 UTC; 6 files); #424 (11:48 UTC; 4 files); #426 (12:11 UTC; 7 files); #384 (12:18 UTC; 5 files). None of the 25 files those commits change is a file this PR changes, and a local trial merge of 642c28a into this head has no conflict. I did not update the branch again after the update the maintainer asked for at about 11:16 UTC: I have no instruction to, and each update restarts CI and the bot reviews. Whoever merges has to update the branch first. That creates a new head, and a QA result on this head will not cover it. Main is moving several times an hour today, so this paragraph is a snapshot of that minute.

CI on this head: 27 check runs complete: 23 success, 3 skipped, 1 neutral (CodeRabbit, rate limited). CI result, License result, gitleaks and Trust release gate (non-required) are success.

Local check: none on this head. My last local check was on the tree of c9e3ae1 (see the marker this one replaces). CI ran the gateway jobs on this head: Python 3.11 to 3.14 / gateway, Postgres proofs / gateway, Postgres concurrency / gateway and M1 external judge / gateway are success.

Bots and review threads on this head: Cursor Bugbot reviewed this head and found no issues (check conclusion success). CodeRabbit was rate limited, so it did not review this head. The PR has no review threads.

Other PRs in this batch: this PR changes gateway/app/core/health.py, which #329 and #331 also change; gateway/app/main.py, which #329, #330 and #331 also change. This PR and #329 change no common function (both change module-level lines of main.py). This PR and #330 change no common function. This PR and #331 change no common function (both change module-level lines of main.py). When one of them lands first, the next merge of main into this branch brings changes to a file this PR also changes. Local trial merges of this head with each of those heads have no conflict. I ran no tests on those combinations.

QA so far: I found no QA result that names this head. I read this PR's reviews, comments and review threads at 12:24 UTC on 2026-11-26.

Maintainer yes: none is recorded on this head. The latest one is recorded in #317 (comment) for this PR's patch, bound to the head named there (c9e3ae1). Since c9e3ae1 only the three merges of main above were added. That yes covers the patch only. It does not waive the QA gate, and QA decides.

I merge nothing.


Generated by Claude Code

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

Independent review (grok): PASS
Head: 3f5ccaa

I reviewed the patch for issue #316 after merging origin/main. No conflicts. The PR files are unchanged by the merges: gateway/app/core/health.py, gateway/app/main.py, and gateway/tests/test_health_public_probes.py.

Correctness

The change matches the issue. gather_dependency_report takes only and starts only the named probes (gateway/app/core/health.py:545-581). One selected list both starts the probes and builds the report, in the same declaration order as the old hardcoded dict, so key order is unchanged. None still runs all eight.

The public route passes PUBLIC_DEPENDENCY_KEYS only when proof surfaces are unmounted (gateway/app/main.py:1369-1379). With proof surfaces mounted it still returns the full report, including simulation modes. build_public_dependency_report still shapes the public body, so the payload keys and the recomputed status stay the same. Discarded probes (mqtt, stripe, llm, sentinel) are not started on that path, which removes the anonymous Stripe and Sentinel calls the issue describes.

Rate limiting is unchanged. skip_paths exempts /health by exact match and does not exempt /health/dependencies (gateway/app/core/rate_limiter.py:717-734).

Tests

gateway/tests/test_health_public_probes.py covers the acceptance criteria: an anonymous public request starts zero Stripe and zero Sentinel calls (lines 86-94), the public body matches the projection of a full report with latency excluded (lines 97-103), mounted proof surfaces still run those probes (lines 106-114), only limits both the started probes and the reported keys (lines 117-122), and a call with no only still runs every probe (lines 125-139).

Local run on this head, Python 3.12: 201 passed, 0 failed, across test_health_public_probes.py, test_health_public_projection.py, test_health_dependencies.py, test_health_sim_parity.py, test_runtime_degradation.py, test_runtime_mode.py, test_build_provenance.py, test_commit_sha_precedence.py, test_stale_commit_sha_prevention.py, test_onboarding_contract.py, test_human_accessibility.py, test_human_preflight.py, test_discover_phase9.py, test_audit_low_surface.py, test_dogfood_tool_flag.py, test_health_dependencies_remains_rate_limited, and test_health_dependencies_reports_proof_surfaces_off. ruff 0.17.6 check and format --check are clean on the three PR files. mypy 2.4.1 reports no issues in app/core/health.py and app/main.py.

Docs

The gather_dependency_report docstring matches the code (gateway/app/core/health.py:555-561). The route description (gateway/app/main.py:1356-1366), the competition kit, and the Public Health Reporting section (gateway/SECURITY_LIMITATIONS.md:419-424) describe the public payload, which is unchanged.

Non-blocking: gateway/SECURITY_LIMITATIONS.md:267-268 still says /health/dependencies stays on the ordinary limits because it runs live Stripe and Sentinel probes. The rate-limit fact is still true. The reason is not, for the production posture this PR changes: those two probes are not started when proof surfaces are unmounted. They still run when proof surfaces are mounted (gateway/app/main.py:1370-1373). I would update that sentence. It does not change the behavior under review.

Non-blocking: the new HTTP test counts Stripe and Sentinel only. A regression that still started mqtt or llm, then dropped them in build_public_dependency_report, would not fail test_anonymous_public_request_starts_no_stripe_or_sentinel_probe. The shared only list makes that split unlikely, and issue #316 names Stripe and Sentinel as the calls to prove.

Bots

This PR has no review threads and no inline comments, on the previous head or on this one. Cursor Bugbot completed with pass and left no findings. CodeRabbit is skipping and left no findings (on the previous head it was rate limited and also left none). There were no earlier bot findings to address.

CI

On this head, CI result, License result, and gitleaks passed. Also passed: lint, Python 3.11, 3.12, 3.13, and 3.14 gateway, Postgres proofs, Postgres concurrency, M1 external judge, Framework integrations, Gateway image import smoke, Site tests, Trust release gate, CodeQL, and the three Analyze jobs. Node and per-project license matrix jobs were skipped. CodeRabbit was skipping. No check failed. The branch contains origin/main f1eb5ca8763c0ab38f44230149eaf1b42349ff88.

I did not merge.

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

Independent review (hermes): PASS
Head: 42a224d

I reviewed PR 317 (Skip discarded dependency probes on the public health route) against origin/main at 97f49e6. git rev-parse HEAD is 42a224d. The patch is three files, +173/-33: gateway/app/core/health.py, gateway/app/main.py, gateway/tests/test_health_public_probes.py. No review threads. No inline comments. Prior grok PASS names an older head (3f5ccaa) and does not count.

Correctness

gather_dependency_report now takes only and starts only the named probes (gateway/app/core/health.py:545-581). One selected list both starts the probes and builds the report, in declaration order, so key order is unchanged when only is None. Unknown names in only are ignored rather than started. None still runs all eight.

The public route passes PUBLIC_DEPENDENCY_KEYS only when proof surfaces are unmounted (gateway/app/main.py:1369-1379). With proof surfaces mounted it still returns the full report. build_public_dependency_report still shapes the public body, so payload keys and the recomputed status stay the same. Discarded probes (mqtt, stripe, llm, sentinel) are not started on that path, which removes the anonymous Stripe and Sentinel calls the issue describes. Rate limiting is unchanged. skip_paths does not exempt /health/dependencies, and test_health_dependencies_remains_rate_limited still pins a 429.

I found no blocking defect. The public status cannot flip on a probe that was not started, because those verdicts were already excluded from the public unhealthy list.

Tests

gateway/tests/test_health_public_probes.py covers the acceptance criteria: an anonymous public request starts zero Stripe and zero Sentinel calls (lines 86-94), the public body matches the projection of a full report with latency excluded (lines 97-103), mounted proof surfaces still run those probes (lines 106-114), only limits both the started probes and the reported keys (lines 117-122), and a call with no only still runs every probe (lines 125-139). The client fixture takes clean_database.

Local run, Python 3.12, uv, no worktree venv: 200 passed, 0 failed, 1 warning (b2a_sdk deprecation), in 11.21s. Modules: test_health_public_probes.py, test_health_public_projection.py, test_health_dependencies.py, test_health_sim_parity.py, test_runtime_degradation.py, test_runtime_mode.py, test_build_provenance.py, test_commit_sha_precedence.py, test_stale_commit_sha_prevention.py, test_onboarding_contract.py, test_human_accessibility.py, test_human_preflight.py, test_discover_phase9.py, test_audit_low_surface.py, test_dogfood_tool_flag.py, and test_health_dependencies_remains_rate_limited.

ruff 0.17.6 check and format --check are clean on the three PR files. mypy 2.4.1 reports no issues in app/core/health.py and app/main.py.

Docs and claims

The gather_dependency_report docstring matches the code (gateway/app/core/health.py:555-561). The route description (gateway/app/main.py:1356-1366) and the Public Health Reporting section (gateway/SECURITY_LIMITATIONS.md:419-424) describe the public payload, which is unchanged. The diff adds no "open source", "signed receipt", "tamper-proof", "tamper-evident", exactly-once, or em dash or en dash.

Non-blocking: gateway/SECURITY_LIMITATIONS.md:267-268 still says /health/dependencies stays on the ordinary limits because it runs live Stripe and Sentinel probes. The rate-limit fact is still true. The reason is not, for the production posture this PR changes: those two probes are not started when proof surfaces are unmounted. They still run when proof surfaces are mounted (gateway/app/main.py:1370-1373). I would update that sentence. It does not change the behavior under review, and no test pins the wording.

Non-blocking: the new HTTP test counts Stripe and Sentinel only. A regression that still started mqtt or llm, then dropped them in build_public_dependency_report, would not fail test_anonymous_public_request_starts_no_stripe_or_sentinel_probe. The shared only list makes that split unlikely.

CI

On this head, CI result, License result, and gitleaks passed. Also passed: lint, Python 3.11, 3.12, 3.13, and 3.14 gateway, Postgres proofs, Postgres concurrency, M1 external judge, Framework integrations, Gateway image import smoke, Site tests, Trust release gate, CodeQL, and the three Analyze jobs. Node and per-project license matrix jobs were skipped. CodeRabbit is skipping (review limit) and left no findings. Cursor Bugbot passed and left no findings. Engine Review Pass is the only failure (no passing review from a non-author engine for this head). That check alone is not a review defect. Author engine is claude. I do not count a claude PASS.

Merge with main

origin/main is an ancestor of this head (merge-base 97f49e6). git merge --no-commit --no-ff origin/main reported Already up to date and left no merge in progress (abort then correctly found no MERGE_HEAD). No conflicts. Working tree clean. HEAD still 42a224d.

Blocking: none.

I did not post to GitHub. I did not merge.

REVIEW: PASS hermes 42a224d

@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 cursor 8914551

Independent review (cursor): PASS
Head: 8914551

I reviewed PR 317 after GitHub's Update branch merge of main (2d65597) into claude/health-public-probes. The previous tip was 42a224d. The three PR files are unchanged by the merge: gateway/app/core/health.py, gateway/app/main.py, and gateway/tests/test_health_public_probes.py. No conflict markers. No review threads.

gather_dependency_report(only=...) starts only the named probes, so discarded probes make no outbound call. The unmounted public route passes PUBLIC_DEPENDENCY_KEYS (postgres, redis, signing_key, upstream_mcp) and still shapes the body with build_public_dependency_report. With proof surfaces mounted, gather_dependency_report() still runs every probe. Rate limiting is unchanged. Public payload shape is unchanged.

Tests cover an anonymous public request starting zero Stripe and zero Sentinel calls, public body matching the projection of a full report, mounted proof surfaces still running those probes, and only limiting both started probes and reported keys.

Nits (non-blocking): the HTTP test counts Stripe and Sentinel only, not MQTT/LLM outbound starts; coverage is still adequate via the only= unit tests and the shared probe table. test_mounted_proof_surfaces_still_run_every_probe flips ENABLE_PROOF_SURFACES and relies on probe_counts to restore it.

Author engine is claude. I do not count a claude PASS. I did not merge.

@PetrefiedThunder
PetrefiedThunder merged commit 4151aaf into main Nov 29, 2026
33 of 35 checks passed
@PetrefiedThunder
PetrefiedThunder deleted the claude/health-public-probes branch November 29, 2026 07:21

This branch was successfully deployed

1 active deployment
Preview — 89145511 Deployed Nov 29, 2026 by vercel[bot]
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.

3 participants