Repository navigation
Fix #8: tighten validation and stop leaking internals (6a-6f) - #15
Open
xiaoyao-666-coder wants to merge 2 commits into
Open
xiaoyao-666-coder wants to merge 2 commits into
xiaoyao-666-coder wants to merge 2 commits into
Conversation
…a-6f)
6a. Age extraction accepts only 0-120 (project's established
range); out-of-range ages are ignored.
6b. base_url normalizers accept only http/https, drop query/fragment,
and reject misspelled .../completions endpoints instead of
silently truncating them.
6c. create_session checks the user exists first (new UnknownUserError)
and only retries on unique-constraint conflicts, in both SQLite
and MySQL stores.
6d. SQLQueryResult.as_dict no longer exposes 'sql'; responses carry
sample_data=true for the built-in sample database, shown in the
UI as demo data.
6e. Nested-credential check covers '#' and '/' separators and
userinfo in decoded nested URLs, in both frontend and backend.
6f. Local (Hash) embedding provider is no longer excluded from vector
retrieval; local vectors fuse with a lower weight (0.25/0.60) so
BM25 ranking quality is preserved.
Closes zhengdaodeguL#8.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8. 六个子项:
.../completions后缀直接报 ValueError,不再静默截断(拼错的/chaat/completions后缀已删除)。UnknownUserError("user does not exist");重试循环只对唯一约束冲突重试,其他 IntegrityError 立即原样抛出。as_dict()去掉sql字段(内部仍可读.sql属性);新增sample_data字段,内置样例库时为 true,前端在样例结果旁显示“以下为内置样例数据,仅供演示,非实时业务数据。”#与/,并对解码后的嵌套值额外检测://[^/]*@形式的 userinfo。provider != "local"排除,本地向量真正参与融合,引用 retrieval 现为 hybrid;本地向量用 0.25/0.60 低权重融合(64 维 token-hash 向量噪声大,全权重会压过 BM25 导致排序回归),远程保持原权重。验证:新增
backend/tests/test_validation_exposure.py(14 个测试);MEDGUIDE_MODE=test python -m pytest -q backend/tests537 passed(基线 521 + 16 新);前端npm test10/10,npm run build成功。说明:6d 选的是“标注样例数据”而非“默认不 seeding”(样例库是 test/local 模式默认的唯一数据源);6f 的本地权重是手工取舍,如上游换成真实本地 embedding 模型应重新评估;6b 的 query/fragment 选的是丢弃而非报错(拼错 endpoint 才报错)。