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,34 @@
from __future__ import annotations
import pytest
from app.tools.export_openapi import export_schema
def test_openapi_export_is_offline_and_contains_product_contracts(
monkeypatch: pytest.MonkeyPatch,
) -> None:
def forbidden(*_args: object, **_kwargs: object) -> None:
raise AssertionError("OpenAPI export must not open a database or read a secret")
monkeypatch.setattr("psycopg.connect", forbidden)
monkeypatch.setattr("app.core.secrets.read_secret_file", forbidden)
schema = export_schema()
paths = schema["paths"]
assert "/api/v1/retrieval/search" in paths
assert "/api/v1/chat/completions" in paths
assert "/api/v1/document-uploads" in paths
assert "/api/v1/document-uploads/{upload_id}/content" in paths
assert "/api/v1/document-uploads/{upload_id}/complete" in paths
assert "/api/v1/documents" in paths
assert "/api/v1/documents/{document_id}/review-bundle" in paths
assert "/api/v1/documents/{document_id}/review-decisions" in paths
assert (
paths["/api/v1/documents/{document_id}/review-decisions"]["post"]["operationId"]
== "createDocumentReviewDecision"
)
assert paths["/api/v1/chat/completions"]["post"]["operationId"] == (
"streamGroundedChatCompletion"
)