Skip to main content

aap-ref-lib-py

PyPI License Spec

Python reference implementation of the Agent Acknowledgment Protocol (AAP) — typed acknowledgment events, the §7.2 reference weighting function, and a simple reputation derivation.

Install

pip install aap-manifest

What's in the box

Module Spec Purpose
entries §3, §4 AcknowledgmentEvent and its parts; the AckType vocabulary
weighting §7.2 compute_weight, type_weight, DEFAULT_TYPE_WEIGHTS
reputation §7.1 compute_reputation — derive a subject's score from events
store §9.3 / §9.4 InMemoryAcknowledgmentStore — dup-id rejection, withdrawal handling

Usage

from aap_manifest import (
    AcknowledgmentEvent, Issuer, Subject,
    compute_weight, InMemoryAcknowledgmentStore,
)

ev = AcknowledgmentEvent(
    id="urn:uuid:5f8a3c2e-…",
    type="ENDORSEMENT",
    issuer=Issuer(did="did:tutus:0xacme", key_id="did:tutus:0xacme#k"),
    subject=Subject(did="did:web:example.com:agents:code-reviewer"),
    signature=Signature(alg="EdDSA", value="…"),
    issued_at="2026-05-20T14:32:00Z",
)

result = compute_weight(ev, issuer_trust=0.8)   # value_weight applies only when verified

store = InMemoryAcknowledgmentStore()
store.append(ev)                                 # raises on duplicate id (§9.3)
rep = store.reputation("did:web:example.com:agents:code-reviewer")

Reference weight (spec §7.2)

weight = type_weight × issuer_trust × value_weight × witness_factor × time_decay
  • value_weight = 1 + log10(1 + usd_equivalent) applies only when the settlement reference is verified (§6.3); otherwise 1.
  • witness_factor = 1 + 0.25 × min(independent_witnesses, 4).
  • time_decay = exp(−Δt/τ), τ = 18 months; omit now for no decay.
  • A WITHDRAWAL zeroes the weight (positive-only vocabulary, §9.1).

This is the informative AAP reference. The normative aggregation — issuer-diversity penalty, recursive-trust bound, mandatory settlement verification — lives in AAR §9 and ships in the aar-manifest package.

How It Composes

aap-manifest   constructs and weights acknowledgment events  (this library)
aar-manifest   stores, chains, federates, and aggregates them
aap-validate   validates events against the schema + anti-abuse rules

Test

pip install -e ".[dev]"
pytest

License

Apache-2.0 — see LICENSE and NOTICE.

Metadata

Release files for aap-manifest 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aap-manifest 1.0.0
File Size Uploaded
aap_manifest-1.0.0.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aap-manifest 1.0.0
File Interpreter ABI Platform
aap_manifest-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.2 kB

Release files / aap_manifest-1.0.0.tar.gz

Download URL aap_manifest-1.0.0.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
abb556e28a50f26488e44f7f63bd8124f827799e31a84b9b48abc8b42fdecb7d
BLAKE2b-256 checksum
How to use checksums
967fa0750af497f2ccbfd6862f66b11c99dfcb81a7e4f88ae37286d41cc49df5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.3

Release files / aap_manifest-1.0.0-py3-none-any.whl

Download URL aap_manifest-1.0.0-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0164052efa9c55608cf9db89d0bae5d68875471abcb96b13e9cc5c584a4c4c4b
BLAKE2b-256 checksum
How to use checksums
935ff0185894bc1dad67529280540e2f6d9eb4aa867c66c50d5dbc30cb3bf034
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page