On this page
Loads and validates data-defined tool TOML files into DataToolDefinition via the strictspec-generated document gate, enforces the custom. namespace root, and validates {{secret:NAME}} references against the registry.
#tool.src.orxtra.tool._data_tool_loader
#tool.src.orxtra.tool._data_tool_loader
Loader for data-defined tool TOML definitions.
Parses .toml files, validates with the pydantic schema, enforces the custom. namespace root, and validates {{secret:NAME}} references against the secret registry.
#DataToolValidationError
A data-tool document failed strictspec validation at the load boundary.
#load_tool_definition
def load_tool_definition(path: Path, secret_registry: SecretRegistry | None=None) -> DataToolDefinitionParse and validate a single data-defined tool TOML file.
Args:
path: Path to the.tomlfile.secret_registry: When provided, all{{secret:NAME}}
references in the file are validated against the registry.
Returns:
- A validated
DataToolDefinition.
Raises:
FileNotFoundError: If the path does not exist.ValueError: On validation failure (wraps pydantic errors).KeyError: On unknown secret references.
#_validate_secrets
def _validate_secrets(definition: DataToolDefinition, path: Path, secret_registry: SecretRegistry) -> NoneScan all string fields in the definition for {{secret:NAME}} references and validate them against the registry.
Raises KeyError with a descriptive message on unknown references.
#load_tool_definitions
def load_tool_definitions(directory: Path, secret_registry: SecretRegistry | None=None) -> list[DataToolDefinition]Load all data-defined tool TOML files from a directory.
Args:
directory: Path to the directory containing.tomlfiles.secret_registry: When provided, all secret references are
validated against the registry.
Returns:
- A list of validated
DataToolDefinitionobjects.
Raises:
FileNotFoundError: If the directory does not exist.ValueError: On validation failure or name collision.KeyError: On unknown secret references.