快速直查通用提速与证据精准绑定:跨网关关闭深度思考、关联维表统计探查与零误报核验

- 模型接入:支持跨 Anthropic / OpenAI 兼容网关显式关闭深度思考(thinking=off / effort=low),对不识别推理参数的网关自动剥离重发并做进程级记忆
- 快速直查:收敛直查图推理预算(max_steps=4),杜绝长思维链与多轮现场盲探
- 语义指标与预命中:Oracle / PostgreSQL 分组聚合补充 DESC NULLS LAST;基于关系图、逆表频共享键与低基数统计(1..20 distinct)实现零硬编码的通用关联维表发现、分类列抽样及全空分组折叠诊断
- 零延迟数字证据:支持纯数字文本编码(含前导零)无损回绑、多表同行实体键与列序号消歧,结合上下文事实白名单与冲突守卫消除误报并保留防编造拦截
This commit is contained in:
ThearchyHelios
2026-11-12 14:40:00 +08:00
parent 46a2988dc1
commit 09949fc8ac
10 changed files with 1536 additions and 69 deletions
+12 -1
View File
@@ -803,7 +803,7 @@ async def _store(doc: dict[str, Any], ctx: NodeContext) -> str | None:
async def _run_fast_inline_report(state: GraphState, ctx: NodeContext, on_violation: str) -> dict[str, Any]:
"""快速直查专用零模型直通证据封装:0 次 LLM 调用、< 10ms 纯内存组装 report_doc 与封存事件。"""
from app.api.evidence import withheld_metrics
from app.chat.direct_evidence import normalize_and_bind_fast_citations
from app.chat.direct_evidence import collect_fast_allow_numbers, normalize_and_bind_fast_citations
from app.engine.evidence import iter_segments
started = time.perf_counter()
@@ -855,6 +855,17 @@ async def _run_fast_inline_report(state: GraphState, ctx: NodeContext, on_violat
prepared = normalize_and_bind_fast_citations(_unfenced(raw_answer), catalog, masked_columns=query_masks)
entities = report_entities(spec, ctx.node) == "link"
allow = report_allowance(spec, ctx.node)
if str(ctx.cfg("numbers", "off") or "off") == "off":
raw_input = state.get("input") if isinstance(state.get("input"), Mapping) else {}
question_str = str(raw_input.get("question") or "")
fast_allow = collect_fast_allow_numbers(
prepared,
catalog,
masked_columns=query_masks,
question=question_str,
)
if fast_allow:
allow = list(dict.fromkeys([*(allow or []), *fast_allow]))
doc = await masked(
compose_doc(
prepared,