@@ -62,66 +62,6 @@ def _mcp_text_json_bytes(value: object) -> bytes:
6262 "materialize named Boolean CNF for finite colorings and forbidden patterns" ,
6363 ),
6464 ),
65- "graph.invariant.maximum_matching.compute" : (
66- (
67- "graph.invariant.maximum_matching.verify" ,
68- "independently replay the stored Tutte-Berge certificate" ,
69- ),
70- ),
71- "graph.invariant.maximum_matching.verify" : (
72- (
73- "graph.invariant.maximum_matching.compute" ,
74- "produce a matching witness and Tutte-Berge certificate" ,
75- ),
76- ),
77- "probability.graph_reliability.connection_probability.compute" : (
78- (
79- "probability.graph_reliability.connection_probability.verify" ,
80- "independently replay every edge state and terminal connection" ,
81- ),
82- ),
83- "probability.graph_reliability.connection_probability.verify" : (
84- (
85- "probability.graph_reliability.connection_probability.compute" ,
86- "compute the complete exact edge-state ledger" ,
87- ),
88- ),
89- "graph.hamiltonian_path.decide" : (
90- (
91- "graph.hamiltonian_path.verify" ,
92- "independently verify the stored positive or negative decision" ,
93- ),
94- ),
95- "graph.hamiltonian_path.verify" : (
96- (
97- "graph.hamiltonian_path.decide" ,
98- "produce a complete bounded decision and optional path witness" ,
99- ),
100- ),
101- "polynomial.jacobian_syzygy.minimum_degree.compute" : (
102- (
103- "polynomial.jacobian_syzygy.minimum_degree.verify" ,
104- "independently rebuild the graded maps, ranks, minors, and first kernel" ,
105- ),
106- ),
107- "polynomial.jacobian_syzygy.minimum_degree.verify" : (
108- (
109- "polynomial.jacobian_syzygy.minimum_degree.compute" ,
110- "produce the provenance-bound graded rank ledger and kernel witness" ,
111- ),
112- ),
113- "geometry.projective_line_arrangement.flats.materialize" : (
114- (
115- "geometry.projective_line_arrangement.flats.verify" ,
116- "independently rebuild all projective flats and pair accounting" ,
117- ),
118- ),
119- "geometry.projective_line_arrangement.flats.verify" : (
120- (
121- "geometry.projective_line_arrangement.flats.materialize" ,
122- "materialize normalized lines, exact flats, incidences and multiplicities" ,
123- ),
124- ),
12565}
12666
12767
@@ -140,16 +80,27 @@ def _capability_inspection_extensions(
14080 descriptors : dict [str , CapabilityDescriptor ],
14181) -> dict [str , Any ]:
14282 extensions : dict [str , Any ] = {}
143- related = [
83+ related = {
84+ item .capability_id : item .model_dump (mode = "json" )
85+ for item in descriptors [capability_id ].related_capabilities
86+ if item .capability_id in descriptors and item .capability_id != capability_id
87+ }
88+ related .update (
14489 {
145- "capability_id" : related_id ,
146- "relationship" : relationship ,
90+ related_id : {
91+ "capability_id" : related_id ,
92+ "relationship" : relationship ,
93+ }
94+ for related_id , relationship in _RELATED_CAPABILITIES .get (capability_id , ())
95+ if related_id in descriptors
96+ and related_id != capability_id
97+ and related_id not in related
14798 }
148- for related_id , relationship in _RELATED_CAPABILITIES .get (capability_id , ())
149- if related_id in descriptors
150- ]
99+ )
151100 if related :
152- extensions ["related_capabilities" ] = related
101+ extensions ["related_capabilities" ] = [
102+ related [related_id ] for related_id in sorted (related )
103+ ]
153104 if capability_id .startswith (("sat." , "smt." )):
154105 extensions ["synchronous_execution" ] = {
155106 "remote_safe_wall_seconds_max" : 150 ,
@@ -222,16 +173,26 @@ def _discovery_operation_card(
222173 """Add compact decision facts without recommending a research action."""
223174
224175 runtime = descriptor .provider_runtime
225- related = [
176+ related = {
177+ item .capability_id : item .model_dump (mode = "json" )
178+ for item in descriptor .related_capabilities
179+ if item .capability_id in descriptors
180+ and item .capability_id != descriptor .capability_id
181+ }
182+ related .update (
226183 {
227- "capability_id" : related_id ,
228- "relationship" : relationship ,
184+ related_id : {
185+ "capability_id" : related_id ,
186+ "relationship" : relationship ,
187+ }
188+ for related_id , relationship in _RELATED_CAPABILITIES .get (
189+ descriptor .capability_id , ()
190+ )
191+ if related_id in descriptors
192+ and related_id != descriptor .capability_id
193+ and related_id not in related
229194 }
230- for related_id , relationship in _RELATED_CAPABILITIES .get (
231- descriptor .capability_id , ()
232- )
233- if related_id in descriptors
234- ]
195+ )
235196 invocation_example = None
236197 if descriptor .invocation_examples :
237198 example = descriptor .invocation_examples [0 ]
@@ -259,7 +220,7 @@ def _discovery_operation_card(
259220 "provider_availability" : (
260221 runtime .availability .value if runtime is not None else "UNKNOWN"
261222 ),
262- "related_capabilities" : related ,
223+ "related_capabilities" : [ related [ item ] for item in sorted ( related )] ,
263224 ** (
264225 {"invocation_example" : invocation_example }
265226 if invocation_example is not None
0 commit comments