|
2 | 2 |
|
3 | 3 | **The plug-and-play AI agent orchestrator for TypeScript/Node.js -- connect 12 agent frameworks with zero glue code** |
4 | 4 |
|
5 | | -[](https://github.com/jovanSAPFIONEER/Network-AI/releases) |
| 5 | +[](https://github.com/jovanSAPFIONEER/Network-AI/releases) |
6 | 6 | [](https://clawhub.ai/skills/network-ai) |
7 | 7 | [](https://nodejs.org) |
8 | 8 | [](https://typescriptlang.org) |
9 | 9 | [](https://python.org) |
10 | 10 | [](LICENSE) |
11 | 11 | [](https://agentskills.io) |
12 | | -[](#testing) |
| 12 | +[](#testing) |
13 | 13 | [](#adapter-system) |
14 | 14 | [](https://github.com/jovanSAPFIONEER/Network-AI/releases.atom) |
15 | 15 |
|
@@ -134,6 +134,7 @@ Network-AI wraps your agent swarm with **file-system mutexes**, **atomic commits |
134 | 134 | ### Operational Safety |
135 | 135 | - **Swarm Guard** -- Prevents "Handoff Tax" (wasted tokens) and detects silent agent failures |
136 | 136 | - **Atomic Commits** -- File-system mutexes prevent split-brain in concurrent writes |
| 137 | +- **Priority-Based Preemption** -- Higher-priority agents preempt lower-priority writes on same-key conflicts (`priority-wins` strategy) |
137 | 138 | - **Cost Awareness** -- Token budget tracking with automatic SafetyShutdown |
138 | 139 | - **Budget-Aware Handoffs** -- `intercept-handoff` command wraps `sessions_send` with budget checks |
139 | 140 |
|
@@ -358,7 +359,32 @@ python scripts/blackboard.py commit "chg_001" |
358 | 359 | python scripts/blackboard.py list |
359 | 360 | ``` |
360 | 361 |
|
361 | | -#### 5. Check Budget Status |
| 362 | +#### 5. Priority-Based Conflict Resolution (Phase 3) |
| 363 | + |
| 364 | +```typescript |
| 365 | +import { LockedBlackboard } from 'network-ai'; |
| 366 | + |
| 367 | +// Enable priority-wins strategy |
| 368 | +const board = new LockedBlackboard('.', { conflictResolution: 'priority-wins' }); |
| 369 | + |
| 370 | +// Low-priority worker proposes a change |
| 371 | +const lowId = board.propose('shared:config', { mode: 'draft' }, 'worker', undefined, 1); |
| 372 | + |
| 373 | +// High-priority supervisor proposes to same key |
| 374 | +const highId = board.propose('shared:config', { mode: 'final' }, 'supervisor', undefined, 3); |
| 375 | + |
| 376 | +// Worker commits first |
| 377 | +board.validate(lowId, 'orchestrator'); |
| 378 | +board.commit(lowId); |
| 379 | + |
| 380 | +// Supervisor validates -- higher priority wins despite stale hash |
| 381 | +board.validate(highId, 'orchestrator'); // true (preempts worker's value) |
| 382 | +board.commit(highId); // success |
| 383 | + |
| 384 | +board.read('shared:config'); // { mode: 'final' } -- supervisor wins |
| 385 | +``` |
| 386 | + |
| 387 | +#### 6. Check Budget Status |
362 | 388 |
|
363 | 389 | ```bash |
364 | 390 | python scripts/swarm_guard.py budget-check --task-id "task_001" |
|
0 commit comments