Skip to content

Commit 305d56c

Browse files
committed
feat(agent-workspace): add causal rag answer profile
1 parent efbbe2b commit 305d56c

10 files changed

Lines changed: 299 additions & 12 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Causal Answer Profile Probe
2+
3+
Causal answer profile probe explains why graph-backed RAG answers need bounded causal evidence instead of a single definition sentence.
4+
5+
## Mechanism
6+
7+
The direct cause is that a why question asks for mechanism evidence, not only a label.
8+
9+
The mechanism layer keeps the direct cause, the source boundary, and the downstream implication available before the bounded RAG pack chooses visible fragments.
10+
11+
## Downstream Evidence
12+
13+
The downstream implication is that graph-neighbor evidence can clarify consequences while the public answer still remains one bounded message.

docs/diataxis/en/explanation/development-progress-dashboard.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ It tracks what is already implemented, where the hard gaps remain, and how to ve
55

66
## 2026-07-05 RSE Document-Augmented Graph RAG Implementation Plan
77

8-
This slice now tracks implementation progress for richer Knowledge Workspace answers. The concrete plan remains at [RSE document-augmented graph RAG answer pipeline](../../../plans/2026-07-05-001-feat-rse-document-augmented-rag-plan.md), but the branch has moved beyond planning: the deterministic RSE/document-augmentation path, full-document graph-neighbor augmentation, query-intent graph-neighbor ranking, intent-aware graph connection-path ordering, intent-aligned graph-window ambiguity filtering, budgeted context pack, stable RAG context replay ids, provider-backed sufficiency trace, bounded one-step recovery, RAG failure-stage classification, RAG-aware one-message release review, claim-level citation-backed RAG release gating, prompt/preamble artifact filtering for public RAG clauses, answer claim-to-citation trace/export mapping, operand-aware compare answer-profile budgeting, how-to answer-profile budgeting, generic answer-profile ranking, Mermaid-label evidence extraction, runtime verifier fields, graph successor-window and graph-diagnostics verifier assertions, context-budget truncation/drop/malformed-provider/timeout-provider/graphintent probe coverage, conflicting adjacent, same-section non-adjacent, cross-document structured measurement/date/location evidence, full-document remote-scan hard-negative coverage, controlled current-vs-historical false-positive guards, single- and multi-neighbor graph source-unavailable hard-negative coverage, localized frontend RAG status, and export RAG trace preservation are implemented. Calibrated graph-confidence thresholds, broader replay tooling over larger corpora, more natural synthesis over label-heavy evidence, broader release-budget calibration, broader semantic conflict classes, and larger runtime probes remain follow-up work.
8+
This slice now tracks implementation progress for richer Knowledge Workspace answers. The concrete plan remains at [RSE document-augmented graph RAG answer pipeline](../../../plans/2026-07-05-001-feat-rse-document-augmented-rag-plan.md), but the branch has moved beyond planning: the deterministic RSE/document-augmentation path, full-document graph-neighbor augmentation, query-intent graph-neighbor ranking, intent-aware graph connection-path ordering, intent-aligned graph-window ambiguity filtering, budgeted context pack, stable RAG context replay ids, provider-backed sufficiency trace, bounded one-step recovery, RAG failure-stage classification, RAG-aware one-message release review, claim-level citation-backed RAG release gating, prompt/preamble artifact filtering for public RAG clauses, answer claim-to-citation trace/export mapping, operand-aware compare answer-profile budgeting, how-to answer-profile budgeting, causal answer-profile budgeting, generic answer-profile ranking, Mermaid-label evidence extraction, runtime verifier fields, graph successor-window and graph-diagnostics verifier assertions, context-budget truncation/drop/malformed-provider/timeout-provider/graphintent probe coverage, conflicting adjacent, same-section non-adjacent, cross-document structured measurement/date/location evidence, full-document remote-scan hard-negative coverage, controlled current-vs-historical false-positive guards, single- and multi-neighbor graph source-unavailable hard-negative coverage, localized frontend RAG status, and export RAG trace preservation are implemented. Calibrated graph-confidence thresholds, broader replay tooling over larger corpora, more natural synthesis over label-heavy evidence, further profile-specific release-budget calibration, broader semantic conflict classes, and larger runtime probes remain follow-up work.
99

1010
Current code-vs-plan reading:
1111

@@ -67,6 +67,7 @@ Fresh implementation evidence in this slice:
6767
- The runtime probe `temporal_cross_document_planned_release_date_probe_en`, backed by `Knowledge_Base/ragtemporalcrossscope`, extends that guard to the cross-document conflict scanner: separate scoped current and planned roadmap documents can both be read in full and returned as evidence without producing a cross-document `conflict` fragment.
6868
- The runtime probe `conflicting_location_evidence_probe_en`, backed by `Knowledge_Base/raglocationconflict`, now extends the conflict slice to a conservative location comparable-fact class: explicit location/site/region/zone/room/rack/slot/bay subjects with Rack A and Rack B values produce a `conflict` fragment, keep both sides visible in the one public answer, and degrade under `context_assembly`.
6969
- The runtime probe `temporal_scoped_location_probe_en`, backed by `Knowledge_Base/ragtemporalqualifier`, verifies the paired hard negative: current and historical placement facts stay in separate comparable scopes, the public answer can use the current Rack A fact, and the RAG pack does not emit a false `conflict` fragment.
70+
- The runtime probe `causal_answer_profile_budget_en`, backed by `Knowledge_Base/ragcausalprofile`, now verifies that why/cause/mechanism-style requests use a bounded causal RAG profile (`20` fragments, `1500` chars per fragment, `7600` total chars), keep the source boundary at `full_document`, and return one public answer with mechanism and downstream evidence rather than a single definition sentence.
7071
- The runtime probe `conflicting_multi_document_evidence_probe_en`, backed by `Knowledge_Base/ragmulticonflict`, now verifies that contradictory `+/-0.10 mm` and `+/-0.50 mm` calibration-tolerance facts across two scoped documents produce a cross-document `conflict` fragment, stay visible in the one public answer, and degrade under `context_assembly`.
7172
- The runtime probe `full_document_scan_remote_conflict_probe_en`, backed by `Knowledge_Base/ragfullscan`, now verifies the corrected source-boundary rule: the local paragraph window is not the maximum range. Two selected documents are read in full, remote appendix facts outside the matched opening spans are scanned for structured conflict evidence, and only the budgeted `RagContextPack` is capped before model-visible answer composition.
7273
- Focused provenance tests now verify that repeated snippet text does not force the first textual occurrence when offsets are stale. If an offset candidate does not contain the evidence snippet but the line-range candidate does, `evidenceContextAssembler.ts` uses the line provenance to select the intended source block and parent section.
@@ -78,7 +79,7 @@ Next movement:
7879

7980
- Calibrate graph relation weights and low-confidence exclusion thresholds against representative hard negatives instead of treating the current scoring constants as final.
8081
- Expand runtime probes beyond the current `graphintent` intent-selection baseline into larger-corpus hard negatives and relation-extraction ambiguity samples.
81-
- Calibrate profile-specific release budgets beyond the current deterministic definition, compare, how-to, and generic baselines while preserving hard public-answer caps.
82+
- Calibrate profile-specific release budgets beyond the current deterministic definition, compare, how-to, causal, and generic baselines while preserving hard public-answer caps.
8283
- Extend replay tooling beyond stable context ids, failure-stage classifications, graph-window ambiguity diagnostics, and answer claim-citation maps; add larger runtime probes for repeated snippets, conflict patterns beyond controlled structured measurement/date/state/location facts, broader multi-document missing graph-neighbor corpora, stricter total-character budget drop cases, broader relation-ambiguity corpora, and provider fallback.
8384

8485
## 2026-07-04 Knowledge Workspace Scope Visibility, Grouped RAG Answers, and File-First Hit Interaction

docs/diataxis/zh/explanation/development-progress-dashboard.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
## 2026-07-05 RSE + document augmentation 图谱 RAG 实践计划
77

8-
本切片现在记录更充分 Knowledge Workspace 回答的实现进展。具体方案仍以 [RSE document-augmented graph RAG answer pipeline](../../../plans/2026-07-05-001-feat-rse-document-augmented-rag-plan.md) 为准,但当前分支已经不只是规划:确定性的 RSE / document augmentation 链路、完整文档感知的图邻居 augmentation、query-intent 图邻居排序、intent-aware graph connection-path 排序、intent-aligned graph-window ambiguity filtering、有界 context pack、稳定 RAG context replay id、接入 provider 的充分性 trace、有界一次性 recovery、RAG failure-stage classification、RAG-aware 单消息 release review、claim-level citation-backed RAG release gate、public RAG clause 的 prompt / preamble artifact 过滤、answer claim-to-citation trace / export 映射、基于 operand 的 compare answer-profile 预算、how-to answer-profile 预算、generic answer-profile 排序、Mermaid label evidence 抽取、runtime verifier 字段、graph successor-window 与 graph-diagnostics verifier 断言、context-budget truncation/drop/malformed-provider/timeout-provider/graphintent 探针覆盖、相邻 / 同节非相邻 / 跨文档 structured measurement / date / location conflicting evidence 与 full-document remote-scan hard-negative 覆盖、受控 current-vs-historical false-positive guard、单邻居与多邻居 graph source-unavailable hard-negative 覆盖、前端本地化 RAG 状态,以及导出 RAG trace 保留已经落地。图置信阈值校准、大语料上的更完整 replay tooling、对 label-heavy evidence 的自然语言 synthesis、更广的 release-budget 校准、更广语义 conflict 类和更大的 runtime probe 语料仍是后续工作。
8+
本切片现在记录更充分 Knowledge Workspace 回答的实现进展。具体方案仍以 [RSE document-augmented graph RAG answer pipeline](../../../plans/2026-07-05-001-feat-rse-document-augmented-rag-plan.md) 为准,但当前分支已经不只是规划:确定性的 RSE / document augmentation 链路、完整文档感知的图邻居 augmentation、query-intent 图邻居排序、intent-aware graph connection-path 排序、intent-aligned graph-window ambiguity filtering、有界 context pack、稳定 RAG context replay id、接入 provider 的充分性 trace、有界一次性 recovery、RAG failure-stage classification、RAG-aware 单消息 release review、claim-level citation-backed RAG release gate、public RAG clause 的 prompt / preamble artifact 过滤、answer claim-to-citation trace / export 映射、基于 operand 的 compare answer-profile 预算、how-to answer-profile 预算、causal answer-profile 预算、generic answer-profile 排序、Mermaid label evidence 抽取、runtime verifier 字段、graph successor-window 与 graph-diagnostics verifier 断言、context-budget truncation/drop/malformed-provider/timeout-provider/graphintent 探针覆盖、相邻 / 同节非相邻 / 跨文档 structured measurement / date / location conflicting evidence 与 full-document remote-scan hard-negative 覆盖、受控 current-vs-historical false-positive guard、单邻居与多邻居 graph source-unavailable hard-negative 覆盖、前端本地化 RAG 状态,以及导出 RAG trace 保留已经落地。图置信阈值校准、大语料上的更完整 replay tooling、对 label-heavy evidence 的自然语言 synthesis、继续细化的 profile-specific release-budget 校准、更广语义 conflict 类和更大的 runtime probe 语料仍是后续工作。
99

1010
当前代码 / 方案对齐判断:
1111

@@ -63,7 +63,7 @@
6363

6464
- 基于代表性 hard negative 校准图关系权重与低置信排除阈值,不把当前 scoring 常量当作最终形态。
6565
- 在当前 `graphintent` intent-selection 基线之上,继续扩展大语料 hard negative 与关系抽取歧义样本的 runtime probes。
66-
- 在当前 deterministic definition / compare / how-to / generic 基线之上继续校准 profile-specific release budget,同时保留公开回答硬上限。
66+
- 在当前 deterministic definition / compare / how-to / causal / generic 基线之上继续校准 profile-specific release budget,同时保留公开回答硬上限。
6767
- 在稳定 context id、failure-stage classification、graph-window ambiguity diagnostics 与 answer claim-citation map 之上扩展 replay tooling,并补齐 repeated snippet、超出受控 structured measurement / date / state / location 事实的更广 conflict pattern、更大规模多文档 missing graph-neighbor 语料、更严格的 total-character budget drop、更广 relation-ambiguity 语料、provider fallback 的更大 runtime probes。
6868

6969
## 2026-07-04 知识工作区 scope 可见性、聚合 RAG 回答与命中文件交互收口
@@ -132,6 +132,7 @@
132132
- `temporal_cross_document_planned_release_date_probe_en` 现在由 `Knowledge_Base/ragtemporalcrossscope` 支撑,把该防护扩展到 cross-document conflict scanner:两个 scoped 文档中的 current 与 planned roadmap 日期会分别完整读入并作为证据返回,而不会误产出跨文档 `conflict` fragment。
133133
- `conflicting_location_evidence_probe_en` 现在由 `Knowledge_Base/raglocationconflict` 支撑,把 conflict 切片扩展到保守的 location comparable-fact 类:subject 明确包含 location/site/region/zone/room/rack/slot/bay,且 Rack A 与 Rack B 值冲突时会产出 `conflict` fragment,在单条公开回答中保留两侧事实,并把降级归类到 `context_assembly`
134134
- `temporal_scoped_location_probe_en` 现在由 `Knowledge_Base/ragtemporalqualifier` 支撑,验证对应 hard negative:current 与 historical placement 事实会进入不同 comparable scope,公开回答可以使用 current Rack A 事实,RAG pack 不会误产出 `conflict` fragment。
135+
- `causal_answer_profile_budget_en` 现在由 `Knowledge_Base/ragcausalprofile` 支撑,验证 why/cause/mechanism 类请求会使用有界 causal RAG profile(`20` 个 fragment、每 fragment `1500` 字符、总计 `7600` 字符),保持 `full_document` source boundary,并在单条公开回答中返回 mechanism 与 downstream evidence,而不是压缩成单句定义。
135136
- `conflicting_multi_document_evidence_probe_en` 现在由 `Knowledge_Base/ragmulticonflict` 支撑,验证两个 scoped 文档中的 `+/-0.10 mm``+/-0.50 mm` calibration-tolerance 矛盾会进入跨文档 `conflict` RAG role,保留在单条公开回答中,并保持 `borderline/conflict` 降级。
136137
- `full_document_scan_remote_conflict_probe_en` 现在由 `Knowledge_Base/ragfullscan` 支撑,验证修正后的 source-boundary 规则:局部段落窗口不是最大范围。两个被选文档会先完整读入,命中开头段落之外的远端 appendix 事实也会参与结构化冲突扫描;真正被硬限制的是进入公开回答编排前的有界 `RagContextPack`
137138
- focused provenance 测试现在验证 repeated snippet 不会在 offset 陈旧时强制落到第一处文本命中。如果 offset 候选不包含 evidence snippet,而 line-range 候选包含它,`evidenceContextAssembler.ts` 会使用 line provenance 选择正确 source block 与 parent section。

0 commit comments

Comments
 (0)