fix(agent): harden live diagnosis skill observability

This commit is contained in:
aruo
2026-07-07 00:20:34 +08:00
parent 64adb998cf
commit b3315ead52
20 changed files with 792 additions and 26 deletions
@@ -227,3 +227,24 @@ The post-retrieval flow SHALL rerank vector candidates using deterministic rule-
- **THEN** the reranker MAY boost the candidate
- **AND** the evidence block SHALL record the hint as a hit reason
- **AND** the system SHALL NOT treat the L0 hint itself as fact evidence
### Requirement: Lookup knowledge SHALL persist modular RAG trace details
The `lookup_knowledge` tool SHALL persist modular RAG pipeline details in `tool_invocation.retrieval_details` for every new lookup invocation.
#### Scenario: Evidence lookup persists modular detail keys
- **WHEN** `lookup_knowledge` returns usable evidence
- **THEN** `retrieval_details` SHALL include `query_transform`
- **AND** it SHALL include `retrieval_trace`
- **AND** it SHALL include `context_pack_summary`
- **AND** it SHALL include `rerank_trace`
- **AND** it SHALL include `evidence_blocks`
#### Scenario: Fallback lookup persists fallback reason
- **WHEN** `lookup_knowledge` performs an unfiltered retry after filtered retrieval fails or is low quality
- **THEN** `retrieval_details.retrieval_trace` SHALL include the selected attempt
- **AND** `retrieval_details.fallback_reason` SHALL preserve the fallback reason
#### Scenario: No-evidence lookup still preserves trace
- **WHEN** `lookup_knowledge` returns no usable evidence
- **THEN** `retrieval_details` SHALL still include retrieval trace information for attempted retrieval paths
- **AND** it SHALL not include full evidence content as duplicated trace data