Skip to content

feat(validator): read stream stamps from aid.stream as well as cpex.stream - #601

Merged
Levaj2000 merged 1 commit into
mainfrom
feat/validator-aid-stream
Oct 12, 2026
Merged

Levaj2000 merged 1 commit into
mainfrom
feat/validator-aid-stream

Conversation

@Levaj2000

Copy link
Copy Markdown
Owner

Summary

scripts/aid_emit1_validator.py read stream stamps only from unmapped."cpex.stream". Emitters that target the AI Identity platform and OCSF rather than a gateway (the LiteLLM adapter designed in #600) write them under AI Identity's own vocabulary, unmapped."aid.stream", so their streams were never checked.

  • New STREAM_STAMP_KEYS = ("aid.stream", "cpex.stream"): stamps are read from aid.stream, else cpex.stream. GAP-STREAM, W-STREAM-HEAD and E-STREAM-ORDER now cover both vocabularies.
  • A record carrying both keys is read from aid.stream and warned as W-STREAM-VOCAB (a warning, not an error: the record is well-formed, but two sets of stamps let a SIEM and a verifier read different sequences).
  • A non-object unmapped no longer raises inside the chain check.
  • Records in the cpex vocabulary, including every committed vector, validate exactly as before.
  • Docstring and CHANGELOG updated.

Matches the platform ingest change, which reads the same two keys in the same order and records the same both-keys case as an anomaly.

Testing

The validator has no tests in this repository; they run against its synced copy in the platform repository, which takes this file over unmodified once it merges. Run there against this exact file:

  • existing validator suite: unchanged results;
  • 4 new tests: an aid.stream story validates with signatures; an aid.stream gap is a GAP-STREAM error under --strict-gaps; a non-zero aid.stream head is W-STREAM-HEAD; both keys present is W-STREAM-VOCAB, with aid.stream read (a deliberately gapped cpex.stream copy opens no gap);
  • 3 of the 4 fail against the current validator; the fourth (clean aid story) guards against false alarms;
  • result: 21 passed.

ruff check and ruff format --check pass on the edited file under this repo's config.

…tream

Emitters that target the AI Identity platform and OCSF rather than a
gateway write AID-EMIT-1 stream stamps under AI Identity's own
vocabulary, unmapped."aid.stream", proposed for AID-EMIT-1 as a 1.2.0
vocabulary profile. The CPEX host family keeps unmapped."cpex.stream".

scripts/aid_emit1_validator.py looked only at cpex.stream, so an aid
record's stream was never checked. It now looks up aid.stream first,
then cpex.stream (STREAM_STAMP_KEYS), so GAP-STREAM, W-STREAM-HEAD and
E-STREAM-ORDER cover both. A record carrying both keys is read from
aid.stream and warned as W-STREAM-VOCAB. cpex records validate exactly
as before.

Matches the platform ingest change. The validator's tests run against
its synced copy in the platform repository: an aid story validates with
signatures, an aid gap and a non-zero aid head are surfaced, and both
keys are warned with aid.stream read.
@Levaj2000
Levaj2000 marked this pull request as ready for review October 12, 2026 21:08
@Levaj2000
Levaj2000 merged commit a28c9ef into main Oct 12, 2026
9 checks passed
@Levaj2000
Levaj2000 deleted the feat/validator-aid-stream branch October 12, 2026 21:08
Levaj2000 added a commit that referenced this pull request Oct 12, 2026
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.
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