Puppet writes a report file in the yaml format after every agent run. The yaml format includes a yaml document tag, or 'taguri', which indicates the ruby object type. This is fine if you have the puppet gem loaded however if you want to use pure ruby to read in the report you need to use a lower level interface of ruby's yaml library (psych) so that the taguri can be removed. In this way we can effectively ignore the ruby object type encoded in the report yaml file.
The taguri can be seen in the first line of the report yaml file:
--- !ruby/object:Puppet::Transaction::Report
host: pe-20198
time: '2020-10-08T00:12:25.779388944+00:00'
configuration_version: 1602115959
transaction_uuid: c3ec7329-736d-46e7-8445-025f7962f170
report_format: 10
puppet_version: 6.17.0
The two ruby files on this gist provide with-puppet, and without-puppet mechanisms for reading the puppet report into ruby so it can then be manipulated, reported on, etc.