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
@@ -3,9 +3,7 @@
## Purpose
Provide versionable diagnosis playbook skills for high-frequency MVP troubleshooting flows, loaded through progressive disclosure so agents can follow scenario-specific evidence workflows without bloating every prompt.
## Requirements
### Requirement: Skill catalog SHALL expose diagnosis playbooks compactly
The system SHALL provide a compact skill catalog containing each playbook skill name and description.
@@ -54,3 +52,28 @@ The system SHALL provide playbooks for the existing fixed diagnosis evaluation s
- **WHEN** the case is payment timeout, MySQL pool exhaustion, Redis timeout, slow response, or JVM memory risk
- **THEN** a matching diagnosis skill SHALL exist
- **AND** the skill SHALL state required evidence tools and low-confidence behavior
### Requirement: Executor SHALL avoid duplicate playbook reads in one diagnosis path
The system SHALL prevent repeated reads of the same selected diagnosis playbook during a single Executor diagnosis path unless a new retry round explicitly requests a fresh playbook read.
#### Scenario: Executor has already read the selected skill
- **WHEN** the Executor has already called `read_skill` for the selected skill in the current diagnosis path
- **THEN** the Executor SHALL continue using the already loaded playbook instructions
- **AND** it SHALL NOT call `read_skill` again for the same skill in that path
#### Scenario: Retry round may read selected skill again
- **WHEN** ChatService starts a distinct retry round after Verifier requests evidence supplementation
- **THEN** the Executor MAY call `read_skill` again for the selected skill
- **AND** the repeated read SHALL be attributable to the new round rather than the same Executor path
### Requirement: Live traces SHALL expose skill selection boundaries
The system SHALL make the Planner and Executor skill boundary auditable from persisted agent steps and logs.
#### Scenario: Planner selects without reading skill body
- **WHEN** a Planner step selects a diagnosis playbook
- **THEN** the persisted Planner output SHALL include the selected skill name
- **AND** the Planner step SHALL NOT include a `read_skill` tool call
#### Scenario: Executor reads selected skill
- **WHEN** the Executor starts a playbook-backed diagnosis
- **THEN** the persisted Executor step SHALL show `read_skill` for the selected skill before evidence-tool execution