Skip to content

docs(specs): Python AID-EMIT-1 emitter and LiteLLM adapter design drafts - #600

Merged
Levaj2000 merged 2 commits into
mainfrom
docs/aid-emit-py-litellm-design
Oct 12, 2026
Merged

Levaj2000 merged 2 commits into
mainfrom
docs/aid-emit-py-litellm-design

Conversation

@Levaj2000

Copy link
Copy Markdown
Owner

Summary

Design drafts, nothing implemented:

  • docs/specs/aid-emit-py.md: aid-emit, a Python implementation of the AID-EMIT-1 emitter class. Canonical bytes, DSSE signing, chain and stream state, epoch and restart handling, a durable spool, an ingest shipper, and a conformance plan (T1 to T7) against the section 12 vectors.
  • docs/specs/litellm-aid-emit.md: a LiteLLM proxy adapter on top of it, in three phases (observe, shadow, enforce). Covers the hook plan, exactly-once emission, verdict and field mappings, security requirements, a one-week phase 1 build plan, the decisions taken, and five open questions.
  • scripts/aid_emit_py_vector_check.py: re-derives both signed records of integrations/cpex-ocsf-audit/SAMPLE-OUTPUT.md in Python (stdlib json plus cryptography with RFC 6979). Fingerprints and signatures are byte-identical to the vector.
  • CHANGELOG entry under [Unreleased] / Added.

Decided

  • Target: the AI Identity platform and OCSF, not CPEX or Praxis. Native OCSF fields first; facts with no native home use an AI Identity aid.* vocabulary under unmapped (aid.stream, aid.decision, aid.request_id, aid.litellm.*). See section 4.1 of aid-emit-py.md.
  • AID-EMIT-1 absorbs this as a 1.2.0 vocabulary profile (additive, MINOR), not AID-EMIT-2: signing, chain and stream rules are unchanged, only names differ. The spec text itself is a follow-up PR.
  • LiteLLM is accepted as a dependency for phase 1 (observe only).

Follow-ups this depends on

  • scripts/aid_emit1_validator.py and the platform ingest endpoint must read stream stamps from aid.stream as well as cpex.stream.
  • Finding 1 in the emitter spec: the reference emitter's metadata.uid repeats after a restart, against section 6. The proposed fix scopes uids by epoch and regenerates the vectors.

Testing

$ python3 scripts/aid_emit_py_vector_check.py integrations/cpex-ocsf-audit/SAMPLE-OUTPUT.md
record 1: fingerprint identical=True signature identical=True
record 2: fingerprint identical=True signature identical=True

ruff check and ruff format --check pass on the new script under this repo's config.

docs/specs/aid-emit-py.md designs aid-emit, a second, independent
AID-EMIT-1 emitter in Python, with a conformance plan against the
section 12 vectors. docs/specs/litellm-aid-emit.md outlines a LiteLLM
proxy adapter (observe, shadow, enforce) built on it.

Both target the AI Identity platform and OCSF rather than a gateway:
native OCSF fields first, and an aid.* vocabulary under unmapped for
the gaps (aid.stream, aid.decision, aid.request_id), proposed for
AID-EMIT-1 as an additive 1.2.0 vocabulary profile.

scripts/aid_emit_py_vector_check.py re-derives both signed records of
the cpex-ocsf-audit dispatch vector in Python; fingerprints and
signatures are byte-identical.

The emitter spec records one conformance gap in the reference emitter:
metadata.uid comes from a per-process counter, so it repeats on the same
chain after a restart (AID-EMIT-1 section 6 requires uniqueness).

Design only. Nothing is implemented.
main gained #601 and #602, which both added CHANGELOG entries at the
top of Unreleased, so CHANGELOG.md conflicted. Resolved by taking main's
CHANGELOG and re-adding this PR's one entry under Added.

Also formats the EmitterConfig example in docs/specs/aid-emit-py.md the
way ruff 0.16.9 (pinned in requirements-dev.txt) does: it formats Python
code blocks inside Markdown, and ruff format --check failed CI on it.
Content unchanged.
@Levaj2000
Levaj2000 marked this pull request as ready for review October 12, 2026 22:10
@Levaj2000
Levaj2000 merged commit fafecb3 into main Oct 12, 2026
9 checks passed
@Levaj2000
Levaj2000 deleted the docs/aid-emit-py-litellm-design branch October 12, 2026 22:10
Levaj2000 added a commit that referenced this pull request Oct 13, 2026
…T-1 1.2.0 (#604)

The #600 drafts were written against the two-vocabulary proposal
(aid.* for AI Identity emitters, cpex.* for the CPEX family) that #603
replaced: 1.2.0 retires cpex.* for every emitter and widens the section
4 value space to the whole of RFC 8785.

aid-emit-py.md: implements 1.2.0-draft; section 4.1 is now the section
1.2 member table with no vocabulary option (LiteLLM, a non-CMF host,
writes aid.request_id and aid.litellm.*); the value-space check rejects
only what JSON cannot carry; the in-tree canonicalizer is a full RFC
8785, ported from the validator, since sorted json.dumps no longer
matches and the rfc8785 package rejects the stream epoch; the T1 note
says the dispatch vector is unchanged by the rename; finding 2 is
settled the other way by 1.2.0.

litellm-aid-emit.md: field names per 1.2.0 section 1.2; the decision
bullet records that 1.2.0 settled it.

Docs only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant