Fleet Formation Protocol
Self-organizing agent groups for the Cocapn fleet.
Install
pip install fleet-formation-protocol
Usage
from fleet_formation_protocol import (
FormationProtocol, FormationType, AgentProfile,
FormationMessage, VickreyAuction,
)
# Create agents
agents = [
AgentProfile("scout-1", capabilities=["navigation", "sensing"], trust_score=0.8),
AgentProfile("worker-1", capabilities=["execution", "building"], trust_score=0.7),
AgentProfile("scout-2", capabilities=["navigation"], trust_score=0.6),
]
# Form a scout party
protocol = FormationProtocol()
formation = protocol.negotiate(agents, FormationType.SCOUT_PARTY, required_capabilities=["navigation"])
print(f"Formation {formation.formation_id}: {len(formation.agents)} agents, leader: {formation.leader.agent_id}")
# Send a formation message (binary format, max 1024 bytes)
msg = FormationMessage(
msg_type=3, # FORM
formation_id=1,
agent_id=42,
formation_type=FormationType.WORK_CREW,
payload={"task": "explore sector 7"},
)
data = msg.serialize() # → bytes
restored = FormationMessage.deserialize(data) # → FormationMessage
# Resolve conflicts (Vickrey auction)
result = protocol.resolve_conflict("formation_a", "formation_b", "contested_agent")
print(f"Winner: {result['winner_formation']}, price: {result['price']}")
Formation Types
| Type | Size | Purpose |
|---|---|---|
| SCOUT_PARTY | 2-4 | Exploration |
| WORK_CREW | 3-8 | Task execution |
| WAR_ROOM | 4-6 | Strategic planning |
| RELAY_CHAIN | 2-10 | Communication |
| COUNCIL | 5-12 | Governance |
Binary Message Format
16-byte header + JSON payload (max 1024 bytes total):
| version (1B) | type (1B) | formation_id (4B) | agent_id (4B) | formation_type (1B) | payload_len (2B) | checksum (3B) |
CRC-24 checksum over payload. Zero dependencies.
License
MIT
Metadata
Release files for fleet-formation-protocol 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fleet_formation_protocol-0.2.1.tar.gz | 8.0 kB | Without provenance | Details for fleet_formation_protocol-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fleet_formation_protocol-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for fleet_formation_protocol-0.2.1-py3-none-any.whl |
Total release size: 16.4 kB
Release files / fleet_formation_protocol-0.2.1.tar.gz
| Download URL | fleet_formation_protocol-0.2.1.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ee52b32ca81668e8efea31a45d05fe8f1e8304b68badb5e82a56e12c4a6b1e1
|
|
BLAKE2b-256 checksum How to use checksums |
16a993f09d19be6ddb409322309dca92ab91127f6160724a2997d2cd4305b0da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / fleet_formation_protocol-0.2.1-py3-none-any.whl
| Download URL | fleet_formation_protocol-0.2.1-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c52f6e1cf8c6ca00b93a9512bf647cf93f2b3bb794e859bc5823642a61e41a25
|
|
BLAKE2b-256 checksum How to use checksums |
406720613e1bf0c40cc2c3da362d6c92501d997201c6d9b8c4df703fa68b7ac2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Security for fleet-formation-protocol 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.