test(graph): establish diagnosis stategraph suite

This commit is contained in:
zhuyongxin
2026-07-17 18:53:29 +08:00
parent 99e490f227
commit 208a231113
19 changed files with 868 additions and 395 deletions
@@ -109,16 +109,24 @@ Orchestration audit SHALL remain separate from self evaluation, AgentStep, ToolI
### Requirement: Test migration design SHALL preserve safety behavior
The baseline SHALL identify Sequential/Hook implementation tests to replace and public/security contract tests to retain or extend. Fixed Agent call order SHALL NOT remain a correctness criterion.
The project SHALL replace Sequential/Hook implementation tests with authoritative `DiagnosisGraphWorkflowTest`, `DiagnosisGraphNodeContractTest`, and `ChatServiceGraphIntegrationTest` layers while retaining focused public/security contract tests. Fixed Agent call order and legacy Hook payload shape SHALL NOT remain correctness criteria.
#### Scenario: Old tests are replaced
- **WHEN** StateGraph tests become authoritative
- **THEN** `ChatServiceSequentialAgentTest` SHALL be replaced by route, node-contract, and Chat integration coverage
- **AND** `VerifierInputHookTest` SHALL be removed or rewritten for explicit nodes
- **THEN** `ChatServiceSequentialAgentTest` SHALL NOT exist
- **AND** `VerifierInputHookTest` SHALL NOT exist after explicit Gatekeeper/Verified Input coverage is established
- **AND** no replacement test SHALL restore fixed Sequential Agent order as a public requirement
#### Scenario: Safety tests are retained
- **WHEN** the new suite is assembled
- **THEN** Gatekeeper, Controller, Run/Trace, Repository, Composer, no-evidence, REJECT, and Eval safety contracts SHALL remain covered
- **AND** fixed-order-only assertions SHALL be removed
- **THEN** Gatekeeper, Controller, Run/Trace, Repository, Composer, parser/projection, no-evidence, REJECT, Eval, and multi-run safety contracts SHALL remain covered
- **AND** Workflow and Node Contract matrices SHALL cover bounded retry, fail-closed routing, verified-only inputs, and deterministic Fallback
#### Scenario: Authoritative test layers are inspected
- **WHEN** a maintainer needs to locate ISS-011 orchestration verification
- **THEN** Workflow tests SHALL own route/loop/event behavior
- **AND** Node Contract tests SHALL own input/output/security projection behavior
- **AND** Chat integration tests SHALL own Run lifecycle and public result behavior