Jan 06 2026 dev (#387)

* sync code

* update code to support brotli

* update code to support brotli

* update code to support brotli

* sync code

* fix findBrotli

* sync code

* sync code

* sync code

* sync code

---------

Co-authored-by: Ned Wright <nedwright@proton.me>
Co-authored-by: Daniel Eisenberg <danielei@checkpoint.com>
This commit is contained in:
Daniel-Eisenberg
2026-01-13 17:17:52 +02:00
committed by GitHub
parent c1058db57d
commit e7b6e51b31
216 changed files with 12601 additions and 2825 deletions

View File

@@ -19,6 +19,8 @@
USE_DEBUG_FLAG(D_WAAP);
// TODO PHASE3: remove inheritance from SerializeToLocalAndRemoteSyncBase
// this class is responsible for logging trusted sources indicators matches (without validation)
class TrustedSourcesConfidenceCalculator : public SerializeToLocalAndRemoteSyncBase
{
@@ -31,27 +33,35 @@ public:
typedef std::unordered_map<Val, SourcesSet> SourcesCounter;
typedef std::unordered_map<Key, SourcesCounter> KeyValSourceLogger;
TrustedSourcesConfidenceCalculator(std::string path, const std::string& remotePath,
const std::string& assetId);
TrustedSourcesConfidenceCalculator(std::string path, const std::string &remotePath,
const std::string &assetId);
bool is_confident(Key key, Val value, size_t minSources) const;
virtual bool postData();
virtual void pullData(const std::vector<std::string>& files);
virtual void pullData(const std::vector<std::string> &files);
virtual void processData();
virtual void postProcessedData();
virtual void pullProcessedData(const std::vector<std::string>& files);
virtual void updateState(const std::vector<std::string>& files);
virtual void pullProcessedData(const std::vector<std::string> &files);
virtual void updateState(const std::vector<std::string> &files);
virtual Maybe<std::string> getRemoteStateFilePath() const override;
ValuesSet getConfidenceValues(const Key& key, size_t minSources) const;
ValuesSet getConfidenceValues(const Key &key, size_t minSources) const;
virtual void serialize(std::ostream& stream);
virtual void deserialize(std::istream& stream);
virtual void serialize(std::ostream &stream);
virtual void deserialize(std::istream &stream);
void mergeFromRemote(const KeyValSourceLogger& logs);
void mergeFromRemote(const KeyValSourceLogger &logs);
void log(Key key, Val value, Source source);
void reset();
// Helper method for testing - merges incremental data to persistent state without network operations
void mergeIncrementalToPersistent();
private:
KeyValSourceLogger m_logger;
// Persistent state - accumulated trusted sources data across sync cycles
KeyValSourceLogger m_persistent_state;
// Incremental logger - only new data since last sync (gets moved during postData)
std::shared_ptr<KeyValSourceLogger> m_incremental_logger;
};