docs: update yonexus failure-path progress

This commit is contained in:
nav
2026-04-09 02:04:11 +00:00
parent e1835ba489
commit 8b5a8efe9a
4 changed files with 16 additions and 10 deletions

View File

@@ -1093,7 +1093,7 @@
### YNX-1105 编写失败路径测试矩阵 ### YNX-1105 编写失败路径测试矩阵
**状态** **状态**
- [x] 持续补齐中,关键路径已覆盖并新增恢复场景2026-04-09 - [x] 持续补齐中,关键路径已覆盖并继续收尾连接/恢复场景2026-04-09
**目标** **目标**
- 系统性覆盖 pairing/auth 失败路径 - 系统性覆盖 pairing/auth 失败路径
@@ -1150,11 +1150,17 @@
- 已扩展 `Yonexus.Client/tests/state-and-rules.test.ts` - 已扩展 `Yonexus.Client/tests/state-and-rules.test.ts`
- SR-06损坏的 client state 会抛出 `YonexusClientStateCorruptionError` - SR-06损坏的 client state 会抛出 `YonexusClientStateCorruptionError`
- 已同步更新 `tests/failure-path/MATRIX.md`,标记 PF-09、SR-01、SR-05、SR-06 为已覆盖 - 已同步更新 `tests/failure-path/MATRIX.md`,标记 PF-09、SR-01、SR-05、SR-06 为已覆盖
- 已新增 `Yonexus.Server/tests/connection-heartbeat-failures.test.ts` 补齐:
- CF-03重复认证连接晋升时关闭旧连接并保留新连接
- CF-04协议版本不匹配时返回 `UNSUPPORTED_PROTOCOL_VERSION` 并主动断开
- 已新增 `Yonexus.Client/tests/runtime-flow.test.ts` 恢复场景:
- SR-03客户端带既有 secret + keypair 重启后直接进入 auth flow不重新配对
- 已同步更新 `tests/failure-path/MATRIX.md`,标记 RP-02、CF-03、CF-04、SR-03 为已覆盖
**待完成** **待完成**
- AF-04当前实现未单独暴露 `invalid_secret` 分支,需先决定是否保留该错误码语义 - AF-04当前实现未单独暴露 `invalid_secret` 分支,需先决定是否保留该错误码语义
- RP 其余触发场景 - RP-03 / RP-04管理员主动撤销与 key rotation 语义仍未实现
- CF / HF / SR 其余边界场景测试(例如 duplicate connection、version mismatch、server/client restart with active session 等) - PF-08 / PF-10、CF-01 / CF-02 / CF-07、SR-02 / SR-04 等剩余边界场景测试
--- ---

View File

@@ -51,7 +51,7 @@ This document defines the systematic test coverage for pairing and authenticatio
| ID | Scenario | Cause | Server Action | Client Action | Status | | ID | Scenario | Cause | Server Action | Client Action | Status |
|----|----------|-------|---------------|---------------|--------| |----|----------|-------|---------------|---------------|--------|
| RP-01 | Nonce collision | Replay attack detected | Clear secret, reset state | Enter `pair_required` | ✅ | | RP-01 | Nonce collision | Replay attack detected | Clear secret, reset state | Enter `pair_required` | ✅ |
| RP-02 | Rate limit exceeded | Brute force detected | Clear secret, reset state | Enter `pair_required` | | | RP-02 | Rate limit exceeded | Brute force detected | Clear secret, reset state | Enter `pair_required` | |
| RP-03 | Admin-initiated | Manual revocation | Mark revoked, notify | Enter `pair_required` | ⬜ | | RP-03 | Admin-initiated | Manual revocation | Mark revoked, notify | Enter `pair_required` | ⬜ |
| RP-04 | Key rotation | Client sends new public key | Update key, keep secret | Continue with new key | ⬜ | | RP-04 | Key rotation | Client sends new public key | Update key, keep secret | Continue with new key | ⬜ |
@@ -63,8 +63,8 @@ This document defines the systematic test coverage for pairing and authenticatio
|----|----------|---------|-------------------|--------| |----|----------|---------|-------------------|--------|
| CF-01 | Network partition | Connection drops mid-auth | Client retries with backoff | ⬜ | | CF-01 | Network partition | Connection drops mid-auth | Client retries with backoff | ⬜ |
| CF-02 | Server unreachable | Initial connect fails | Exponential backoff retry | ⬜ | | CF-02 | Server unreachable | Initial connect fails | Exponential backoff retry | ⬜ |
| CF-03 | Duplicate connection | Same ID connects twice | Old connection closed, new accepted | | | CF-03 | Duplicate connection | Same ID connects twice | Old connection closed, new accepted | |
| CF-04 | Protocol version mismatch | Unsupported version | Connection rejected with error | | | CF-04 | Protocol version mismatch | Unsupported version | Connection rejected with error | |
| CF-05 | Malformed hello | Invalid JSON | Error response, connection maintained | ⬜ | | CF-05 | Malformed hello | Invalid JSON | Error response, connection maintained | ⬜ |
| CF-06 | Unauthenticated rule message | Client sends before auth | Connection closed | ✅ | | CF-06 | Unauthenticated rule message | Client sends before auth | Connection closed | ✅ |
| CF-07 | Reserved rule registration | Plugin tries `registerRule("builtin")` | Registration rejected | ⬜ | | CF-07 | Reserved rule registration | Plugin tries `registerRule("builtin")` | Registration rejected | ⬜ |
@@ -88,7 +88,7 @@ This document defines the systematic test coverage for pairing and authenticatio
|----|----------|-----------|-------------------|--------| |----|----------|-----------|-------------------|--------|
| SR-01 | Server restart with pending pairing | Pairing in progress | Preserve pairing state, code valid | ✅ | | SR-01 | Server restart with pending pairing | Pairing in progress | Preserve pairing state, code valid | ✅ |
| SR-02 | Server restart with active sessions | Online clients | All marked offline, reconnect required | ⬜ | | SR-02 | Server restart with active sessions | Online clients | All marked offline, reconnect required | ⬜ |
| SR-03 | Client restart with credentials | Has secret + keys | Resume with auth, no re-pairing | | | SR-03 | Client restart with credentials | Has secret + keys | Resume with auth, no re-pairing | |
| SR-04 | Client restart without credentials | First run | Full pairing flow required | ⬜ | | SR-04 | Client restart without credentials | First run | Full pairing flow required | ⬜ |
| SR-05 | Corrupted server store | File unreadable | Surface corruption error clearly for operator handling | ✅ | | SR-05 | Corrupted server store | File unreadable | Surface corruption error clearly for operator handling | ✅ |
| SR-06 | Corrupted client state | File unreadable | Surface corruption error clearly for operator handling | ✅ | | SR-06 | Corrupted client state | File unreadable | Surface corruption error clearly for operator handling | ✅ |
@@ -133,7 +133,7 @@ npm test -- failure-paths
### Current Notes ### Current Notes
- AF-04 (`invalid_secret`) 仍未单独覆盖:现有实现把“错误 secret 导致的验签失败”统一落到 `invalid_signature`,是否拆分错误码仍待确认。 - AF-04 (`invalid_secret`) 仍未单独覆盖:现有实现把“错误 secret 导致的验签失败”统一落到 `invalid_signature`,是否拆分错误码仍待确认。
- 本轮已补齐 AF-01/02/03/05/06/09/10/11、RP-01、HF-01/02、PF-09、SR-01、SR-05、SR-06。 - 本轮已补齐 AF-01/02/03/05/06/09/10/11、RP-01/02、CF-03/04、HF-01/02、PF-09、SR-01/03/05/06。
### Adding New Test Cases ### Adding New Test Cases