Make the governed RAG evidence path executable end to end
Some checks failed
verify / verify (push) Has been cancelled

Separate local parsing from model indexing, bind review decisions to immutable manifests, persist vectors behind active profiles, and expose retrieval, chat, evaluation, and document workflows through the React workbench.

Constraint: Live Bailian authentication currently fails for all three configured capabilities

Rejected: Direct upload-to-embedding flow | bypasses local review and manifest binding

Confidence: high

Scope-risk: broad

Directive: Keep private-data deployment blocked until authentication, RBAC, and separate database roles land

Tested: make verify; fresh and replay Docker document smoke; worker recovery smoke; frozen synthetic evaluation; migration 0003-0004 roundtrip

Not-tested: Successful live Bailian calls, OCR, real multi-user authorization
This commit is contained in:
2026-07-13 05:58:11 +08:00
parent 75592af33a
commit ecdb10c37a
111 changed files with 25457 additions and 152 deletions

View File

@@ -0,0 +1,43 @@
from __future__ import annotations
import os
from pathlib import Path
import pytest
from app.tools.init_upload_storage import (
UploadStorageInitializationError,
initialize_upload_root,
)
def test_upload_root_is_created_with_verified_owner_and_mode(tmp_path: Path) -> None:
root = tmp_path / "uploads"
uid = os.getuid()
gid = os.getgid()
initialize_upload_root(root, uid=uid, gid=gid, change_owner=lambda *_args: None)
assert root.is_dir()
assert root.stat().st_uid == uid
assert root.stat().st_gid == gid
assert root.stat().st_mode & 0o777 == 0o750
def test_relative_or_symlink_upload_root_fails_without_echoing_path(tmp_path: Path) -> None:
with pytest.raises(UploadStorageInitializationError):
initialize_upload_root(Path("relative"), change_owner=lambda *_args: None)
target = tmp_path / "target"
target.mkdir()
link = tmp_path / ("sk-" + "A" * 24)
link.symlink_to(target, target_is_directory=True)
with pytest.raises(UploadStorageInitializationError) as captured:
initialize_upload_root(
link,
uid=os.getuid(),
gid=os.getgid(),
change_owner=lambda *_args: None,
)
assert str(link) not in str(captured.value)