Files
knowledge-adapter-service/README.md
T
姚章浩 693cd952cd feat(asset): 清理被截断的结尾图片引用,修复整单 502
仓库首次入库(此前仅存在于本地工作区与测试服构建产物中,未上传)。

改动(src/knowledge_adapter/asset_content_processor.py):
- 新增 _TRUNCATED_TRAILING_MARKDOWN_RESOURCE_IMAGE 规则,清除 chunk 末尾被截断的
  ![](resource://xxxx 残片(WeKnora 分块在图片引用中间截断时产生,旧逻辑无法匹配完整引用,
  残留 resource:// 触发 ContentProcessingError,导致整单 502)
- 回归测试 tests/test_asset_content_processor.py::
  test_truncated_trailing_markdown_resource_image_is_removed

验证证据:
- 测试服 120.76.217.51,镜像 knowledge-adapter-service:reviewed-test-aeab4b5fca2d
  (release aeab4b5fca2d8661):KB d015d05c-25c8-4d63-b2ab-e8590d3c2dfb 5 个查询全部
  http=200、records=5、残留 resource:// = 0;KB b9dacd62 无退化;容器日志无 error/exception
- 本地:pytest 141 项全通过、ruff 全通过
- 该文件与 258c31e0fe07fd08 源码的差异经逐文件 md5 比对,为唯一变更文件
2026-09-16 10:01:27 +08:00

30 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Knowledge Adapter Service
Small Python 3.12/FastAPI adapter for Dify External Knowledge retrieval through an existing WeKnora deployment, with stable UUID image URLs backed by a Private Alibaba Cloud OSS bucket.
## Status
Slices 1–8 provide implementation, automated tests, and prepared delivery artifacts. Production deployment is not authorized. Slice 9 must complete real test-environment Dify → Adapter → WeKnora → OSS E2E and produce an audit report before a production decision.
## Documentation
- [Architecture](docs/architecture.md)
- [Security model](docs/security.md)
- [Test deployment and rollback](docs/deployment.md)
- [Key and credential rotation](docs/key-rotation.md)
- [Slice 9 verification and E2E audit](docs/audit-report-slice9.md)
## Local validation
```text
make check
```
Compose rendering requires an external non-secret env file:
```text
make compose-config ENV_FILE=/absolute/path/to/adapter.env
```
Neither target starts containers. `image-build` is explicit and requires Docker access; no target deploys or modifies production.