lots of fixes

This commit is contained in:
Taylor Wilsdon
2025-08-10 15:56:18 -04:00
parent 543f85ac1c
commit 5bcd149f40
7 changed files with 141 additions and 57 deletions

View File

@@ -164,6 +164,25 @@ class ValidationManager:
return True, ""
def validate_index(self, index: int, context: str = "Index") -> Tuple[bool, str]:
"""
Validate a single document index.
Args:
index: Index to validate
context: Context description for error messages
Returns:
Tuple of (is_valid, error_message)
"""
if not isinstance(index, int):
return False, f"{context} must be an integer, got {type(index).__name__}"
if index < 0:
return False, f"{context} {index} is negative. You MUST call inspect_doc_structure first to get the proper insertion index."
return True, ""
def validate_index_range(
self,
start_index: int,