Convert, index, and compile a single document under the KB mutation lock.
(
file_path: Path, kb_dir: Path, *, stage: bool = True
)
| 440 | |
| 441 | |
| 442 | def add_single_file( |
| 443 | file_path: Path, kb_dir: Path, *, stage: bool = True |
| 444 | ) -> Literal["added", "skipped", "failed"]: |
| 445 | """Convert, index, and compile a single document under the KB mutation lock.""" |
| 446 | with kb_ingest_lock(kb_dir / ".openkb"): |
| 447 | return _add_single_file_locked(file_path, kb_dir, stage=stage) |
| 448 | |
| 449 | |
| 450 | def _add_single_file_locked( |