Entropic 2.11.1
Local-first agentic inference engine
Loading...
Searching...
No Matches
validate.h File Reference

Config validation functions. More...

#include <entropic/entropic_export.h>
#include <entropic/types/config.h>
#include <string>
#include <vector>
Include dependency graph for validate.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  entropic
 Activate model on GPU (WARM → ACTIVE).
 

Functions

ENTROPIC_EXPORT std::string entropic::config::validate (const ModelConfig &config)
 Validate a ModelConfig.
 
ENTROPIC_EXPORT std::string entropic::config::validate (const ModelsConfig &config)
 Validate ModelsConfig.
 
ENTROPIC_EXPORT std::string entropic::config::validate (const CompactionConfig &config)
 Validate CompactionConfig.
 
ENTROPIC_EXPORT std::string entropic::config::validate_routing (const RoutingConfig &routing, const ModelsConfig &models)
 Validate RoutingConfig against defined tiers.
 
ENTROPIC_EXPORT std::string entropic::config::validate (const PromptCacheConfig &config)
 Validate PromptCacheConfig.
 
ENTROPIC_EXPORT std::string entropic::config::validate_config (const ParsedConfig &config, std::vector< std::string > &warnings)
 Validate the full ParsedConfig.
 
ENTROPIC_EXPORT std::string entropic::config::validate_allowed_tools (const std::vector< std::string > &tools)
 Validate allowed_tools entries use "server.tool" format.
 
ENTROPIC_EXPORT std::string entropic::config::validate_fallback_tier (const std::string &fallback, const std::unordered_map< std::string, TierConfig > &tiers)
 Check fallback_tier exists in tiers.
 
ENTROPIC_EXPORT std::string entropic::config::validate_tier_map (const std::unordered_map< std::string, std::string > &tier_map, const std::unordered_map< std::string, TierConfig > &tiers)
 Check all tier_map values exist in tiers.
 
ENTROPIC_EXPORT std::string entropic::config::validate_handoff_rules (const std::unordered_map< std::string, std::vector< std::string > > &rules, const std::unordered_map< std::string, TierConfig > &tiers)
 Check all handoff_rules keys and values exist in tiers.
 
ENTROPIC_EXPORT std::string entropic::config::warn_auto_chain_without_targets (const std::unordered_map< std::string, TierConfig > &tiers, const std::unordered_map< std::string, std::vector< std::string > > &handoff_rules)
 Warn if tier has auto_chain but no handoff_rules entry.
 

Detailed Description

Config validation functions.

Validation is separate from parsing. Parse populates structs, validate checks cross-field constraints and range limits. All functions return empty string on success, error on failure.

Version
1.8.1

Definition in file validate.h.

Function Documentation

◆ validate() [1/4]

std::string entropic::config::validate ( const CompactionConfig config)

Validate CompactionConfig.

Checks: warning_threshold_percent < threshold_percent, threshold_percent in [0.5, 0.99], preserve_recent_turns in [1, 10].

Parameters
configCompaction config to validate.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.1
Parameters
configCompaction config to validate.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
2.1.3

Definition at line 83 of file validate.cpp.

◆ validate() [2/4]

std::string entropic::config::validate ( const ModelConfig config)

Validate a ModelConfig.

Checks: context_length range [512, 131072], adapter non-empty, allowed_tools entries use "server.tool" format.

Parameters
configModel config to validate.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.1
Parameters
configModel config to validate.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.2

Definition at line 40 of file validate.cpp.

◆ validate() [3/4]

std::string entropic::config::validate ( const ModelsConfig config)

Validate ModelsConfig.

Checks: default tier exists in tiers dict.

Parameters
configModels config to validate.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.1
Parameters
configModels config to validate.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.2

Definition at line 66 of file validate.cpp.

◆ validate() [4/4]

std::string entropic::config::validate ( const PromptCacheConfig config)

Validate PromptCacheConfig.

Checks: max_bytes > 0 when enabled.

Parameters
configPrompt cache config to validate.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.3
Parameters
configPrompt cache config to validate.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.3

Definition at line 279 of file validate.cpp.

◆ validate_allowed_tools()

std::string entropic::config::validate_allowed_tools ( const std::vector< std::string > &  tools)

Validate allowed_tools entries use "server.tool" format.

Parameters
toolsTool name list to validate.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.1
Parameters
toolsTool name list to validate.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.2

Definition at line 22 of file validate.cpp.

◆ validate_config()

std::string entropic::config::validate_config ( const ParsedConfig config,
std::vector< std::string > &  warnings 
)

Validate the full ParsedConfig.

Runs all section validators + cross-section checks.

Parameters
configFull config to validate.
[out]warningsNon-fatal warnings (e.g., auto_chain without targets).
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.1
Parameters
configFull config to validate.
[out]warningsNon-fatal warnings.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
2.0.0

Definition at line 326 of file validate.cpp.

◆ validate_fallback_tier()

std::string entropic::config::validate_fallback_tier ( const std::string &  fallback,
const std::unordered_map< std::string, TierConfig > &  tiers 
)

Check fallback_tier exists in tiers.

Parameters
fallbackFallback tier name.
tiersDefined tiers.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.1
Parameters
fallbackFallback tier name.
tiersDefined tiers.
Returns
Empty string on success, error message on failure.
Version
1.8.2 @req REQ-CFG-006

Definition at line 125 of file validate.cpp.

◆ validate_handoff_rules()

std::string entropic::config::validate_handoff_rules ( const std::unordered_map< std::string, std::vector< std::string > > &  rules,
const std::unordered_map< std::string, TierConfig > &  tiers 
)

Check all handoff_rules keys and values exist in tiers.

Parameters
rulesHandoff rules.
tiersDefined tiers.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.1
Parameters
rulesHandoff rules.
tiersDefined tiers.
Returns
Empty string on success, error message on failure.
Version
1.8.2 @req REQ-CFG-006

Definition at line 164 of file validate.cpp.

◆ validate_routing()

std::string entropic::config::validate_routing ( const RoutingConfig routing,
const ModelsConfig models 
)

Validate RoutingConfig against defined tiers.

Cross-field: fallback_tier, tier_map values, handoff_rules keys and values must all reference tiers that exist.

Parameters
routingRouting config.
modelsModels config (provides tier names).
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.1
Parameters
routingRouting config.
modelsModels config.
Returns
Empty string on success, error message on failure.
Version
2.8.1 @req REQ-CFG-006

Definition at line 218 of file validate.cpp.

◆ validate_tier_map()

std::string entropic::config::validate_tier_map ( const std::unordered_map< std::string, std::string > &  tier_map,
const std::unordered_map< std::string, TierConfig > &  tiers 
)

Check all tier_map values exist in tiers.

Parameters
tier_mapClassification to tier mapping.
tiersDefined tiers.
Returns
Empty string on success, error message on failure. @req REQ-CFG-006
Version
1.8.1
Parameters
tier_mapClassification to tier mapping.
tiersDefined tiers.
Returns
Empty string on success, error message on failure.
Version
1.8.2 @req REQ-CFG-006

Definition at line 143 of file validate.cpp.

◆ warn_auto_chain_without_targets()

std::string entropic::config::warn_auto_chain_without_targets ( const std::unordered_map< std::string, TierConfig > &  tiers,
const std::unordered_map< std::string, std::vector< std::string > > &  handoff_rules 
)

Warn if tier has auto_chain but no handoff_rules entry.

Parameters
tiersTier configs.
handoff_rulesHandoff rules from routing config.
Returns
Warning message (empty if no issues). @req REQ-CFG-006
Version
1.8.1
Parameters
tiersTier configs.
handoff_rulesHandoff rules.
Returns
Warning message (empty if no issues). @req REQ-CFG-006
Version
1.8.2

Definition at line 253 of file validate.cpp.