Establish a safe foundation before implementing the geology RAG system
Some checks failed
secret-scan / scan (push) Has been cancelled

The project begins with architecture, data governance, reproducible evaluation, deployment boundaries, and secret-handling contracts so later code has measurable acceptance criteria.

Constraint: Real provider credentials, workspace identities, and restricted geological data must never enter Git

Rejected: Add placeholder runnable services in the design commit | would imply unverified implementation readiness

Confidence: high

Scope-risk: narrow

Reversibility: clean

Directive: Run make verify before every commit and update ADRs when architecture boundaries change

Tested: Secret scan, Markdown links, YAML parse, shell syntax, and staged diff validation

Not-tested: Application runtime is intentionally deferred to the implementation stage
This commit is contained in:
2026-07-12 14:42:11 +08:00
commit ec1acb36b5
55 changed files with 2882 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
# ADR-0002分离百炼协议适配器
- Status: accepted
- Date: 2026-07-11
## Context
百炼 Chat/Embedding 使用 `/compatible-mode/v1`,而 `qwen3-rerank` 使用独立的 `/compatible-api/v1/reranks`。把它们封装成一个通用 OpenAI 客户端容易误拼路径,并掩盖不同错误和限流语义。
## Decision
后端建立独立的 `EmbeddingProvider``Reranker``Generator` 接口。OpenAI 兼容客户端承担 Chat 与基础 Embedding独立 HTTP 客户端承担 Rerank。实验需要 `text_type=query/document` 时,由原生 Embedding 适配器承担。
## Consequences
- 三类端点和错误处理可以独立做契约测试。
- Anthropic 兼容地址不进入本项目运行配置。
- 模型凭证仍只在服务端配置层读取,任何适配器都不得记录鉴权请求头。