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

@@ -10,6 +10,7 @@ x-runtime-config: &runtime-config
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_app_password
UPLOAD_ROOT: ${UPLOAD_ROOT:-/data/uploads}
MAX_UPLOAD_MB: "${MAX_UPLOAD_MB:-100}"
DOCUMENT_NAMESPACE_MODE: ${DOCUMENT_NAMESPACE_MODE:-fake}
x-rag-config: &rag-config
DASHSCOPE_API_KEY_FILE: /run/secrets/bailian_api_key
@@ -87,6 +88,29 @@ services:
- data
restart: "no"
upload-init:
build:
context: ./backend
command: ["python", "-m", "app.tools.init_upload_storage"]
environment:
UPLOAD_ROOT: /data/uploads
user: "0:0"
network_mode: none
volumes:
- uploads_data:/data/uploads
read_only: true
tmpfs:
- /tmp
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
cap_add:
- CHOWN
- FOWNER
- DAC_OVERRIDE
restart: "no"
api:
build:
context: ./backend
@@ -96,6 +120,8 @@ services:
condition: service_healthy
migrate:
condition: service_completed_successfully
upload-init:
condition: service_completed_successfully
model-gateway:
condition: service_healthy
environment:
@@ -103,6 +129,8 @@ services:
secrets:
- postgres_app_password
- model_gateway_api_token
volumes:
- uploads_data:/data/uploads
networks:
- data
- model
@@ -165,6 +193,70 @@ services:
- ALL
restart: unless-stopped
worker-local:
build:
context: ./backend
command: ["python", "-m", "app.worker"]
depends_on:
db:
condition: service_healthy
migrate:
condition: service_completed_successfully
upload-init:
condition: service_completed_successfully
environment:
<<: *runtime-config
WORKER_CAPABILITIES: document_parse
secrets:
- postgres_app_password
volumes:
- uploads_data:/data/uploads
networks:
- data
init: true
read_only: true
tmpfs:
- /tmp
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
stop_grace_period: 150s
restart: unless-stopped
worker-model:
build:
context: ./backend
command: ["python", "-m", "app.worker"]
depends_on:
db:
condition: service_healthy
migrate:
condition: service_completed_successfully
model-gateway:
condition: service_healthy
environment:
<<: [*runtime-config, *model-client-config]
WORKER_CAPABILITIES: embedding
MODEL_GATEWAY_TOKEN_FILE: /run/secrets/model_gateway_worker_token
MODEL_GATEWAY_CALLER: worker
secrets:
- postgres_app_password
- model_gateway_worker_token
networks:
- data
- model
init: true
read_only: true
tmpfs:
- /tmp
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
stop_grace_period: 150s
restart: unless-stopped
gateway:
build:
context: ./backend
@@ -298,8 +390,63 @@ services:
- ./data/samples/public:/demo:ro
restart: "no"
worker-smoke:
build:
context: ./backend
command: ["python", "-m", "app.tools.worker_smoke"]
profiles: ["tools"]
depends_on:
migrate:
condition: service_completed_successfully
environment:
<<: *runtime-config
secrets:
- postgres_app_password
networks:
- data
init: true
read_only: true
tmpfs:
- /tmp
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
restart: "no"
document-pipeline-smoke:
build:
context: ./backend
command: ["python", "-m", "app.tools.document_pipeline_smoke"]
profiles: ["tools"]
depends_on:
gateway:
condition: service_healthy
worker-local:
condition: service_started
worker-model:
condition: service_started
environment:
RAG_BASE_URL: http://gateway:8000
RAG_UPLOAD_SAMPLE: /demo/upload_demo.md
DOCUMENT_NAMESPACE_MODE: ${DOCUMENT_NAMESPACE_MODE:-fake}
volumes:
- ./data/samples/public:/demo:ro
networks:
- ingress
init: true
read_only: true
tmpfs:
- /tmp
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
restart: "no"
volumes:
postgres_data:
uploads_data:
networks:
edge: