Skip to content

Commit b9f638e

Browse files
author
J.A.R.V.I.S.
committed
feat: v2.94 principal_diversity_defense — colluding-pair penalty in bilateral IR
Core implementation: - _principal_diversity_score(peer_id): concentration_threshold=0.60, penalty_weight=0.10, min_records=3 (aeoess adversarial-trust-fixture.json) - effective_bilateral_count = normal_count + excess * 0.10 when top counterparty ratio > 60% - _bilateral_ir_adj() → 4-tuple (adj, count, merkle, diversity_dict); effective_count used in tier threshold instead of raw count New endpoint: - GET /trust/bilateral-ir/diversity?peer_id=<did> - 400: missing peer_id - 404: unknown peer - 200: concentration_ratio, penalty_applied, diversity_weight, effective_bilateral_count, defense_params, version Test helper: - POST /trust/bilateral-ir/inject (seeds bilateral IR records in tests) AgentCard: - capabilities.principal_diversity_defense: true - endpoints.bilateral_ir_diversity: /trust/bilateral-ir/diversity Tests: PD01-PD16, 16/16 PASS Regression: governance_metadata(16) + hybrid_identity(6) + adversarial_fixtures(7) = 29/29 PASS VERSION: 2.93.0 → 2.94.0 Addresses A2A #1718 aeoess adversarial-trust-fixture gist:bdcd1dd0512661138ff7a71bf1e946c7
1 parent 8253453 commit b9f638e

3 files changed

Lines changed: 734 additions & 14 deletions

File tree

docs/CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,40 @@ Dates: Asia/Shanghai (UTC+8)
77

88
---
99

10+
## v2.94.0 — Principal Diversity Defense for Bilateral IR (2026-04-10)
11+
12+
### Added
13+
- **`_principal_diversity_score(peer_id)`** — new function implementing the colluding-pair inflation defense from aeoess adversarial-trust-fixture.json (A2A #1718 gist:bdcd1dd0512661138ff7a71bf1e946c7)
14+
- Parameters aligned with aeoess model: `concentration_threshold=0.60`, `penalty_weight=0.10`, `min_records_for_analysis=3`
15+
- Returns: `concentration_ratio`, `penalty_applied`, `diversity_weight`, `effective_bilateral_count`, `top_counterparty`, `unique_counterparties`
16+
- Formula: `effective = normal_count + excess_count * 0.10` when `top_counterparty_ratio > 0.60`
17+
- **`GET /trust/bilateral-ir/diversity`** — new endpoint exposing principal diversity analysis per peer
18+
- `?peer_id=<did>` — required query param
19+
- 400 on missing peer_id, 404 on unknown peer
20+
- Response includes full `defense_params` block with reference to aeoess gist
21+
- **`_bilateral_ir_adj()` enhanced** — now returns 4-tuple `(adj, count, merkle_root, diversity_dict)`; `effective_bilateral_count` (penalty-adjusted) used in threshold calculation instead of raw count
22+
- **`capabilities.principal_diversity_defense: true`** in AgentCard
23+
- **`endpoints.bilateral_ir_diversity: /trust/bilateral-ir/diversity`** in AgentCard
24+
- **`principal_diversity` sub-field** in `/trust/signals/capability-token` response factors
25+
- **`POST /trust/bilateral-ir/inject`** — test helper endpoint for seeding bilateral IR records in tests
26+
- **Tests PD01–PD16** (`tests/test_principal_diversity_v294.py`) — 16/16 PASS
27+
- PD01–PD04: VERSION + capability/endpoint flags
28+
- PD05–PD07: 400/404 error handling
29+
- PD08–PD10: defense params values and response schema
30+
- PD11–PD14: penalty logic (no-penalty below threshold, penalty above, effective count formula, insufficient records)
31+
- PD15–PD16: version in response, backward compat
32+
33+
### Changed
34+
- `_bilateral_ir_adj()` return type: 3-tuple → 4-tuple (backward compat: callers updated)
35+
- VERSION: 2.93.0 → 2.94.0
36+
37+
### Security
38+
- **Colluding-pair inflation attack** (AF-002 adversarial scenario) now has a concrete defense
39+
- Peer concentrating >60% of bilateral interactions with a single counterparty receives `diversity_weight < 1.0`
40+
- `effective_bilateral_count` replaces raw count in tier threshold calculation — prevents artificial T3 inflation from exclusively mutual interactions
41+
42+
---
43+
1044
## v2.93.0 — ACP-RFC-004: Decentralized Agent Identity Without CA (2026-04-09)
1145

1246
### Added

0 commit comments

Comments
 (0)