Arachne 1.0
Arachne - the perpetual stitcher of Wikidata entities.
Loading...
Searching...
No Matches
hardened_transport.hpp
Go to the documentation of this file.
1#ifndef ARACHNE_PHEIDIPPIDES_HARDENED_TRANSPORT_HPP
2#define ARACHNE_PHEIDIPPIDES_HARDENED_TRANSPORT_HPP
3
4#include "pheidippides/transport.hpp"
5
6#include <filesystem>
7#include <memory>
8#include <nlohmann/json_fwd.hpp>
9
10namespace arachne::pheidippides {
11
12/**
13 * Declarative policy boundary around the domain-blind byte transport.
14 *
15 * Construction validates the complete door registry. No network operation is
16 * possible through an invalid registry. The implementation applies endpoint
17 * capabilities, runtime secret references, admission limits, freshness rules,
18 * artifact-reference caching, and equivalent-read single flight before handing
19 * a concrete request to transport.
20 */
21class hardened_transport final {
22public:
24 std::filesystem::path artifact_root,
25 const nlohmann::json& transport_configuration
26 );
28
29 hardened_transport(const hardened_transport&) = delete;
30 hardened_transport& operator=(const hardened_transport&) = delete;
31 hardened_transport(hardened_transport&&) noexcept;
32 hardened_transport& operator=(hardened_transport&&) noexcept;
33
34 [[nodiscard]] acquired_artifact_v1
35 execute(const fetch_request_v1& request) const;
36
37 [[nodiscard]] acquired_artifact_v1
38 execute(const nlohmann::json& request_contract) const;
39
40private:
41 struct implementation;
43};
44
45}
46
47#endif // ARACHNE_PHEIDIPPIDES_HARDENED_TRANSPORT_HPP
cli_error(std::string message, const int exit_code=2)
Definition main.cpp:57
bool flag(const std::string_view name) const
Definition main.cpp:243
const std::string & require(const std::string_view name) const
Definition main.cpp:226
std::map< std::string, std::string, std::less<> > values_
Definition main.cpp:248
std::optional< std::string > optional(const std::string_view name) const
Definition main.cpp:235
std::set< std::string, std::less<> > present_flags_
Definition main.cpp:249
options(const std::vector< std::string > &arguments, const std::size_t first, const std::initializer_list< std::string_view > allowed, const std::initializer_list< std::string_view > flags={})
Definition main.cpp:187
envelope_record intake(const intake_request &request)
void capture_inbox_baseline(const std::filesystem::path &inbox_root)
snapshot_result replace_candidate_snapshot(const candidate_snapshot_request &request)
Definition store.cpp:1523
const std::filesystem::path & root() const noexcept
Definition store.hpp:101
std::filesystem::path root_
Definition store.hpp:106
store(std::filesystem::path root)
Definition store.cpp:1283
std::optional< snapshot_result > active_snapshot(graph_domain domain) const
Definition store.cpp:1307
void checkpoint_staging(graph_domain domain, const std::filesystem::path &database_path) const
Definition store.cpp:1323
integrity_report integrity_check(graph_domain domain, const std::filesystem::path &database_path) const
Definition store.cpp:1315
std::string export_jsonl(graph_domain domain, const std::filesystem::path &database_path, const std::filesystem::path &destination) const
Definition store.cpp:1337
acquired_artifact_v1 execute(const fetch_request_v1 &request) const
acquired_artifact_v1 execute(const nlohmann::json &request_contract) const
hardened_transport(std::filesystem::path artifact_root, const nlohmann::json &transport_configuration)
hardened_transport(const hardened_transport &)=delete
hardened_transport(hardened_transport &&) noexcept
hardened_transport & operator=(hardened_transport &&) noexcept
std::unique_ptr< implementation > implementation_
hardened_transport & operator=(const hardened_transport &)=delete
int main(const int argc, char **argv)
Definition main.cpp:2205
std::string join_strings(const std::span< const std::string > values, const std::string_view separator)
Definition main.cpp:1575
int command_inbox_baseline(const options &arguments)
Definition main.cpp:1218
const json & required_object(const json &parent, const std::string_view key)
Definition main.cpp:313
std::string validation_details(const arachnespace::contracts::validation_result &result, const std::string_view description)
Definition main.cpp:171
int command_fetch(const options &arguments)
Definition main.cpp:1506
std::size_t size_value(const json &object, const std::string_view key, const std::size_t fallback)
Definition main.cpp:281
written_run_manifest write_graph_run_manifest(const configuration &config, const std::string_view domain_directory, const std::string_view graph_domain, const std::string_view run_id, ordered_json configuration_hashes, ordered_json inputs, const arachne::penelope::snapshot_result &snapshot)
Definition main.cpp:601
void emit(const json &document)
Definition main.cpp:167
void atomic_write(const fs::path &destination, const std::string_view bytes, const bool replace)
Definition main.cpp:487
int command_contract_validate(const options &arguments)
Definition main.cpp:1117
ordered_json envelope_json(const arachne::coordination::envelope_record &envelope)
Definition main.cpp:560
json candidate_tables_for_viewer(const json &tables)
Definition main.cpp:916
fs::path resolved_path(const fs::path &path, const fs::path &relative_root)
Definition main.cpp:76
ordered_json wikidata_point_fetch_request(const configuration &config, const json &plan, const json &planned, const std::span< const std::string > entities, const std::string &request_id)
Definition main.cpp:1588
std::string read_bytes(const fs::path &path, const std::uintmax_t maximum_bytes, const std::string_view description)
Definition main.cpp:101
constexpr std::uintmax_t maximum_config_bytes
Definition main.cpp:49
resolved_snapshot_export resolve_snapshot_export(const configuration &config, const fs::path &control_path, const arachnespace::contracts::contract_name expected_contract, const std::string_view expected_kind)
Definition main.cpp:762
std::string form_encode(const std::string_view value)
Definition main.cpp:1548
void write_immutable_exact(const fs::path &destination, const std::string_view bytes, const std::string_view description)
Definition main.cpp:539
ordered_json snapshot_json(const arachne::penelope::snapshot_result &snapshot)
Definition main.cpp:579
int command_candidate_rebuild(const options &arguments)
Definition main.cpp:1354
int command_fetch_plan(const options &arguments)
Definition main.cpp:1782
void verify_external_source_snapshot(const configuration &config, const json &external_graph)
Definition main.cpp:836
arachne::ariadne::candidate_configuration candidate_configuration_from(const configuration &config)
Definition main.cpp:1081
constexpr std::uintmax_t maximum_export_bytes
Definition main.cpp:51
std::optional< fs::path > conventional_legacy_inbox()
Definition main.cpp:91
int command_intake(const options &arguments)
Definition main.cpp:1154
int command_cocoon_transition(const options &arguments)
Definition main.cpp:1177
json materialize_jsonl_export(const fs::path &path, const bool candidate)
Definition main.cpp:993
ordered_json actor_inbox_issues(const arachne::coordination::operational_ledger &ledger, const fs::path &inbox)
Definition main.cpp:1205
int dispatch(const std::vector< std::string > &arguments)
Definition main.cpp:2116
std::string policy_configuration_hash(const configuration &config, const std::string_view section)
Definition main.cpp:455
bool path_is_in_protected_legacy(const fs::path &path, const configuration &config)
Definition main.cpp:479
ordered_json wikidata_bulk_fetch_request(const json &plan, const json &planned, std::string request_id, std::string locator)
Definition main.cpp:1698
fs::path resolve_plan_artifact(const configuration &config, const fs::path &control_path, const std::string_view storage_ref)
Definition main.cpp:715
bool wikidata_entity_id(const std::string_view value)
Definition main.cpp:1566
configuration load_configuration(const fs::path &input_path)
Definition main.cpp:323
std::atomic< std::uint64_t > temporary_sequence
Definition main.cpp:53
ordered_json capabilities()
Definition main.cpp:2103
bool valid_logical_date(const std::string_view value)
Definition main.cpp:1056
int command_candidate_plan(const options &arguments)
Definition main.cpp:1951
int command_viewer_build(const options &arguments)
Definition main.cpp:2025
json parse_embedded_json(const json &row, const std::string_view key, json fallback)
Definition main.cpp:896
ordered_json issue_json(std::string path, std::string message)
Definition main.cpp:693
bool path_has_symlink(const fs::path &root, const fs::path &candidate)
Definition main.cpp:698
void verify_product_coverage(const json &external_graph, const json &product_tables)
Definition main.cpp:859
int command_inbox_verify(const options &arguments)
Definition main.cpp:1265
std::uint64_t unsigned_value(const json &object, const std::string_view key, const std::uint64_t default_value, const bool positive)
Definition main.cpp:252
int command_product_inbox(const bool apply)
Definition main.cpp:1297
fs::path command_path(const std::string &value)
Definition main.cpp:474
json read_json(const fs::path &path, const std::uintmax_t maximum_bytes, const std::string_view description)
Definition main.cpp:142
constexpr std::uintmax_t maximum_control_bytes
Definition main.cpp:50
std::string sha256(std::span< const std::byte > bytes)
Definition crypto.cpp:209
std::string sha256_file(const std::filesystem::path &path)
Definition crypto.cpp:221
inbox_result apply_product_inbox(const std::filesystem::path &repository_root)
const char * to_string(inbox_batch_status status) noexcept
Definition inbox.cpp:6133
inbox_result check_product_inbox(const std::filesystem::path &repository_root)
std::size_t rebuild_product_merge_hints(const std::filesystem::path &repository_root)
std::optional< fs::path > legacy_inbox
Definition main.cpp:299
std::vector< fs::path > protected_legacy_inboxes
Definition main.cpp:300
std::chrono::seconds candidate_lock_stale
Definition main.cpp:309
std::filesystem::path resolved_plan_payload_path
Definition store.hpp:23
std::filesystem::path control_contract_path
Definition store.hpp:21
std::vector< inbox_issue > issues
Definition inbox.hpp:36
std::vector< inbox_batch_report > batches
Definition inbox.hpp:46
std::size_t already_applied_count
Definition inbox.hpp:44
std::vector< std::string > problems
Definition store.hpp:36
std::filesystem::path metadata_path
Definition store.hpp:45
std::filesystem::path export_path
Definition store.hpp:44
std::filesystem::path database_path
Definition store.hpp:43