Repository Doc Validator¶
osa_tool.operations.analysis.repository_validation.doc_validator
¶
DocValidator
¶
Validates documentation files against the code repository.
This class processes documentation files (DOCX or PDF), extracts and preprocesses their content, analyzes code files in the repository, and validates the documentation against the codebase using a language model.
__init__(config_manager, git_agent, create_fork, attachment=None)
¶
Initialize the DocValidator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_manager
|
ConfigManager
|
A unified configuration manager that provides task-specific LLM settings, repository information, and workflow preferences. |
required |
git_agent
|
GitAgent
|
Abstract base class for Git platform agents. |
required |
create_fork
|
bool
|
The flag is responsible for creating a pull request. |
required |
attachment
|
str
|
Path to the documentation file (.docx or .pdf) or None. |
None
|
__validate_doc_against_repo(code_files_info)
async
¶
Asynchronously validate the processed document content against the code repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code_files_info
|
str
|
Aggregated code files analysis. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Validation result from the language model. |
validate()
async
¶
Asynchronously validate a documentation file against the code repository.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
tuple[Experiment, ...]
|
Validation result from the language model. |