feat(gateway): add gateway_version to TRACE claims and /readyz health endpoint (CONF-006 CONF-007) - #248
Merged
Conversation
… endpoint (CONF-006 CONF-007)
CONF-006: gateway_version already present in GatewayAddenda schema and populated
via importlib.metadata.version("cmcp-gateway") with "unknown" fallback. Added
test_generate_claim_gateway_version_is_string_or_unknown to cover the constant.
CONF-007: update _readyz to return {"status": "not_ready"} (not "degraded") on
failure, format failed checks as "failed: <reason>", add Cedar policy check,
TEE attestation staleness check, and AGT (agent_os) availability check. Returns
HTTP 503 on any failure, 200 when all checks pass. Tests updated to match the
revised response shape; added test_readyz_returns_503_when_agt_unavailable.
Closes #195, #196
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gateway_versionfield was already inGatewayAddendaschema and populated viaimportlib.metadata.version("cmcp-gateway")with"unknown"fallback. Addedtest_generate_claim_gateway_version_is_string_or_unknownto explicitly cover the_GATEWAY_VERSIONconstant behavior._readyzto conform to the issue spec: status is"not_ready"(not"degraded") on failure, failed check values use"failed: <reason>"format, Cedar policy check, TEE attestation staleness check, and AGT (agent_os) library availability check. Returns HTTP 503 on any failure, 200 when all pass. Updated all tests to match.Test plan
test_generate_claim_gateway_versionpasses: assertsgateway_versionis a non-empty stringtest_generate_claim_gateway_version_is_string_or_unknownpasses: covers_GATEWAY_VERSIONconstanttest_readyz_returns_200_when_healthypasses: all checks"ok", status"ready", HTTP 200test_readyz_returns_503_when_policy_missingpasses: status"not_ready",checks.policystarts with"failed:", HTTP 503test_readyz_returns_503_when_attestation_stalepasses:checks.attestation == "failed: attestation_stale", HTTP 503test_readyz_returns_503_when_agt_unavailablepasses:checks.agtstarts with"failed:", HTTP 503test_readyz_accessible_without_bearer_tokenpasses: no auth requiredtest_trace_claim.pyandtest_mcp_server_auth.pypassCloses #195, closes #196
🤖 Generated with Claude Code