Skip to content

Commit 923c989

Browse files
committed
docs(phase-11): close TA-P11-007 evidence and trackers
1 parent bbaa26f commit 923c989

7 files changed

+187
-72
lines changed

docs/implementation/phase-11/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# TelAgent v1 Phase 11 执行产出(v1.1 安全与运营能力增强)
22

33
- 文档版本:v1.0
4-
- 状态:Phase 11 执行中(`TA-P11-001` ~ `TA-P11-006` 已完成,`TA-P11-007` ~ `TA-P11-010` 待执行)
4+
- 状态:Phase 11 执行中(`TA-P11-001` ~ `TA-P11-007` 已完成,`TA-P11-008` ~ `TA-P11-010` 待执行)
55
- 最后更新:2026-03-03
66

77
## 1. 产出目录
@@ -14,6 +14,7 @@
1414
| TA-P11-004 | `ta-p11-004-federation-pinning-rotation-2026-03-03.md` | 联邦互信 pinning 与轮换策略 |
1515
| TA-P11-005 | `ta-p11-005-federation-dlq-replay-toolchain-2026-03-03.md` | 联邦 DLQ 与重放工具链 |
1616
| TA-P11-006 | `ta-p11-006-signal-mls-key-lifecycle-2026-03-03.md` | Signal/MLS 密钥生命周期管理 |
17+
| TA-P11-007 | `ta-p11-007-revoked-did-session-invalidation-2026-03-03.md` | revoked DID 会话失效链路 |
1718

1819
## 2. 当前证据目录
1920

@@ -24,6 +25,7 @@
2425
- `ta-p11-004-federation-pinning-rotation-2026-03-03.md`
2526
- `ta-p11-005-federation-dlq-replay-toolchain-2026-03-03.md`
2627
- `ta-p11-006-signal-mls-key-lifecycle-2026-03-03.md`
28+
- `ta-p11-007-revoked-did-session-invalidation-2026-03-03.md`
2729
- 运行日志:
2830
- `logs/2026-03-03-p11-runtime-check.txt`
2931
- `logs/2026-03-03-p11-workspace-build.txt`
@@ -34,11 +36,13 @@
3436
- `logs/2026-03-03-p11-federation-pinning-check-run.txt`
3537
- `logs/2026-03-03-p11-federation-dlq-replay-check-run.txt`
3638
- `logs/2026-03-03-p11-key-lifecycle-check-run.txt`
39+
- `logs/2026-03-03-p11-revoked-did-session-check-run.txt`
3740
- 机读清单:
3841
- `manifests/2026-03-03-p11-domain-proof-challenge-check.json`
3942
- `manifests/2026-03-03-p11-federation-pinning-check.json`
4043
- `manifests/2026-03-03-p11-federation-dlq-replay-check.json`
4144
- `manifests/2026-03-03-p11-key-lifecycle-check.json`
45+
- `manifests/2026-03-03-p11-revoked-did-session-check.json`
4246

4347
## 3. 当前进展
4448

@@ -48,8 +52,8 @@
4852
- `TA-P11-004`:DONE
4953
- `TA-P11-005`:DONE
5054
- `TA-P11-006`:DONE
51-
- `TA-P11-007`TODO
55+
- `TA-P11-007`DONE
5256
- `TA-P11-008`:TODO
5357
- `TA-P11-009`:TODO
5458
- `TA-P11-010`:TODO
55-
- 下一步:进入 `TA-P11-007`(revoked DID 会话失效链路)。
59+
- 下一步:进入 `TA-P11-008`(Agent SDK TypeScript v0)。

docs/implementation/phase-11/logs/2026-03-03-p11-node-test.txt

Lines changed: 66 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -11,73 +11,74 @@
1111
> @telagent/node@0.1.0 test /Users/xiasenhai/workspace/private-repo/Bots/telagent/packages/node
1212
> node --test dist/*.test.js dist/**/*.test.js
1313

14-
✔ created response returns data envelope and Location header (124.031375ms)
15-
✔ list response returns paginated envelope shape (23.811ms)
16-
✔ validation errors use RFC7807 shape and problem+json content type (4.63075ms)
17-
✔ not found uses RFC7807 shape (4.855375ms)
18-
✔ identities and groups endpoints are accessible with expected status codes (16.922958ms)
19-
✔ messages, attachments and federation endpoints are accessible (116.265167ms)
20-
✔ routes only serve /api/v1/* prefix (86.78625ms)
21-
✔ identity endpoint responds with data envelope (8.710333ms)
22-
✔ mailbox store defaults to sqlite backend (4.071708ms)
23-
✔ mailbox store parses postgres backend config (0.46175ms)
24-
✔ postgres backend requires connection url (0.40075ms)
25-
✔ mailbox backend rejects unsupported value (0.193542ms)
26-
✔ federation protocol defaults to v1 and supports self version (0.92375ms)
27-
✔ federation supported protocols auto-include self version (0.297417ms)
28-
✔ domain proof config defaults to enforced mode (2.825417ms)
29-
✔ domain proof config accepts report-only mode and custom values (2.700625ms)
30-
✔ domain proof mode rejects unsupported value (0.320209ms)
31-
✔ domain proof numeric settings require positive integers (0.2985ms)
32-
✔ federation pinning defaults to disabled mode (0.25775ms)
33-
✔ federation pinning parses current/next keys and cutover timestamp (0.351958ms)
34-
✔ federation pinning rejects invalid mode (0.176833ms)
35-
✔ federation pinning enabled requires key mappings (2.141208ms)
36-
✔ federation pinning map requires domain=keys format (1.118959ms)
37-
✔ finalityDepth only materializes finalized blocks (56.656958ms)
38-
✔ reorg rollback replays canonical events and restores deterministic view (49.29325ms)
39-
✔ TA-P4-009 E2E main path: create -> invite -> accept -> group chat (text/image/file) (214.676834ms)
40-
✔ TA-P4-010 E2E offline 24h pull keeps dedupe and per-conversation order (48.243ms)
41-
✔ TA-P4-006 init-upload sanitizes filename and emits attachment objectKey (1.314958ms)
42-
✔ TA-P4-006 complete-upload enforces manifest and checksum integrity (0.578583ms)
43-
✔ TA-P4-006 complete-upload is idempotent and rejects checksum divergence (0.1765ms)
44-
✔ TA-P4-006 expired upload sessions are cleaned and cannot be completed (0.34075ms)
45-
✔ TA-P11-003 accepts valid domain proof challenge and canonical hash (31.041792ms)
46-
✔ TA-P11-003 rejects illegal domain challenge on malformed domain (1.01875ms)
47-
✔ TA-P11-003 rejects when canonical domainProofHash mismatches payload (14.564583ms)
48-
✔ TA-P11-003 rotates challenge nonce near expiry and accepts renewed domain proof (1.329542ms)
49-
✔ TA-P11-003 report-only mode returns warning without blocking create flow (0.238375ms)
50-
✔ TA-P4-007 federation envelopes support idempotent retries (5.124625ms)
51-
✔ TA-P4-007 federation auth token is enforced when configured (0.330958ms)
52-
✔ TA-P4-007 federation rate limit rejects burst traffic (0.167625ms)
53-
✔ TA-P4-008 group-state sync enforces domain consistency (0.232666ms)
54-
✔ TA-P8-002 group-state sync rejects stale stateVersion and records resilience counters (0.422875ms)
55-
✔ TA-P8-002 group-state sync detects split-brain on same stateVersion with different state (0.188833ms)
56-
✔ TA-P9-002 federation accepts compatible protocol versions and tracks usage stats (18.425958ms)
57-
✔ TA-P9-002 federation rejects unsupported protocol versions (1.340417ms)
58-
✔ TA-P11-004 federation pinning enforces sourceKeyId with current/next rotation (1.584ms)
59-
✔ TA-P11-004 federation pinning report-only mode allows traffic but records warnings (1.084ms)
60-
✔ TA-P11-005 federation DLQ captures failures and replays in sequence order (0.721167ms)
61-
✔ TA-P4-008 node-info publishes domain and federation security policy (0.144916ms)
62-
✔ assertSufficient throws INSUFFICIENT_GAS_TOKEN_BALANCE when native balance is not enough (1.069708ms)
63-
✔ TA-P11-006 rotate key keeps old key usable in grace window then expires (1.135791ms)
64-
✔ TA-P11-006 revoke and recover lifecycle is verifiable (0.261541ms)
65-
✔ TA-P11-006 rejects invalid did and malformed key id (0.123709ms)
66-
✔ TA-P4-002 sequence allocator keeps per-conversation monotonic order (2.091583ms)
67-
✔ TA-P4-003 dedupe keeps idempotent writes for same envelopeId (0.310333ms)
68-
✔ TA-P4-003 duplicate envelopeId with different payload is rejected (0.505917ms)
69-
✔ TA-P4-004 cleanupExpired removes expired envelopes and releases dedupe key (0.27275ms)
70-
✔ TA-P4-005 provisional envelopes are retracted when group is reorged back (3.692083ms)
71-
✔ TA-P4-005 send is rejected when group chain state is REORGED_BACK (0.651166ms)
72-
✔ TA-P6-001 mailbox persists messages and seq after service restart (21.581708ms)
73-
✔ TA-P11-006 message send validates signal/mls key lifecycle status (0.986792ms)
74-
✔ TA-P5-002 monitoring snapshot normalizes dynamic route segments and records counters (4.755416ms)
75-
✔ TA-P5-002 monitoring emits warning/critical alerts when thresholds are exceeded (0.309ms)
76-
ℹ tests 62
14+
✔ created response returns data envelope and Location header (33.765375ms)
15+
✔ list response returns paginated envelope shape (10.271291ms)
16+
✔ validation errors use RFC7807 shape and problem+json content type (36.935792ms)
17+
✔ not found uses RFC7807 shape (2.115833ms)
18+
✔ identities and groups endpoints are accessible with expected status codes (20.126209ms)
19+
✔ messages, attachments and federation endpoints are accessible (107.239833ms)
20+
✔ routes only serve /api/v1/* prefix (62.463125ms)
21+
✔ identity endpoint responds with data envelope (11.891041ms)
22+
✔ mailbox store defaults to sqlite backend (30.735125ms)
23+
✔ mailbox store parses postgres backend config (0.364375ms)
24+
✔ postgres backend requires connection url (0.322208ms)
25+
✔ mailbox backend rejects unsupported value (0.154125ms)
26+
✔ federation protocol defaults to v1 and supports self version (0.530542ms)
27+
✔ federation supported protocols auto-include self version (0.203125ms)
28+
✔ domain proof config defaults to enforced mode (0.161041ms)
29+
✔ domain proof config accepts report-only mode and custom values (8.673ms)
30+
✔ domain proof mode rejects unsupported value (2.582542ms)
31+
✔ domain proof numeric settings require positive integers (0.304292ms)
32+
✔ federation pinning defaults to disabled mode (0.208542ms)
33+
✔ federation pinning parses current/next keys and cutover timestamp (0.263042ms)
34+
✔ federation pinning rejects invalid mode (0.142541ms)
35+
✔ federation pinning enabled requires key mappings (0.130916ms)
36+
✔ federation pinning map requires domain=keys format (0.129166ms)
37+
✔ finalityDepth only materializes finalized blocks (87.088542ms)
38+
✔ reorg rollback replays canonical events and restores deterministic view (8.437667ms)
39+
✔ TA-P4-009 E2E main path: create -> invite -> accept -> group chat (text/image/file) (109.507041ms)
40+
✔ TA-P4-010 E2E offline 24h pull keeps dedupe and per-conversation order (42.255833ms)
41+
✔ TA-P4-006 init-upload sanitizes filename and emits attachment objectKey (2.142875ms)
42+
✔ TA-P4-006 complete-upload enforces manifest and checksum integrity (0.414791ms)
43+
✔ TA-P4-006 complete-upload is idempotent and rejects checksum divergence (0.139083ms)
44+
✔ TA-P4-006 expired upload sessions are cleaned and cannot be completed (0.111792ms)
45+
✔ TA-P11-003 accepts valid domain proof challenge and canonical hash (23.900167ms)
46+
✔ TA-P11-003 rejects illegal domain challenge on malformed domain (0.338458ms)
47+
✔ TA-P11-003 rejects when canonical domainProofHash mismatches payload (0.366541ms)
48+
✔ TA-P11-003 rotates challenge nonce near expiry and accepts renewed domain proof (0.936667ms)
49+
✔ TA-P11-003 report-only mode returns warning without blocking create flow (0.189917ms)
50+
✔ TA-P4-007 federation envelopes support idempotent retries (0.9485ms)
51+
✔ TA-P4-007 federation auth token is enforced when configured (0.276167ms)
52+
✔ TA-P4-007 federation rate limit rejects burst traffic (0.139417ms)
53+
✔ TA-P4-008 group-state sync enforces domain consistency (0.15975ms)
54+
✔ TA-P8-002 group-state sync rejects stale stateVersion and records resilience counters (0.342375ms)
55+
✔ TA-P8-002 group-state sync detects split-brain on same stateVersion with different state (0.165083ms)
56+
✔ TA-P9-002 federation accepts compatible protocol versions and tracks usage stats (12.750166ms)
57+
✔ TA-P9-002 federation rejects unsupported protocol versions (0.16175ms)
58+
✔ TA-P11-004 federation pinning enforces sourceKeyId with current/next rotation (0.36875ms)
59+
✔ TA-P11-004 federation pinning report-only mode allows traffic but records warnings (0.164125ms)
60+
✔ TA-P11-005 federation DLQ captures failures and replays in sequence order (0.405834ms)
61+
✔ TA-P4-008 node-info publishes domain and federation security policy (0.103709ms)
62+
✔ assertSufficient throws INSUFFICIENT_GAS_TOKEN_BALANCE when native balance is not enough (0.868083ms)
63+
✔ TA-P11-006 rotate key keeps old key usable in grace window then expires (0.918542ms)
64+
✔ TA-P11-006 revoke and recover lifecycle is verifiable (0.2165ms)
65+
✔ TA-P11-006 rejects invalid did and malformed key id (0.100458ms)
66+
✔ TA-P4-002 sequence allocator keeps per-conversation monotonic order (0.975958ms)
67+
✔ TA-P4-003 dedupe keeps idempotent writes for same envelopeId (0.218458ms)
68+
✔ TA-P4-003 duplicate envelopeId with different payload is rejected (0.367458ms)
69+
✔ TA-P4-004 cleanupExpired removes expired envelopes and releases dedupe key (0.23ms)
70+
✔ TA-P4-005 provisional envelopes are retracted when group is reorged back (1.268417ms)
71+
✔ TA-P4-005 send is rejected when group chain state is REORGED_BACK (0.502625ms)
72+
✔ TA-P6-001 mailbox persists messages and seq after service restart (22.117792ms)
73+
✔ TA-P11-006 message send validates signal/mls key lifecycle status (1.40875ms)
74+
✔ TA-P11-007 revoked DID cannot continue sending new messages (0.231334ms)
75+
✔ TA-P5-002 monitoring snapshot normalizes dynamic route segments and records counters (2.435583ms)
76+
✔ TA-P5-002 monitoring emits warning/critical alerts when thresholds are exceeded (0.296459ms)
77+
ℹ tests 63
7778
ℹ suites 0
78-
ℹ pass 62
79+
ℹ pass 63
7980
ℹ fail 0
8081
ℹ cancelled 0
8182
ℹ skipped 0
8283
ℹ todo 0
83-
ℹ duration_ms 880.273417
84+
ℹ duration_ms 832.12
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
. |  WARN  Unsupported engine: wanted: {"node":">=22 <25"} (current: {"node":"v25.6.1","pnpm":"10.18.1"})
2+
[TA-P11-007] preRevokeSendSuccess=true
3+
[TA-P11-007] postRevokeSendBlocked=true blockedErrorCode=UNPROCESSABLE_ENTITY
4+
[TA-P11-007] mailboxIsolationAfterRevoke=true
5+
[TA-P11-007] decision=PASS
6+
[TA-P11-007] output=/Users/xiasenhai/workspace/private-repo/Bots/telagent/docs/implementation/phase-11/manifests/2026-03-03-p11-revoked-did-session-check.json
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"phase": "Phase 11",
3+
"taskId": "TA-P11-007",
4+
"generatedAt": "2026-03-03T08:33:26.329Z",
5+
"summary": {
6+
"preRevokeSendSuccess": true,
7+
"postRevokeSendBlocked": true,
8+
"mailboxIsolationAfterRevoke": true,
9+
"blockedErrorCode": "UNPROCESSABLE_ENTITY"
10+
},
11+
"decision": "PASS",
12+
"details": {
13+
"did": "did:claw:zRevokedCase",
14+
"conversationId": "direct:revoked-case",
15+
"mailboxItems": [
16+
{
17+
"envelopeId": "p11-revoked-did-send-1",
18+
"conversationId": "direct:revoked-case",
19+
"conversationType": "direct",
20+
"routeHint": {
21+
"targetDomain": "node-a.tel",
22+
"mailboxKeyId": "signal-key-v1"
23+
},
24+
"sealedHeader": "0x11",
25+
"seq": "1",
26+
"ciphertext": "0x22",
27+
"contentType": "text",
28+
"sentAtMs": 1772582400000,
29+
"ttlSec": 60,
30+
"provisional": false
31+
}
32+
]
33+
}
34+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# TA-P11-007 revoked DID 会话失效链路(2026-03-03)
2+
3+
- Task ID:TA-P11-007
4+
- 阶段:Phase 11(v1.1 安全与运营能力增强)
5+
- 状态:DONE
6+
- 负责人角色:Security + Backend
7+
8+
## 1. 目标
9+
10+
落地 revoked DID 的链下会话失效机制,确保被撤销身份无法继续发送新消息,满足 Phase 11 身份强约束。
11+
12+
验收关键点:
13+
14+
1. send 前必须校验 DID active 状态;
15+
2. DID 被撤销后,新消息发送必须被拒绝;
16+
3. 已入箱历史消息保留,但撤销后不会新增同会话消息。
17+
18+
## 2. 实现
19+
20+
### 2.1 MessageService 引入身份活性校验
21+
22+
- 更新:`packages/node/src/services/message-service.ts`
23+
- 新增 `MessageIdentityService` 抽象:
24+
- `assertActiveDid(rawDid)`
25+
- `send()` 新增强校验:
26+
- 先验证 DID 格式;
27+
- 再调用 `identityService.assertActiveDid(senderDid)`
28+
- revoked/inactive 直接抛错并阻断发送。
29+
30+
### 2.2 运行时接入 ClawIdentity 适配器
31+
32+
- 更新:`packages/node/src/app.ts`
33+
-`TelagentNode` 内将 `IdentityAdapterService` 注入 `MessageService`
34+
- 结果:线上路径默认执行链上身份活性校验,revoked DID 无法继续发消息。
35+
36+
### 2.3 自动化验证
37+
38+
- 更新测试:`packages/node/src/services/message-service.test.ts`
39+
- 用例:`TA-P11-007 revoked DID cannot continue sending new messages`
40+
- 覆盖“撤销前可发、撤销后拒绝、会话消息不新增”三段行为。
41+
- 新增脚本:`packages/node/scripts/run-phase11-revoked-did-session-check.ts`
42+
- 产出机读清单,供 Gate 复核。
43+
44+
## 3. 执行命令
45+
46+
```bash
47+
pnpm --filter @telagent/node build
48+
pnpm --filter @telagent/node test
49+
pnpm --filter @telagent/node exec tsx scripts/run-phase11-revoked-did-session-check.ts
50+
```
51+
52+
## 4. 证据
53+
54+
- 代码:
55+
- `packages/node/src/services/message-service.ts`
56+
- `packages/node/src/services/message-service.test.ts`
57+
- `packages/node/src/app.ts`
58+
- `packages/node/scripts/run-phase11-revoked-did-session-check.ts`
59+
- 日志:
60+
- `docs/implementation/phase-11/logs/2026-03-03-p11-node-build.txt`
61+
- `docs/implementation/phase-11/logs/2026-03-03-p11-node-test.txt`
62+
- `docs/implementation/phase-11/logs/2026-03-03-p11-revoked-did-session-check-run.txt`
63+
- 清单:
64+
- `docs/implementation/phase-11/manifests/2026-03-03-p11-revoked-did-session-check.json`
65+
66+
## 5. 结论
67+
68+
- `TA-P11-007`:PASS
69+
- revoked DID 已被纳入消息发送前强校验,撤销后无法继续发送新消息,满足“会话失效链路”验收标准。

docs/implementation/telagent-v1-iteration-board.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@
202202
- 已完成:`TA-P11-004`(联邦互信 pinning 与轮换策略)
203203
- 已完成:`TA-P11-005`(联邦 DLQ 与重放工具链)
204204
- 已完成:`TA-P11-006`(Signal/MLS 密钥生命周期管理)
205-
- 下一批 Ready:继续 Phase 11 执行(优先 `TA-P11-007` ~ `TA-P11-008`
205+
- 已完成:`TA-P11-007`(revoked DID 会话失效链路)
206+
- 下一批 Ready:继续 Phase 11 执行(优先 `TA-P11-008` ~ `TA-P11-009`
206207

207208
## 4.2 Blockers(2026-03-03 更新)
208209

@@ -343,7 +344,7 @@
343344
- `TA-P11-004`:DONE(联邦互信 pinning 与轮换,见 `docs/implementation/phase-11/ta-p11-004-federation-pinning-rotation-2026-03-03.md`)。
344345
- `TA-P11-005`:DONE(联邦 DLQ 与重放工具链,见 `docs/implementation/phase-11/ta-p11-005-federation-dlq-replay-toolchain-2026-03-03.md`)。
345346
- `TA-P11-006`:DONE(Signal/MLS 密钥生命周期管理,见 `docs/implementation/phase-11/ta-p11-006-signal-mls-key-lifecycle-2026-03-03.md`)。
346-
- `TA-P11-007`TODO(revoked DID 会话失效链路)。
347+
- `TA-P11-007`DONE(revoked DID 会话失效链路,见 `docs/implementation/phase-11/ta-p11-007-revoked-did-session-invalidation-2026-03-03.md`)。
347348
- `TA-P11-008`:TODO(Agent SDK TypeScript v0)。
348349
- `TA-P11-009`:TODO(Web Console v2 运营能力增强)。
349350
- `TA-P11-010`:TODO(Phase 11 Gate 收口)。

0 commit comments

Comments
 (0)