#pragma once // The seam capture.offer's decision logic reads through, instead of touching store::* (or // the wall clock) directly — the same reasoning as rpc::TaskActionPort: it lets a test // substitute a fake that reports "the store took a long time just now" by advancing a // shared fake clock, and assert that capture.offer's deadline check actually bails to // `ignore` instead of pressing on, without a real sleep anywhere (deterministic, instant). // // vdm::rules::Rule (not velox::proto::Rule) on purpose: this is what // vdm::rules::match_rules consumes directly, so the real implementation is the only place // that ever converts the stored proto::Rule/JSON shape into CORE's plain vocabulary. #include #include #include #include #include "vdm/rules/match.hpp" namespace velox::daemon::rpc { class CaptureDataSource { public: virtual ~CaptureDataSource() = default; // Read at every checkpoint in the offer's decision pipeline; a fake can advance this // however it likes (including "jump forward 2 real seconds, instantly") to simulate a // slow step without ever calling sleep. virtual std::chrono::steady_clock::time_point now() = 0; virtual bool capture_enabled() = 0; virtual std::vector monitored_extensions() = 0; virtual std::vector monitored_mime_types() = 0; virtual std::int64_t min_size_bytes() = 0; virtual std::vector excluded_hosts() = 0; // Enabled rules, in priority order — ready for vdm::rules::match_rules as-is. virtual std::vector enabled_rules() = 0; // "resolve the category folder": a plain extension guess (store::Categories' // guess_by_extension) when no rule named a category explicitly. virtual std::string guess_category_id(const std::string& filename) = 0; virtual std::string category_save_dir(const std::string& category_id) = 0; virtual std::string default_save_dir() = 0; // True if an active (non-terminal) task already targets this exact URL. virtual bool has_active_duplicate(const std::string& url) = 0; }; } // namespace velox::daemon::rpc