Repository navigation
Skip discarded dependency probes on the public health route - #317
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou'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. View limit details
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. |
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>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
READY FOR QA 0eb3254 Refs #316. The unauthenticated Evidence: five tests in 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 Generated by Claude Code |
|
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 ( It does not waive the QA gate. There is no Checked today by the coordinating session, read-only:
The coordinating session merges nothing and posts no QA verdict. Generated by Claude Code |
|
READY FOR QA 137d131 This is a readiness marker, not a QA verdict. I post no Head: CI on this head: 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 Main moved again: main is now I merge nothing. Generated by Claude Code |
Bugbot couldn't run - usage limit reachedBugbot 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) |
|
READY FOR QA 7a6d72d This is a readiness marker, not a QA verdict. I post no Head: CI on this head: 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 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 |
|
READY FOR QA 1fb673d This is a readiness marker, not a QA verdict. I post no Head: CI 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 |
|
READY FOR QA c9e3ae1 This is a readiness marker, not a QA verdict. I post no Head: CI on this head: 27 check runs complete: 23 success, 3 skipped, 1 neutral (CodeRabbit, review limit). Local check on the identical tree: 69 passed, 0 failed, 0 skipped across the five 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 |
|
MAINTAINER YES RECORDED for this PR's patch, at head 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 What the yes covers: this PR's own patch at this head: 3 files, +173/-33 ( What it does not cover:
Order: this PR changes State at the time of the yes: CI is complete on The coordinating session merges nothing and posts no QA verdict. Generated by Claude Code |
|
READY FOR QA faca927 This is a readiness marker, not a QA verdict. I post no verdict. It replaces my earlier marker on Head:
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, This PR's patch: unchanged. The same 2 non-merge commits, and the diff against main is the same patch as on Main has moved since this head: as read at 12:23 UTC on 2026-11-26, main is CI on this head: 27 check runs complete: 23 success, 3 skipped, 1 neutral (CodeRabbit, rate limited). Local check: none on this head. My last local check was on the tree of 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 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 ( I merge nothing. Generated by Claude Code |
PetrefiedThunder
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
Summary
With proof surfaces unmounted,
GET /health/dependenciesran 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 optionalonlyset and starts just those probes. The unmounted posture passesPUBLIC_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
gateway/.spec/,verifier/,sdk/python/,sdk/typescript/,integrations/, andexamples/are Apache-2.0.gateway/contributions are under FSL-1.1-ALv2 (Fair Source).Spec changes
Validation
tests/test_health_public_probes.py(5 cases) plustest_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.pyandtest_discover_phase9.pypass (82 passed across the touched and neighbouring health modules).test_anonymous_public_request_starts_no_stripe_or_sentinel_probe. On unfixedmaincode 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 thestripe.Balanceclass and thehttpx.AsyncClientclass (no singleton instance is patched).test_only_limits_the_probes_started_and_the_entries_reported(theonlyargument does not exist there).checkandformat --checkclean ingateway; mypy 2.4.1 onapp/clean; no em dashes, en dashes or spaced hyphens in added lines. Test keys are generated at run time withsecrets.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
gather_dependency_reportdocstring; no user docs describe the probe set).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/dependenciesroute when proof surfaces are unmounted: the handler still ran all eight dependency checks, then droppedmqtt,stripe,llm, andsentinelfrom 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 optionalonlyfrozenset and only starts those probes in parallel; excluded names never run and make no outbound call. In production posture, the route callsgather_dependency_report(only=PUBLIC_DEPENDENCY_KEYS)beforebuild_public_dependency_report, so only wedge deps (postgres,redis,signing_key,upstream_mcp) are probed. WithENABLE_PROOF_SURFACES=true, behavior is unchanged: full report, all probes.New tests in
test_health_public_probes.pyassert zero Stripe/Sentinel calls on the public route, payload parity with the projected full report, and thatonlyand 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.