1#ifndef ARACHNE_CONTRACTS_HPP
2#define ARACHNE_CONTRACTS_HPP
4#include <nlohmann/json_fwd.hpp>
56
57
58
62
63
68
69
70
71
72
73
static nlohmann::ordered_json write_plan(const nlohmann::json &materialization, const std::filesystem::path &destination, std::string storage_ref, std::string product_snapshot_id, std::string product_snapshot_sha256, const candidate_configuration &configuration, std::string created_at)
static nlohmann::ordered_json enrichment_fetch_plan(const nlohmann::json &candidate_pool, const nlohmann::json &available_profiles, std::string source_name, std::string locator, std::string created_at)
static nlohmann::ordered_json configuration_values(const candidate_configuration &configuration={})
static nlohmann::ordered_json build(const nlohmann::json &external_graph, const candidate_configuration &configuration={})
std::vector< ranked_candidate > rank_pool(const graph_input &graph, const candidate_configuration &configuration)
void require_only_fields(const nlohmann::json &value, const std::set< std::string_view, std::less<> > &allowed, std::string_view context)
std::string selection_explanation(const ranked_candidate &candidate)
std::uint64_t natural_identifier(std::string_view value)
bool id_less(std::string_view left, std::string_view right)
void collect_profile_features(const nlohmann::json &value, std::string prefix, feature_vector &output)
void validate_configuration(const candidate_configuration &configuration)
std::map< std::string, double, std::less<> > feature_vector
feature_vector centroid(const std::vector< std::size_t > &members, const std::vector< feature_vector > &features)
graph_input parse_graph(const nlohmann::json &document)
void require_stable_id(std::string_view value, std::string_view context)
void group_and_select(std::vector< ranked_candidate > &pool, const graph_input &graph, const candidate_configuration &configuration)
void publish_immutable_file(const std::filesystem::path &destination, std::string_view bytes)
std::string required_string(const nlohmann::json &value, std::string_view field, std::string_view context)
double weighted_jaccard(const feature_vector &left, const feature_vector &right)
std::string sha256(std::span< const std::byte > bytes)
std::string sha256_file(const std::filesystem::path &path)
bool is_artifact_bearing(contract_name name) noexcept
validation_result validate(contract_name expected, const nlohmann::json &document)
validation_result validate(const nlohmann::json &document)
std::optional< contract_name > parse_contract_name(std::string_view name) noexcept
@ research_candidate_graph_plan
@ research_candidate_graph_snapshot
std::string_view to_string(contract_name name) noexcept
std::string canonical_json(const nlohmann::json &document)
std::vector< std::size_t > works
std::size_t total_children
std::size_t gray_children
std::vector< std::size_t > claimed_works
std::size_t parsed_children
std::int64_t coverage_basis_points
int gray_bonus_basis_points
std::string instance_path
bool operator==(const diagnostic &) const =default
bool valid() const noexcept
operator bool() const noexcept
std::vector< diagnostic > diagnostics