Skip to main content

Crate acl_core

Crate acl_core 

Source
Expand description

ACL — Agent Communication Language, core codec (spec v0.1).

Implements L1–L4 of SPEC.md: MessagePack envelope, performatives, body variants, Ed25519 signing, AgentCard, stream framing.

Modules§

batch
Batch signature verification (spec §BENCH note): relays and registries verify many envelopes from the same or different senders; the batched ed25519 algorithm amortizes the expensive scalar math across signatures.
bridge
Bridge adapters (SPEC.md roadmap item 3): map ACL semantics to the protocols agents already speak — A2A task lifecycle and MCP tools.
cl
Content Language (CL) — spec §6.2.
cnp
Contract-Net Protocol (spec §21): the standard multi-agent negotiation pattern (Smith 1980, FIPA Contract-Net) built on ACL performatives and the content language.
codegen
§34: endpoint codegen — aclc gen agent py <file.aclp> <out_dir>.
dialogue
Dialogue rules (spec §16): normative conversation policy.
did
DID resolution (spec §22): turn did:key AIDs into verifying keys without any network, and construct did:web resolution URLs.
idempotency
Idempotency and ordering (spec §8.1).
idl
IDL — Interface Definition Language for ACL vocabularies (spec §18).
protocol
.aclp — ACL protocol programs (spec §33).
rdf
RDF / JSON-LD mapping (spec §26): export CL facts as JSON-LD claims so ACL vocabularies interoperate with the RDF/Linked-Data ecosystem (schema.org, W3C ontologies). Scope: mapping layer, not a full RDF lib.
registry
Local agent registry (spec roadmap): discovery for same-machine agents without a directory service. File-backed JSON at a caller-chosen path.
registry_protocols
§35.15: protocol registry — publish, discover and fetch .aclp programs. File-backed (like the agent registry): every entry stores the protocol source, its declared roles, and a SHA-256 checksum of the source; fetch verifies the checksum (tamper-evident).
replay
Replay protection and rate limiting (spec §24).
runtime
Protocol runtime (spec §33.4) and multiparty projection (§33.5).
scenario
§35.12: scenario runner — executable protocol tests inside .aclp.
schema
Runtime schema validation (spec §19): validate incoming CL payloads against a compiled IDL schema BEFORE processing.
sealed
Sealed envelopes (spec §10.1): end-to-end confidentiality through relays.
semantics
Formal semantics (spec §17): every performative carries machine-readable feasibility preconditions (FP) and rational effects (RE), in the FIPA-ACL tradition, so agents and verifiers can process the semantics of a message rather than parse English prose.
session
§35.8/§35.9: multi-session host and event sourcing.
stdlib
§35.14: standard protocol fragments — battle-tested handler sets for common agent interaction patterns. Merge into a program with apply_fragment; the program’s own handlers win on trigger clash.

Structs§

AgentCard
Signed capability descriptor (spec §7).
Aid
Agent ID (spec §4.1): scheme:opaque.
Artifact
Artifact attached to a Result body.
Capability
Envelope
The ACL envelope (spec §4). Field order is wire order.
Matcher
§32: declarative message matcher — the filter construct that subscriptions and routers share.

Enums§

AclError
Body
Body variants (spec §6).
ErrorKind
§32: structured error taxonomy — machine-actionable failure kinds.
Performative
Speech acts (spec §5). Wire representation: u8 discriminant.

Constants§

ACL_VERSION
DEFAULT_TTL_MS
MAX_HOP_COUNT

Functions§

new_msg_id
Generate a random 128-bit hex msg_id.
read_frame
Length-prefixed stream framing (spec §3): 4-byte BE length + payload. Reads one framed message; returns Ok(None) on EOF at a frame boundary.
rotate_identity
§37: identity rotation — build a rotation statement signed by the OLD key. Continuity is provable: the message verifies under the old did:key and announces the new one; receivers update their registries.
write_frame