Normalize MCP proof timestamps#850
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR standardizes timestamp serialization for the MCP ChangesMCP get_proof Timestamp Serialization
Possibly Related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
xiefuzheng713-alt
left a comment
There was a problem hiding this comment.
Bounty #654 current-head review for PR #850.
Reviewed head e737d847b4e5d3c9e33132192a44549c72dfdfb1 against base d4d0e4860cfa3e9c338b1349001277c148afaf6d as a non-author.
Files inspected: app/mcp_tools.py, app/serializers.py, tests/test_api_mcp.py, and docs/api-examples.md.
What I verified:
get_proofnow uses the existingpublic_utc_timestamp()helper instead of rawdatetime.isoformat(), so naive stored UTC values and aware datetimes serialize with an explicitZmarker consistently with public API timestamp behavior.- The focused regression assertion covers the exact
get_proof.created_atfield from the created proof object. - The docs example was updated to show the same explicit UTC marker.
- The change is limited to timestamp serialization for this MCP tool and does not touch proof hashing, ledger mutation, payout/proposal execution, wallet material, or private state.
Validation run locally on this head:
uv run --extra dev pytest tests/test_api_mcp.py::test_mcp_get_proof_returns_public_proof_details -q-> 1 passed, 1 existing Starlette/httpx warning.uv run --extra dev pytest tests/test_api_mcp.py -q-> 105 passed, 1 existing Starlette/httpx warning.uv run --extra dev pytest -q-> 790 passed, 1 existing Starlette/httpx warning.uv run --extra dev ruff check app/mcp_tools.py tests/test_api_mcp.py docs/api-examples.md-> passed.uv run --extra dev ruff format --check app/mcp_tools.py tests/test_api_mcp.py-> passed.uv run --extra dev mypy app-> success for 42 source files.uv run --extra dev python scripts/docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean treee6fb6b528aad46aac4adb0e4fcdaa202345945af.
GitHub state checked before review: PR #850 head still matches e737d847b4e5d3c9e33132192a44549c72dfdfb1, mergeable, hosted Quality/readiness/docs/image check successful, CodeRabbit had no actionable comments, and there were no prior human reviews.
laughlife
left a comment
There was a problem hiding this comment.
Bounty #838 current-head review for PR #850.
Reviewed head e737d847b4e5d3c9e33132192a44549c72dfdfb1 as a non-author after #838 claims opened.
No blocker found.
What I verified:
get_proofnow serializescreated_atthrough the existingpublic_utc_timestamp()helper, matching the UTCZtimestamp shape already used by public serializers.- The focused regression assertion checks the actual MCP
get_proofresponse payload againstpublic_utc_timestamp(proof.created_at). - The docs example was updated to show the same explicit UTC marker.
- Scope stays limited to MCP proof timestamp serialization and documentation; I did not see changes to proof hashing, ledger mutation, wallet material, payout/proposal execution, bridge/exchange/cash-out, or price behavior.
Validation on current head:
uv run --extra dev pytest tests/test_api_mcp.py::test_mcp_get_proof_returns_public_proof_details -q-> 1 passed, 1 existing Starlette/httpx warning.uv run --extra dev ruff check app/mcp_tools.py tests/test_api_mcp.py docs/api-examples.md-> passed.uv run --extra dev ruff format --check app/mcp_tools.py tests/test_api_mcp.py-> 2 files already formatted.uv run --extra dev python scripts/docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean treee6fb6b528aad46aac4adb0e4fcdaa202345945af.
GitHub state checked before review: PR #850 head still matches e737d847b4e5d3c9e33132192a44549c72dfdfb1, merge state is CLEAN, hosted Quality/readiness/docs/image check is successful, and CodeRabbit is successful. I saw one prior human approval on this head; this review is an independent current-window verification for #838 rather than a claim that no prior review existed.
aglichandrap
left a comment
There was a problem hiding this comment.
Review evidence (head SHA: e737d847b4e5):
- ✅ Scope: Replaces
proof.created_at.isoformat()withpublic_utc_timestamp(proof.created_at)— ensures UTC suffix. - ✅ Consistency: Imports
public_utc_timestampfromapp/serializers.py, reusing existing utility. - ✅ Docs:
api-examples.mdupdated to showZsuffix in example output. - ✅ Tests:
test_api_mcp.pyupdated to assert normalized timestamp format. - ✅ Files: 3 files, +4/-2 — minimal, focused.
- ✅ Mergeable: state=clean.
No blockers. Approve.
Related bounty
Refs #798
Summary
get_proofproof metadatacreated_atwith the existing public UTC timestamp helperEvidence
Live read-only checks still show MCP
get_proofreturning2026-06-01T11:42:20.646161whileget_ledger_entryfor the same proof-backed ledger item returns2026-06-01T11:42:20.644787Z.Final preflight before publication:
mergework-798-mcp-final-preflight-20260604T035708Z.md.Tests
140 passed, 1 warning790 passed, 1 warningOut of scope
Summary by CodeRabbit
Bug Fixes
get_proofAPI response to use proper UTC notation (ISO 8601 standard)Documentation