Skip to content

Commit 3789943

Browse files
committed
feat(phase-12): implement TA-P12-004 federation SLO automation
1 parent e432baf commit 3789943

18 files changed

+1228
-80
lines changed

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ TELAGENT_FEDERATION_SELF_DOMAIN=node-a.tel
3939
TELAGENT_FEDERATION_ENVELOPE_RATE_LIMIT_PER_MIN=600
4040
TELAGENT_FEDERATION_SYNC_RATE_LIMIT_PER_MIN=300
4141
TELAGENT_FEDERATION_RECEIPT_RATE_LIMIT_PER_MIN=600
42+
# Phase 12: federation DLQ auto replay scheduler
43+
TELAGENT_FEDERATION_DLQ_REPLAY_INTERVAL_SEC=60
44+
TELAGENT_FEDERATION_DLQ_REPLAY_BATCH_SIZE=100
45+
TELAGENT_FEDERATION_DLQ_REPLAY_STOP_ON_ERROR=false
4246
# Optional: federation source key pinning mode (disabled|enforced|report-only)
4347
# TELAGENT_FEDERATION_PINNING_MODE=disabled
4448
# Optional: current key fingerprints by domain (domain=key1|key2,domain2=key3)
@@ -61,3 +65,7 @@ TELAGENT_MONITOR_REQ_P95_WARN_MS=250
6165
TELAGENT_MONITOR_REQ_P95_CRITICAL_MS=500
6266
TELAGENT_MONITOR_MAINT_STALE_WARN_SEC=180
6367
TELAGENT_MONITOR_MAINT_STALE_CRITICAL_SEC=300
68+
# Phase 12: federation DLQ burn-rate alert thresholds
69+
TELAGENT_MONITOR_FED_DLQ_ERROR_BUDGET_RATIO=0.01
70+
TELAGENT_MONITOR_FED_DLQ_BURN_RATE_WARN=2
71+
TELAGENT_MONITOR_FED_DLQ_BURN_RATE_CRITICAL=5
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# TelAgent v1 Phase 12 执行产出(v1.2 候选能力冻结)
22

33
- 文档版本:v1.0
4-
- 状态:Phase 12 执行中(`TA-P12-001` ~ `TA-P12-003` 已完成,`TA-P12-004` ~ `TA-P12-008` 待执行)
4+
- 状态:Phase 12 执行中(`TA-P12-001` ~ `TA-P12-004` 已完成,`TA-P12-005` ~ `TA-P12-008` 待执行)
55
- 最后更新:2026-03-03
66

77
## 1. 产出目录
@@ -11,31 +11,35 @@
1111
| TA-P12-001 | `ta-p12-001-phase12-candidate-pool-freeze-2026-03-03.md` | Phase 12 候选池冻结 |
1212
| TA-P12-002 | `ta-p12-002-audit-snapshot-export-2026-03-03.md` | 链上/链下审计快照导出(脱敏) |
1313
| TA-P12-003 | `ta-p12-003-revoked-did-realtime-session-isolation-2026-03-03.md` | revoked DID 实时会话隔离(订阅+驱逐) |
14+
| TA-P12-004 | `ta-p12-004-federation-slo-automation-2026-03-03.md` | 联邦 SLO 自动化(DLQ 自动重放 + burn-rate 告警) |
1415

1516
## 2. 当前证据目录
1617

1718
- 启动文档:
1819
- `ta-p12-001-phase12-candidate-pool-freeze-2026-03-03.md`
1920
- `ta-p12-002-audit-snapshot-export-2026-03-03.md`
2021
- `ta-p12-003-revoked-did-realtime-session-isolation-2026-03-03.md`
22+
- `ta-p12-004-federation-slo-automation-2026-03-03.md`
2123
- 机读清单:
2224
- `manifests/2026-03-03-p12-candidate-pool-freeze.json`
2325
- `manifests/2026-03-03-p12-audit-snapshot-check.json`
2426
- `manifests/2026-03-03-p12-revoked-did-isolation-check.json`
27+
- `manifests/2026-03-03-p12-federation-slo-automation-check.json`
2528
- 日志:
2629
- `logs/2026-03-03-p12-node-build.txt`
2730
- `logs/2026-03-03-p12-node-test.txt`
2831
- `logs/2026-03-03-p12-audit-snapshot-check-run.txt`
2932
- `logs/2026-03-03-p12-revoked-did-isolation-check-run.txt`
33+
- `logs/2026-03-03-p12-federation-slo-automation-check-run.txt`
3034

3135
## 3. 当前进展
3236

3337
- `TA-P12-001`:DONE
3438
- `TA-P12-002`:DONE
3539
- `TA-P12-003`:DONE
36-
- `TA-P12-004`TODO
40+
- `TA-P12-004`DONE
3741
- `TA-P12-005`:TODO
3842
- `TA-P12-006`:TODO
3943
- `TA-P12-007`:TODO
4044
- `TA-P12-008`:TODO
41-
- 下一步:进入 `TA-P12-004`(联邦 SLO 自动化:DLQ 自动重放 + burn-rate 告警)。
45+
- 下一步:进入 `TA-P12-005`(Agent SDK Python Beta)。
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[TA-P12-004] autoReplayPass=true pendingBefore=9 pendingAfter=8
2+
[TA-P12-004] burnRateWarnPass=true burnRateCriticalPass=true
3+
[TA-P12-004] schedulerTickPass=true schedulerRunsDelta=1
4+
[TA-P12-004] decision=PASS
5+
[TA-P12-004] output=/Users/xiasenhai/Workspace/OpenClaw/telagent/docs/implementation/phase-12/manifests/2026-03-03-p12-federation-slo-automation-check.json

docs/implementation/phase-12/logs/2026-03-03-p12-node-test.txt

Lines changed: 80 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -10,81 +10,88 @@
1010
> @telagent/node@0.1.0 test /Users/xiasenhai/Workspace/OpenClaw/telagent/packages/node
1111
> node --test dist/*.test.js dist/**/*.test.js
1212

13-
✔ created response returns data envelope and Location header (201.988721ms)
14-
✔ list response returns paginated envelope shape (27.751717ms)
15-
✔ validation errors use RFC7807 shape and problem+json content type (14.101667ms)
16-
✔ node audit snapshot exports de-sensitized envelope and links.self (101.777339ms)
17-
✔ node audit snapshot rejects invalid query with RFC7807 response (7.444877ms)
18-
✔ TA-P12-003 revoked DID event isolates session and rejects message send with RFC7807 (24.044224ms)
19-
✔ not found uses RFC7807 shape (3.760304ms)
20-
✔ identities and groups endpoints are accessible with expected status codes (27.138716ms)
21-
✔ messages, attachments and federation endpoints are accessible (94.28094ms)
22-
✔ routes only serve /api/v1/* prefix (226.560098ms)
23-
✔ identity endpoint responds with data envelope (38.693577ms)
24-
✔ mailbox store defaults to sqlite backend (4.980825ms)
25-
✔ mailbox store parses postgres backend config (0.693923ms)
26-
✔ postgres backend requires connection url (0.629182ms)
27-
✔ mailbox backend rejects unsupported value (0.344071ms)
28-
✔ federation protocol defaults to v1 and supports self version (0.983959ms)
29-
✔ federation supported protocols auto-include self version (0.423962ms)
30-
✔ domain proof config defaults to enforced mode (0.34525ms)
31-
✔ domain proof config accepts report-only mode and custom values (4.038343ms)
32-
✔ domain proof mode rejects unsupported value (1.352386ms)
33-
✔ domain proof numeric settings require positive integers (1.878416ms)
34-
✔ federation pinning defaults to disabled mode (1.161413ms)
35-
✔ federation pinning parses current/next keys and cutover timestamp (0.519115ms)
36-
✔ federation pinning rejects invalid mode (0.325709ms)
37-
✔ federation pinning enabled requires key mappings (0.400825ms)
38-
✔ federation pinning map requires domain=keys format (1.494653ms)
39-
✔ finalityDepth only materializes finalized blocks (41.850422ms)
40-
✔ reorg rollback replays canonical events and restores deterministic view (16.65258ms)
41-
✔ TA-P4-009 E2E main path: create -> invite -> accept -> group chat (text/image/file) (273.019079ms)
42-
✔ TA-P4-010 E2E offline 24h pull keeps dedupe and per-conversation order (47.117487ms)
43-
✔ TA-P4-006 init-upload sanitizes filename and emits attachment objectKey (1.425367ms)
44-
✔ TA-P4-006 complete-upload enforces manifest and checksum integrity (0.706507ms)
45-
✔ TA-P4-006 complete-upload is idempotent and rejects checksum divergence (0.392383ms)
46-
✔ TA-P4-006 expired upload sessions are cleaned and cannot be completed (0.243144ms)
47-
✔ TA-P11-003 accepts valid domain proof challenge and canonical hash (27.116966ms)
48-
✔ TA-P11-003 rejects illegal domain challenge on malformed domain (0.722989ms)
49-
✔ TA-P11-003 rejects when canonical domainProofHash mismatches payload (0.715704ms)
50-
✔ TA-P11-003 rotates challenge nonce near expiry and accepts renewed domain proof (2.871016ms)
51-
✔ TA-P11-003 report-only mode returns warning without blocking create flow (0.911579ms)
52-
✔ TA-P4-007 federation envelopes support idempotent retries (2.030286ms)
53-
✔ TA-P4-007 federation auth token is enforced when configured (2.950585ms)
54-
✔ TA-P4-007 federation rate limit rejects burst traffic (7.381569ms)
55-
✔ TA-P4-008 group-state sync enforces domain consistency (0.414258ms)
56-
✔ TA-P8-002 group-state sync rejects stale stateVersion and records resilience counters (1.162181ms)
57-
✔ TA-P8-002 group-state sync detects split-brain on same stateVersion with different state (0.368307ms)
58-
✔ TA-P9-002 federation accepts compatible protocol versions and tracks usage stats (17.272465ms)
59-
✔ TA-P9-002 federation rejects unsupported protocol versions (0.265048ms)
60-
✔ TA-P11-004 federation pinning enforces sourceKeyId with current/next rotation (0.641915ms)
61-
✔ TA-P11-004 federation pinning report-only mode allows traffic but records warnings (0.3097ms)
62-
✔ TA-P11-005 federation DLQ captures failures and replays in sequence order (0.816906ms)
63-
✔ TA-P4-008 node-info publishes domain and federation security policy (0.196557ms)
64-
✔ assertSufficient throws INSUFFICIENT_GAS_TOKEN_BALANCE when native balance is not enough (2.46961ms)
65-
✔ TA-P11-006 rotate key keeps old key usable in grace window then expires (2.56483ms)
66-
✔ TA-P11-006 revoke and recover lifecycle is verifiable (0.479821ms)
67-
✔ TA-P11-006 rejects invalid did and malformed key id (0.467458ms)
68-
✔ TA-P4-002 sequence allocator keeps per-conversation monotonic order (3.892848ms)
69-
✔ TA-P4-003 dedupe keeps idempotent writes for same envelopeId (0.758626ms)
70-
✔ TA-P4-003 duplicate envelopeId with different payload is rejected (0.895827ms)
71-
✔ TA-P4-004 cleanupExpired removes expired envelopes and releases dedupe key (0.608604ms)
72-
✔ TA-P4-005 provisional envelopes are retracted when group is reorged back (0.858395ms)
73-
✔ TA-P4-005 send is rejected when group chain state is REORGED_BACK (0.921126ms)
74-
✔ TA-P12-002 buildAuditSnapshot exports hashed retraction samples (1.107947ms)
75-
✔ TA-P12-002 buildAuditSnapshot normalizes sample and scan bounds (0.199506ms)
76-
✔ TA-P12-003 revoked DID event isolates related sessions and evicts active sessions (2.119033ms)
77-
✔ TA-P12-003 buildAuditSnapshot includes revocation isolation evidence (0.583113ms)
78-
✔ TA-P6-001 mailbox persists messages and seq after service restart (23.514943ms)
79-
✔ TA-P11-006 message send validates signal/mls key lifecycle status (1.754109ms)
80-
✔ TA-P11-007 revoked DID cannot continue sending new messages (0.465936ms)
81-
✔ TA-P5-002 monitoring snapshot normalizes dynamic route segments and records counters (22.521397ms)
82-
✔ TA-P5-002 monitoring emits warning/critical alerts when thresholds are exceeded (0.508388ms)
83-
ℹ tests 70
13+
✔ created response returns data envelope and Location header (142.978537ms)
14+
✔ list response returns paginated envelope shape (9.281913ms)
15+
✔ validation errors use RFC7807 shape and problem+json content type (101.586937ms)
16+
✔ node audit snapshot exports de-sensitized envelope and links.self (21.198809ms)
17+
✔ node audit snapshot rejects invalid query with RFC7807 response (3.576696ms)
18+
✔ TA-P12-003 revoked DID event isolates session and rejects message send with RFC7807 (214.699747ms)
19+
✔ TA-P12-004 node metrics exposes federation DLQ replay burn-rate section (4.371435ms)
20+
✔ not found uses RFC7807 shape (5.272078ms)
21+
✔ identities and groups endpoints are accessible with expected status codes (32.918991ms)
22+
✔ messages, attachments and federation endpoints are accessible (69.476523ms)
23+
✔ routes only serve /api/v1/* prefix (343.033357ms)
24+
✔ identity endpoint responds with data envelope (10.371252ms)
25+
✔ mailbox store defaults to sqlite backend (6.798975ms)
26+
✔ mailbox store parses postgres backend config (0.552916ms)
27+
✔ postgres backend requires connection url (0.652736ms)
28+
✔ mailbox backend rejects unsupported value (0.352623ms)
29+
✔ federation protocol defaults to v1 and supports self version (1.430739ms)
30+
✔ federation supported protocols auto-include self version (0.510169ms)
31+
✔ domain proof config defaults to enforced mode (5.823333ms)
32+
✔ domain proof config accepts report-only mode and custom values (0.628877ms)
33+
✔ domain proof mode rejects unsupported value (0.638306ms)
34+
✔ domain proof numeric settings require positive integers (0.535536ms)
35+
✔ federation pinning defaults to disabled mode (0.461271ms)
36+
✔ federation pinning parses current/next keys and cutover timestamp (0.625499ms)
37+
✔ federation pinning rejects invalid mode (0.322217ms)
38+
✔ federation pinning enabled requires key mappings (0.301392ms)
39+
✔ federation pinning map requires domain=keys format (0.297021ms)
40+
✔ federation SLO automation config defaults are applied (0.414898ms)
41+
✔ federation SLO automation config accepts custom values (0.614628ms)
42+
✔ federation SLO burn-rate thresholds require positive values (0.367184ms)
43+
✔ finalityDepth only materializes finalized blocks (50.109869ms)
44+
✔ reorg rollback replays canonical events and restores deterministic view (20.18709ms)
45+
✔ TA-P4-009 E2E main path: create -> invite -> accept -> group chat (text/image/file) (410.714016ms)
46+
✔ TA-P4-010 E2E offline 24h pull keeps dedupe and per-conversation order (41.684085ms)
47+
✔ TA-P4-006 init-upload sanitizes filename and emits attachment objectKey (1.715338ms)
48+
✔ TA-P4-006 complete-upload enforces manifest and checksum integrity (29.778586ms)
49+
✔ TA-P4-006 complete-upload is idempotent and rejects checksum divergence (1.512655ms)
50+
✔ TA-P4-006 expired upload sessions are cleaned and cannot be completed (0.426007ms)
51+
✔ TA-P11-003 accepts valid domain proof challenge and canonical hash (107.917819ms)
52+
✔ TA-P11-003 rejects illegal domain challenge on malformed domain (0.87869ms)
53+
✔ TA-P11-003 rejects when canonical domainProofHash mismatches payload (0.95517ms)
54+
✔ TA-P11-003 rotates challenge nonce near expiry and accepts renewed domain proof (2.894795ms)
55+
✔ TA-P11-003 report-only mode returns warning without blocking create flow (0.59398ms)
56+
✔ TA-P4-007 federation envelopes support idempotent retries (11.038269ms)
57+
✔ TA-P4-007 federation auth token is enforced when configured (0.591878ms)
58+
✔ TA-P4-007 federation rate limit rejects burst traffic (0.325528ms)
59+
✔ TA-P4-008 group-state sync enforces domain consistency (0.430939ms)
60+
✔ TA-P8-002 group-state sync rejects stale stateVersion and records resilience counters (0.797773ms)
61+
✔ TA-P8-002 group-state sync detects split-brain on same stateVersion with different state (0.766815ms)
62+
✔ TA-P9-002 federation accepts compatible protocol versions and tracks usage stats (53.843521ms)
63+
✔ TA-P9-002 federation rejects unsupported protocol versions (0.310898ms)
64+
✔ TA-P11-004 federation pinning enforces sourceKeyId with current/next rotation (0.671058ms)
65+
✔ TA-P11-004 federation pinning report-only mode allows traffic but records warnings (0.372314ms)
66+
✔ TA-P11-005 federation DLQ captures failures and replays in sequence order (11.166528ms)
67+
✔ TA-P4-008 node-info publishes domain and federation security policy (0.299215ms)
68+
✔ TA-P12-004 federation SLO runOnce auto-replays DLQ and records burn-rate metrics (7.966754ms)
69+
✔ TA-P12-004 federation SLO scheduler periodically replays DLQ (1102.711982ms)
70+
✔ assertSufficient throws INSUFFICIENT_GAS_TOKEN_BALANCE when native balance is not enough (2.572739ms)
71+
✔ TA-P11-006 rotate key keeps old key usable in grace window then expires (2.551018ms)
72+
✔ TA-P11-006 revoke and recover lifecycle is verifiable (0.534262ms)
73+
✔ TA-P11-006 rejects invalid did and malformed key id (0.334605ms)
74+
✔ TA-P4-002 sequence allocator keeps per-conversation monotonic order (3.675683ms)
75+
✔ TA-P4-003 dedupe keeps idempotent writes for same envelopeId (0.653546ms)
76+
✔ TA-P4-003 duplicate envelopeId with different payload is rejected (0.995472ms)
77+
✔ TA-P4-004 cleanupExpired removes expired envelopes and releases dedupe key (0.617718ms)
78+
✔ TA-P4-005 provisional envelopes are retracted when group is reorged back (0.791942ms)
79+
✔ TA-P4-005 send is rejected when group chain state is REORGED_BACK (0.540054ms)
80+
✔ TA-P12-002 buildAuditSnapshot exports hashed retraction samples (0.95024ms)
81+
✔ TA-P12-002 buildAuditSnapshot normalizes sample and scan bounds (0.154561ms)
82+
✔ TA-P12-003 revoked DID event isolates related sessions and evicts active sessions (1.906471ms)
83+
✔ TA-P12-003 buildAuditSnapshot includes revocation isolation evidence (0.670945ms)
84+
✔ TA-P6-001 mailbox persists messages and seq after service restart (22.976621ms)
85+
✔ TA-P11-006 message send validates signal/mls key lifecycle status (1.579605ms)
86+
✔ TA-P11-007 revoked DID cannot continue sending new messages (0.467104ms)
87+
✔ TA-P5-002 monitoring snapshot normalizes dynamic route segments and records counters (3.120293ms)
88+
✔ TA-P5-002 monitoring emits warning/critical alerts when thresholds are exceeded (0.505947ms)
89+
✔ TA-P12-004 federation DLQ burn-rate alert is emitted and tracked (1.16978ms)
90+
ℹ tests 77
8491
ℹ suites 0
85-
ℹ pass 70
92+
ℹ pass 77
8693
ℹ fail 0
8794
ℹ cancelled 0
8895
ℹ skipped 0
8996
ℹ todo 0
90-
ℹ duration_ms 1451.377978
97+
ℹ duration_ms 2458.799264

0 commit comments

Comments
 (0)