Class: Igniter::Lang::VerificationReport
- Inherits:
-
Object
- Object
- Igniter::Lang::VerificationReport
- Defined in:
- lib/igniter/lang/verification_report.rb
Constant Summary collapse
- METADATA_CARRIER_SECTIONS =
%i[ diagnostics receipts model_validity_reports scenario_comparison_reports review_receipts ].freeze
- CUSTOM_METADATA_CARRIER_SECTIONS_KEY =
:custom_sections- METADATA_CARRIER_SEMANTICS =
{ report_only: true, runtime_enforced: false, execution_authorized: false, provider_call_authorized: false, real_data_export_authorized: false, readiness_enforced: false, ledger_core: false }.freeze
- DEFAULT_METADATA_REDACTION_POLICY =
{ raw_ref_export: false, hash_source_refs: true, redacted_ref_kinds: [] }.freeze
- RAW_REF_KEYS =
%i[raw_ref raw_refs raw_source_ref raw_source_refs].freeze
- RAW_REF_PREFIX =
"raw:"
Instance Attribute Summary collapse
-
#carrier_manifest ⇒ Object
readonly
Returns the value of attribute carrier_manifest.
-
#descriptors ⇒ Object
readonly
Returns the value of attribute descriptors.
-
#diagnostic_payloads ⇒ Object
readonly
Returns the value of attribute diagnostic_payloads.
-
#findings ⇒ Object
readonly
Returns the value of attribute findings.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#metadata_manifest ⇒ Object
readonly
Returns the value of attribute metadata_manifest.
-
#operations ⇒ Object
readonly
Returns the value of attribute operations.
-
#profile_fingerprint ⇒ Object
readonly
Returns the value of attribute profile_fingerprint.
-
#receipt_payloads ⇒ Object
readonly
Returns the value of attribute receipt_payloads.
-
#schema_compatibility_diagnostics ⇒ Object
readonly
Returns the value of attribute schema_compatibility_diagnostics.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(profile_fingerprint:, operations:, findings: [], metadata: {}, diagnostic_payloads: [], receipt_payloads: [], schema_compatibility_diagnostics: []) ⇒ VerificationReport
constructor
A new instance of VerificationReport.
- #invalid? ⇒ Boolean
- #ok? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(profile_fingerprint:, operations:, findings: [], metadata: {}, diagnostic_payloads: [], receipt_payloads: [], schema_compatibility_diagnostics: []) ⇒ VerificationReport
Returns a new instance of VerificationReport.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/igniter/lang/verification_report.rb', line 64 def initialize( profile_fingerprint:, operations:, findings: [], metadata: {}, diagnostic_payloads: [], receipt_payloads: [], schema_compatibility_diagnostics: [] ) @profile_fingerprint = profile_fingerprint @operations = operations.freeze @findings = findings.freeze @metadata = () @metadata_manifest = MetadataManifest.from_operations(operations) @carrier_manifest = MetadataCarrierManifest.(@metadata) @descriptors = .descriptors @diagnostic_payloads = normalize_diagnostic_payloads(diagnostic_payloads) @receipt_payloads = normalize_receipt_payloads(receipt_payloads) @schema_compatibility_diagnostics = normalize_schema_compatibility_diagnostics( schema_compatibility_diagnostics ) freeze end |
Instance Attribute Details
#carrier_manifest ⇒ Object (readonly)
Returns the value of attribute carrier_manifest.
34 35 36 |
# File 'lib/igniter/lang/verification_report.rb', line 34 def carrier_manifest @carrier_manifest end |
#descriptors ⇒ Object (readonly)
Returns the value of attribute descriptors.
34 35 36 |
# File 'lib/igniter/lang/verification_report.rb', line 34 def descriptors @descriptors end |
#diagnostic_payloads ⇒ Object (readonly)
Returns the value of attribute diagnostic_payloads.
34 35 36 |
# File 'lib/igniter/lang/verification_report.rb', line 34 def diagnostic_payloads @diagnostic_payloads end |
#findings ⇒ Object (readonly)
Returns the value of attribute findings.
34 35 36 |
# File 'lib/igniter/lang/verification_report.rb', line 34 def findings @findings end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
34 35 36 |
# File 'lib/igniter/lang/verification_report.rb', line 34 def @metadata end |
#metadata_manifest ⇒ Object (readonly)
Returns the value of attribute metadata_manifest.
34 35 36 |
# File 'lib/igniter/lang/verification_report.rb', line 34 def @metadata_manifest end |
#operations ⇒ Object (readonly)
Returns the value of attribute operations.
34 35 36 |
# File 'lib/igniter/lang/verification_report.rb', line 34 def operations @operations end |
#profile_fingerprint ⇒ Object (readonly)
Returns the value of attribute profile_fingerprint.
34 35 36 |
# File 'lib/igniter/lang/verification_report.rb', line 34 def profile_fingerprint @profile_fingerprint end |
#receipt_payloads ⇒ Object (readonly)
Returns the value of attribute receipt_payloads.
34 35 36 |
# File 'lib/igniter/lang/verification_report.rb', line 34 def receipt_payloads @receipt_payloads end |
#schema_compatibility_diagnostics ⇒ Object (readonly)
Returns the value of attribute schema_compatibility_diagnostics.
34 35 36 |
# File 'lib/igniter/lang/verification_report.rb', line 34 def schema_compatibility_diagnostics @schema_compatibility_diagnostics end |
Class Method Details
.from_artifact(artifact, profile_fingerprint:) ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/igniter/lang/verification_report.rb', line 54 def self.from_artifact(artifact, profile_fingerprint:) operations = artifact ? artifact.operations : [] new( profile_fingerprint: profile_fingerprint, operations: operations, findings: [], metadata: { source: :compiled_artifact } ) end |
.from_compilation_report(report) ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/igniter/lang/verification_report.rb', line 45 def self.from_compilation_report(report) new( profile_fingerprint: report.profile_fingerprint, operations: report.operations, findings: report.findings.map(&:to_h), metadata: { source: :compilation_report } ) end |
Instance Method Details
#invalid? ⇒ Boolean
92 93 94 |
# File 'lib/igniter/lang/verification_report.rb', line 92 def invalid? !ok? end |
#ok? ⇒ Boolean
88 89 90 |
# File 'lib/igniter/lang/verification_report.rb', line 88 def ok? findings.empty? end |
#to_h ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/igniter/lang/verification_report.rb', line 96 def to_h { ok: ok?, profile_fingerprint: profile_fingerprint, descriptors: descriptors, metadata_manifest: .to_h, carrier_manifest: carrier_manifest.to_h, diagnostic_payloads: diagnostic_payloads.map(&:to_h), receipt_payloads: receipt_payloads.map(&:to_h), schema_compatibility_diagnostics: schema_compatibility_diagnostics.map(&:to_h), findings: findings, metadata: } end |