Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::authoring_capsule::ProfileValidator Class Referenceabstract

Semantic validation of an extracted staging tree. More...

#include <profile_registry.hpp>

Public Member Functions

virtual ~ProfileValidator ()=default
virtual std::string_view profile_id () const noexcept=0
 The profile this validator answers for, e.g.
virtual std::uint32_t max_profile_version () const noexcept=0
 Highest profile version understood.
virtual std::vector< std::string > required_roles () const =0
 Roles this profile requires.
virtual bool supports_capability (std::string_view name) const noexcept=0
 Capabilities this profile can satisfy locally.
virtual runtime::Result< void, CapsuleError > check_compatibility (const Manifest &manifest) const =0
 Is the local runtime new enough for this capsule?
virtual runtime::Result< void, CapsuleError > validate_staged (const Manifest &manifest, const std::filesystem::path &staging_root) const =0
 Validate the extracted staging tree without executing it.

Detailed Description

Semantic validation of an extracted staging tree.

Runs after admission and before publication, and must not execute any capsule content.

Constructor & Destructor Documentation

◆ ~ProfileValidator()

virtual pulp::authoring_capsule::ProfileValidator::~ProfileValidator ( )
virtualdefault

Member Function Documentation

◆ check_compatibility()

virtual runtime::Result< void, CapsuleError > pulp::authoring_capsule::ProfileValidator::check_compatibility ( const Manifest & manifest) const
pure virtual

Is the local runtime new enough for this capsule?

◆ max_profile_version()

virtual std::uint32_t pulp::authoring_capsule::ProfileValidator::max_profile_version ( ) const
pure virtualnoexcept

Highest profile version understood.

A capsule above it is unsupported_profile_version; the caller reports the exact numbers so the user learns which update they need.

◆ profile_id()

virtual std::string_view pulp::authoring_capsule::ProfileValidator::profile_id ( ) const
pure virtualnoexcept

The profile this validator answers for, e.g.

"com.generous.forge.instrument".

◆ required_roles()

virtual std::vector< std::string > pulp::authoring_capsule::ProfileValidator::required_roles ( ) const
pure virtual

Roles this profile requires.

The substrate enforces this; a consumer must not repeat the check. preview_capsule() calls this and reports every role absent from the manifest's files[] and dependencies[] as missing_required_role, which lands as CompatibilityVerdict::unsupported in the preview rather than as an immediate error — the preview exists to tell a person what is missing. admit_to_staging() is where that verdict bites: it refuses before extracting anything, so nothing reaches validate_staged() with a required role missing.

Only the missing direction is checked. A role this list does not name is not rejected: unknown optional metadata must round-trip, and which unrecognized roles matter is this profile's own judgment, in validate_staged().

◆ supports_capability()

virtual bool pulp::authoring_capsule::ProfileValidator::supports_capability ( std::string_view name) const
pure virtualnoexcept

Capabilities this profile can satisfy locally.

◆ validate_staged()

virtual runtime::Result< void, CapsuleError > pulp::authoring_capsule::ProfileValidator::validate_staged ( const Manifest & manifest,
const std::filesystem::path & staging_root ) const
pure virtual

Validate the extracted staging tree without executing it.


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/authoring_capsule/include/pulp/authoring_capsule/profile_registry.hpp