fix(agent-mesh): serialize JCS numbers per RFC 8785 #4341
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.43) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 380 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.356
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #4341"
general
weight: 0.35
MohammadHaroonAbuomar
Related Issue
None
Problem & Solution
The approval digest converts integer-valued floats to ints and formats the other floats with repr.
| float | main | RFC 8785 section 3.2.2.3, and this branch |
|---|---|---|
|
1e-06|1e-06|0.000001||
1e-07|1e-07|1e-7||
1e21|1000000000000000000000|1e+21||
1.7976931348623157e308| a 309-digit integer |1.7976931348623157e+308|This change formats floats the way ECMAScript Number::toString does and leaves integers, strings and key order unchanged.
Impact on Your Work
Float digests match RFC 8785 Appendix B and the a2a-tck vectors, but an approval computed on main over one of these values no longer binds.
Timeline
None
Alternatives Considered
Rounding integers above 253 through a double would let two distinct integers share one digest, so integers stay exact.
Type of Change
Package(s) Affected
Testing
Unit Testing
TestJcsNumberSerialization in
tests/test_approval_protocol.pypins the 24 Appendix B rows; that file passes 62 of 62, and 16 of its tests fail on main's digest.py.Manual Testing
This branch passes all 53 a2a-tck canonicalization vectors as packaged in agent-evidence-vectors (
pip install agent-evidence-vectors==0.18.1), where main fails A5-001, A5-002 and A5-011.Checklist
Attribution & Prior Art
Prior art / related projects** (if any):
RFC 8785 section 3.2.2.3 and Appendix B, and ECMA-262 Number::toString.
AI Assistance
IP, Patents, and Licensing