Repository: kythe/kythe
Pull request #5784 (2023-08-10 23:25:31)

feat(serving): return estimates for all ref edge subkinds
Instead of returning a total count of ref edges, return a map containing the count of each ref subkind. With ref/writes, clients want to have more visibility into the counts of different ref kinds.


Patch:
diff --git a/kythe/go/serving/xrefs/xrefs.go b/kythe/go/serving/xrefs/xrefs.go
index aae97db8c..30843b57d 100644
--- a/kythe/go/serving/xrefs/xrefs.go
+++ b/kythe/go/serving/xrefs/xrefs.go
@@ -655,8 +655,10 @@ func (c xrefCategory) AddCount(reply *xpb.CrossReferencesReply, idx *srvpb.Paged
 		}
 	case xrefCategoryRef:
 		if pageSet.Contains(idx) {
+			reply.Total.RefEdgeToCount[strings.TrimPrefix(idx.Kind, "%")] += int64(idx.Count)
 			reply.Total.References += int64(idx.Count)
 		} else {
+			reply.Filtered.RefEdgeToCount[strings.TrimPrefix(idx.Kind, "%")] += int64(idx.Count)
 			reply.Filtered.References += int64(idx.Count)
 		}
 	case xrefCategoryRelated:
@@ -758,11 +760,17 @@ func (t *Table) CrossReferences(ctx context.Context, req *xpb.CrossReferencesReq
 		CrossReferences: make(map[string]*xpb.CrossReferencesReply_CrossReferenceSet, len(req.Ticket)),
 		Nodes:           make(map[string]*cpb.NodeInfo, len(req.Ticket)),
 
-		Total: &xpb.CrossReferencesReply_Total{},
+		Total: &xpb.CrossReferencesReply_Total{
+			RefEdgeToCount: make(map[string]int64),
+		},
 		Filtered: &xpb.CrossReferencesReply_Total{
+			RefEdgeToCount:         make(map[string]int64),
 			RelatedNodesByRelation: make(map[string]int64),
 		},
 	}
+	// Before we return reply, remove all RefEdgeToCount map entries that point to a 0 count.
+	defer cleanupRefEdgeToCount(reply)
+
 	if len(req.Filter) > 0 {
 		reply.Total.RelatedNodesByRelation = make(map[string]int64)
 	}
@@ -908,8 +916,11 @@ readLoop:
 				}
 			case xrefs.IsRefKind(req.ReferenceKind, grp.Kind):
 				filtered := filter.FilterGroup(grp)
+				reply.Total.RefEdgeToCount[strings.TrimPrefix(grp.Kind, "%")] += int64(len(grp.Anchor))
 				reply.Total.References += int64(len(grp.Anchor))
+				reply.Total.RefEdgeToCount[strings.TrimPrefix(grp.Kind, "%")] += int64(countRefs(grp.GetScopedReference()))
 				reply.Total.References += int64(countRefs(grp.GetScopedReference()))
+				reply.Filtered.RefEdgeToCount[strings.TrimPrefix(grp.Kind, "%")] += int64(filtered)
 				reply.Filtered.References += int64(filtered)
 				if wantMoreCrossRefs {
 					stats.addAnchors(&crs.Reference, grp)
@@ -1048,7 +1059,9 @@ readLoop:
 					if err != nil {
 						return nil, fmt.Errorf("internal error: error retrieving cross-references page %v: %v", idx.PageKey, err)
 					}
-					reply.Total.References -= int64(filtered) // update counts to reflect filtering
+					reply.Total.RefEdgeToCount[strings.TrimPrefix(idx.Kind, "%")] -= int64(filtered) // update counts to reflect filtering
+					reply.Total.References -= int64(filtered)                                        // update counts to reflect filtering
+					reply.Filtered.RefEdgeToCount[strings.TrimPrefix(idx.Kind, "%")] += int64(filtered)
 					reply.Filtered.References += int64(filtered)
 					stats.addAnchors(&crs.Reference, p.Group)
 				}
@@ -1231,6 +1244,22 @@ readLoop:
 	return reply, nil
 }
 
+// cleanupRefEdgeToCount removes all the keys from r.Total.RefEdgeToCount and
+// r.Filtered.RefEdgeToCount that have a value of 0.
+func cleanupRefEdgeToCount(r *xpb.CrossReferencesReply) {
+	for k, v := range r.Total.RefEdgeToCount {
+		if v == 0 {
+			delete(r.Total.RefEdgeToCount, k)
+		}
+	}
+	for k, v := range r.Filtered.RefEdgeToCount {
+		if v == 0 {
+			delete(r.Filtered.RefEdgeToCount, k)
+		}
+	}
+
+}
+
 func addMergeNode(mergeMap map[string]string, allTickets []string, rootNode, mergeNode string) []string {
 	if _, ok := mergeMap[mergeNode]; ok {
 		return allTickets
@@ -1261,11 +1290,20 @@ func nodeKind(n *srvpb.Node) string {
 }
 
 func sumTotalCrossRefs(ts *xpb.CrossReferencesReply_Total) int {
+	var refs int
+	for _, cnt := range ts.RefEdgeToCount {
+		refs += int(cnt)
+	}
 	var relatedNodes int
 	for _, cnt := range ts.RelatedNodesByRelation {
 		relatedNodes += int(cnt)
 	}
-	return int(ts.Callers) + int(ts.Definitions) + int(ts.Declarations) + int(ts.References) + int(ts.Documentation) + relatedNodes
+	return int(ts.Callers) +
+		int(ts.Definitions) +
+		int(ts.Declarations) +
+		refs +
+		int(ts.Documentation) +
+		relatedNodes
 }
 
 type refOptions struct {
diff --git a/kythe/proto/xref.proto b/kythe/proto/xref.proto
index 8033c9684..dbb10f1cb 100644
--- a/kythe/proto/xref.proto
+++ b/kythe/proto/xref.proto
@@ -566,10 +566,16 @@ message CrossReferencesReply {
   message Total {
     int64 definitions = 1;
     int64 declarations = 2;
-    int64 references = 3;
+    int64 references = 3 [deprecated = true];
     int64 documentation = 4;
     int64 callers = 5;
 
+    // Map from ref edge type to count.
+    //
+    // Example
+    // /kythe/edge/ref -> 20,
+    // /kythe/edge/ref/writes -> 50
+    map<string, int64> ref_edge_to_count = 7;
     map<string, int64> related_nodes_by_relation = 6;
   }
   // Total number of cross-references on all pages matching requested kinds,
diff --git a/kythe/proto/xref_go_proto/xref.pb.go b/kythe/proto/xref_go_proto/xref.pb.go
index b5e9b40a8..80089f08c 100644
--- a/kythe/proto/xref_go_proto/xref.pb.go
+++ b/kythe/proto/xref_go_proto/xref.pb.go
@@ -2120,11 +2120,13 @@ type CrossReferencesReply_Total struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Definitions            int64            `protobuf:"varint,1,opt,name=definitions,proto3" json:"definitions,omitempty"`
-	Declarations           int64            `protobuf:"varint,2,opt,name=declarations,proto3" json:"declarations,omitempty"`
+	Definitions  int64 `protobuf:"varint,1,opt,name=definitions,proto3" json:"definitions,omitempty"`
+	Declarations int64 `protobuf:"varint,2,opt,name=declarations,proto3" json:"declarations,omitempty"`
+	// Deprecated: Marked as deprecated in kythe/proto/xref.proto.
 	References             int64            `protobuf:"varint,3,opt,name=references,proto3" json:"references,omitempty"`
 	Documentation          int64            `protobuf:"varint,4,opt,name=documentation,proto3" json:"documentation,omitempty"`
 	Callers                int64            `protobuf:"varint,5,opt,name=callers,proto3" json:"callers,omitempty"`
+	RefEdgeToCount         map[string]int64 `protobuf:"bytes,7,rep,name=ref_edge_to_count,json=refEdgeToCount,proto3" json:"ref_edge_to_count,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
 	RelatedNodesByRelation map[string]int64 `protobuf:"bytes,6,rep,name=related_nodes_by_relation,json=relatedNodesByRelation,proto3" json:"related_nodes_by_relation,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
 }
 
@@ -2174,6 +2176,7 @@ func (x *CrossReferencesReply_Total) GetDeclarations() int64 {
 	return 0
 }
 
+// Deprecated: Marked as deprecated in kythe/proto/xref.proto.
 func (x *CrossReferencesReply_Total) GetReferences() int64 {
 	if x != nil {
 		return x.References
@@ -2195,6 +2198,13 @@ func (x *CrossReferencesReply_Total) GetCallers() int64 {
 	return 0
 }
 
+func (x *CrossReferencesReply_Total) GetRefEdgeToCount() map[string]int64 {
+	if x != nil {
+		return x.RefEdgeToCount
+	}
+	return nil
+}
+
 func (x *CrossReferencesReply_Total) GetRelatedNodesByRelation() map[string]int64 {
 	if x != nil {
 		return x.RelatedNodesByRelation
@@ -2216,7 +2226,7 @@ type DocumentationReply_Document struct {
 func (x *DocumentationReply_Document) Reset() {
 	*x = DocumentationReply_Document{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_kythe_proto_xref_proto_msgTypes[27]
+		mi := &file_kythe_proto_xref_proto_msgTypes[28]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -2229,7 +2239,7 @@ func (x *DocumentationReply_Document) String() string {
 func (*DocumentationReply_Document) ProtoMessage() {}
 
 func (x *DocumentationReply_Document) ProtoReflect() protoreflect.Message {
-	mi := &file_kythe_proto_xref_proto_msgTypes[27]
+	mi := &file_kythe_proto_xref_proto_msgTypes[28]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -2579,7 +2589,7 @@ var file_kythe_proto_xref_proto_rawDesc = []byte{
 	0x09, 0x52, 0x07, 0x72, 0x61, 0x77, 0x54, 0x65, 0x78, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x6c, 0x69,
 	0x6e, 0x6b, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65,
 	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x69,
-	0x6e, 0x6b, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0xde, 0x0f, 0x0a, 0x14, 0x43, 0x72, 0x6f,
+	0x6e, 0x6b, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x8d, 0x11, 0x0a, 0x14, 0x43, 0x72, 0x6f,
 	0x73, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6c,
 	0x79, 0x12, 0x3d, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b,
 	0x32, 0x27, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43,
@@ -2663,135 +2673,146 @@ var file_kythe_proto_xref_proto_rawDesc = []byte{
 	0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x52, 0x65, 0x6c, 0x61,
 	0x74, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64,
 	0x4e, 0x6f, 0x64, 0x65, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08,
-	0x1a, 0xf8, 0x02, 0x0a, 0x05, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65,
+	0x1a, 0xa7, 0x04, 0x0a, 0x05, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65,
 	0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
 	0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x22, 0x0a, 0x0c,
 	0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01,
 	0x28, 0x03, 0x52, 0x0c, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
-	0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73,
-	0x12, 0x24, 0x0a, 0x0d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f,
-	0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
-	0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72,
-	0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x73,
-	0x12, 0x7e, 0x0a, 0x19, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x6f, 0x64, 0x65,
-	0x73, 0x5f, 0x62, 0x79, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20,
-	0x03, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
-	0x6f, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
-	0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x6c,
-	0x61, 0x74, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x79, 0x52, 0x65, 0x6c, 0x61, 0x74,
-	0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x16, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65,
-	0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x79, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e,
-	0x1a, 0x49, 0x0a, 0x1b, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73,
-	0x42, 0x79, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
-	0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
-	0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x77, 0x0a, 0x14, 0x43,
-	0x72, 0x6f, 0x73, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x45, 0x6e,
+	0x12, 0x22, 0x0a, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03,
+	0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65,
+	0x6e, 0x63, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+	0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x64, 0x6f, 0x63,
+	0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61,
+	0x6c, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x61, 0x6c,
+	0x6c, 0x65, 0x72, 0x73, 0x12, 0x66, 0x0a, 0x11, 0x72, 0x65, 0x66, 0x5f, 0x65, 0x64, 0x67, 0x65,
+	0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32,
+	0x3b, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72,
+	0x6f, 0x73, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x70,
+	0x6c, 0x79, 0x2e, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x66, 0x45, 0x64, 0x67, 0x65,
+	0x54, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x72, 0x65,
+	0x66, 0x45, 0x64, 0x67, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x7e, 0x0a, 0x19,
+	0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x5f, 0x62, 0x79,
+	0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32,
+	0x43, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72,
+	0x6f, 0x73, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x70,
+	0x6c, 0x79, 0x2e, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64,
+	0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x79, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45,
+	0x6e, 0x74, 0x72, 0x79, 0x52, 0x16, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x6f, 0x64,
+	0x65, 0x73, 0x42, 0x79, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x41, 0x0a, 0x13,
+	0x52, 0x65, 0x66, 0x45, 0x64, 0x67, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e,
 	0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x49, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
-	0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f,
-	0x74, 0x6f, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63,
-	0x65, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x52, 0x65, 0x66,
-	0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
-	0x3a, 0x02, 0x38, 0x01, 0x1a, 0x56, 0x0a, 0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x45, 0x6e, 0x74,
+	0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a,
+	0x49, 0x0a, 0x1b, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42,
+	0x79, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
+	0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
+	0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x77, 0x0a, 0x14, 0x43, 0x72,
+	0x6f, 0x73, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74,
 	0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
-	0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
-	0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66,
-	0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5b, 0x0a, 0x18,
-	0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69,
-	0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61,
-	0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6b, 0x79, 0x74, 0x68,
-	0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x52, 0x05,
-	0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xdf, 0x01, 0x0a, 0x14, 0x44, 0x6f,
-	0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
-	0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x03,
-	0x28, 0x09, 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69,
-	0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74,
-	0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x63, 0x68,
-	0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x69, 0x6e,
-	0x63, 0x6c, 0x75, 0x64, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x12, 0x34, 0x0a,
-	0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
-	0x32, 0x16, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x57,
-	0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70,
-	0x61, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x61, 0x67, 0x61,
-	0x69, 0x6e, 0x73, 0x74, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x05,
-	0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x67, 0x61, 0x69, 0x6e,
-	0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0xd5, 0x05, 0x0a, 0x12,
-	0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70,
-	0x6c, 0x79, 0x12, 0x44, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01,
-	0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f,
-	0x74, 0x6f, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
-	0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08,
-	0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65,
-	0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e,
+	0x03, 0x6b, 0x65, 0x79, 0x12, 0x49, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
+	0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x52, 0x65, 0x66, 0x65,
+	0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
+	0x02, 0x38, 0x01, 0x1a, 0x56, 0x0a, 0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72,
+	0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
+	0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
+	0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f,
+	0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5b, 0x0a, 0x18, 0x44,
+	0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
+	0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c,
+	0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65,
+	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x52, 0x05, 0x76,
+	0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xdf, 0x01, 0x0a, 0x14, 0x44, 0x6f, 0x63,
+	0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+	0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28,
+	0x09, 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c,
+	0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65,
+	0x72, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x63, 0x68, 0x69,
+	0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x69, 0x6e, 0x63,
+	0x6c, 0x75, 0x64, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x12, 0x34, 0x0a, 0x09,
+	0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,
+	0x16, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x57, 0x6f,
+	0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
+	0x63, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x61, 0x67, 0x61, 0x69,
+	0x6e, 0x73, 0x74, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20,
+	0x01, 0x28, 0x08, 0x52, 0x15, 0x70, 0x61, 0x74, 0x63, 0x68, 0x41, 0x67, 0x61, 0x69, 0x6e, 0x73,
+	0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0xd5, 0x05, 0x0a, 0x12, 0x44,
+	0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c,
+	0x79, 0x12, 0x44, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20,
+	0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
+	0x65, 0x70, 0x6c, 0x79, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64,
+	0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73,
+	0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70,
+	0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69,
+	0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x45, 0x6e, 0x74,
+	0x72, 0x79, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x6b, 0x0a, 0x14, 0x64, 0x65, 0x66,
+	0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+	0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e,
 	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74,
-	0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x45, 0x6e,
-	0x74, 0x72, 0x79, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x6b, 0x0a, 0x14, 0x64, 0x65,
-	0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
-	0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65,
-	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61,
-	0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69,
-	0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74,
-	0x72, 0x79, 0x52, 0x13, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f,
-	0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x75, 0x69, 0x6c, 0x64,
-	0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64,
-	0x49, 0x64, 0x1a, 0xf9, 0x01, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12,
-	0x16, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18,
-	0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72,
-	0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x04, 0x74,
-	0x65, 0x78, 0x74, 0x12, 0x45, 0x0a, 0x0d, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x5f, 0x73, 0x6f,
-	0x75, 0x72, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6b, 0x79, 0x74,
-	0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
-	0x4d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x0c, 0x6d, 0x61,
-	0x72, 0x6b, 0x65, 0x64, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x08, 0x63, 0x68,
-	0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b,
-	0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d,
-	0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x44, 0x6f,
-	0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e,
-	0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05,
-	0x10, 0x06, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, 0x1a, 0x56,
-	0x0a, 0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
-	0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32,
-	0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e,
-	0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
-	0x6f, 0x6e, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c,
-	0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5b, 0x0a, 0x18, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69,
-	0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74,
-	0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x03, 0x6b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
-	0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
-	0x6f, 0x2e, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
-	0x02, 0x38, 0x01, 0x22, 0x1d, 0x0a, 0x09, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65,
-	0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75,
-	0x72, 0x69, 0x2a, 0x25, 0x0a, 0x0c, 0x53, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x73, 0x4b, 0x69,
-	0x6e, 0x64, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07,
-	0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x01, 0x32, 0x92, 0x02, 0x0a, 0x0b, 0x58, 0x52,
-	0x65, 0x66, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x0b, 0x44, 0x65, 0x63,
-	0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65,
-	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f,
-	0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6b, 0x79, 0x74, 0x68,
-	0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x72, 0x61, 0x74, 0x69,
-	0x6f, 0x6e, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x0f, 0x43, 0x72,
-	0x6f, 0x73, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x23, 0x2e,
-	0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x6f, 0x73,
-	0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
-	0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
-	0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73,
-	0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0d, 0x44, 0x6f, 0x63, 0x75, 0x6d,
-	0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65,
-	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61,
-	0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6b, 0x79,
+	0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74,
+	0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72,
+	0x79, 0x52, 0x13, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x63,
+	0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f,
+	0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49,
+	0x64, 0x1a, 0xf9, 0x01, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16,
+	0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
+	0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x04, 0x74, 0x65,
+	0x78, 0x74, 0x12, 0x45, 0x0a, 0x0d, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x5f, 0x73, 0x6f, 0x75,
+	0x72, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6b, 0x79, 0x74, 0x68,
+	0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d,
+	0x61, 0x72, 0x6b, 0x65, 0x64, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x0c, 0x6d, 0x61, 0x72,
+	0x6b, 0x65, 0x64, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x08, 0x63, 0x68, 0x69,
+	0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x79,
 	0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65,
-	0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x47,
-	0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76,
-	0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
-	0x6f, 0x50, 0x01, 0x5a, 0x22, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x79,
-	0x74, 0x68, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x78, 0x72, 0x65, 0x66, 0x5f, 0x67,
-	0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x44, 0x6f, 0x63,
+	0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x4a,
+	0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10,
+	0x06, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, 0x1a, 0x56, 0x0a,
+	0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
+	0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a,
+	0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6b,
+	0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
+	0x6e, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
+	0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5b, 0x0a, 0x18, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74,
+	0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72,
+	0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
+	0x6b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
+	0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x2e, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
+	0x38, 0x01, 0x22, 0x1d, 0x0a, 0x09, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12,
+	0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72,
+	0x69, 0x2a, 0x25, 0x0a, 0x0c, 0x53, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x73, 0x4b, 0x69, 0x6e,
+	0x64, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x44,
+	0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x01, 0x32, 0x92, 0x02, 0x0a, 0x0b, 0x58, 0x52, 0x65,
+	0x66, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x0b, 0x44, 0x65, 0x63, 0x6f,
+	0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+	0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65,
+	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f,
+	0x6e, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x0f, 0x43, 0x72, 0x6f,
+	0x73, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x6b,
+	0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73,
+	0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+	0x74, 0x1a, 0x21, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
+	0x43, 0x72, 0x6f, 0x73, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52,
+	0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0d, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+	0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74,
+	0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6b, 0x79, 0x74,
+	0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+	0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x47, 0x0a,
+	0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x74,
+	0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x50, 0x01, 0x5a, 0x22, 0x6b, 0x79, 0x74, 0x68, 0x65, 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x79, 0x74,
+	0x68, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x78, 0x72, 0x65, 0x66, 0x5f, 0x67, 0x6f,
+	0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -2807,7 +2828,7 @@ func file_kythe_proto_xref_proto_rawDescGZIP() []byte {
 }
 
 var file_kythe_proto_xref_proto_enumTypes = make([]protoimpl.EnumInfo, 10)
-var file_kythe_proto_xref_proto_msgTypes = make([]protoimpl.MessageInfo, 30)
+var file_kythe_proto_xref_proto_msgTypes = make([]protoimpl.MessageInfo, 31)
 var file_kythe_proto_xref_proto_goTypes = []interface{}{
 	(SnippetsKind)(0),                              // 0: kythe.proto.SnippetsKind
 	(Location_Kind)(0),                             // 1: kythe.proto.Location.Kind
@@ -2845,28 +2866,29 @@ var file_kythe_proto_xref_proto_goTypes = []interface{}{
 	nil,                                            // 33: kythe.proto.CrossReferencesReply.CrossReferencesEntry
 	nil,                                            // 34: kythe.proto.CrossReferencesReply.NodesEntry
 	nil,                                            // 35: kythe.proto.CrossReferencesReply.DefinitionLocationsEntry
-	nil,                                            // 36: kythe.proto.CrossReferencesReply.Total.RelatedNodesByRelationEntry
-	(*DocumentationReply_Document)(nil),            // 37: kythe.proto.DocumentationReply.Document
-	nil,                                            // 38: kythe.proto.DocumentationReply.NodesEntry
-	nil,                                            // 39: kythe.proto.DocumentationReply.DefinitionLocationsEntry
-	(*common_go_proto.Span)(nil),                   // 40: kythe.proto.common.Span
-	(*common_go_proto.CorpusPath)(nil),             // 41: kythe.proto.common.CorpusPath
-	(*common_go_proto.Diagnostic)(nil),             // 42: kythe.proto.common.Diagnostic
-	(*common_go_proto.Link)(nil),                   // 43: kythe.proto.common.Link
-	(*common_go_proto.MarkedSource)(nil),           // 44: kythe.proto.common.MarkedSource
-	(*common_go_proto.NodeInfo)(nil),               // 45: kythe.proto.common.NodeInfo
+	nil,                                            // 36: kythe.proto.CrossReferencesReply.Total.RefEdgeToCountEntry
+	nil,                                            // 37: kythe.proto.CrossReferencesReply.Total.RelatedNodesByRelationEntry
+	(*DocumentationReply_Document)(nil),            // 38: kythe.proto.DocumentationReply.Document
+	nil,                                            // 39: kythe.proto.DocumentationReply.NodesEntry
+	nil,                                            // 40: kythe.proto.DocumentationReply.DefinitionLocationsEntry
+	(*common_go_proto.Span)(nil),                   // 41: kythe.proto.common.Span
+	(*common_go_proto.CorpusPath)(nil),             // 42: kythe.proto.common.CorpusPath
+	(*common_go_proto.Diagnostic)(nil),             // 43: kythe.proto.common.Diagnostic
+	(*common_go_proto.Link)(nil),                   // 44: kythe.proto.common.Link
+	(*common_go_proto.MarkedSource)(nil),           // 45: kythe.proto.common.MarkedSource
+	(*common_go_proto.NodeInfo)(nil),               // 46: kythe.proto.common.NodeInfo
 }
 var file_kythe_proto_xref_proto_depIdxs = []int32{
 	1,  // 0: kythe.proto.Location.kind:type_name -> kythe.proto.Location.Kind
-	40, // 1: kythe.proto.Location.span:type_name -> kythe.proto.common.Span
+	41, // 1: kythe.proto.Location.span:type_name -> kythe.proto.common.Span
 	10, // 2: kythe.proto.DecorationsRequest.location:type_name -> kythe.proto.Location
 	2,  // 3: kythe.proto.DecorationsRequest.span_kind:type_name -> kythe.proto.DecorationsRequest.SpanKind
 	0,  // 4: kythe.proto.DecorationsRequest.snippets:type_name -> kythe.proto.SnippetsKind
 	22, // 5: kythe.proto.DecorationsRequest.workspace:type_name -> kythe.proto.Workspace
-	41, // 6: kythe.proto.File.corpus_path:type_name -> kythe.proto.common.CorpusPath
+	42, // 6: kythe.proto.File.corpus_path:type_name -> kythe.proto.common.CorpusPath
 	10, // 7: kythe.proto.DecorationsReply.location:type_name -> kythe.proto.Location
 	23, // 8: kythe.proto.DecorationsReply.reference:type_name -> kythe.proto.DecorationsReply.Reference
-	42, // 9: kythe.proto.DecorationsReply.diagnostic:type_name -> kythe.proto.common.Diagnostic
+	43, // 9: kythe.proto.DecorationsReply.diagnostic:type_name -> kythe.proto.common.Diagnostic
 	12, // 10: kythe.proto.DecorationsReply.generated_by_file:type_name -> kythe.proto.File
 	26, // 11: kythe.proto.DecorationsReply.nodes:type_name -> kythe.proto.DecorationsReply.NodesEntry
 	27, // 12: kythe.proto.DecorationsReply.definition_locations:type_name -> kythe.proto.DecorationsReply.DefinitionLocationsEntry
@@ -2881,54 +2903,55 @@ var file_kythe_proto_xref_proto_depIdxs = []int32{
 	15, // 21: kythe.proto.CrossReferencesRequest.corpus_path_filters:type_name -> kythe.proto.CorpusPathFilters
 	16, // 22: kythe.proto.CorpusPathFilters.filter:type_name -> kythe.proto.CorpusPathFilter
 	9,  // 23: kythe.proto.CorpusPathFilter.type:type_name -> kythe.proto.CorpusPathFilter.Type
-	40, // 24: kythe.proto.Anchor.span:type_name -> kythe.proto.common.Span
-	40, // 25: kythe.proto.Anchor.snippet_span:type_name -> kythe.proto.common.Span
-	43, // 26: kythe.proto.Printable.link:type_name -> kythe.proto.common.Link
+	41, // 24: kythe.proto.Anchor.span:type_name -> kythe.proto.common.Span
+	41, // 25: kythe.proto.Anchor.snippet_span:type_name -> kythe.proto.common.Span
+	44, // 26: kythe.proto.Printable.link:type_name -> kythe.proto.common.Link
 	32, // 27: kythe.proto.CrossReferencesReply.total:type_name -> kythe.proto.CrossReferencesReply.Total
 	32, // 28: kythe.proto.CrossReferencesReply.filtered:type_name -> kythe.proto.CrossReferencesReply.Total
 	33, // 29: kythe.proto.CrossReferencesReply.cross_references:type_name -> kythe.proto.CrossReferencesReply.CrossReferencesEntry
 	34, // 30: kythe.proto.CrossReferencesReply.nodes:type_name -> kythe.proto.CrossReferencesReply.NodesEntry
 	35, // 31: kythe.proto.CrossReferencesReply.definition_locations:type_name -> kythe.proto.CrossReferencesReply.DefinitionLocationsEntry
 	22, // 32: kythe.proto.DocumentationRequest.workspace:type_name -> kythe.proto.Workspace
-	37, // 33: kythe.proto.DocumentationReply.document:type_name -> kythe.proto.DocumentationReply.Document
-	38, // 34: kythe.proto.DocumentationReply.nodes:type_name -> kythe.proto.DocumentationReply.NodesEntry
-	39, // 35: kythe.proto.DocumentationReply.definition_locations:type_name -> kythe.proto.DocumentationReply.DefinitionLocationsEntry
-	40, // 36: kythe.proto.DecorationsReply.Reference.span:type_name -> kythe.proto.common.Span
+	38, // 33: kythe.proto.DocumentationReply.document:type_name -> kythe.proto.DocumentationReply.Document
+	39, // 34: kythe.proto.DocumentationReply.nodes:type_name -> kythe.proto.DocumentationReply.NodesEntry
+	40, // 35: kythe.proto.DocumentationReply.definition_locations:type_name -> kythe.proto.DocumentationReply.DefinitionLocationsEntry
+	41, // 36: kythe.proto.DecorationsReply.Reference.span:type_name -> kythe.proto.common.Span
 	3,  // 37: kythe.proto.DecorationsReply.Override.kind:type_name -> kythe.proto.DecorationsReply.Override.Kind
-	44, // 38: kythe.proto.DecorationsReply.Override.marked_source:type_name -> kythe.proto.common.MarkedSource
+	45, // 38: kythe.proto.DecorationsReply.Override.marked_source:type_name -> kythe.proto.common.MarkedSource
 	24, // 39: kythe.proto.DecorationsReply.Overrides.override:type_name -> kythe.proto.DecorationsReply.Override
-	45, // 40: kythe.proto.DecorationsReply.NodesEntry.value:type_name -> kythe.proto.common.NodeInfo
+	46, // 40: kythe.proto.DecorationsReply.NodesEntry.value:type_name -> kythe.proto.common.NodeInfo
 	17, // 41: kythe.proto.DecorationsReply.DefinitionLocationsEntry.value:type_name -> kythe.proto.Anchor
 	25, // 42: kythe.proto.DecorationsReply.ExtendsOverridesEntry.value:type_name -> kythe.proto.DecorationsReply.Overrides
 	17, // 43: kythe.proto.CrossReferencesReply.RelatedAnchor.anchor:type_name -> kythe.proto.Anchor
-	44, // 44: kythe.proto.CrossReferencesReply.RelatedAnchor.marked_source:type_name -> kythe.proto.common.MarkedSource
+	45, // 44: kythe.proto.CrossReferencesReply.RelatedAnchor.marked_source:type_name -> kythe.proto.common.MarkedSource
 	17, // 45: kythe.proto.CrossReferencesReply.RelatedAnchor.site:type_name -> kythe.proto.Anchor
-	44, // 46: kythe.proto.CrossReferencesReply.CrossReferenceSet.marked_source:type_name -> kythe.proto.common.MarkedSource
+	45, // 46: kythe.proto.CrossReferencesReply.CrossReferenceSet.marked_source:type_name -> kythe.proto.common.MarkedSource
 	30, // 47: kythe.proto.CrossReferencesReply.CrossReferenceSet.definition:type_name -> kythe.proto.CrossReferencesReply.RelatedAnchor
 	30, // 48: kythe.proto.CrossReferencesReply.CrossReferenceSet.declaration:type_name -> kythe.proto.CrossReferencesReply.RelatedAnchor
 	30, // 49: kythe.proto.CrossReferencesReply.CrossReferenceSet.reference:type_name -> kythe.proto.CrossReferencesReply.RelatedAnchor
 	30, // 50: kythe.proto.CrossReferencesReply.CrossReferenceSet.caller:type_name -> kythe.proto.CrossReferencesReply.RelatedAnchor
 	29, // 51: kythe.proto.CrossReferencesReply.CrossReferenceSet.related_node:type_name -> kythe.proto.CrossReferencesReply.RelatedNode
-	36, // 52: kythe.proto.CrossReferencesReply.Total.related_nodes_by_relation:type_name -> kythe.proto.CrossReferencesReply.Total.RelatedNodesByRelationEntry
-	31, // 53: kythe.proto.CrossReferencesReply.CrossReferencesEntry.value:type_name -> kythe.proto.CrossReferencesReply.CrossReferenceSet
-	45, // 54: kythe.proto.CrossReferencesReply.NodesEntry.value:type_name -> kythe.proto.common.NodeInfo
-	17, // 55: kythe.proto.CrossReferencesReply.DefinitionLocationsEntry.value:type_name -> kythe.proto.Anchor
-	18, // 56: kythe.proto.DocumentationReply.Document.text:type_name -> kythe.proto.Printable
-	44, // 57: kythe.proto.DocumentationReply.Document.marked_source:type_name -> kythe.proto.common.MarkedSource
-	37, // 58: kythe.proto.DocumentationReply.Document.children:type_name -> kythe.proto.DocumentationReply.Document
-	45, // 59: kythe.proto.DocumentationReply.NodesEntry.value:type_name -> kythe.proto.common.NodeInfo
-	17, // 60: kythe.proto.DocumentationReply.DefinitionLocationsEntry.value:type_name -> kythe.proto.Anchor
-	11, // 61: kythe.proto.XRefService.Decorations:input_type -> kythe.proto.DecorationsRequest
-	14, // 62: kythe.proto.XRefService.CrossReferences:input_type -> kythe.proto.CrossReferencesRequest
-	20, // 63: kythe.proto.XRefService.Documentation:input_type -> kythe.proto.DocumentationRequest
-	13, // 64: kythe.proto.XRefService.Decorations:output_type -> kythe.proto.DecorationsReply
-	19, // 65: kythe.proto.XRefService.CrossReferences:output_type -> kythe.proto.CrossReferencesReply
-	21, // 66: kythe.proto.XRefService.Documentation:output_type -> kythe.proto.DocumentationReply
-	64, // [64:67] is the sub-list for method output_type
-	61, // [61:64] is the sub-list for method input_type
-	61, // [61:61] is the sub-list for extension type_name
-	61, // [61:61] is the sub-list for extension extendee
-	0,  // [0:61] is the sub-list for field type_name
+	36, // 52: kythe.proto.CrossReferencesReply.Total.ref_edge_to_count:type_name -> kythe.proto.CrossReferencesReply.Total.RefEdgeToCountEntry
+	37, // 53: kythe.proto.CrossReferencesReply.Total.related_nodes_by_relation:type_name -> kythe.proto.CrossReferencesReply.Total.RelatedNodesByRelationEntry
+	31, // 54: kythe.proto.CrossReferencesReply.CrossReferencesEntry.value:type_name -> kythe.proto.CrossReferencesReply.CrossReferenceSet
+	46, // 55: kythe.proto.CrossReferencesReply.NodesEntry.value:type_name -> kythe.proto.common.NodeInfo
+	17, // 56: kythe.proto.CrossReferencesReply.DefinitionLocationsEntry.value:type_name -> kythe.proto.Anchor
+	18, // 57: kythe.proto.DocumentationReply.Document.text:type_name -> kythe.proto.Printable
+	45, // 58: kythe.proto.DocumentationReply.Document.marked_source:type_name -> kythe.proto.common.MarkedSource
+	38, // 59: kythe.proto.DocumentationReply.Document.children:type_name -> kythe.proto.DocumentationReply.Document
+	46, // 60: kythe.proto.DocumentationReply.NodesEntry.value:type_name -> kythe.proto.common.NodeInfo
+	17, // 61: kythe.proto.DocumentationReply.DefinitionLocationsEntry.value:type_name -> kythe.proto.Anchor
+	11, // 62: kythe.proto.XRefService.Decorations:input_type -> kythe.proto.DecorationsRequest
+	14, // 63: kythe.proto.XRefService.CrossReferences:input_type -> kythe.proto.CrossReferencesRequest
+	20, // 64: kythe.proto.XRefService.Documentation:input_type -> kythe.proto.DocumentationRequest
+	13, // 65: kythe.proto.XRefService.Decorations:output_type -> kythe.proto.DecorationsReply
+	19, // 66: kythe.proto.XRefService.CrossReferences:output_type -> kythe.proto.CrossReferencesReply
+	21, // 67: kythe.proto.XRefService.Documentation:output_type -> kythe.proto.DocumentationReply
+	65, // [65:68] is the sub-list for method output_type
+	62, // [62:65] is the sub-list for method input_type
+	62, // [62:62] is the sub-list for extension type_name
+	62, // [62:62] is the sub-list for extension extendee
+	0,  // [0:62] is the sub-list for field type_name
 }
 
 func init() { file_kythe_proto_xref_proto_init() }
@@ -3177,7 +3200,7 @@ func file_kythe_proto_xref_proto_init() {
 				return nil
 			}
 		}
-		file_kythe_proto_xref_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} {
+		file_kythe_proto_xref_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*DocumentationReply_Document); i {
 			case 0:
 				return &v.state
@@ -3197,7 +3220,7 @@ func file_kythe_proto_xref_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_kythe_proto_xref_proto_rawDesc,
 			NumEnums:      10,
-			NumMessages:   30,
+			NumMessages:   31,
 			NumExtensions: 0,
 			NumServices:   1,
 		},


Test patch:
diff --git a/kythe/go/serving/xrefs/xrefs_test.go b/kythe/go/serving/xrefs/xrefs_test.go
index da03d81c5..3c1361b69 100644
--- a/kythe/go/serving/xrefs/xrefs_test.go
+++ b/kythe/go/serving/xrefs/xrefs_test.go
@@ -1331,10 +1331,14 @@ func TestCrossReferences(t *testing.T) {
 	if err := testutil.DeepEqual(&xpb.CrossReferencesReply_Total{
 		Definitions: 1,
 		References:  2,
+		RefEdgeToCount: map[string]int64{
+			"/kythe/edge/ref": 2,
+		},
 	}, reply.Total); err != nil {
 		t.Error(err)
 	}
-	if err := testutil.DeepEqual(&xpb.CrossReferencesReply_Total{}, reply.Filtered); err != nil {
+	wantFiltered := &xpb.CrossReferencesReply_Total{}
+	if err := testutil.DeepEqual(wantFiltered, reply.Filtered); err != nil {
 		t.Error(err)
 	}
 
@@ -1494,10 +1498,14 @@ func TestCrossReferencesScoped(t *testing.T) {
 	if err := testutil.DeepEqual(&xpb.CrossReferencesReply_Total{
 		Definitions: 1,
 		References:  2,
+		RefEdgeToCount: map[string]int64{
+			"/kythe/edge/ref": 2,
+		},
 	}, reply.Total); err != nil {
 		t.Error(err)
 	}
-	if err := testutil.DeepEqual(&xpb.CrossReferencesReply_Total{}, reply.Filtered); err != nil {
+	wantFiltered := &xpb.CrossReferencesReply_Total{}
+	if err := testutil.DeepEqual(wantFiltered, reply.Filtered); err != nil {
 		t.Error(err)
 	}
 
@@ -1788,10 +1796,14 @@ func TestCrossReferencesReadAhead(t *testing.T) {
 	if err := testutil.DeepEqual(&xpb.CrossReferencesReply_Total{
 		Definitions: 1,
 		References:  2,
+		RefEdgeToCount: map[string]int64{
+			"/kythe/edge/ref": 2,
+		},
 	}, reply.Total); err != nil {
 		t.Error(err)
 	}
-	if err := testutil.DeepEqual(&xpb.CrossReferencesReply_Total{}, reply.Filtered); err != nil {
+	wantFiltered := &xpb.CrossReferencesReply_Total{}
+	if err := testutil.DeepEqual(wantFiltered, reply.Filtered); err != nil {
 		t.Error(err)
 	}
 
@@ -2188,11 +2200,17 @@ filter: {
 	if err := testutil.DeepEqual(&xpb.CrossReferencesReply_Total{
 		Definitions: 1,
 		References:  1,
+		RefEdgeToCount: map[string]int64{
+			"/kythe/edge/ref": 1,
+		},
 	}, reply.Total); err != nil {
 		t.Error(err)
 	}
 	if err := testutil.DeepEqual(&xpb.CrossReferencesReply_Total{
 		References: 1,
+		RefEdgeToCount: map[string]int64{
+			"/kythe/edge/ref": 1,
+		},
 	}, reply.Filtered); err != nil {
 		t.Error(err)
 	}
@@ -2477,6 +2495,9 @@ func TestCrossReferencesIndirection(t *testing.T) {
 
 		if err := testutil.DeepEqual(&xpb.CrossReferencesReply_Total{
 			References: 1,
+			RefEdgeToCount: map[string]int64{
+				"/kythe/edge/ref": 1,
+			},
 		}, reply.Total); err != nil {
 			t.Error(err)
 		}
@@ -2543,6 +2564,9 @@ func TestCrossReferencesIndirection(t *testing.T) {
 
 		if err := testutil.DeepEqual(&xpb.CrossReferencesReply_Total{
 			References: 3,
+			RefEdgeToCount: map[string]int64{
+				"/kythe/edge/ref": 3,
+			},
 		}, reply.Total); err != nil {
 			t.Error(err)
 		}
@@ -2612,6 +2636,9 @@ func TestCrossReferencesIndirection(t *testing.T) {
 
 		if err := testutil.DeepEqual(&xpb.CrossReferencesReply_Total{
 			References: 3,
+			RefEdgeToCount: map[string]int64{
+				"/kythe/edge/ref": 3,
+			},
 		}, reply.Total); err != nil {
 			t.Error(err)
 		}
@@ -2664,6 +2691,9 @@ func TestCrossReferencesIndirection(t *testing.T) {
 
 		if err := testutil.DeepEqual(&xpb.CrossReferencesReply_Total{
 			References: 2,
+			RefEdgeToCount: map[string]int64{
+				"/kythe/edge/ref": 2,
+			},
 		}, reply.Total); err != nil {
 			t.Error(err)
 		}
@@ -2742,6 +2772,9 @@ func TestCrossReferencesIndirection(t *testing.T) {
 
 		if err := testutil.DeepEqual(&xpb.CrossReferencesReply_Total{
 			References: 4,
+			RefEdgeToCount: map[string]int64{
+				"/kythe/edge/ref": 4,
+			},
 		}, reply.Total); err != nil {
 			t.Error(err)
 		}
@@ -2884,6 +2917,9 @@ func TestCrossReferencesRevisions(t *testing.T) {
 	expected := &xpb.CrossReferencesReply{
 		Total: &xpb.CrossReferencesReply_Total{
 			References: 1,
+			RefEdgeToCount: map[string]int64{
+				"/kythe/edge/ref": 1,
+			},
 		},
 		Filtered: &xpb.CrossReferencesReply_Total{},
 		CrossReferences: map[string]*xpb.CrossReferencesReply_CrossReferenceSet{